Connect your tools
Any tool that lets you set an OpenAI base URL can use Prism. You change two settings: the base URL becomes http://127.0.0.1:8130/v1, and the model becomes auto or a model name from prism models.
Start the gateway first:
prism serveAbout the API key field
Most tools insist on an API key. Your real provider keys stay in Prism, so the tool does not need them.
- If
server.api_keysinprism.yamlis empty, the default for a gateway on127.0.0.1, Prism accepts any value. Typedummy. - If you set
server.api_keys, use one of those values.
Prism accepts the key as Authorization: Bearer <key> or as an x-api-key header.
curl and scripts
curl http://127.0.0.1:8130/v1/chat/completions \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer dummy' \
-d '{"model":"auto","messages":[{"role":"user","content":"hi"}]}'GET /v1/models lists auto plus every model you configured, so tools that fill a model picker from the API show them all. For more on requests like this, see Your first API call.
Codex CLI
export OPENAI_BASE_URL=http://127.0.0.1:8130/v1
export OPENAI_API_KEY=dummy
codex --model autoCursor
In Cursor, open Settings, then Models, then Override OpenAI Base URL:
Base URL: http://127.0.0.1:8130/v1
API key: dummy
Model: auto (add it as a custom model name)Cursor's own cloud features still go to Cursor's servers. The override applies to chat traffic.
Continue (VS Code and JetBrains)
Add a model to ~/.continue/config.json:
{
"models": [
{
"title": "DL Prism (auto)",
"provider": "openai",
"model": "auto",
"apiBase": "http://127.0.0.1:8130/v1",
"apiKey": "dummy"
}
]
}Windsurf
In Windsurf, open Settings, then Cascade, then Add custom model provider, and choose OpenAI-compatible:
Base URL: http://127.0.0.1:8130/v1
API key: dummy
Model: autoClaude Code
Claude Code can use Prism in two ways.
As extra tools (recommended). Prism's MCP server lets Claude Code ask a cheaper, local or specialised model for help during a session. See Companions.
As the model. Prism also accepts the Anthropic Messages API, so Claude Code's own traffic can go through your rules:
export ANTHROPIC_BASE_URL=http://127.0.0.1:8130
export ANTHROPIC_API_KEY=dummy
export ANTHROPIC_MODEL=auto
claudeWARNING
In this mode, requests that include tool definitions are refused with a 400 error. Claude Code relies on tools for most work, so this mode suits prompt-only use.
Reading which model answered
Every answer carries these headers:
| Header | Tells you |
|---|---|
X-Prism-Mode | auto or manual |
X-Prism-Provider | The provider that answered |
X-Prism-Model | The model that answered |
X-Prism-Reason | The rule that matched, and any failovers |