codai docs
API referenceGateway

Gateway

Every public route of ai.codai.ro, grouped the way the code groups them.

Base URL https://ai.codai.ro, bearer auth with a codai_ key, JSON in and out (SSE where noted). The groups below map one-to-one onto the route files of the gateway; each page mounts the operations of its group with a live try-it panel.

GroupWhat it covers
Chat & CompletionsPOST /v1/chat/completions, /v1/messages, /v1/responses — the three wire formats
Embeddings & AudioEmbeddings, speech-to-text, text-to-speech, ephemeral realtime tokens
ModelsGET /v1/models
AgentsSynchronous and async agent runs, steps, SSE stream, cancel
ToolsVerified web search and safe page fetch
TasksOutcome-billed tasks and confirmation
SessionsShared-sessions protocol v2: events, controls, lease, dispatch, stream
DevicesDevices bound to the account and the dispatch inbox
HostsPhone → desktop exec relay
Orgs & SharingSession shares, orgs and members
AccountAccount card, consents, receipts, feedback, on-device model catalog
HealthUnauthenticated probes at the root

Not in this reference, on purpose: /internal/** (service-to-service, secret-gated), /metrics (Prometheus scrape, VPC-only), /vscode/** and /copilot/** (editor config discovery documented in the clients guide), /mcp and /.well-known/oauth-protected-resource (MCP-as-server plumbing) and the legacy read-only GET /v1/sessions[/{sessionKey}] shape that clients without an x-codai-device header still receive. The realtime WebSocket wss://ai.codai.ro/v1/realtime cannot be expressed in OpenAPI; its contract is in the streaming guide.