Skip to content

REST API

The REST surface lives under /v1/*. Everything the Console does, you can do programmatically — the Console itself is just an API consumer.

EnvironmentBase URL
Hosted (production)https://app.openma.dev
Hosted (staging)https://app.staging.openma.dev
Self-hostWhatever you set in apps/main/wrangler.jsonc → routes

Two auth schemes:

API key — for server-to-server and CLI use. Pass as Authorization: Bearer oma_.... Create on the Console API Keys page.

Session cookie — what the Console UI uses (better-auth-issued). Not normally what you’ll integrate against unless you’re embedding openma in a browser app.

Terminal window
export OMA_BASE_URL="https://app.openma.dev"
export OMA_API_KEY="oma_..."
GroupPathPurpose
Agents/v1/agentsCreate / read / update / archive agent configurations. Versioned — every update bumps the version.
Sessions/v1/sessionsCreate sessions, list, fetch event log. Live events via SSE.
Environments/v1/environmentsSandbox templates: packages, network rules, base image.
Skills/v1/skillsBuilt-in + custom skill catalog. Custom skill files via R2-backed upload.
Vaults/v1/vaultsCredential stores (bearer tokens, OAuth, env vars).
Memory Stores/v1/memory_storesPer-agent semantic memory.
Files/v1/filesPer-session file storage.
Model Cards/v1/model_cardsCustom model provider configuration.
Integrations/v1/integrationsLinear / GitHub / Slack install state, webhooks, publications.
Evals/v1/evalsEvaluation framework.
API Keys/v1/api_keysManage personal access tokens.
OAuth/v1/oauthThird-party OAuth flows for the Console UI.

A full endpoint-by-endpoint reference lives at Reference → API Endpoints.

Terminal window
curl -X POST "$OMA_BASE_URL/v1/agents" \
-H "Authorization: Bearer $OMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "research-agent",
"model": "claude-sonnet-4-6",
"system": "You are a research assistant.",
"tools": [{"type": "agent_toolset_20260401"}]
}'
Terminal window
curl -X POST "$OMA_BASE_URL/v1/sessions" \
-H "Authorization: Bearer $OMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agent_abc123",
"input": [
{"role": "user", "content": "Summarize the openma docs."}
]
}'
Terminal window
curl -N "$OMA_BASE_URL/v1/sessions/sess_xyz/events" \
-H "Authorization: Bearer $OMA_API_KEY"

The connection stays open. Each data: line is a JSON event. Common event types:

  • message_start / message_delta / message_stop — model output streaming
  • tool_use — model is calling a tool
  • tool_result — sandbox returned a result
  • session_done — final state

You can reconnect at any time and the platform replays the full event log from the beginning (or from a ?after=<event_id> cursor).

Send another turn into an existing session

Section titled “Send another turn into an existing session”
Terminal window
curl -X POST "$OMA_BASE_URL/v1/sessions/sess_xyz/messages" \
-H "Authorization: Bearer $OMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"role": "user",
"content": "Now also include the integrations."
}'
Terminal window
curl -X POST "$OMA_BASE_URL/v1/files" \
-H "Authorization: Bearer $OMA_API_KEY" \
-F "session_id=sess_xyz" \
-F "file=@./report.pdf"

The file lands in R2 and is mounted into the sandbox at /home/user/files/<id>/report.pdf.

Standard HTTP status codes. Body shape:

{
"error": {
"type": "invalid_request",
"message": "agent_id is required"
}
}

Common types: invalid_request, not_found, unauthorized, forbidden, rate_limited, internal_error.

Per-tenant. Limits and current usage are surfaced in response headers X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (Unix epoch seconds).