Create a Project Session
Create a durable Session from explicit inline harness/model/instructions, or an optional saved Agent preset in this Project.
/projects/{projectId}/threadsCreate a durable Session from explicit inline harness/model/instructions, or an optional saved Agent preset in this Project. Project model credentials are required. Input and files are optional. Creation freezes the effective configuration and never creates a hidden Agent; follow-ups use the returned Thread ID.
Authorization
publicApiBearer Use Authorization: Bearer msp_... . Project API keys can configure Agents, execute Sessions, and access files only in their Project. Key and account management require console or CLI login. Legacy account tokens are rejected.
In: header
Path Parameters
Owned Project. A Project key can access only its own Project; CLI login supplies an explicit owned Project.
^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$ulidHeader Parameters
Optional key for retry-safe create-thread and send-events calls. Reusing the same key with the same request returns the original response. Reusing the key while the original request is still processing returns 409.
length <= 128Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Create a Project-owned durable Session with inline configuration or an optional saved Agent preset. No Agent is created for inline execution. Model credentials must already be configured in this Project.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/projects/01ARZ3NDEKTSV4RRFFQ69G5FAV/threads" \ -H "Idempotency-Key: thread-20260528-linear-eng-123" \ -H "Content-Type: application/json" \ -d '{ "configuration": { "type": "inline", "harness": "openai-runtime", "provider": "openai", "model": "gpt-5.6-luna", "instructions": "Analyze the supplied material and save the results." }, "input": { "type": "user.message", "content": [ { "type": "text", "text": "Create an analysis report." } ] } }'{ "links": { "thread": "string" }, "run": { "completedAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "error": { "code": "string", "message": "string", "retryable": true }, "finalOutput": { "text": "string", "warnings": [ { "code": "unresolved_provider_citation", "count": 1 } ] }, "id": "01ARZ3NDEKTSV4RRFFQ69G5FAV", "startedAt": "2019-08-24T14:15:22Z", "status": "queued", "trigger": "user_prompt", "updatedAt": "2019-08-24T14:15:22Z" }, "thread": { "agent_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV", "created_at": "2019-08-24T14:15:22Z", "id": "01ARZ3NDEKTSV4RRFFQ69G5FAV", "last_run_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV", "source": "api", "status": "IDLE", "title": "string", "updated_at": "2019-08-24T14:15:22Z", "userId": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}