Skip to content

Agents

Define your own agents and assign them work.

OperationRequest
List agent assignmentsGET /v1/agent-assignments
Create agent assignmentPOST /v1/agent-assignments
Get agent assignmentGET /v1/agent-assignments/{id}
Command agent assignmentPOST /v1/agent-assignments/{id}/commands
Report agent assignmentPOST /v1/agent-assignments/{id}/report
List agent definitionsGET /v1/agent-definitions
Create agent definitionPOST /v1/agent-definitions
Get agent definitionGET /v1/agent-definitions/{id}
Update agent definitionPUT /v1/agent-definitions/{id}
Delete agent definitionDELETE /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

NameInTypeRequiredDescription
hostquerystringNo
afterquerystringNo

Response

200 — Account-owned assignment or page, no-store/private.

Type: AgentAssignmentPage

FieldTypeRequiredDescription
dataarray of AgentAssignmentValueYes
data[].active_commandstring or nullNo
data[].after_seqintegerNo
data[].idstringYes
data[].revisionintegerYes
data[].specAgentAssignmentSpecYes
data[].spec.agentstringYes
data[].spec.agent_revisionintegerYes
data[].spec.hoststringYes
data[].spec.projectstring or nullNo
data[].spec.taskstringYes

Nonblank, no NUL, at most 65,536 UTF-8 bytes.

data[].definitionCustomAgentDefinitionYes
data[].definition.idstringYes
data[].definition.revisionintegerYes
data[].definition.specCustomAgentSpecYes
data[].definition.spec.namestringYes

Nonblank, no control characters; at most 80 UTF-8 bytes.

data[].definition.spec.descriptionstringYes

At most 512 UTF-8 bytes; no control characters.

data[].definition.spec.instructionsstringYes

Nonblank, no NUL; at most 16,384 UTF-8 bytes.

data[].definition.spec.runtimestringYes

The runtime to use first. any leaves the choice to the computer. Not part of the agent's identity: changing it keeps the agent and applies from the next turn.

data[].definition.spec.modelstring or nullYes
data[].definition.spec.accessone of "host_default", "read_only", "workspace_write"Yes
data[].definition.spec.fallbacksarray of objectNo

Runtimes to try in order when runtime isn't installed, turned on, or signed in on the computer; then the computer's own default. Each runtime appears once and is not sdk or any. Omitted when empty.

data[].definition.spec.fallbacks[].runtimestringYes
data[].definition.spec.fallbacks[].modelstringNo
data[].definition.spec.autonomyobjectNo

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_secsintegerNo

The longest one shell command may run, in seconds. The host passes it to the runtime.

data[].definition.deletedbooleanYes
data[].chatstring (uuid)Yes
data[].stateone of "queued", "running", "completed", "failed", "stopped", "unknown"Yes
data[].commandsarray of AgentAssignmentCommandYes
data[].commands[].request_idstringYes
data[].commands[].actionobjectYes
data[].resultstring or nullYes
data[].archivedbooleanYes
nextstring or nullYes

Errors

StatusMeaningBody
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

FieldTypeRequiredDescription
request_idstringYes
specAgentAssignmentSpecYes
spec.agentstringYes
spec.agent_revisionintegerYes
spec.hoststringYes
spec.projectstring or nullNo
spec.taskstringYes

Nonblank, no NUL, at most 65,536 UTF-8 bytes.

Response

200 — Account-owned assignment or page, no-store/private.

Type: AgentAssignmentValue

FieldTypeRequiredDescription
active_commandstring or nullNo
after_seqintegerNo
idstringYes
revisionintegerYes
specAgentAssignmentSpecYes
spec.agentstringYes
spec.agent_revisionintegerYes
spec.hoststringYes
spec.projectstring or nullNo
spec.taskstringYes

Nonblank, no NUL, at most 65,536 UTF-8 bytes.

definitionCustomAgentDefinitionYes
definition.idstringYes
definition.revisionintegerYes
definition.specCustomAgentSpecYes
definition.spec.namestringYes

Nonblank, no control characters; at most 80 UTF-8 bytes.

definition.spec.descriptionstringYes

At most 512 UTF-8 bytes; no control characters.

definition.spec.instructionsstringYes

Nonblank, no NUL; at most 16,384 UTF-8 bytes.

definition.spec.runtimestringYes

The runtime to use first. any leaves the choice to the computer. Not part of the agent's identity: changing it keeps the agent and applies from the next turn.

definition.spec.modelstring or nullYes
definition.spec.accessone of "host_default", "read_only", "workspace_write"Yes
definition.spec.fallbacksarray of objectNo

Runtimes to try in order when runtime isn't installed, turned on, or signed in on the computer; then the computer's own default. Each runtime appears once and is not sdk or any. Omitted when empty.

definition.spec.fallbacks[].runtimestringYes
definition.spec.fallbacks[].modelstringNo
definition.spec.autonomyobjectNo

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_secsintegerNo

The longest one shell command may run, in seconds. The host passes it to the runtime.

definition.deletedbooleanYes
chatstring (uuid)Yes
stateone of "queued", "running", "completed", "failed", "stopped", "unknown"Yes
commandsarray of AgentAssignmentCommandYes
commands[].request_idstringYes
commands[].actionobjectYes
resultstring or nullYes
archivedbooleanYes

Errors

StatusMeaningBody
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

NameInTypeRequiredDescription
idpathstringYes

Response

200 — Account-owned assignment or page, no-store/private.

Type: AgentAssignmentValue

FieldTypeRequiredDescription
active_commandstring or nullNo
after_seqintegerNo
idstringYes
revisionintegerYes
specAgentAssignmentSpecYes
spec.agentstringYes
spec.agent_revisionintegerYes
spec.hoststringYes
spec.projectstring or nullNo
spec.taskstringYes

Nonblank, no NUL, at most 65,536 UTF-8 bytes.

definitionCustomAgentDefinitionYes
definition.idstringYes
definition.revisionintegerYes
definition.specCustomAgentSpecYes
definition.spec.namestringYes

Nonblank, no control characters; at most 80 UTF-8 bytes.

definition.spec.descriptionstringYes

At most 512 UTF-8 bytes; no control characters.

definition.spec.instructionsstringYes

Nonblank, no NUL; at most 16,384 UTF-8 bytes.

definition.spec.runtimestringYes

The runtime to use first. any leaves the choice to the computer. Not part of the agent's identity: changing it keeps the agent and applies from the next turn.

definition.spec.modelstring or nullYes
definition.spec.accessone of "host_default", "read_only", "workspace_write"Yes
definition.spec.fallbacksarray of objectNo

Runtimes to try in order when runtime isn't installed, turned on, or signed in on the computer; then the computer's own default. Each runtime appears once and is not sdk or any. Omitted when empty.

definition.spec.fallbacks[].runtimestringYes
definition.spec.fallbacks[].modelstringNo
definition.spec.autonomyobjectNo

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_secsintegerNo

The longest one shell command may run, in seconds. The host passes it to the runtime.

definition.deletedbooleanYes
chatstring (uuid)Yes
stateone of "queued", "running", "completed", "failed", "stopped", "unknown"Yes
commandsarray of AgentAssignmentCommandYes
commands[].request_idstringYes
commands[].actionobjectYes
resultstring or nullYes
archivedbooleanYes

Errors

StatusMeaningBody
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

NameInTypeRequiredDescription
idpathstringYes

Request body

Content type: application/json

Type: AgentAssignmentCommand

FieldTypeRequiredDescription
request_idstringYes
actionobjectYes

Response

200 — Account-owned assignment or page, no-store/private.

Type: AgentAssignmentValue

FieldTypeRequiredDescription
active_commandstring or nullNo
after_seqintegerNo
idstringYes
revisionintegerYes
specAgentAssignmentSpecYes
spec.agentstringYes
spec.agent_revisionintegerYes
spec.hoststringYes
spec.projectstring or nullNo
spec.taskstringYes

Nonblank, no NUL, at most 65,536 UTF-8 bytes.

definitionCustomAgentDefinitionYes
definition.idstringYes
definition.revisionintegerYes
definition.specCustomAgentSpecYes
definition.spec.namestringYes

Nonblank, no control characters; at most 80 UTF-8 bytes.

definition.spec.descriptionstringYes

At most 512 UTF-8 bytes; no control characters.

definition.spec.instructionsstringYes

Nonblank, no NUL; at most 16,384 UTF-8 bytes.

definition.spec.runtimestringYes

The runtime to use first. any leaves the choice to the computer. Not part of the agent's identity: changing it keeps the agent and applies from the next turn.

definition.spec.modelstring or nullYes
definition.spec.accessone of "host_default", "read_only", "workspace_write"Yes
definition.spec.fallbacksarray of objectNo

Runtimes to try in order when runtime isn't installed, turned on, or signed in on the computer; then the computer's own default. Each runtime appears once and is not sdk or any. Omitted when empty.

definition.spec.fallbacks[].runtimestringYes
definition.spec.fallbacks[].modelstringNo
definition.spec.autonomyobjectNo

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_secsintegerNo

The longest one shell command may run, in seconds. The host passes it to the runtime.

definition.deletedbooleanYes
chatstring (uuid)Yes
stateone of "queued", "running", "completed", "failed", "stopped", "unknown"Yes
commandsarray of AgentAssignmentCommandYes
commands[].request_idstringYes
commands[].actionobjectYes
resultstring or nullYes
archivedbooleanYes

Errors

StatusMeaningBody
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

NameInTypeRequiredDescription
idpathstringYes

Request body

Content type: application/json

Type: AgentAssignmentReport

FieldTypeRequiredDescription
active_commandstring or nullNo
after_seqintegerNo
request_idstringYes
hoststringYes
expected_revisionintegerYes
stateone of "running", "completed", "failed", "stopped", "unknown"Yes
resultstring or nullNo

At most 16,384 UTF-8 bytes; no NUL.

Response

200 — Account-owned assignment or page, no-store/private.

Type: AgentAssignmentValue

FieldTypeRequiredDescription
active_commandstring or nullNo
after_seqintegerNo
idstringYes
revisionintegerYes
specAgentAssignmentSpecYes
spec.agentstringYes
spec.agent_revisionintegerYes
spec.hoststringYes
spec.projectstring or nullNo
spec.taskstringYes

Nonblank, no NUL, at most 65,536 UTF-8 bytes.

definitionCustomAgentDefinitionYes
definition.idstringYes
definition.revisionintegerYes
definition.specCustomAgentSpecYes
definition.spec.namestringYes

Nonblank, no control characters; at most 80 UTF-8 bytes.

definition.spec.descriptionstringYes

At most 512 UTF-8 bytes; no control characters.

definition.spec.instructionsstringYes

Nonblank, no NUL; at most 16,384 UTF-8 bytes.

definition.spec.runtimestringYes

The runtime to use first. any leaves the choice to the computer. Not part of the agent's identity: changing it keeps the agent and applies from the next turn.

definition.spec.modelstring or nullYes
definition.spec.accessone of "host_default", "read_only", "workspace_write"Yes
definition.spec.fallbacksarray of objectNo

Runtimes to try in order when runtime isn't installed, turned on, or signed in on the computer; then the computer's own default. Each runtime appears once and is not sdk or any. Omitted when empty.

definition.spec.fallbacks[].runtimestringYes
definition.spec.fallbacks[].modelstringNo
definition.spec.autonomyobjectNo

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_secsintegerNo

The longest one shell command may run, in seconds. The host passes it to the runtime.

definition.deletedbooleanYes
chatstring (uuid)Yes
stateone of "queued", "running", "completed", "failed", "stopped", "unknown"Yes
commandsarray of AgentAssignmentCommandYes
commands[].request_idstringYes
commands[].actionobjectYes
resultstring or nullYes
archivedbooleanYes

Errors

StatusMeaningBody
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

NameInTypeRequiredDescription
limitqueryintegerNo
afterquerystringNo

Response

200 — The account-owned result; no-store, private.

Type: CustomAgentPage

FieldTypeRequiredDescription
dataarray of CustomAgentDefinitionYes
data[].idstringYes
data[].revisionintegerYes
data[].specCustomAgentSpecYes
data[].spec.namestringYes

Nonblank, no control characters; at most 80 UTF-8 bytes.

data[].spec.descriptionstringYes

At most 512 UTF-8 bytes; no control characters.

data[].spec.instructionsstringYes

Nonblank, no NUL; at most 16,384 UTF-8 bytes.

data[].spec.runtimestringYes

The runtime to use first. any leaves the choice to the computer. Not part of the agent's identity: changing it keeps the agent and applies from the next turn.

data[].spec.modelstring or nullYes
data[].spec.accessone of "host_default", "read_only", "workspace_write"Yes
data[].spec.fallbacksarray of objectNo

Runtimes to try in order when runtime isn't installed, turned on, or signed in on the computer; then the computer's own default. Each runtime appears once and is not sdk or any. Omitted when empty.

data[].spec.fallbacks[].runtimestringYes
data[].spec.fallbacks[].modelstringNo
data[].spec.autonomyobjectNo

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_secsintegerNo

The longest one shell command may run, in seconds. The host passes it to the runtime.

data[].deletedbooleanYes
nextstring or nullYes

Errors

StatusMeaningBody
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

FieldTypeRequiredDescription
request_idstringYes
specCustomAgentSpecYes
spec.namestringYes

Nonblank, no control characters; at most 80 UTF-8 bytes.

spec.descriptionstringYes

At most 512 UTF-8 bytes; no control characters.

spec.instructionsstringYes

Nonblank, no NUL; at most 16,384 UTF-8 bytes.

spec.runtimestringYes

The runtime to use first. any leaves the choice to the computer. Not part of the agent's identity: changing it keeps the agent and applies from the next turn.

spec.modelstring or nullYes
spec.accessone of "host_default", "read_only", "workspace_write"Yes
spec.fallbacksarray of objectNo

Runtimes to try in order when runtime isn't installed, turned on, or signed in on the computer; then the computer's own default. Each runtime appears once and is not sdk or any. Omitted when empty.

spec.fallbacks[].runtimestringYes
spec.fallbacks[].modelstringNo
spec.autonomyobjectNo

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_secsintegerNo

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

FieldTypeRequiredDescription
idstringYes
revisionintegerYes
specCustomAgentSpecYes
spec.namestringYes

Nonblank, no control characters; at most 80 UTF-8 bytes.

spec.descriptionstringYes

At most 512 UTF-8 bytes; no control characters.

spec.instructionsstringYes

Nonblank, no NUL; at most 16,384 UTF-8 bytes.

spec.runtimestringYes

The runtime to use first. any leaves the choice to the computer. Not part of the agent's identity: changing it keeps the agent and applies from the next turn.

spec.modelstring or nullYes
spec.accessone of "host_default", "read_only", "workspace_write"Yes
spec.fallbacksarray of objectNo

Runtimes to try in order when runtime isn't installed, turned on, or signed in on the computer; then the computer's own default. Each runtime appears once and is not sdk or any. Omitted when empty.

spec.fallbacks[].runtimestringYes
spec.fallbacks[].modelstringNo
spec.autonomyobjectNo

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_secsintegerNo

The longest one shell command may run, in seconds. The host passes it to the runtime.

deletedbooleanYes

Errors

StatusMeaningBody
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

NameInTypeRequiredDescription
idpathstringYes
revisionqueryintegerNo

Response

200 — The account-owned result; no-store, private.

Type: CustomAgentDefinition

FieldTypeRequiredDescription
idstringYes
revisionintegerYes
specCustomAgentSpecYes
spec.namestringYes

Nonblank, no control characters; at most 80 UTF-8 bytes.

spec.descriptionstringYes

At most 512 UTF-8 bytes; no control characters.

spec.instructionsstringYes

Nonblank, no NUL; at most 16,384 UTF-8 bytes.

spec.runtimestringYes

The runtime to use first. any leaves the choice to the computer. Not part of the agent's identity: changing it keeps the agent and applies from the next turn.

spec.modelstring or nullYes
spec.accessone of "host_default", "read_only", "workspace_write"Yes
spec.fallbacksarray of objectNo

Runtimes to try in order when runtime isn't installed, turned on, or signed in on the computer; then the computer's own default. Each runtime appears once and is not sdk or any. Omitted when empty.

spec.fallbacks[].runtimestringYes
spec.fallbacks[].modelstringNo
spec.autonomyobjectNo

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_secsintegerNo

The longest one shell command may run, in seconds. The host passes it to the runtime.

deletedbooleanYes

Errors

StatusMeaningBody
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

NameInTypeRequiredDescription
idpathstringYes

Request body

Content type: application/json

Type: CustomAgentUpdate

FieldTypeRequiredDescription
request_idstringYes
expected_revisionintegerYes
specCustomAgentSpecYes
spec.namestringYes

Nonblank, no control characters; at most 80 UTF-8 bytes.

spec.descriptionstringYes

At most 512 UTF-8 bytes; no control characters.

spec.instructionsstringYes

Nonblank, no NUL; at most 16,384 UTF-8 bytes.

spec.runtimestringYes

The runtime to use first. any leaves the choice to the computer. Not part of the agent's identity: changing it keeps the agent and applies from the next turn.

spec.modelstring or nullYes
spec.accessone of "host_default", "read_only", "workspace_write"Yes
spec.fallbacksarray of objectNo

Runtimes to try in order when runtime isn't installed, turned on, or signed in on the computer; then the computer's own default. Each runtime appears once and is not sdk or any. Omitted when empty.

spec.fallbacks[].runtimestringYes
spec.fallbacks[].modelstringNo
spec.autonomyobjectNo

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_secsintegerNo

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

FieldTypeRequiredDescription
idstringYes
revisionintegerYes
specCustomAgentSpecYes
spec.namestringYes

Nonblank, no control characters; at most 80 UTF-8 bytes.

spec.descriptionstringYes

At most 512 UTF-8 bytes; no control characters.

spec.instructionsstringYes

Nonblank, no NUL; at most 16,384 UTF-8 bytes.

spec.runtimestringYes

The runtime to use first. any leaves the choice to the computer. Not part of the agent's identity: changing it keeps the agent and applies from the next turn.

spec.modelstring or nullYes
spec.accessone of "host_default", "read_only", "workspace_write"Yes
spec.fallbacksarray of objectNo

Runtimes to try in order when runtime isn't installed, turned on, or signed in on the computer; then the computer's own default. Each runtime appears once and is not sdk or any. Omitted when empty.

spec.fallbacks[].runtimestringYes
spec.fallbacks[].modelstringNo
spec.autonomyobjectNo

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_secsintegerNo

The longest one shell command may run, in seconds. The host passes it to the runtime.

deletedbooleanYes

Errors

StatusMeaningBody
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

NameInTypeRequiredDescription
idpathstringYes

Request body

Content type: application/json

Type: CustomAgentDelete

FieldTypeRequiredDescription
request_idstringYes
expected_revisionintegerYes

Response

200 — The account-owned result; no-store, private.

Type: CustomAgentDefinition

FieldTypeRequiredDescription
idstringYes
revisionintegerYes
specCustomAgentSpecYes
spec.namestringYes

Nonblank, no control characters; at most 80 UTF-8 bytes.

spec.descriptionstringYes

At most 512 UTF-8 bytes; no control characters.

spec.instructionsstringYes

Nonblank, no NUL; at most 16,384 UTF-8 bytes.

spec.runtimestringYes

The runtime to use first. any leaves the choice to the computer. Not part of the agent's identity: changing it keeps the agent and applies from the next turn.

spec.modelstring or nullYes
spec.accessone of "host_default", "read_only", "workspace_write"Yes
spec.fallbacksarray of objectNo

Runtimes to try in order when runtime isn't installed, turned on, or signed in on the computer; then the computer's own default. Each runtime appears once and is not sdk or any. Omitted when empty.

spec.fallbacks[].runtimestringYes
spec.fallbacks[].modelstringNo
spec.autonomyobjectNo

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_secsintegerNo

The longest one shell command may run, in seconds. The host passes it to the runtime.

deletedbooleanYes

Errors

StatusMeaningBody
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
}'

In the Rust SDK