/health
Health check endpoint. Returns worker status.
/v1/agents
Create a new AI agent.
"agent_name": "string (default: 'My Agent')",
"model": "string (default: '@cf/meta/llama-3.1-8b-instruct')",
"model_provider": "string (default: 'workers-ai')",
"governance_mode": "transparent | enforcing (default: 'transparent')"
}
/v1/agents
List all agents for the authenticated user. Not available via API keys.
/v1/agents/:id
Get agent details including state, model, governance mode.
/v1/agents/:id/start
Start a stopped agent. Required before chat connections.
/v1/agents/:id/stop
Stop a running agent. Creates an automatic checkpoint.
/v1/agents/:id/chat
WebSocket endpoint for real-time chat. Supports streaming AI responses and governance results.
{ "type": "stream_start", "message_id": "...", "role": "assistant" }
{ "type": "stream_chunk", "message_id": "...", "content": "..." }
{ "type": "stream_end", "message_id": "..." }
/v1/agents/:id/messages
Retrieve chat message history.
/v1/agents/:id/messages
Clear all chat messages for the agent's current session.
/v1/agents/:id/vault
Store a BYOK API key (AES-GCM encrypted at rest).
/v1/agents/:id/vault
List stored BYOK keys (prefixes only, never full keys).
/v1/agents/:id/vault?provider=openai
Delete a stored BYOK key.
/v1/agents/:id/api-keys
Create a scoped API key for programmatic access to this agent.
The raw_key is shown only once. Store it securely.
/v1/agents/:id/api-keys
List API keys for the agent.
/v1/agents/:id/api-keys/:key_id
Revoke an API key. The key cannot be used after revocation.
/v1/agents/:id/files
Upload a file to the agent's R2 storage. Use multipart/form-data.
/v1/agents/:id/files
List files in the agent's storage.
/v1/agents/:id/proofs/:leaf_hash
Retrieve a governance proof by leaf hash. Returns 403 if the hash does not belong to this agent.
"agent_id": "ocs_...",
"hash": "sha256:...",
"proof": { ... },
"proof_error": null,
"verification_url": "/verify/proof/sha256:...",
"verification_portal": "https://obligationsign.com/verify/"
}
/v1/agents/:id/quota
Get quota usage and tier for the agent.