Any OpenAI-compatible API

Point a profile at any API that serves chat completions, with one endpoint table and a key from an environment variable. You need that provider's API key.

An openai-compat endpoint is a base URL and a key. The gateway translates Claude Code’s Anthropic-format requests into chat completions and streams the answer back in Anthropic format. The steps use DeepSeek; swap in any provider from the table below.

  1. Export your key

    export DEEPSEEK_API_KEY="<your-deepseek-key>"

    Export it before the daemon starts. A key exported later needs sc daemon stop and a new launch (why).

  2. Add the endpoint and a profile to ~/.superclaude/config.toml

    [endpoints.deepseek]
    url = "https://api.deepseek.com"
    format = "openai-compat"
    key_csv = "${DEEPSEEK_API_KEY}"
    
    [profiles.deepseek]
    opus = { slug = "deepseek/<model-id>" }

    url is everything before /v1/chat/completions, because the gateway appends that path. auth defaults to bearer for this format.

  3. Check the routing

    sc profiles deepseek

    It prints a row for each of opus, sonnet and haiku with the model that role goes to; a role the profile does not set is marked ↑ as inherited (^ on a terminal without Unicode).

  4. Launch with the profile

    sc -u deepseek <project> <agent>

This profile maps only opus, so sonnet and haiku inherit it and every request goes to DeepSeek. To split the roles, see Profiles.

Providerurl
OpenAIhttps://api.openai.com
DeepSeekhttps://api.deepseek.com
Groqhttps://api.groq.com/openai
Togetherhttps://api.together.xyz
Fireworkshttps://api.fireworks.ai/inference

OpenCode, OpenRouter, Grok and local servers use this format too and have their own pages.

What the provider must support
  • Streaming POST <url>/v1/chat/completions. A provider whose path uses another version segment, such as /v4/chat/completions, cannot be reached, because the gateway always appends /v1/chat/completions.
  • Tool calls, because Claude Code sends its tools as function definitions.

A /v1/models route is optional; the launch check passes a provider without one.

The gateway translates the system prompt, messages, tools, tool results and images. A model that streams its reasoning as reasoning_content, or as reasoning, shows it in Claude Code as a thinking block, and the gateway sends that reasoning back on later turns.

Providers share no reasoning parameter, so the gateway picks one from the model id: DeepSeek, GLM, Kimi, Qwen, MiniMax and MiMo ids each get their own field, and any other id gets none (the table).

Rotate several OpenAI keys

The config.toml that sc writes on first run already has an [endpoints.openai] table with type = "pool" that reads ${OPENAI_KEYS}. Set that variable to a comma-separated list of keys to use it; the gateway rotates them (key pools).

The OpenAI Responses API
[endpoints.openai-responses]
url = "https://api.openai.com"
format = "openai-responses"
key_csv = "${OPENAI_API_KEY}"

[profiles.gpt]
opus = { slug = "openai-responses/<model-id>", reasoning = { effort = "high" } }

This format posts to <url>/v1/responses. The gateway sends the effort as reasoning.effort (low, medium or high; max becomes high) and asks for a reasoning summary, which Claude Code shows as a thinking block. OpenAI’s reasoning models reject a custom temperature or top_p, so leave sampling off rows that use them. Codex speaks the same API on a ChatGPT subscription.

Per-model wire overrides

A provider can serve some models over chat completions and others over the Anthropic wire behind one URL. Set format and auth on the row that differs. The research profile in the config sc writes on first run does this for OpenCode’s qwen3.7-max:

[profiles.research]
opus   = { slug = "opencode/qwen3.7-max", format = "anthropic-messages", auth = "x-api-key", reasoning = { effort = "high" } }
sonnet = { slug = "opencode/deepseek-v4-pro", temperature = 0.7, params = { top_k = 40, repetition_penalty = 1.05 } }
haiku  = { slug = "opencode/deepseek-v4-flash" }

A row’s format beats the endpoint’s, and the endpoint’s beats the default, openai-compat. auth resolves the same way, falling back to the format’s default: x-api-key for anthropic-messages, bearer for the two OpenAI formats.

Next: Grok (xAI subscription)

View as Markdown