Skip to content

API Endpoints

Every endpoint requires the x-api-key: <api_key> header unless noted. JSON request and response bodies. Errors follow the shape in REST API → Errors.

List all agents in the tenant. Query params: archived (bool), limit, cursor.

Create an agent. Body: AgentConfig minus the platform-assigned fields (id, version, timestamps).

Get a single agent’s current version.

List all versions of an agent.

Get a specific historical version.

Update an agent. Bumps version. Body: partial AgentConfig.

Archive an agent (soft delete; sessions retain pinned version).

Create a session. Returns SessionMeta.

{
"agent": "agent_...",
"environment_id": "env_...",
"title": "optional"
}

Post the first user turn afterwards via POST /v1/sessions/:id/messages (one-shot, streams reply) or POST /v1/sessions/:id/events (fire-and-forget; pair with a separate SSE consumer).

List sessions. Query: agent_id, status, limit, cursor.

Get session metadata + status.

JSON-paginated event log. Query: limit (1–1000, default 100), order (asc|desc), after_seq. Returns { data: SessionEvent[], has_more, next_page }.

Pass Accept: text/event-stream to switch to the SSE variant (or call /v1/sessions/:id/events/stream directly). Default behavior is Anthropic-spec-aligned: no history replay, only the spec event union (third-party @anthropic-ai/sdk parses cleanly). Two opt-ins:

  • ?include=chunks — admit OMA extension events (token chunks, lifecycle, system.user_message_*, session.warning, extra spans like aux.model_call)
  • ?replay=1 (or Last-Event-ID: <seq> header) — replay persisted history before tailing

See REST API → Stream session events for the full event tables.

Full event log as a JSON array (non-streaming).

Chatbot one-shot: post a user turn AND stream the response in one HTTP call. Body: { "content": string | ContentBlock[] }. Returns text/event-stream and auto-closes when the turn finishes (session.status_idle). For the fire-and-forget variant (when you already have a separate SSE consumer open), POST to /v1/sessions/:id/events instead with the user.message wrapped in {events:[...]} — returns 202.

Cancel a running session.

Soft-delete a session.

List environment templates.

Create an environment. Body: EnvironmentConfig.

Get one.

Update.

Delete (only if no agents reference it).

List custom + built-in skills.

Upload a custom skill. multipart/form-data with id, display_title, description, and one or more files.

Get metadata.

Download a skill file.

Delete (built-in skills can’t be deleted).

List. Returned objects never include the secret material.

Create. Body includes the secret; subsequent reads will not.

Update — including rotating the secret.

Delete.

List per agent.

Create.

List recent entries.

Semantic search. Body: { "query": "...", "limit": 10 }.

Delete the store and its index.

Upload. multipart/form-data with session_id and file.

Download.

Delete.

Per-tenant LLM credentials. Keys are AES-256-GCM-encrypted at rest under PLATFORM_ROOT_SECRET directly on the row (no Vault indirection). List responses surface only the last-4 preview.

List configured model cards.

Add a model card. Runs a 6-second capability probe so a bad key fails loudly. Body:

{
"model_id": "my-anthropic",
"provider": "ant",
"model": "claude-sonnet-4-6",
"base_url": "https://api.anthropic.com",
"custom_headers": { "x-extra": "..." },
"api_key": "sk-ant-..."
}

provider is one of ant | ant-compatible | oai | oai-compatible. model_id is the string an agent sets as agent.model = "<model_id>" to bind this card.

Rotate the api_key, base_url, headers, or default model. Body shape matches POST. In-flight sessions keep the cached key until next credential resolve.

Delete.

GET /v1/model_cards/:id/key (internal — agent worker only)

Section titled “GET /v1/model_cards/:id/key (internal — agent worker only)”

Returns cleartext credentials for the agent worker. Not exposed publicly.

List shipped + active integrations.

Start the OAuth flow for the integration. Returns a redirect URL.

Revoke the install.

List publications (which agents serve which workspaces).

Create a publication.

DELETE /v1/integrations/:id/publications/:pub_id

Section titled “DELETE /v1/integrations/:id/publications/:pub_id”

Delete a publication.

List eval runs.

Start an eval.

Get an eval’s results.

List your keys (the actual key value is not returned).

Create. Body: { "name": "..." }. Returns the key once — store it now.

Revoke.

Start an OAuth flow (Google sign-in for the Console).

OAuth callback handler.

Returns {"ok": true}. Unauthenticated.