API

API overview

Use Codius through its OpenAI-compatible model API.

APIReference

The Codius API provides OpenAI-compatible model discovery and chat-completions interfaces for organization-owned API keys.

Start with the API quickstart, then review authentication, streaming, and the generated operation reference.

Base URL

Use the environment-specific API base URL shown in your Codius account. Production examples resolve CODIUS_API_BASE_URL at render time so copied snippets do not point at a development environment.

curl https://api.codius.ai/v1/v1/models \
  -H "Authorization: Bearer $CODIUS_API_KEY"

Compatibility surface

The public contract follows the OpenAI model-list and chat-completions shapes. An OpenAI-compatible client can normally connect by changing its base URL, API key, and model ID.

Public model IDs are Codius identifiers. Internal routing and infrastructure names are intentionally absent from responses. Discover IDs with GET /v1/models instead of copying a temporary marketing list.

Operations

  • GET /v1/models lists models available to the authenticated organization and requires the models:read scope.
  • POST /v1/chat/completions creates a non-streaming completion or an SSE stream and requires inference:create.
  • Usage endpoints expose organization window state for account experiences described in the generated reference.
  • Health endpoints are operational probes and do not replace an authenticated request test.

Response metadata

Every response includes x-codius-request-id. Successful inference responses also include usage-percentage and reset-time headers for the five-hour, weekly, and monthly windows. Treat those headers as account state, not as model output.

Source of truth

The generated operation reference comes directly from the version-controlled OpenAPI contract. When a prose example and the generated operation disagree, use the generated contract and report the prose issue.

Last reviewed 2026-07-28 · Capability verified · Public docs are adapted and capability-checked before publication.

Provenance: apps/web/content/docs/api.mdx from CodiusAI/codius at working-tree.