Skip to content

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:

bash
prism serve

About 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_keys in prism.yaml is empty, the default for a gateway on 127.0.0.1, Prism accepts any value. Type dummy.
  • 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 ​

bash
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 ​

bash
export OPENAI_BASE_URL=http://127.0.0.1:8130/v1
export OPENAI_API_KEY=dummy
codex --model auto

Cursor ​

In Cursor, open Settings, then Models, then Override OpenAI Base URL:

text
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:

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:

text
Base URL:  http://127.0.0.1:8130/v1
API key:   dummy
Model:     auto

Claude 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:

bash
export ANTHROPIC_BASE_URL=http://127.0.0.1:8130
export ANTHROPIC_API_KEY=dummy
export ANTHROPIC_MODEL=auto
claude

WARNING

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:

HeaderTells you
X-Prism-Modeauto or manual
X-Prism-ProviderThe provider that answered
X-Prism-ModelThe model that answered
X-Prism-ReasonThe rule that matched, and any failovers

Next steps ​