Skip to content

Chats

Start chats, send messages, follow answers as they arrive, share chats, and sync chats from your computers.

OperationRequest
Check in sync computerPOST /v1/computers/check-in
Read computer sync choiceGET /v1/computers/{name}/sync
Set computer sync choicePUT /v1/computers/{name}/sync
List threadsGET /v1/threads
Start threadPOST /v1/threads
List synced threadsGET /v1/threads/synced
Sync threadPUT /v1/threads/synced/{session}
Forget synced threadDELETE /v1/threads/synced/{session}
Save synced thread capturePUT /v1/threads/synced/{session}/captures/{ask}
Fail synced thread capturePOST /v1/threads/synced/{session}/captures/{ask}/failed
Take synced thread repliesPOST /v1/threads/synced/{session}/replies
Set synced thread statusPOST /v1/threads/synced/{session}/status
Read threadGET /v1/threads/{id}
Move threadPATCH /v1/threads/{id}
Delete threadDELETE /v1/threads/{id}
Continue chat on computerPOST /v1/threads/{id}/continue
Stream cloud turnGET /v1/threads/{id}/events
Add thread filePOST /v1/threads/{id}/files
Read thread fileGET /v1/threads/{id}/files/{file}
Remove unsent thread fileDELETE /v1/threads/{id}/files/{file}
List thread messagesGET /v1/threads/{id}/messages
Reply to threadPOST /v1/threads/{id}/messages
Read thread shareGET /v1/threads/{id}/share
Set thread sharePOST /v1/threads/{id}/share
Stop cloud turnPOST /v1/threads/{id}/stop

Check in sync computer

POST /v1/computers/check-in · checkInSyncComputer

Records account-owned presence; returns waiting sessions and sync choice. Does not run them. Older /coder/check-in alias remains. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Request body

Content type: application/json

Type: object

FieldTypeRequiredDescription
computerstringYes

Response

200 — Success

Type: object

FieldTypeRequiredDescription
waitingarray of stringYes
syncone of "all", "local", nullYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl -X POST 'https://api.openagents.com/v1/computers/check-in' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "computer": "string"
}'

Read computer sync choice

GET /v1/computers/{name}/sync · readComputerSyncChoice

Account-owned sync preference. null on GET means not chosen. PUT accepts all or local. Older /coder/sync alias accepts the computer query/body field. This choice does not itself upload transcripts or start execution. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
namepathstringYes

Response

200 — Success

Type: object

FieldTypeRequiredDescription
choiceone of "all", "local", nullYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl 'https://api.openagents.com/v1/computers/{name}/sync' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN"

Set computer sync choice

PUT /v1/computers/{name}/sync · setComputerSyncChoice

Account-owned sync preference. null on GET means not chosen. PUT accepts all or local. Older /coder/sync alias accepts the computer query/body field. This choice does not itself upload transcripts or start execution. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
namepathstringYes

Request body

Content type: application/json

Type: object

FieldTypeRequiredDescription
choiceone of "all", "local"Yes

Response

200 — Success

Type: object

FieldTypeRequiredDescription
choiceone of "all", "local", nullYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl -X PUT 'https://api.openagents.com/v1/computers/{name}/sync' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "choice": "all"
}'

List threads

GET /v1/threads · listThreads

Without project: owned, nonarchived chats, pinned first then newest activity; offset pagination, limit defaults to 200 and clamps to 1..200, store discovery ceiling 10000. With project: current authorized project (ID or name:NAME; none means unfiled), after pagination oldest activity first, limit defaults to 100 and clamps to 1..200. These are different response envelopes; neither is a snapshot. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
offsetqueryintegerNo

Without project only

limitqueryintegerNo

Clamped to 1..200

afterquerystringNo

Project list only; last returned ID, unknown after value is 400 invalid_cursor

projectquerystringNo

Project ID, name:NAME, or none; changes envelope and order

Response

200 — Success

Type: ThreadList or ThreadProjectList

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl 'https://api.openagents.com/v1/threads' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN"

Start thread

POST /v1/threads · startThread

Starts an account-store cloud chat using the existing server runtime and caller allowance. request_id names the chat; retry the same UUID after a lost response. Existing chat returns 200, first start 201. Project is allowed here only. Files must be uploaded under request_id first. Follow the request through /v1/threads/{id}/events and cancel that request through /v1/threads/{id}/stop. Browser HTML forms/events remain compatible. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Request body

Content type: application/json

Type: ThreadReply

FieldTypeRequiredDescription
request_idstring (uuid)Yes
textstringYes
filesarray of stringNo
projectstring or nullNo

Response

200 — Success

Type: ThreadStarted

FieldTypeRequiredDescription
idstringYes
answeringalways trueYes

201 — Success

Type: ThreadStarted

FieldTypeRequiredDescription
idstringYes
answeringalways trueYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl -X POST 'https://api.openagents.com/v1/threads' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "request_id": "00000000-0000-4000-8000-000000000000",
  "text": "string"
}'

In the Rust SDK

List synced threads

GET /v1/threads/synced · listSyncedThreads

Account-owned sync session IDs and deletion tombstones, not transcript history. Older /coder/sessions alias remains supported. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Response

200 — Success

Type: ThreadSyncList

FieldTypeRequiredDescription
sessionsarray of objectYes
sessions[].sessionstringYes
sessions[].deletedbooleanYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl 'https://api.openagents.com/v1/threads/synced' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN"

Sync thread

PUT /v1/threads/synced/{session} · syncThread

Upsert under authenticated account and session (ASCII letters/digits/_/-, 1..128 bytes). Maximum body 8 MiB, 4000 messages, 256 KiB/message; invalid tool details are omitted (32 KiB input/output). Secret screening refuses 422. Repeated same content returns changed:false; website deletion returns 410 deleted. Does not execute a turn. Older /coder/sessions/{session} alias is unchanged. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
sessionpathstringYes

Request body

Content type: application/json

Type: ThreadSyncUpload

FieldTypeRequiredDescription
computerstringYes
titlestringYes
messagesarray of objectYes
messages[].roleone of "user", "assistant", "tool", "thinking"Yes
messages[].textstringYes
messages[].stepnull or objectNo
repositorystring or nullNo
active_unixinteger or nullNo

Response

200 — Success

Type: ThreadSyncSaved

FieldTypeRequiredDescription
chatstringYes
changedbooleanYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl -X PUT 'https://api.openagents.com/v1/threads/synced/{session}' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "computer": "string",
  "title": "string",
  "messages": [
    {
      "role": "user",
      "text": "string"
    }
  ]
}'

Forget synced thread

DELETE /v1/threads/synced/{session} · forgetSyncedThread

Account-owned session removal. Safe to repeat; deleted boolean; older /coder/sessions/{session} alias is unchanged. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
sessionpathstringYes

Response

200 — Success

Type: object

FieldTypeRequiredDescription
deletedbooleanYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl -X DELETE 'https://api.openagents.com/v1/threads/synced/{session}' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN"

Save synced thread capture

PUT /v1/threads/synced/{session}/captures/{ask} · saveSyncedThreadCapture

Raw PNG/file bytes for a previously taken ask; at most 15 MiB. Older /coder/sessions/{session}/captures/{ask} alias remains. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
sessionpathstringYes
askpathstringYes

Request body

Content type: application/octet-stream

Type: string (binary)

Response

200 — Success

Type: ThreadSyncSaved

FieldTypeRequiredDescription
chatstringYes
changedbooleanYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl -X PUT 'https://api.openagents.com/v1/threads/synced/{session}/captures/{ask}' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN" \
  -H 'Content-Type: application/octet-stream' \
  --data-binary @file

Fail synced thread capture

POST /v1/threads/synced/{session}/captures/{ask}/failed · failSyncedThreadCapture

Records a failed capture, no execution. Older /coder/sessions/{session}/captures/{ask}/failed alias remains. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
sessionpathstringYes
askpathstringYes

Request body

Content type: application/json

Type: object

FieldTypeRequiredDescription
messagestringYes

Response

200 — Success

Type: ThreadSyncSaved

FieldTypeRequiredDescription
chatstringYes
changedbooleanYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl -X POST 'https://api.openagents.com/v1/threads/synced/{session}/captures/{ask}/failed' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "message": "string"
}'

Take synced thread replies

POST /v1/threads/synced/{session}/replies · takeSyncedThreadReplies

Destructive take: queued replies and asks are delivered at most once. A lost response cannot be retried for redelivery; this is not exactly-once execution. Continued user/assistant messages are oldest first, bounded to 64, each at most 256 KiB. The computer executes work under its own authority. Older /coder/sessions/{session}/replies alias remains. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
sessionpathstringYes

Response

200 — Success

Type: ThreadSyncTaken

FieldTypeRequiredDescription
repliesarray of objectYes
replies[].idstringYes
replies[].textstringYes
continuedarray of objectYes
continued[].roleone of "user", "assistant", "tool", "thinking"Yes
continued[].textstringYes
asksarray of objectYes
asks[].idstringYes
asks[].actionobjectYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl -X POST 'https://api.openagents.com/v1/threads/synced/{session}/replies' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN"

Set synced thread status

POST /v1/threads/synced/{session}/status · setSyncedThreadStatus

Sets working status without running a turn; 404 unknown, 410 deleted. Older /coder/sessions/{session}/status alias remains. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
sessionpathstringYes

Request body

Content type: application/json

Type: object

FieldTypeRequiredDescription
workingbooleanYes

Response

200 — Success

Type: ThreadSyncSaved

FieldTypeRequiredDescription
chatstringYes
changedbooleanYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl -X POST 'https://api.openagents.com/v1/threads/synced/{session}/status' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "working": false
}'

Read thread

GET /v1/threads/{id} · readThread

Owner or current shared-project member. Newest 200 nonempty messages; earlier counts omitted messages. Use read-only /v1/history for revision-pinned rich transcript pages. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Response

200 — Success

Type: ThreadRecent

FieldTypeRequiredDescription
threadThreadRowYes
thread.idstring (uuid)Yes
thread.titlestringYes
thread.linestringYes
thread.surfaceone of "web", "terminal", "phone"Yes
thread.computerstring or nullYes
thread.sessionstring or nullYes
thread.updated_unixintegerYes
thread.workingbooleanYes
thread.onlinebooleanYes
thread.can_replybooleanYes
thread.pinnedbooleanYes
thread.projectstring or nullYes
thread.messagesintegerYes
thread.request_idstring (uuid) or nullNo
thread.outcomeone of "pending", "answered", "stopped", "failed", "unknown", nullNo
thread.homeChatHome (string)No
thread.continuesnull or ChatPartRefNo
thread.continued_bynull or ChatPartRefNo
messagesarray of objectYes
messages[].roleone of "user", "assistant", "tool", "thinking"Yes
messages[].textstringYes
messages[].filesarray of HistoryFileNo
messages[].files[].idstringYes
messages[].files[].namestringYes
messages[].files[].kindone of "png", "jpeg", "gif", "webp", "pdf", "text", "step", "stl"Yes
messages[].files[].sizeintegerYes
earlierintegerYes
waitingintegerYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl 'https://api.openagents.com/v1/threads/{id}' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN"

In the Rust SDK

Move thread

PATCH /v1/threads/{id} · moveThread

Owner only. Send at least one of project, pinned, archived; an empty body refuses 400 invalid_request. project: the target requires current project editor/owner role; null removes filing; moving resets the branch. pinned: true pins after every earlier pin, false unpins. archived: true archives the chat and removes the cloud computers that ran it, false restores it. Revision compare-and-swap retries three times; conflicts return 503. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Request body

Content type: application/json

Type: object

FieldTypeRequiredDescription
projectstring or nullNo
pinnedbooleanNo
archivedbooleanNo

Response

200 — Success

Type: ThreadObject

FieldTypeRequiredDescription
idstringYes
objectalways "thread"Yes
titlestringYes
projectstring or nullYes
surfaceone of "web", "terminal", "phone"Yes
computerstring or nullYes
updated_atstring (date-time)Yes
messagesintegerYes
pinnedbooleanYes
archivedbooleanYes
started_byobjectNo
started_by.namestringYes
started_by.youbooleanYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl -X PATCH 'https://api.openagents.com/v1/threads/{id}' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "project": "string",
  "pinned": false,
  "archived": false
}'

Delete thread

DELETE /v1/threads/{id} · deleteThread

Owner only. Deletes permanently; a running answer refuses 409 busy, a race refuses 409 changed. A repeated delete returns 404, not another effect. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Response

204 — Success; no response body

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl -X DELETE 'https://api.openagents.com/v1/threads/{id}' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN"

Continue chat on computer

POST /v1/threads/{id}/continue · continueChatOnComputer

Owner-only transition of an idle source to a new cloud or computer part. The host first creates its normal session, then calls with that session ID and its device home. A changed source refuses; the same destination is retry-safe, while another destination refuses. The source becomes read-only and records continued_by before execution starts. The host records continues in its document and registry and passes the bounded seed through its existing harness path. This endpoint never starts a harness or creates execution authority. Computer sources supply a bounded seed after freezing their local command queue. Cloud targets are created with that context outside the visible transcript; the normal cloud send route starts their turns. Older terminal sources use stable legacy-{chat-id} computer references until their original computer can be identified.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Request body

Content type: application/json

Type: ChatContinuationClaim

FieldTypeRequiredDescription
revisionintegerYes
targetChatPartRefYes
target.idstring (uuid)Yes
target.homeChatHome (string)Yes
seedChatContextNo

At most 16 KiB of serialized UTF-8 JSON. Summary and recent user/assistant text only; no file or tool output. Credential-shaped text is screened.

seed.titlestringYes
seed.summarystringYes
seed.recentarray of ChatContextTurnYes
seed.recent[].roleone of "user", "assistant"Yes
seed.recent[].textstringYes

Response

200 — The same linked destination, including a safe context seed

Type: ChatContinuation

FieldTypeRequiredDescription
accountstringYes
sourceChatPartRefYes
source.idstring (uuid)Yes
source.homeChatHome (string)Yes
targetChatPartRefYes
target.idstring (uuid)Yes
target.homeChatHome (string)Yes
seedChatContextYes

At most 16 KiB of serialized UTF-8 JSON. Summary and recent user/assistant text only; no file or tool output. Credential-shaped text is screened.

seed.titlestringYes
seed.summarystringYes
seed.recentarray of ChatContextTurnYes
seed.recent[].roleone of "user", "assistant"Yes
seed.recent[].textstringYes

Errors

StatusMeaningBody
400, 401, 404, 409, 429, 503

Invalid reference, signed out, not owned/missing, changed/busy/already continued, throttled, or unavailable.

AppAccountError

Example

curl -X POST 'https://api.openagents.com/v1/threads/{id}/continue' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "revision": 1,
  "target": {
    "id": "00000000-0000-4000-8000-000000000000",
    "home": "string"
  }
}'

In the Rust SDK

Stream cloud turn

GET /v1/threads/{id}/events · streamCloudTurn

Follow one request in the existing account-store cloud runtime. Account session/sign-in key only; cookies and oak keys are refused. Owner or current shared-project member, rechecked while connected. SSE event names match JSON type: text, tool, cards, done, error. Each connection starts with replace:true snapshots of that request's current messages, followed by replace:false text suffixes; apply by index, never append a replacement twice. Reconnect with the same request_id after a lost connection; no resend is needed. Event IDs identify this connection's revision/sequence; Last-Event-ID is not used to replay events. A connection lasts at most five minutes; stream_timeout asks the client to reconnect. Closing/cancelling the stream leaves execution running; POST stop cancels the named request. A terminal done/error closes the stream. Tool/card events are display data, never local execution authority.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Yes
request_idquerystring (uuid)Yes

Response

200 — UTF-8 SSE. JSON data conforms to ChatEvent; comment keepalives every 15 seconds. Cache-Control: no-store.

Content type: text/event-stream

Type: string

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 429, 503

Invalid request, signed out, current access refused, missing chat/request, wrong home/changed state, throttled or unavailable.

AppAccountError

Example

curl 'https://api.openagents.com/v1/threads/{id}/events?request_id=...' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN"

Add thread file

POST /v1/threads/{id}/files · addThreadFile

Owner-only raw upload for a cloud chat or a not-yet-started request UUID; at most 10 MiB (text 512 KiB), 32 files per chat, four per message. Supports images, PDF, text and supported CAD files. Returns formatted size, not byte count. A retry can create another pending file; keep the returned ID rather than blindly retrying. File validation errors use code file; pending limit is 409 full. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
idpathstringYes
namequerystringNo

Request body

Content type: application/octet-stream

Type: string (binary)

Response

201 — Success

Type: object

FieldTypeRequiredDescription
idstringYes
namestringYes
kindone of "png", "jpeg", "gif", "webp", "pdf", "text", "step", "stl"Yes
sizestringYes
urlstringYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl -X POST 'https://api.openagents.com/v1/threads/{id}/files' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN" \
  -H 'Content-Type: application/octet-stream' \
  --data-binary @file

Read thread file

GET /v1/threads/{id}/files/{file} · readThreadFile

Owner-only attachment bytes. Shared project access to transcript words does not grant this route. Missing bytes return 404 not_found. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
idpathstringYes
filepathstringYes

Response

200 — Attachment bytes with validated media type

Content type: application/octet-stream

Type: string (binary)

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl 'https://api.openagents.com/v1/threads/{id}/files/{file}' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN"

Remove unsent thread file

DELETE /v1/threads/{id}/files/{file} · removeUnsentThreadFile

Owner-only removal of a pending attachment; sent attachments refuse. Success is 204; a repeated removal returns a file refusal. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
idpathstringYes
filepathstringYes

Response

204 — Success; no response body

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl -X DELETE 'https://api.openagents.com/v1/threads/{id}/files/{file}' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN"

List thread messages

GET /v1/threads/{id}/messages · listThreadMessages

Current owner/shared-project access, oldest first, limit defaults to 100 and clamps to 1..200; after is msg_INDEX. Unknown after value returns 400 invalid_cursor. Unversioned text-only pages; files/generated_files/artifacts are null. Use /v1/history for rich revision-pinned reads. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
idpathstringYes
limitqueryintegerNo
afterquerystringNo

Response

200 — Success

Type: ThreadMessages

FieldTypeRequiredDescription
dataarray of objectYes
data[].idstringYes
data[].objectalways "message"Yes
data[].threadstringYes
data[].roleone of "user", "assistant", "tool", "thinking"Yes
data[].contentarray of objectYes
data[].content[].typealways "text"Yes
data[].content[].textstringYes
data[].filesnullYes
data[].generated_filesnullYes
data[].artifactsnullYes
nextstring or nullYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl 'https://api.openagents.com/v1/threads/{id}/messages' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN"

Reply to thread

POST /v1/threads/{id}/messages · replyToThread

Trimmed nonempty text, at most 4000 characters; secrets refuse 422 secret. Reuse request_id on retry. Terminal queues at most four replies for an online computer, remembers 16 reply IDs; offline/busy return 409. Phone chats refuse 409 phone. Web chats use the existing server turn and caller allowance; busy 409, unavailable 503. project must be absent/null. Shared-project editor/owner can send words to a web chat using their own allowance; viewers refuse 403 project_role, shared terminal/files refuse 400 words_only. This operation accepts a turn; it does not return generated output or an SSE stream. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Request body

Content type: application/json

Type: ThreadReply

FieldTypeRequiredDescription
request_idstring (uuid)Yes
textstringYes
filesarray of stringNo
projectstring or nullNo

Response

202 — Success

Type: ThreadAccepted

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl -X POST 'https://api.openagents.com/v1/threads/{id}/messages' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "request_id": "00000000-0000-4000-8000-000000000000",
  "text": "string"
}'

In the Rust SDK

Read thread share

GET /v1/threads/{id}/share · readThreadShare

Owner only, otherwise 404 unknown. A project set to only_me refuses 409 not_shareable. The URL is a read-only bearer link to words, never attachments. Unsharing or deletion revokes it; resharing creates a new token. GET does not create a share. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Response

200 — Success

Type: ThreadShare

FieldTypeRequiredDescription
sharedbooleanYes
urlstring or nullYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl 'https://api.openagents.com/v1/threads/{id}/share' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN"

Set thread share

POST /v1/threads/{id}/share · setThreadShare

Owner only, otherwise 404 unknown. A project set to only_me refuses 409 not_shareable. The URL is a read-only bearer link to words, never attachments. Unsharing or deletion revokes it; resharing creates a new token. GET does not create a share. Account session or sign-in key required; cookies and oak API keys do not authorize this operation.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
idpathstringYes

Request body

Content type: application/json

Type: object

FieldTypeRequiredDescription
sharedbooleanYes

Response

200 — Success

Type: ThreadShare

FieldTypeRequiredDescription
sharedbooleanYes
urlstring or nullYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 410, 413, 415, 422, 429, 503

Refusal. The error code distinguishes invalid input, missing authority/resource, changed/busy state, deleted sync sessions, size/content limits, secret screening, or unavailable service.

AppAccountError

Example

curl -X POST 'https://api.openagents.com/v1/threads/{id}/share' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "shared": false
}'

Stop cloud turn

POST /v1/threads/{id}/stop · stopCloudTurn

Stop only request_id in this cloud chat, using the existing stop transition. Owner or the current shared member who sent the pending turn. A delayed or repeated stop cannot cancel a newer request. stopped:true confirms the persisted stopped state; stopped:false with finished:true means the named request already finished. Partial text stays; the server drops the model call after observing the stopped state. A pending request owned by another execution path refuses 409 unsupported_turn, rather than claiming it finished. This does not stop terminal/phone sessions or background work.

Sign-in: a bearer credential in the Authorization header.

appBearer: A live app sess_ session or oa_sk_ sign-in key. Account-bound oak_ keys are accepted only where the operation declares them and their scopes permit it. API cookies are ignored.

Parameters

NameInTypeRequiredDescription
idpathstring (uuid)Yes

Request body

Content type: application/json

Type: ChatStop

FieldTypeRequiredDescription
request_idstring (uuid)Yes

Response

200 — Confirmed state of the named request

Type: ChatStopped

FieldTypeRequiredDescription
request_idstring (uuid)Yes
stoppedbooleanYes
finishedalways trueYes

Errors

StatusMeaningBody
400, 401, 403, 404, 409, 429, 503

Invalid request, signed out, current access refused, missing chat/request, wrong home/changed state, throttled or unavailable.

AppAccountError

Example

curl -X POST 'https://api.openagents.com/v1/threads/{id}/stop' \
  -H "Authorization: Bearer $OPENAGENTS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "request_id": "00000000-0000-4000-8000-000000000000"
}'

In the Rust SDK