Agents
Define your own agents and assign them work.
| Operation | Request |
|---|---|
| List agent assignments | GET /v1/agent-assignments |
| Create agent assignment | POST /v1/agent-assignments |
| Get agent assignment | GET /v1/agent-assignments/{id} |
| Command agent assignment | POST /v1/agent-assignments/{id}/commands |
| Report agent assignment | POST /v1/agent-assignments/{id}/report |
| List agent definitions | GET /v1/agent-definitions |
| Create agent definition | POST /v1/agent-definitions |
| Get agent definition | GET /v1/agent-definitions/{id} |
| Update agent definition | PUT /v1/agent-definitions/{id} |
| Delete agent definition | DELETE /v1/agent-definitions/{id} |
List agent assignments
GET /v1/agent-assignments · listAgentAssignments
Private account-owned assignment. Creation records intent; only the selected, account-authorized host may execute through its session ledger after its own permission checks. IDs and command IDs survive restart. Retain request_id and exact inputs for retry; changed inputs conflict. Follow-up and stop are intents, not proof of consumption or cancellation. Archive is refused while queued/running. Reports are what a host the account authorized says happened, not proof we checked, and require the selected host ID and exact expected revision. The transcript remains on coder-sync under chat; result is only a bounded summary. Limits: 256 unarchived assignments, 128 commands per assignment, 4096 saved mutations and 4 MiB per account including history. Maximum JSON body 96 KiB; list pages contain at most eight assignments.
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 |
|---|---|---|---|---|
host | query | string | No | |
after | query | string | No |
Response
200 — Account-owned assignment or page, no-store/private.
Type: AgentAssignmentPage
| Field | Type | Required | Description |
|---|---|---|---|
data | array of AgentAssignmentValue | Yes | |
data[].active_command | string or null | No | |
data[].after_seq | integer | No | |
data[].id | string | Yes | |
data[].revision | integer | Yes | |
data[].spec | AgentAssignmentSpec | Yes | |
data[].spec.agent | string | Yes | |
data[].spec.agent_revision | integer | Yes | |
data[].spec.host | string | Yes | |
data[].spec.project | string or null | No | |
data[].spec.task | string | Yes | Nonblank, no NUL, at most 65,536 UTF-8 bytes. |
data[].definition | CustomAgentDefinition | Yes | |
data[].definition.id | string | Yes | |
data[].definition.revision | integer | Yes | |
data[].definition.spec | CustomAgentSpec | Yes | |
data[].definition.spec.name | string | Yes | Nonblank, no control characters; at most 80 UTF-8 bytes. |
data[].definition.spec.description | string | Yes | At most 512 UTF-8 bytes; no control characters. |
data[].definition.spec.instructions | string | Yes | Nonblank, no NUL; at most 16,384 UTF-8 bytes. |
data[].definition.spec.runtime | string | Yes | The runtime to use first. |
data[].definition.spec.model | string or null | Yes | |
data[].definition.spec.access | one of "host_default", "read_only", "workspace_write" | Yes | |
data[].definition.spec.fallbacks | array of object | No | Runtimes to try in order when |
data[].definition.spec.fallbacks[].runtime | string | Yes | |
data[].definition.spec.fallbacks[].model | string | No | |
data[].definition.spec.autonomy | object | No | How the agent runs on its own. Not part of the agent's identity. Omitted when unset; unknown fields are ignored. |
data[].definition.spec.autonomy.shell_timeout_secs | integer | No | The longest one shell command may run, in seconds. The host passes it to the runtime. |
data[].definition.deleted | boolean | Yes | |
data[].chat | string (uuid) | Yes | |
data[].state | one of "queued", "running", "completed", "failed", "stopped", "unknown" | Yes | |
data[].commands | array of AgentAssignmentCommand | Yes | |
data[].commands[].request_id | string | Yes | |
data[].commands[].action | object | Yes | |
data[].result | string or null | Yes | |
data[].archived | boolean | Yes | |
next | string or null | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 400, 401, 403, 404, 409, 413, 429, 503 | Invalid assignment, signed out, denied, missing, assignment_conflict, too large, quota_exhausted, or unavailable. | AppAccountError |
Example
curl 'https://api.openagents.com/v1/agent-assignments' \
-H "Authorization: Bearer $OPENAGENTS_TOKEN"
In the Rust SDK
Create agent assignment
POST /v1/agent-assignments · createAgentAssignment
Private account-owned assignment. Creation records intent; only the selected, account-authorized host may execute through its session ledger after its own permission checks. IDs and command IDs survive restart. Retain request_id and exact inputs for retry; changed inputs conflict. Follow-up and stop are intents, not proof of consumption or cancellation. Archive is refused while queued/running. Reports are what a host the account authorized says happened, not proof we checked, and require the selected host ID and exact expected revision. The transcript remains on coder-sync under chat; result is only a bounded summary. Limits: 256 unarchived assignments, 128 commands per assignment, 4096 saved mutations and 4 MiB per account including history. Maximum JSON body 96 KiB; list pages contain at most eight assignments.
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: AgentAssignmentCreate
| Field | Type | Required | Description |
|---|---|---|---|
request_id | string | Yes | |
spec | AgentAssignmentSpec | Yes | |
spec.agent | string | Yes | |
spec.agent_revision | integer | Yes | |
spec.host | string | Yes | |
spec.project | string or null | No | |
spec.task | string | Yes | Nonblank, no NUL, at most 65,536 UTF-8 bytes. |
Response
200 — Account-owned assignment or page, no-store/private.
Type: AgentAssignmentValue
| Field | Type | Required | Description |
|---|---|---|---|
active_command | string or null | No | |
after_seq | integer | No | |
id | string | Yes | |
revision | integer | Yes | |
spec | AgentAssignmentSpec | Yes | |
spec.agent | string | Yes | |
spec.agent_revision | integer | Yes | |
spec.host | string | Yes | |
spec.project | string or null | No | |
spec.task | string | Yes | Nonblank, no NUL, at most 65,536 UTF-8 bytes. |
definition | CustomAgentDefinition | Yes | |
definition.id | string | Yes | |
definition.revision | integer | Yes | |
definition.spec | CustomAgentSpec | Yes | |
definition.spec.name | string | Yes | Nonblank, no control characters; at most 80 UTF-8 bytes. |
definition.spec.description | string | Yes | At most 512 UTF-8 bytes; no control characters. |
definition.spec.instructions | string | Yes | Nonblank, no NUL; at most 16,384 UTF-8 bytes. |
definition.spec.runtime | string | Yes | The runtime to use first. |
definition.spec.model | string or null | Yes | |
definition.spec.access | one of "host_default", "read_only", "workspace_write" | Yes | |
definition.spec.fallbacks | array of object | No | Runtimes to try in order when |
definition.spec.fallbacks[].runtime | string | Yes | |
definition.spec.fallbacks[].model | string | No | |
definition.spec.autonomy | object | No | How the agent runs on its own. Not part of the agent's identity. Omitted when unset; unknown fields are ignored. |
definition.spec.autonomy.shell_timeout_secs | integer | No | The longest one shell command may run, in seconds. The host passes it to the runtime. |
definition.deleted | boolean | Yes | |
chat | string (uuid) | Yes | |
state | one of "queued", "running", "completed", "failed", "stopped", "unknown" | Yes | |
commands | array of AgentAssignmentCommand | Yes | |
commands[].request_id | string | Yes | |
commands[].action | object | Yes | |
result | string or null | Yes | |
archived | boolean | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 400, 401, 403, 404, 409, 413, 429, 503 | Invalid assignment, signed out, denied, missing, assignment_conflict, too large, quota_exhausted, or unavailable. | AppAccountError |
Example
curl -X POST 'https://api.openagents.com/v1/agent-assignments' \
-H "Authorization: Bearer $OPENAGENTS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"request_id": "string",
"spec": {
"agent": "string",
"agent_revision": 1,
"host": "string",
"task": "string"
}
}'
In the Rust SDK
Get agent assignment
GET /v1/agent-assignments/{id} · getAgentAssignment
Private account-owned assignment. Creation records intent; only the selected, account-authorized host may execute through its session ledger after its own permission checks. IDs and command IDs survive restart. Retain request_id and exact inputs for retry; changed inputs conflict. Follow-up and stop are intents, not proof of consumption or cancellation. Archive is refused while queued/running. Reports are what a host the account authorized says happened, not proof we checked, and require the selected host ID and exact expected revision. The transcript remains on coder-sync under chat; result is only a bounded summary. Limits: 256 unarchived assignments, 128 commands per assignment, 4096 saved mutations and 4 MiB per account including history. Maximum JSON body 96 KiB; list pages contain at most eight assignments.
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 — Account-owned assignment or page, no-store/private.
Type: AgentAssignmentValue
| Field | Type | Required | Description |
|---|---|---|---|
active_command | string or null | No | |
after_seq | integer | No | |
id | string | Yes | |
revision | integer | Yes | |
spec | AgentAssignmentSpec | Yes | |
spec.agent | string | Yes | |
spec.agent_revision | integer | Yes | |
spec.host | string | Yes | |
spec.project | string or null | No | |
spec.task | string | Yes | Nonblank, no NUL, at most 65,536 UTF-8 bytes. |
definition | CustomAgentDefinition | Yes | |
definition.id | string | Yes | |
definition.revision | integer | Yes | |
definition.spec | CustomAgentSpec | Yes | |
definition.spec.name | string | Yes | Nonblank, no control characters; at most 80 UTF-8 bytes. |
definition.spec.description | string | Yes | At most 512 UTF-8 bytes; no control characters. |
definition.spec.instructions | string | Yes | Nonblank, no NUL; at most 16,384 UTF-8 bytes. |
definition.spec.runtime | string | Yes | The runtime to use first. |
definition.spec.model | string or null | Yes | |
definition.spec.access | one of "host_default", "read_only", "workspace_write" | Yes | |
definition.spec.fallbacks | array of object | No | Runtimes to try in order when |
definition.spec.fallbacks[].runtime | string | Yes | |
definition.spec.fallbacks[].model | string | No | |
definition.spec.autonomy | object | No | How the agent runs on its own. Not part of the agent's identity. Omitted when unset; unknown fields are ignored. |
definition.spec.autonomy.shell_timeout_secs | integer | No | The longest one shell command may run, in seconds. The host passes it to the runtime. |
definition.deleted | boolean | Yes | |
chat | string (uuid) | Yes | |
state | one of "queued", "running", "completed", "failed", "stopped", "unknown" | Yes | |
commands | array of AgentAssignmentCommand | Yes | |
commands[].request_id | string | Yes | |
commands[].action | object | Yes | |
result | string or null | Yes | |
archived | boolean | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 400, 401, 403, 404, 409, 413, 429, 503 | Invalid assignment, signed out, denied, missing, assignment_conflict, too large, quota_exhausted, or unavailable. | AppAccountError |
Example
curl 'https://api.openagents.com/v1/agent-assignments/{id}' \
-H "Authorization: Bearer $OPENAGENTS_TOKEN"
In the Rust SDK
Command agent assignment
POST /v1/agent-assignments/{id}/commands · commandAgentAssignment
Private account-owned assignment. Creation records intent; only the selected, account-authorized host may execute through its session ledger after its own permission checks. IDs and command IDs survive restart. Retain request_id and exact inputs for retry; changed inputs conflict. Follow-up and stop are intents, not proof of consumption or cancellation. Archive is refused while queued/running. Reports are what a host the account authorized says happened, not proof we checked, and require the selected host ID and exact expected revision. The transcript remains on coder-sync under chat; result is only a bounded summary. Limits: 256 unarchived assignments, 128 commands per assignment, 4096 saved mutations and 4 MiB per account including history. Maximum JSON body 96 KiB; list pages contain at most eight assignments.
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: AgentAssignmentCommand
| Field | Type | Required | Description |
|---|---|---|---|
request_id | string | Yes | |
action | object | Yes |
Response
200 — Account-owned assignment or page, no-store/private.
Type: AgentAssignmentValue
| Field | Type | Required | Description |
|---|---|---|---|
active_command | string or null | No | |
after_seq | integer | No | |
id | string | Yes | |
revision | integer | Yes | |
spec | AgentAssignmentSpec | Yes | |
spec.agent | string | Yes | |
spec.agent_revision | integer | Yes | |
spec.host | string | Yes | |
spec.project | string or null | No | |
spec.task | string | Yes | Nonblank, no NUL, at most 65,536 UTF-8 bytes. |
definition | CustomAgentDefinition | Yes | |
definition.id | string | Yes | |
definition.revision | integer | Yes | |
definition.spec | CustomAgentSpec | Yes | |
definition.spec.name | string | Yes | Nonblank, no control characters; at most 80 UTF-8 bytes. |
definition.spec.description | string | Yes | At most 512 UTF-8 bytes; no control characters. |
definition.spec.instructions | string | Yes | Nonblank, no NUL; at most 16,384 UTF-8 bytes. |
definition.spec.runtime | string | Yes | The runtime to use first. |
definition.spec.model | string or null | Yes | |
definition.spec.access | one of "host_default", "read_only", "workspace_write" | Yes | |
definition.spec.fallbacks | array of object | No | Runtimes to try in order when |
definition.spec.fallbacks[].runtime | string | Yes | |
definition.spec.fallbacks[].model | string | No | |
definition.spec.autonomy | object | No | How the agent runs on its own. Not part of the agent's identity. Omitted when unset; unknown fields are ignored. |
definition.spec.autonomy.shell_timeout_secs | integer | No | The longest one shell command may run, in seconds. The host passes it to the runtime. |
definition.deleted | boolean | Yes | |
chat | string (uuid) | Yes | |
state | one of "queued", "running", "completed", "failed", "stopped", "unknown" | Yes | |
commands | array of AgentAssignmentCommand | Yes | |
commands[].request_id | string | Yes | |
commands[].action | object | Yes | |
result | string or null | Yes | |
archived | boolean | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 400, 401, 403, 404, 409, 413, 429, 503 | Invalid assignment, signed out, denied, missing, assignment_conflict, too large, quota_exhausted, or unavailable. | AppAccountError |
Example
curl -X POST 'https://api.openagents.com/v1/agent-assignments/{id}/commands' \
-H "Authorization: Bearer $OPENAGENTS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"request_id": "string",
"action": {
"action": "follow_up",
"text": "string"
}
}'
In the Rust SDK
Report agent assignment
POST /v1/agent-assignments/{id}/report · reportAgentAssignment
Private account-owned assignment. Creation records intent; only the selected, account-authorized host may execute through its session ledger after its own permission checks. IDs and command IDs survive restart. Retain request_id and exact inputs for retry; changed inputs conflict. Follow-up and stop are intents, not proof of consumption or cancellation. Archive is refused while queued/running. Reports are what a host the account authorized says happened, not proof we checked, and require the selected host ID and exact expected revision. The transcript remains on coder-sync under chat; result is only a bounded summary. Limits: 256 unarchived assignments, 128 commands per assignment, 4096 saved mutations and 4 MiB per account including history. Maximum JSON body 96 KiB; list pages contain at most eight assignments.
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: AgentAssignmentReport
| Field | Type | Required | Description |
|---|---|---|---|
active_command | string or null | No | |
after_seq | integer | No | |
request_id | string | Yes | |
host | string | Yes | |
expected_revision | integer | Yes | |
state | one of "running", "completed", "failed", "stopped", "unknown" | Yes | |
result | string or null | No | At most 16,384 UTF-8 bytes; no NUL. |
Response
200 — Account-owned assignment or page, no-store/private.
Type: AgentAssignmentValue
| Field | Type | Required | Description |
|---|---|---|---|
active_command | string or null | No | |
after_seq | integer | No | |
id | string | Yes | |
revision | integer | Yes | |
spec | AgentAssignmentSpec | Yes | |
spec.agent | string | Yes | |
spec.agent_revision | integer | Yes | |
spec.host | string | Yes | |
spec.project | string or null | No | |
spec.task | string | Yes | Nonblank, no NUL, at most 65,536 UTF-8 bytes. |
definition | CustomAgentDefinition | Yes | |
definition.id | string | Yes | |
definition.revision | integer | Yes | |
definition.spec | CustomAgentSpec | Yes | |
definition.spec.name | string | Yes | Nonblank, no control characters; at most 80 UTF-8 bytes. |
definition.spec.description | string | Yes | At most 512 UTF-8 bytes; no control characters. |
definition.spec.instructions | string | Yes | Nonblank, no NUL; at most 16,384 UTF-8 bytes. |
definition.spec.runtime | string | Yes | The runtime to use first. |
definition.spec.model | string or null | Yes | |
definition.spec.access | one of "host_default", "read_only", "workspace_write" | Yes | |
definition.spec.fallbacks | array of object | No | Runtimes to try in order when |
definition.spec.fallbacks[].runtime | string | Yes | |
definition.spec.fallbacks[].model | string | No | |
definition.spec.autonomy | object | No | How the agent runs on its own. Not part of the agent's identity. Omitted when unset; unknown fields are ignored. |
definition.spec.autonomy.shell_timeout_secs | integer | No | The longest one shell command may run, in seconds. The host passes it to the runtime. |
definition.deleted | boolean | Yes | |
chat | string (uuid) | Yes | |
state | one of "queued", "running", "completed", "failed", "stopped", "unknown" | Yes | |
commands | array of AgentAssignmentCommand | Yes | |
commands[].request_id | string | Yes | |
commands[].action | object | Yes | |
result | string or null | Yes | |
archived | boolean | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 400, 401, 403, 404, 409, 413, 429, 503 | Invalid assignment, signed out, denied, missing, assignment_conflict, too large, quota_exhausted, or unavailable. | AppAccountError |
Example
curl -X POST 'https://api.openagents.com/v1/agent-assignments/{id}/report' \
-H "Authorization: Bearer $OPENAGENTS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"request_id": "string",
"host": "string",
"expected_revision": 1,
"state": "running"
}'
In the Rust SDK
List agent definitions
GET /v1/agent-definitions · listAgentDefinitions
Private account-owned definition. Does not install or execute an agent. We keep each change's request_id: a retry with the same inputs returns the first result, and changed inputs conflict. Deleted definitions and old revisions remain readable to their owner. Lists exclude deleted definitions and continue in ID order. Capacity is 128 active definitions, 4096 mutations, and 4 MiB per account, including history; no automatic history pruning. Updates and deletion require expected_revision. Maximum JSON body is 24 KiB.
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 |
|---|---|---|---|---|
limit | query | integer | No | |
after | query | string | No |
Response
200 — The account-owned result; no-store, private.
Type: CustomAgentPage
| Field | Type | Required | Description |
|---|---|---|---|
data | array of CustomAgentDefinition | Yes | |
data[].id | string | Yes | |
data[].revision | integer | Yes | |
data[].spec | CustomAgentSpec | Yes | |
data[].spec.name | string | Yes | Nonblank, no control characters; at most 80 UTF-8 bytes. |
data[].spec.description | string | Yes | At most 512 UTF-8 bytes; no control characters. |
data[].spec.instructions | string | Yes | Nonblank, no NUL; at most 16,384 UTF-8 bytes. |
data[].spec.runtime | string | Yes | The runtime to use first. |
data[].spec.model | string or null | Yes | |
data[].spec.access | one of "host_default", "read_only", "workspace_write" | Yes | |
data[].spec.fallbacks | array of object | No | Runtimes to try in order when |
data[].spec.fallbacks[].runtime | string | Yes | |
data[].spec.fallbacks[].model | string | No | |
data[].spec.autonomy | object | No | How the agent runs on its own. Not part of the agent's identity. Omitted when unset; unknown fields are ignored. |
data[].spec.autonomy.shell_timeout_secs | integer | No | The longest one shell command may run, in seconds. The host passes it to the runtime. |
data[].deleted | boolean | Yes | |
next | string or null | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 400, 401, 403, 404, 409, 413, 429, 503 | Invalid fields, signed out, denied, missing, version_conflict/idempotency_conflict, too large, quota_exhausted, or unavailable. | AppAccountError |
Example
curl 'https://api.openagents.com/v1/agent-definitions' \
-H "Authorization: Bearer $OPENAGENTS_TOKEN"
In the Rust SDK
Create agent definition
POST /v1/agent-definitions · createAgentDefinition
Private account-owned definition. Does not install or execute an agent. We keep each change's request_id: a retry with the same inputs returns the first result, and changed inputs conflict. Deleted definitions and old revisions remain readable to their owner. Lists exclude deleted definitions and continue in ID order. Capacity is 128 active definitions, 4096 mutations, and 4 MiB per account, including history; no automatic history pruning. Updates and deletion require expected_revision. Maximum JSON body is 24 KiB.
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: CustomAgentCreate
| Field | Type | Required | Description |
|---|---|---|---|
request_id | string | Yes | |
spec | CustomAgentSpec | Yes | |
spec.name | string | Yes | Nonblank, no control characters; at most 80 UTF-8 bytes. |
spec.description | string | Yes | At most 512 UTF-8 bytes; no control characters. |
spec.instructions | string | Yes | Nonblank, no NUL; at most 16,384 UTF-8 bytes. |
spec.runtime | string | Yes | The runtime to use first. |
spec.model | string or null | Yes | |
spec.access | one of "host_default", "read_only", "workspace_write" | Yes | |
spec.fallbacks | array of object | No | Runtimes to try in order when |
spec.fallbacks[].runtime | string | Yes | |
spec.fallbacks[].model | string | No | |
spec.autonomy | object | No | How the agent runs on its own. Not part of the agent's identity. Omitted when unset; unknown fields are ignored. |
spec.autonomy.shell_timeout_secs | integer | No | The longest one shell command may run, in seconds. The host passes it to the runtime. |
Response
200 — The account-owned result; no-store, private.
Type: CustomAgentDefinition
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
revision | integer | Yes | |
spec | CustomAgentSpec | Yes | |
spec.name | string | Yes | Nonblank, no control characters; at most 80 UTF-8 bytes. |
spec.description | string | Yes | At most 512 UTF-8 bytes; no control characters. |
spec.instructions | string | Yes | Nonblank, no NUL; at most 16,384 UTF-8 bytes. |
spec.runtime | string | Yes | The runtime to use first. |
spec.model | string or null | Yes | |
spec.access | one of "host_default", "read_only", "workspace_write" | Yes | |
spec.fallbacks | array of object | No | Runtimes to try in order when |
spec.fallbacks[].runtime | string | Yes | |
spec.fallbacks[].model | string | No | |
spec.autonomy | object | No | How the agent runs on its own. Not part of the agent's identity. Omitted when unset; unknown fields are ignored. |
spec.autonomy.shell_timeout_secs | integer | No | The longest one shell command may run, in seconds. The host passes it to the runtime. |
deleted | boolean | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 400, 401, 403, 404, 409, 413, 429, 503 | Invalid fields, signed out, denied, missing, version_conflict/idempotency_conflict, too large, quota_exhausted, or unavailable. | AppAccountError |
Example
curl -X POST 'https://api.openagents.com/v1/agent-definitions' \
-H "Authorization: Bearer $OPENAGENTS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"request_id": "string",
"spec": {
"name": "string",
"description": "string",
"instructions": "string",
"runtime": "string",
"model": "string",
"access": "host_default"
}
}'
In the Rust SDK
Get agent definition
GET /v1/agent-definitions/{id} · getAgentDefinition
Private account-owned definition. Does not install or execute an agent. We keep each change's request_id: a retry with the same inputs returns the first result, and changed inputs conflict. Deleted definitions and old revisions remain readable to their owner. Lists exclude deleted definitions and continue in ID order. Capacity is 128 active definitions, 4096 mutations, and 4 MiB per account, including history; no automatic history pruning. Updates and deletion require expected_revision. Maximum JSON body is 24 KiB.
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 | |
revision | query | integer | No |
Response
200 — The account-owned result; no-store, private.
Type: CustomAgentDefinition
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
revision | integer | Yes | |
spec | CustomAgentSpec | Yes | |
spec.name | string | Yes | Nonblank, no control characters; at most 80 UTF-8 bytes. |
spec.description | string | Yes | At most 512 UTF-8 bytes; no control characters. |
spec.instructions | string | Yes | Nonblank, no NUL; at most 16,384 UTF-8 bytes. |
spec.runtime | string | Yes | The runtime to use first. |
spec.model | string or null | Yes | |
spec.access | one of "host_default", "read_only", "workspace_write" | Yes | |
spec.fallbacks | array of object | No | Runtimes to try in order when |
spec.fallbacks[].runtime | string | Yes | |
spec.fallbacks[].model | string | No | |
spec.autonomy | object | No | How the agent runs on its own. Not part of the agent's identity. Omitted when unset; unknown fields are ignored. |
spec.autonomy.shell_timeout_secs | integer | No | The longest one shell command may run, in seconds. The host passes it to the runtime. |
deleted | boolean | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 400, 401, 403, 404, 409, 413, 429, 503 | Invalid fields, signed out, denied, missing, version_conflict/idempotency_conflict, too large, quota_exhausted, or unavailable. | AppAccountError |
Example
curl 'https://api.openagents.com/v1/agent-definitions/{id}' \
-H "Authorization: Bearer $OPENAGENTS_TOKEN"
In the Rust SDK
Update agent definition
PUT /v1/agent-definitions/{id} · updateAgentDefinition
Private account-owned definition. Does not install or execute an agent. We keep each change's request_id: a retry with the same inputs returns the first result, and changed inputs conflict. Deleted definitions and old revisions remain readable to their owner. Lists exclude deleted definitions and continue in ID order. Capacity is 128 active definitions, 4096 mutations, and 4 MiB per account, including history; no automatic history pruning. Updates and deletion require expected_revision. Maximum JSON body is 24 KiB.
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: CustomAgentUpdate
| Field | Type | Required | Description |
|---|---|---|---|
request_id | string | Yes | |
expected_revision | integer | Yes | |
spec | CustomAgentSpec | Yes | |
spec.name | string | Yes | Nonblank, no control characters; at most 80 UTF-8 bytes. |
spec.description | string | Yes | At most 512 UTF-8 bytes; no control characters. |
spec.instructions | string | Yes | Nonblank, no NUL; at most 16,384 UTF-8 bytes. |
spec.runtime | string | Yes | The runtime to use first. |
spec.model | string or null | Yes | |
spec.access | one of "host_default", "read_only", "workspace_write" | Yes | |
spec.fallbacks | array of object | No | Runtimes to try in order when |
spec.fallbacks[].runtime | string | Yes | |
spec.fallbacks[].model | string | No | |
spec.autonomy | object | No | How the agent runs on its own. Not part of the agent's identity. Omitted when unset; unknown fields are ignored. |
spec.autonomy.shell_timeout_secs | integer | No | The longest one shell command may run, in seconds. The host passes it to the runtime. |
Response
200 — The account-owned result; no-store, private.
Type: CustomAgentDefinition
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
revision | integer | Yes | |
spec | CustomAgentSpec | Yes | |
spec.name | string | Yes | Nonblank, no control characters; at most 80 UTF-8 bytes. |
spec.description | string | Yes | At most 512 UTF-8 bytes; no control characters. |
spec.instructions | string | Yes | Nonblank, no NUL; at most 16,384 UTF-8 bytes. |
spec.runtime | string | Yes | The runtime to use first. |
spec.model | string or null | Yes | |
spec.access | one of "host_default", "read_only", "workspace_write" | Yes | |
spec.fallbacks | array of object | No | Runtimes to try in order when |
spec.fallbacks[].runtime | string | Yes | |
spec.fallbacks[].model | string | No | |
spec.autonomy | object | No | How the agent runs on its own. Not part of the agent's identity. Omitted when unset; unknown fields are ignored. |
spec.autonomy.shell_timeout_secs | integer | No | The longest one shell command may run, in seconds. The host passes it to the runtime. |
deleted | boolean | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 400, 401, 403, 404, 409, 413, 429, 503 | Invalid fields, signed out, denied, missing, version_conflict/idempotency_conflict, too large, quota_exhausted, or unavailable. | AppAccountError |
Example
curl -X PUT 'https://api.openagents.com/v1/agent-definitions/{id}' \
-H "Authorization: Bearer $OPENAGENTS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"request_id": "string",
"expected_revision": 1,
"spec": {
"name": "string",
"description": "string",
"instructions": "string",
"runtime": "string",
"model": "string",
"access": "host_default"
}
}'
In the Rust SDK
Delete agent definition
DELETE /v1/agent-definitions/{id} · deleteAgentDefinition
Private account-owned definition. Does not install or execute an agent. We keep each change's request_id: a retry with the same inputs returns the first result, and changed inputs conflict. Deleted definitions and old revisions remain readable to their owner. Lists exclude deleted definitions and continue in ID order. Capacity is 128 active definitions, 4096 mutations, and 4 MiB per account, including history; no automatic history pruning. Updates and deletion require expected_revision. Maximum JSON body is 24 KiB.
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: CustomAgentDelete
| Field | Type | Required | Description |
|---|---|---|---|
request_id | string | Yes | |
expected_revision | integer | Yes |
Response
200 — The account-owned result; no-store, private.
Type: CustomAgentDefinition
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | |
revision | integer | Yes | |
spec | CustomAgentSpec | Yes | |
spec.name | string | Yes | Nonblank, no control characters; at most 80 UTF-8 bytes. |
spec.description | string | Yes | At most 512 UTF-8 bytes; no control characters. |
spec.instructions | string | Yes | Nonblank, no NUL; at most 16,384 UTF-8 bytes. |
spec.runtime | string | Yes | The runtime to use first. |
spec.model | string or null | Yes | |
spec.access | one of "host_default", "read_only", "workspace_write" | Yes | |
spec.fallbacks | array of object | No | Runtimes to try in order when |
spec.fallbacks[].runtime | string | Yes | |
spec.fallbacks[].model | string | No | |
spec.autonomy | object | No | How the agent runs on its own. Not part of the agent's identity. Omitted when unset; unknown fields are ignored. |
spec.autonomy.shell_timeout_secs | integer | No | The longest one shell command may run, in seconds. The host passes it to the runtime. |
deleted | boolean | Yes |
Errors
| Status | Meaning | Body |
|---|---|---|
| 400, 401, 403, 404, 409, 413, 429, 503 | Invalid fields, signed out, denied, missing, version_conflict/idempotency_conflict, too large, quota_exhausted, or unavailable. | AppAccountError |
Example
curl -X DELETE 'https://api.openagents.com/v1/agent-definitions/{id}' \
-H "Authorization: Bearer $OPENAGENTS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"request_id": "string",
"expected_revision": 1
}'