Chats
Start chats, send messages, follow answers as they arrive, share chats, and sync chats from your computers.
| Operation | Request |
|---|---|
| Check in sync computer | POST /v1/computers/check-in |
| Read computer sync choice | GET /v1/computers/{name}/sync |
| Set computer sync choice | PUT /v1/computers/{name}/sync |
| List threads | GET /v1/threads |
| Start thread | POST /v1/threads |
| List synced threads | GET /v1/threads/synced |
| Sync thread | PUT /v1/threads/synced/{session} |
| Forget synced thread | DELETE /v1/threads/synced/{session} |
| Save synced thread capture | PUT /v1/threads/synced/{session}/captures/{ask} |
| Fail synced thread capture | POST /v1/threads/synced/{session}/captures/{ask}/failed |
| Take synced thread replies | POST /v1/threads/synced/{session}/replies |
| Set synced thread status | POST /v1/threads/synced/{session}/status |
| Read thread | GET /v1/threads/{id} |
| Move thread | PATCH /v1/threads/{id} |
| Delete thread | DELETE /v1/threads/{id} |
| Continue chat on computer | POST /v1/threads/{id}/continue |
| Stream cloud turn | GET /v1/threads/{id}/events |
| Add thread file | POST /v1/threads/{id}/files |
| Read thread file | GET /v1/threads/{id}/files/{file} |
| Remove unsent thread file | DELETE /v1/threads/{id}/files/{file} |
| List thread messages | GET /v1/threads/{id}/messages |
| Reply to thread | POST /v1/threads/{id}/messages |
| Read thread share | GET /v1/threads/{id}/share |
| Set thread share | POST /v1/threads/{id}/share |
| Stop cloud turn | POST /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
| Field | Type | Required | Description |
|---|---|---|---|
computer | string | Yes |
Response
200 — Success
Type: object
| Field | Type | Required | Description |
|---|---|---|---|
waiting | array of string | Yes | |
sync | one of "all", "local", null | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
name | path | string | Yes |
Response
200 — Success
Type: object
| Field | Type | Required | Description |
|---|---|---|---|
choice | one of "all", "local", null | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
name | path | string | Yes |
Request body
Content type: application/json
Type: object
| Field | Type | Required | Description |
|---|---|---|---|
choice | one of "all", "local" | Yes |
Response
200 — Success
Type: object
| Field | Type | Required | Description |
|---|---|---|---|
choice | one of "all", "local", null | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
offset | query | integer | No | Without project only |
limit | query | integer | No | Clamped to 1..200 |
after | query | string | No | Project list only; last returned ID, unknown after value is 400 invalid_cursor |
project | query | string | No | Project ID, name:NAME, or none; changes envelope and order |
Response
200 — Success
Type: ThreadList or ThreadProjectList
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Field | Type | Required | Description |
|---|---|---|---|
request_id | string (uuid) | Yes | |
text | string | Yes | |
files | array of string | No | |
project | string or null | No |
Response
200 — Success
Type: ThreadStarted
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
answering | always true | Yes |
201 — Success
Type: ThreadStarted
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
answering | always true | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Field | Type | Required | Description |
|---|---|---|---|
sessions | array of object | Yes | |
sessions[].session | string | Yes | |
sessions[].deleted | boolean | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
session | path | string | Yes |
Request body
Content type: application/json
Type: ThreadSyncUpload
| Field | Type | Required | Description |
|---|---|---|---|
computer | string | Yes | |
title | string | Yes | |
messages | array of object | Yes | |
messages[].role | one of "user", "assistant", "tool", "thinking" | Yes | |
messages[].text | string | Yes | |
messages[].step | null or object | No | |
repository | string or null | No | |
active_unix | integer or null | No |
Response
200 — Success
Type: ThreadSyncSaved
| Field | Type | Required | Description |
|---|---|---|---|
chat | string | Yes | |
changed | boolean | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
session | path | string | Yes |
Response
200 — Success
Type: object
| Field | Type | Required | Description |
|---|---|---|---|
deleted | boolean | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
session | path | string | Yes | |
ask | path | string | Yes |
Request body
Content type: application/octet-stream
Type: string (binary)
Response
200 — Success
Type: ThreadSyncSaved
| Field | Type | Required | Description |
|---|---|---|---|
chat | string | Yes | |
changed | boolean | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
session | path | string | Yes | |
ask | path | string | Yes |
Request body
Content type: application/json
Type: object
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes |
Response
200 — Success
Type: ThreadSyncSaved
| Field | Type | Required | Description |
|---|---|---|---|
chat | string | Yes | |
changed | boolean | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
session | path | string | Yes |
Response
200 — Success
Type: ThreadSyncTaken
| Field | Type | Required | Description |
|---|---|---|---|
replies | array of object | Yes | |
replies[].id | string | Yes | |
replies[].text | string | Yes | |
continued | array of object | Yes | |
continued[].role | one of "user", "assistant", "tool", "thinking" | Yes | |
continued[].text | string | Yes | |
asks | array of object | Yes | |
asks[].id | string | Yes | |
asks[].action | object | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
session | path | string | Yes |
Request body
Content type: application/json
Type: object
| Field | Type | Required | Description |
|---|---|---|---|
working | boolean | Yes |
Response
200 — Success
Type: ThreadSyncSaved
| Field | Type | Required | Description |
|---|---|---|---|
chat | string | Yes | |
changed | boolean | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes |
Response
200 — Success
Type: ThreadRecent
| Field | Type | Required | Description |
|---|---|---|---|
thread | ThreadRow | Yes | |
thread.id | string (uuid) | Yes | |
thread.title | string | Yes | |
thread.line | string | Yes | |
thread.surface | one of "web", "terminal", "phone" | Yes | |
thread.computer | string or null | Yes | |
thread.session | string or null | Yes | |
thread.updated_unix | integer | Yes | |
thread.working | boolean | Yes | |
thread.online | boolean | Yes | |
thread.can_reply | boolean | Yes | |
thread.pinned | boolean | Yes | |
thread.project | string or null | Yes | |
thread.messages | integer | Yes | |
thread.request_id | string (uuid) or null | No | |
thread.outcome | one of "pending", "answered", "stopped", "failed", "unknown", null | No | |
thread.home | ChatHome (string) | No | |
thread.continues | null or ChatPartRef | No | |
thread.continued_by | null or ChatPartRef | No | |
messages | array of object | Yes | |
messages[].role | one of "user", "assistant", "tool", "thinking" | Yes | |
messages[].text | string | Yes | |
messages[].files | array of HistoryFile | No | |
messages[].files[].id | string | Yes | |
messages[].files[].name | string | Yes | |
messages[].files[].kind | one of "png", "jpeg", "gif", "webp", "pdf", "text", "step", "stl" | Yes | |
messages[].files[].size | integer | Yes | |
earlier | integer | Yes | |
waiting | integer | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes |
Request body
Content type: application/json
Type: object
| Field | Type | Required | Description |
|---|---|---|---|
project | string or null | No | |
pinned | boolean | No | |
archived | boolean | No |
Response
200 — Success
Type: ThreadObject
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
object | always "thread" | Yes | |
title | string | Yes | |
project | string or null | Yes | |
surface | one of "web", "terminal", "phone" | Yes | |
computer | string or null | Yes | |
updated_at | string (date-time) | Yes | |
messages | integer | Yes | |
pinned | boolean | Yes | |
archived | boolean | Yes | |
started_by | object | No | |
started_by.name | string | Yes | |
started_by.you | boolean | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes |
Response
204 — Success; no response body
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | Yes |
Request body
Content type: application/json
Type: ChatContinuationClaim
| Field | Type | Required | Description |
|---|---|---|---|
revision | integer | Yes | |
target | ChatPartRef | Yes | |
target.id | string (uuid) | Yes | |
target.home | ChatHome (string) | Yes | |
seed | ChatContext | No | 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.title | string | Yes | |
seed.summary | string | Yes | |
seed.recent | array of ChatContextTurn | Yes | |
seed.recent[].role | one of "user", "assistant" | Yes | |
seed.recent[].text | string | Yes |
Response
200 — The same linked destination, including a safe context seed
Type: ChatContinuation
| Field | Type | Required | Description |
|---|---|---|---|
account | string | Yes | |
source | ChatPartRef | Yes | |
source.id | string (uuid) | Yes | |
source.home | ChatHome (string) | Yes | |
target | ChatPartRef | Yes | |
target.id | string (uuid) | Yes | |
target.home | ChatHome (string) | Yes | |
seed | ChatContext | Yes | 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.title | string | Yes | |
seed.summary | string | Yes | |
seed.recent | array of ChatContextTurn | Yes | |
seed.recent[].role | one of "user", "assistant" | Yes | |
seed.recent[].text | string | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | Yes | |
request_id | query | string (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
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | |
name | query | string | No |
Request body
Content type: application/octet-stream
Type: string (binary)
Response
201 — Success
Type: object
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
name | string | Yes | |
kind | one of "png", "jpeg", "gif", "webp", "pdf", "text", "step", "stl" | Yes | |
size | string | Yes | |
url | string | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | |
file | path | string | Yes |
Response
200 — Attachment bytes with validated media type
Content type: application/octet-stream
Type: string (binary)
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | |
file | path | string | Yes |
Response
204 — Success; no response body
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | |
limit | query | integer | No | |
after | query | string | No |
Response
200 — Success
Type: ThreadMessages
| Field | Type | Required | Description |
|---|---|---|---|
data | array of object | Yes | |
data[].id | string | Yes | |
data[].object | always "message" | Yes | |
data[].thread | string | Yes | |
data[].role | one of "user", "assistant", "tool", "thinking" | Yes | |
data[].content | array of object | Yes | |
data[].content[].type | always "text" | Yes | |
data[].content[].text | string | Yes | |
data[].files | null | Yes | |
data[].generated_files | null | Yes | |
data[].artifacts | null | Yes | |
next | string or null | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes |
Request body
Content type: application/json
Type: ThreadReply
| Field | Type | Required | Description |
|---|---|---|---|
request_id | string (uuid) | Yes | |
text | string | Yes | |
files | array of string | No | |
project | string or null | No |
Response
202 — Success
Type: ThreadAccepted
Errors
| Status | Meaning | Body |
|---|---|---|
| 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
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
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | Yes |
Request body
Content type: application/json
Type: ChatStop
| Field | Type | Required | Description |
|---|---|---|---|
request_id | string (uuid) | Yes |
Response
200 — Confirmed state of the named request
Type: ChatStopped
| Field | Type | Required | Description |
|---|---|---|---|
request_id | string (uuid) | Yes | |
stopped | boolean | Yes | |
finished | always true | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 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"
}'