Skip to content

Configuration reference ​

Every command, option and config key in the DL Prism 0.2.0 gateway.

Commands ​

CommandWhat it does
prism serve [-c config] [--listen addr] [--offline]Starts the gateway
prism models [-c config]Lists every configured model
prism explain [-c config] [-m model] <prompt>Shows the routing decision for a prompt, without calling a model
prism usage [-c config]Shows this month's spend, budget and per-model totals
prism mcp [--gateway url] [--api-key key]Runs the MCP server over stdio, for Claude Code and Codex
prism versionPrints the version
prism helpPrints the list of commands

Options ​

OptionCommandsWhat it doesDefault
-c <file>serve, models, explain, usageConfig file to useSee search order below
--listen <addr>serveOverrides server.listenfrom the config
--offlineserveRoutes to local providers onlyoff
-m <model>explainModel to resolve instead of automatic routingauto
--gateway <url>mcpGateway address. A bare host:port is accepted$PRISM_GATEWAY, else http://127.0.0.1:8130
--api-key <key>mcpKey sent to the gateway$PRISM_API_KEY

Config search order: the -c file, then ./prism.yaml, then ~/.config/prism/prism.yaml.

prism.yaml keys ​

Unknown keys are an error, so a typo stops the gateway with a message instead of being ignored.

Top level ​

KeyWhat it doesDefault
serverListen address and client keys
providersList of providers. At least one is required
routingDefault model, rules and fallbacks
budgetMonthly budget
offlinetrue routes to local providers only, like --offlinefalse

server ​

KeyWhat it doesDefault
listenAddress and port to listen on127.0.0.1:8130
api_keysList of keys clients must send. Required when listen is not a loopback address[] (any key accepted)

providers[] ​

KeyWhat it does
nameUnique name. Required
typeopenai, anthropic, claude-code or codex-cli. Required
base_urlAddress of the API, starting with http:// or https://. Required for openai and anthropic; refused for the CLI types
api_key_envName of an environment variable holding the key
api_keyThe key itself. ${VAR} references are expanded. Prefer api_key_env
headersExtra HTTP headers sent with every request
localtrue marks a provider on your machine
commandProgram and arguments for the CLI types, when not on PATH. Defaults to claude or codex; refused for the HTTP types
modelsList of models. At least one is required

providers[].models[] ​

KeyWhat it does
idModel name at the provider. Required
aliasesExtra names. Ids and aliases must be unique across all providers
context_windowLargest request in tokens. Larger requests skip this model
capabilitiesTags such as code, reasoning, vision, tools
speedA label such as fast or medium
cost.input_per_mtokUS dollars per million input tokens. Default 0
cost.output_per_mtokUS dollars per million output tokens. Default 0

routing ​

KeyWhat it does
defaultModel used in automatic mode when no rule matches
rulesList of {if: {...}, then: model}, checked top to bottom; first match wins
fallbacksMap of model to an ordered list of backup models

Rule conditions (if): task (code, security, docs, vision, general), language, vision, offline, budget_exceeded, min_context_tokens. Targets (then): a model id or alias, local:any or local:<capability>. Every model named in default, rules and fallbacks must exist, or the gateway does not start.

budget ​

KeyWhat it doesDefault
monthly_usdSpend per calendar month after which budget_exceeded matches. 0 means no budget0

HTTP endpoints ​

Method and pathWhat it does
POST /v1/chat/completionsOpenAI-compatible chat, streaming and non-streaming
POST /v1/messagesAnthropic Messages-compatible chat, streaming and non-streaming. Tool definitions are refused
POST /v1/messages/count_tokensToken estimate for Anthropic SDKs
GET /v1/modelsauto plus every model, with Prism details
POST /v1/route/explainThe routing decision for a request body, without calling a model
GET /admin/usageThis month's spend, budget, per-model totals and 30 days of daily cost
GET /admin/statusVersion, uptime, offline mode, listen address and provider health
GET /admin/routingThe loaded default, rules and fallbacks
GET /healthzHealth check
GET /The web dashboard

When server.api_keys is set, send a key as Authorization: Bearer <key> or x-api-key: <key>.

Errors: an unknown model is 404, a routing problem is 400, and a request where every candidate failed is 502.

Response headers ​

HeaderValue
X-Prism-Modeauto or manual
X-Prism-ProviderProvider that answered
X-Prism-ModelModel that answered
X-Prism-ReasonWhy, plus failed over after: when a failover happened

Environment variables ​

VariableUsed byWhat it does
The names in api_key_envserveProvider API keys
XDG_DATA_HOMEallBase folder for usage and projects. Default ~/.local/share
PRISM_GATEWAYmcpGateway address
PRISM_API_KEYmcpKey sent to the gateway

Files ​

PathWhat it is
./prism.yaml or ~/.config/prism/prism.yamlThe config file
~/.local/share/prism/usage.jsonlUsage records: time, provider, model, tokens, cost
~/.local/share/prism/workbench/Projects, chats, attached files and agent workspaces
~/.var/app/com.dhivalabs.prism.desktop/data/prism/Usage records when you use the Flatpak

Defaults at a glance ​

SettingDefault
Listen address127.0.0.1:8130
Circuit breaker3 failures in a row, then 30 seconds demoted
Daily usage window30 days

Next steps ​