Outlay maps your AI spend to your roadmap and, optionally, routes each request down to the cheapest model that's provably good enough. The attribution platform onboards through a design-partner pilot; the pages below cover the optional routing proxy you run yourself — quickstart, configuration, SDKs, and the privacy architecture.
Route your Claude traffic through Outlay's optimization engine in about five minutes. Your API key and prompts never leave your machine — the proxy runs locally and classifies on your box.
deployment id and an Outlay
API key) plus your own Anthropic API key. Not in a pilot yet?
Book one →deployment id and click Create API key (shown once).# Python 3.10+
pip install modelpilot-clientexport ANTHROPIC_API_KEY=sk-ant-… # stays on your machine export MODELPILOT_API_KEY=mp_live_… # from the Connect page export MODELPILOT_DEPLOYMENT_ID=dep_… export MODELPILOT_BRAIN_URL=https://modelpilot-brain-prod.fly.dev export MODELPILOT_CONSOLE_URL=https://modelpilot-console-prod.fly.dev modelpilot-client # listens on http://127.0.0.1:8400
Full env-var list under Configuration.
# Python from anthropic import Anthropic client = Anthropic(base_url="http://127.0.0.1:8400") # your key, local
One-line variants for TypeScript and cURL are under SDKs.
Set your mode in the console (it takes effect server-side within seconds, no redeploy):
| Mode | What it does | When to use |
|---|---|---|
| shadow | Scores a cheaper candidate per request but leaves traffic untouched; builds the cost + quality evidence. | First — to see the routing before trusting it. |
| advise | Recommends a cheaper model per request; traffic still flows to your chosen model. | To review concrete suggestions. |
| autopilot | Auto-routes to the cheapest model proven non-inferior on your own work. | Once the numbers convince you. This is where you save. |
The proxy is configured entirely through environment variables. Only the first three are required.
| Variable | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY | yes | Your Anthropic key. Stays on your machine; used to call Anthropic directly. |
MODELPILOT_API_KEY | yes | Your Outlay key from the Connect page (mp_live_…). |
MODELPILOT_DEPLOYMENT_ID | yes | The deployment the requests are billed/attributed to (dep_…). |
MODELPILOT_BRAIN_URL | no | Routing-decision endpoint. Defaults to the hosted brain. |
MODELPILOT_CONSOLE_URL | no | Control-plane endpoint for entitlement + telemetry. Defaults to the hosted console. |
MODELPILOT_BIND | no | Local listen address. Defaults to 127.0.0.1:8400. |
MODELPILOT_MODE | no | Override the console mode (shadow / advise / autopilot) locally. |
MODELPILOT_REQUEST_OBSERVER | no | module:factory hook that receives per-request metadata — the seam Outlay's attribution uses. Stays out of the data path. |
To attribute a request to a ticket, pass a work tag on the call — an x-modelpilot-work-ticket
header (e.g. PROJ-123) on the request, or the SCOPEPILOT_TICKET env for the whole
process. Outlay also recovers the ticket from the branch, a PR→issue link, or a commit trailer when no
explicit tag is present.
The proxy is a drop-in Messages API endpoint, so every Anthropic SDK works by pointing
base_url at it. No new client library to learn.
# pip install anthropic from anthropic import Anthropic client = Anthropic(base_url="http://127.0.0.1:8400") msg = client.messages.create( model="claude-sonnet-4-6", max_tokens=512, messages=[{"role":"user","content":"Summarize this ticket."}], extra_headers={"x-modelpilot-work-ticket":"PROJ-123"}, # optional )
// npm i @anthropic-ai/sdk import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic({ baseURL: "http://127.0.0.1:8400" }); await client.messages.create({ model: "claude-sonnet-4-6", max_tokens: 512, messages: [{ role: "user", content: "Summarize this ticket." }], }, { headers: { "x-modelpilot-work-ticket": "PROJ-123" } });
curl http://127.0.0.1:8400/v1/messages \ -H "content-type: application/json" \ -H "x-modelpilot-work-ticket: PROJ-123" \ -d '{"model":"claude-sonnet-4-6","max_tokens":512, "messages":[{"role":"user","content":"Summarize this ticket."}]}'
Your Anthropic key is read from the proxy's environment, so it never appears in client code.
Outlay splits cleanly so your sensitive data physically can't reach us. The piece in your environment is a thin, inspectable client that does local classification and tagging and carries no proprietary routing logic. The decision engine and the attribution model run on our side and only ever see metadata.
You're using your own Anthropic key, so Anthropic's Usage Policy still applies to your traffic when it routes through Outlay. High-risk domains (legal, healthcare, insurance, finance, employment or housing, academic testing, journalism) need a qualified human reviewing outputs and an "AI was involved" disclosure; any user-facing chatbot or agent should tell users they're talking to AI. These are Anthropic's requirements — full detail in Terms §10.