Create Thread
Threads

Create Thread

Create Thread

POST/v2/threads

Request Body

agentobjectoptional

Agent spec passed inline on the run call. Mirrors AgentCreate's functional fields; ``harness`` is the public name for ``runtime_kind``.

agent.harnessstring · claude_code | codex | cursor | factory | kafka_cloud | opencode | qoder | qwenoptional

Harness that executes the agent's turns (the public name for runtime_kind).

agent.instructionsstringoptional
agent.modelstringoptional
agent.machine_kindstring · daytona | e2boptional

Sandbox provider the agent's machines run on. Omit to use the deployment default.

agent.mcp_serversarray<object>optional
agent.skillsarray<object>optional
agent.secretsobjectoptional
agent.entrypointstringoptional
agent.titlestringoptional
agent_idstring · uuidoptional
group_idstring · uuidoptional
inputstringoptional
messagesarray<object>optional
titlestringoptional
metadataobjectoptional
Request
curl --request POST \
  --url https://api.brainbaselabs.com/v2/threads \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "agent": {
    "harness": "claude_code",
    "instructions": "",
    "model": "string",
    "machine_kind": "daytona",
    "mcp_servers": [
      {
        "name": "string",
        "url": "string",
        "command": "string",
        "args": [
          "string"
        ],
        "env": {
          "property1": "string",
          "property2": "string"
        },
        "headers": {
          "property1": "string",
          "property2": "string"
        },
        "is_enabled": true
      }
    ],
    "skills": [
      {
        "source": "string"
      }
    ],
    "secrets": {
      "property1": "string",
      "property2": "string"
    },
    "entrypoint": "string",
    "title": "string"
  },
  "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
  "group_id": "306db4e0-7449-4501-b76f-075576fe2d8f",
  "input": "string",
  "messages": [
    {
      "role": "user",
      "content": null,
      "name": "string",
      "tool_calls": {},
      "tool_call_id": "string",
      "metadata": {}
    }
  ],
  "title": "",
  "metadata": {
    "property1": "string",
    "property2": "string"
  }
}'
Response
json
{
  "thread_id": "1de43264-67cb-48af-89f9-e865c375bb84",
  "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
  "status": "string"
}