Create Task
Create Task
/v2/tasksSend an Idempotency-Key header (8 to 200 characters) to make a retry safe. Reusing it with the same request returns the same task with Idempotency-Replayed: true. Reusing it with a different request returns 409 with detail.code=idempotency_key_reused, and 409 with detail.code=idempotency_request_in_progress and Retry-After: 1 means the original request is still being processed.
Request Body
self_delegation_concurrency_limitintegeroptionalChildren running at once: a positive integer or null for Unlimited. Only the agent setting takes effect; omission there inherits the global default. On a task or an orchestration the value is accepted and stored but does not change the limit. Available only when self-delegation is enabled; otherwise the route's unknown-field behavior applies.
agent_idstring · uuidrequiredtitlestringoptionalparent_task_idstring · uuidoptionalmetadataobjectoptionalFreeform string→string labels stored on the task. Filter the list endpoint with repeated ?metadata=key:value params. Omit or null for none.
initial_messagesarray<object>optionalauto_runbooleanoptionaldefault_modelstringoptionalmachine_sizestring · xs | s | m | l | xloptionalT-shirt size labels for sandbox compute tiers. All five labels are part of the public contract so tiers can be added without renaming, but only the sizes present in ``SIZE_RESOURCES`` are provisionable today. ``XS`` and ``XL`` are reserved: XL is blocked on the Daytona per-sandbox resource caps (4 vCPU / 8 GiB), XS on demand.
agent_version_idstring · uuidoptionalcurl --request POST \
--url https://api.brainbaselabs.com/v2/tasks \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"self_delegation_concurrency_limit": 1,
"agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
"title": "",
"parent_task_id": "0595d3a2-39ad-4ab5-906d-3e39522e8eed",
"metadata": {
"property1": "string",
"property2": "string"
},
"initial_messages": [
{
"role": "user",
"content": null,
"name": "string",
"tool_calls": {},
"tool_call_id": "string",
"metadata": {}
}
],
"auto_run": false,
"default_model": "string",
"machine_size": "xs",
"agent_version_id": "1c2a713c-7248-4a56-a9eb-0bdcb3a41741"
}'{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
"owner_user_id": "65139110-7c3c-4777-b692-80c218be3b9d",
"parent_task_id": "0595d3a2-39ad-4ab5-906d-3e39522e8eed",
"title": "string",
"status": "string",
"status_info": {},
"metadata": {
"property1": "string",
"property2": "string"
},
"sandbox_id": "string",
"machine_id": "76ca96f6-a9a8-43bf-917c-a176478a33ba",
"machine_size": "xs",
"model": "string",
"benchmark_attempt_id": "5321abbd-5523-4e8e-9800-e8132608c1f0",
"created_at": "2019-08-24T14:15:22Z"
}