Assistant
Send a message and run the assistant. `stream: true` or `Accept: text/event-stream` answers with server-sent events; otherwise one JSON AssistantRun. Mutating tool calls are never executed here: they come back as pending proposals, approved only in the app Approval Feed. 402 when the AI budget or credit is exhausted, 429 on rate or concurrency limits. (scope: assistant:write)
POST
bearerAuthheader
AuthorizationBearer <token>API key as Bearer token
threadId*integerAssistant thread id
Range
1 <= valueapplication/json- body
message*stringLength
1 <= length <= 20000locale?stringValue in
"ro""en"stream?booleanAnswer as text/event-stream (same as sending Accept: text/event-stream).
The run result, as JSON or as an event stream.
- response
data*error*nullcurl -X POST "https://example.com/assistant/threads/1/runs" \ -H "Content-Type: application/json" \ -d '{ "message": "string" }'{ "data": { "thread_id": 1, "status": "completed", "text": "string", "pending_approvals": [ { "id": 1, "thread_id": 1, "tool": "string", "created_at": "2019-08-24T14:15:22Z", "expires_at": "2019-08-24T14:15:22Z", "approve_url": "http://example.com" } ], "usage": { "input_tokens": 0, "output_tokens": 0, "total_tokens": 0 }, "ai_generated": true }, "error": null}