API Reference
All API endpoints are served from the gateway worker. Authentication is via API key (Bearer token) for agent endpoints, or session cookie for dashboard endpoints.
Agent Chat
POST /v1/agent/:agentId/chat
Send a message to an agent. Returns an SSE stream.
curl -N -X POST https://api.claudepaw.com/v1/agent/ag_123/chat \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"message": "Research market trends in Norway"}'SSE events:
event: text—{"text": "..."}event: tool_start—{"tool": "web_search", "input": {...}}event: tool_result—{"tool": "web_search", "output": "..."}event: done—{"iterations": 3, "toolCalls": 4, "tokens": 1847, "cost": 0.004}
Agents
POST /v1/orgs/:orgId/agents
Create an agent.
{
"name": "Research Assistant",
"systemPrompt": "You are a research assistant...",
"model": "claude-sonnet-4-20250514",
"temperature": 0.7,
"maxIterations": 25,
"enabledTools": ["web_search", "read_url", "memory_read", "memory_write"]
}GET /v1/orgs/:orgId/agents
List all agents in the organization.
GET /v1/orgs/:orgId/agents/:agentId
Get agent details including attached skills.
PATCH /v1/orgs/:orgId/agents/:agentId
Update agent configuration. Partial updates supported.
DELETE /v1/orgs/:orgId/agents/:agentId
Delete an agent and all associated data.
Skills
POST /v1/orgs/:orgId/skills
Create a custom skill.
GET /v1/orgs/:orgId/skills
List skills (org custom + built-in).
PUT /v1/orgs/:orgId/agents/:agentId/skills/:skillId
Attach a skill to an agent.
DELETE /v1/orgs/:orgId/agents/:agentId/skills/:skillId
Detach a skill from an agent.
API Keys
POST /v1/orgs/:orgId/api-keys
Generate a new API key. Returns the key once — store it securely.
GET /v1/orgs/:orgId/api-keys
List API keys (prefix only, not the full key).
DELETE /v1/orgs/:orgId/api-keys/:keyId
Revoke an API key.
Usage
GET /v1/orgs/:orgId/usage
Paginated usage records. Query params: agentId, from, to, page, limit.
GET /v1/orgs/:orgId/usage/summary
MTD aggregates, active agents, top agents by cost, recent activity.
Billing
POST /v1/orgs/:orgId/billing/checkout
Create a Stripe checkout session for plan upgrade.
POST /v1/orgs/:orgId/billing/portal
Create a Stripe billing portal session.
GET /v1/orgs/:orgId/billing
Current billing status: plan, token usage, limits, overage rate.
Custom Domains
PUT /v1/orgs/:orgId/custom-domain
Set a custom domain for the org's API.
GET /v1/orgs/:orgId/custom-domain
Get current custom domain and DNS instructions.
DELETE /v1/orgs/:orgId/custom-domain
Remove custom domain.