CrossModel API documentation

CrossModel is a multi-model API gateway for developers. With a single API key you can call DeepSeek, Claude, GPT, Gemini and more — and handle model selection, top-ups, usage, and key management from one console.

Already have code wired to the OpenAI or Anthropic SDK? Usually you only need to change base_url and model — no need to rewrite your application logic.

Pick your path

Your situationWhere to startNotes
Already on OpenAI Chat CompletionsQuickstartSwap base_url for CrossModel and use the vendor/model ID format.
New project, want an OpenAI-compatible API/v1/chat/completionsThe most mature ecosystem — chat, tool calls, multimodal input, streaming.
Prefer the OpenAI Responses style/v1/responsesInput and output organized as structured items; good for richer tool and multimodal flows.
Already using the Anthropic SDK or Claude Code/v1/messagesThe Anthropic Messages protocol; auth prefers x-api-key.
Need to discover models dynamically/v1/modelsList the models available right now and validate a model ID.

Base URLs

ProtocolBase URLWhy
OpenAI-compatiblehttps://api.crossmodel.ai/v1The OpenAI SDK appends only /chat/completions, /responses, or /models, so keep the /v1.
Anthropic-compatiblehttps://api.crossmodel.aiThe Anthropic SDK (and Claude Code) appends /v1/messages itself, so leave the /v1 off.

Both protocols are served by the same host — only the path each SDK adds for you differs. If you're calling the API directly with cURL, use the full endpoint URL shown on each API reference page.

Concepts worth knowing

  • Auth: API keys start with cm-. OpenAI-compatible endpoints use Authorization: Bearer; Anthropic-compatible endpoints can use x-api-key.
  • Model IDs: CrossModel uses the vendor/model format, e.g. deepseek/deepseek-v4-pro or anthropic/claude-sonnet-4.6.
  • Billing: you pay for actual token usage; requests are rejected when your balance runs out.
  • Rate limits: RPM and TPM are tracked per API key; exceeding them returns 429 rate_limit_error.
  • Request tracing: successful responses include an x-request-id. Include it when reporting an issue.

In production

  1. Keep your API key in a server-side environment variable — never in frontend code or a mobile bundle.
  2. Retry 429, 502, and 503 with exponential backoff, and log the x-request-id.
  3. Handle error events on streaming calls too — don't just wait for the normal end-of-stream marker.
  4. Pass a stable end-user identifier (e.g. safety_identifier, or Anthropic's metadata.user_id) to help with safety and abuse investigations.

Next steps