Create Batch

Submit a batch of agent runs for asynchronous processing. Creates a job that will fan out messages to all listed agents and process them in parallel. The request will be rejected if it exceeds 256MB.

Headers

AuthorizationstringRequired

Header authentication of the form Bearer <token>

Request

This endpoint expects an object.
requestslist of objectsRequired
List of requests to be processed in batch.
callback_urlstring or nullOptionalformat: "uri">=1 character<=2083 characters
Optional URL to call via POST when the batch completes. The callback payload will be a JSON object with the following fields: {'job_id': string, 'status': string, 'completed_at': string}. Where 'job_id' is the unique batch job identifier, 'status' is the final batch status (e.g., 'completed', 'failed'), and 'completed_at' is an ISO 8601 timestamp indicating when the batch job completed.

Response

Successful Response
created_by_idstring or null
The id of the user that made this object.
last_updated_by_idstring or null
The id of the user that made this object.
created_atstring or nullformat: "date-time"
The unix timestamp of when the job was created.
updated_atstring or nullformat: "date-time"
The timestamp when the object was last updated.
statusenum or null
The status of the job.
completed_atstring or nullformat: "date-time"
The unix timestamp of when the job was completed.
stop_reasonenum or null
The reason why the job was stopped.
metadatamap from strings to any or null
The metadata of the job.
job_typeenum or null
Allowed values:
backgroundboolean or null
Whether the job was created in background mode.
agent_idstring or null

The agent associated with this job/run.

callback_urlstring or null
If set, POST to this URL when the job completes.
callback_sent_atstring or nullformat: "date-time"
Timestamp when the callback was last attempted.
callback_status_codeinteger or null
HTTP status code returned by the callback endpoint.
callback_errorstring or null
Optional error message from attempting to POST the callback endpoint.
ttft_nsinteger or null
Time to first token for a run in nanoseconds
total_duration_nsinteger or null
Total run duration in nanoseconds
idstring or nullformat: "^(job|run)-[a-fA-F0-9]{8}"

The human-friendly ID of the Job

Errors