Get started

Relay: the gateway on your side of the wire.

A local gateway for OpenAI and Anthropic clients that serves the exact model you name on your own provider keys. It lifts known credentials before requests leave, logs every call locally, and never calls vitna.ai.

On npmvitna-runtime 0.2.0 · Apache-2.0 · Node 22.13+ · no Vitna account

DownstreamYour clientClaude Code, an SDK, a script, or any tool that takes a base URL. Nothing in it changes but that URL.OPENAI_BASE_URL · ANTHROPIC_BASE_URL
The daemonRelay, on your machineLifts known credentials, sends the request to the model it names, puts them back into the answer, writes one ledger line.http://127.0.0.1:8787
UpstreamThe provider you namedOpenAI or Anthropic directly, or OpenRouter, on your own keys. Never a model you did not name.api.openai.com · api.anthropic.com · openrouter.ai
01 / 10Try itIn-browser REPL · zero network calls

Where a name goes, and what leaves with it.

The commands answer in this tab. /route prints where Relay would send a model name and what the seller mirror read, /redact runs a sketch of the redaction here, and /status and /ledger print illustrative readings. A browser page cannot reach a Relay on your machine, so nothing here sends a request.

Illustrative, except /route, which prints the seller mirror's reading, and /redact, which runs in this tab. Type /route, /redact, /status or /ledger

02 / 10What comes backStation trace + local JSONL ledger

The provider's answer, and a line on your disk.

Your client reads the provider's own response, a stream byte for byte, with each stand-in put back. What Relay keeps is a ledger row per request and a status page, both on your machine. Below, one request as Relay walks it, and the row it writes.

Relay / one request, station by stationIllustrative offsets.
+0.0 msReceivedPOST /v1/messages from Claude Code, naming claude-opus-5-5, with about 40,000 tokens of context and an .env file it read along the way.inbound
+0.1 msAdmittedOn loopback, so no key is asked for. The model names no lane and there is no policy to consult, so it goes as the model it names.unrouted
+0.6 msRedactedTwo credentials from the file it read, an OpenAI key and a database password, swapped for stand-ins of the same shape and held in memory for this run.2 lifted
+0.7 msCacheOff, as it is until --cache is set, and a streamed request is never answered from it anyway.off
+0.9 msDispatchedTo api.anthropic.com as it was written, with its anthropic-version and anthropic-beta headers and the stand-ins in place. Nothing else leaves.sent
+640 msFirst tokenThe stream comes back byte for byte, each stand-in put back as it arrives, one split across two events included. Thinking is left as it came.streaming
+9,850 msLedgerOne JSONL row on your disk: unrouted, the tokens Anthropic reported with its cache reads and writes, the latency, 2 lifted and 2 put back. No credential.written

Illustrative. One request as Relay walks it; nothing here calls anything.

{
  "at": "2026-10-09T23:08:41.204Z",
  "model": "claude-opus-5-5",
  "units": 1,
  "lane": null,
  "sku": null,
  "provider": "anthropic",
  "via": "direct",
  "decision": null,
  "policy": null,
  "routed": false,
  "serve": "primary",
  "outcome": "served",
  "status": 200,
  "latencyMs": 9850,
  "inputTokens": 41220,
  "outputTokens": 812,
  "cacheReadTokens": 38912,
  "cacheWriteTokens": 1406,
  "cache_hit": null,
  "secretsLifted": 2,
  "secretsRestored": 2,
  "requestId": null,
  "listPriceUsd": null,
  "chargedUsd": null,
  "error": null
}
routed: false
Nothing chose the model: it went as it was named. lane, sku, decision and policy are null for the same reason.
provider, via
Who served it, and by which route: direct here, or openrouter for a name sent through OpenRouter.
inputTokens, outputTokens
What the provider reported, and null where it reported nothing. inputTokens is the whole input, prompt-cache reads and writes included.
cacheReadTokens, cacheWriteTokens
The parts of that input the provider read from its prompt cache and wrote to it, which it bills at their own rates.
secretsLifted, secretsRestored
Two credentials taken out of the request and two put back into the answer. Counts only: no secret is ever on a row.
listPriceUsd, chargedUsd
Null. Relay writes tokens and never a price, and estimates nothing.

Illustrative values in the runtime's own columns, shown wrapped and shortened: in ~/.vitna/relay/ledger.jsonl it is one line, with the runtime's other columns beside these. The ledger says what each field means.

03 / 10StatusGET 127.0.0.1:8787/status · local telemetry

The status page ships inside the runtime.

GET /status answers with what has been served, refused and lifted since start, and which keys are set, never what they are. No collector, no database, no account.

GET http://127.0.0.1:8787/statusMode passthrough · Inbound loopback · Redaction on
214Served
3Refused
17Credentials lifted
17Put back into answers

Keys, and what each carries

OpenAI keysetchatevery /v1/chat/completions
Anthropic keysetmessagesevery /v1/messages, as written
OpenRouter keyunsetcarries nothing
Inbound keyunsetloopback only
Allowlistunsetevery provider

The last three ledger rows

POST /v1/chat/completions (deepseek/deepseek-chat)openrouter · 200 · none lifted
POST /v1/messages (claude-opus-5-5)anthropic · 200 · 2 lifted, 2 put back
POST /v1/chat/completions (vitna/deep-research)404 · this runtime serves no lanes

Illustrative figures. There is no reader's gateway for this page to read.

04 / 10Quickstartnpm install -g vitna-runtime · 4 steps

Install the runtime, then run vitna-relay.

vitna-relay is a command in vitna-runtime, on npm since 0.2.0. Four steps on the machine your client runs on, then one base URL in the client.

  1. 01 · Install
    vitna-runtime 0.2.0On npm since 2026-10-07, and the package the vitna-relay command comes in. It needs Node 22.13 or later and has no dependencies.
    npm install -g vitna-runtime
  2. 02 · Keys
    Relay's own keysThe keys Relay answers with, set in the environment it starts from: the one place a real key goes. Set the ones you have. A client's own credential is never forwarded.
    export OPENAI_API_KEY=sk-... export ANTHROPIC_API_KEY=sk-ant-... export OPENROUTER_API_KEY=sk-or-...
  3. 03 · Run
    vitna-relayStarts the runtime with no policy on 127.0.0.1:8787, redaction on and a ledger in ~/.vitna/relay/. Its start lines say which key bills which account for what, and the base URL each kind of client takes.
    vitna-relay
  4. 04 · Check
    GET /healthzAsks for no key and says two things: that it is up, and which version. GET /status is the full page.
    curl http://127.0.0.1:8787/healthz{ "ok": true, "version": "0.2.0" }
Below: each client's configuration.Relay listens on 127.0.0.1:8787 unless told otherwise.
Claude CodeShell profile

On loopback any token will do, since nothing reads it. Claude Code keeps its thinking and its prompt cache, and your ANTHROPIC_API_KEY stays with Relay.

export ANTHROPIC_BASE_URL="http://127.0.0.1:8787"
export ANTHROPIC_AUTH_TOKEN="relay"
claude
OpenAI SDKsThe client's .env

openai-python, openai-node and the tools built on them. Name the model as the provider behind Relay names it.

OPENAI_BASE_URL="http://127.0.0.1:8787/v1"
OPENAI_API_KEY="relay"
# openai/gpt-5.6-luna through OpenRouter,
# gpt-5.6-luna with only OPENAI_API_KEY set
Anthropic SDKsThe client's .env

anthropic-python and @anthropic-ai/sdk read the same base URL Claude Code does. Set this in the client's environment, not Relay's.

ANTHROPIC_BASE_URL="http://127.0.0.1:8787"
ANTHROPIC_API_KEY="relay"
Other OpenAI-compatible toolsThe tool's settings

Any tool that takes an OpenAI-compatible base URL and a fixed model name. There is no GET /v1/models, so type the name rather than pick it from a list. A tool that calls its provider from its own servers rather than your machine cannot reach 127.0.0.1.

base URL   http://127.0.0.1:8787/v1
API key    relay
model      the provider's own name for it
05 / 10Where it fitsRedaction · unified ledger · allowlist

Three jobs a gateway on your own machine does.

When the choice of model belongs to a decision somebody signed, with a fallback chain behind it, that is a lane, and lanes are the same package started with a policy: vitna-runtime.

  1. 01

    A coding agent that reads your .env files.

    An agent reads configuration and shell history into its context, and the next request would carry any production key in them to a provider, where it cannot be called back. Relay lifts each known credential format out first and puts the real value back into the answer, so the file the agent writes gets the real key.

    ANTHROPIC_BASE_URL=http://127.0.0.1:8787
  2. 02

    One ledger across three providers.

    Every request, whether OpenAI, Anthropic or OpenRouter served it, is one line in one file on your disk: the tokens the provider reported, its prompt-cache reads and writes, latency and status, and nulls where it reported nothing.

    ~/.vitna/relay/ledger.jsonl
  3. 03

    A machine held to one provider.

    Every request Relay serves names a model, and it is held to the allowlist by the route it takes. With only anthropic listed, Relay is an Anthropic-only gateway: a /v1/messages request goes as written and every chat completion is refused by name.

    VITNA_ALLOW_PROVIDERS=anthropic
06 / 10How it worksDownstream clients -> Relay :8787 -> upstream

Plugs into the stack you already have.

Point any OpenAI or Anthropic client at 127.0.0.1:8787. Nothing else changes, and nothing chooses a model for you.

Client toolsDownstream
Claude CodeAnthropic /v1ANTHROPIC_BASE_URL, its requests sent as written
Anthropic SDKsAnthropic /v1A base URL, and nothing else changes
OpenAI SDKsOpenAI /v1A base URL, and nothing else changes
Other OpenAI-compatible toolsOpenAI /v1Any that takes a base URL and a fixed model name, since there is no GET /v1/models
Relay, :8787vitna-runtime
PassthroughEvery request as the model it names
RedactionKnown formats lifted and put back, on by default
Response cacheDeterministic repeats only, off until --cache
LedgerOne JSONL line per request, on your disk
Front doorLoopback; any other VITNA_HOST needs VITNA_INBOUND_KEY or it refuses to start
AllowlistVITNA_ALLOW_PROVIDERS, read against the route
Where it goesUpstream
AnthropicDirectANTHROPIC_API_KEY, requests as written
OpenAIDirectOPENAI_API_KEY, names as OpenAI knows them
OpenRouterSubstrateOPENROUTER_API_KEY, any model it lists
vitna.aiNeverNot at start, and not per request
01 · The model you named

Nothing picks for you.

No policy, no lanes, no fallback. A request goes to the model it names, by the route your keys reach, and a provider that fails answers with its own error rather than another model's reply.

02 · Redaction

Known credential formats are lifted before transit.

Provider keys, cloud tokens, JWTs, private keys and connection-string passwords are swapped for stand-ins of the same shape, in memory, before the request leaves.

03 · Restoration

The answer comes back with the real values.

Wherever the model wrote a stand-in, in text, in tool arguments or mid-stream, the real value goes back in, so the file your agent writes gets the real key.

04 · The ledger

One line per request, on your disk.

What the provider reported, and nulls where it reported nothing. Never an estimate, never a price, and never a credential.

07 / 10Redaction and parts8 credential formats · 13 runtime components

What Relay takes out of a prompt.

Formats with a shape of their own, found before a request leaves, and nothing found by guessing. Each becomes a stand-in the provider sees instead.

Prompt redaction round-trip8 fixed formats · restored locally · --no-redact disables
01 · Local promptSecret enters Relaysk-ant-api03-9f2a…
02 · 8 format matchersLifted before egress[VITNA_REDACTED_1]
03 · Upstream providerSees stand-in onlyreply references _1
04 · Back to clientOriginal put backsk-ant-api03-9f2a…
  • Provider keys
    sk-proj-, sk-svcacct-, sk-admin-, the older sk-, sk-ant-api03- and Anthropic's admin form, sk-or-v1-
    The prefix kept, the rest a stand-in of the same kinds of character: the same length, or longer under twelve letters and digits
  • AWS access key ids
    AKIA..., ASIA...
    A stand-in of the same shape
  • GitHub tokens
    ghp_ and its siblings, github_pat_
    A stand-in of the same shape
  • Slack, Stripe and Google keys
    xoxb-, sk_live_, sk_test_, rk_, AIza
    A stand-in of the same shape
  • Signed tokens
    JWTs, three dot-separated parts
    A stand-in of the same shape
  • Private keys
    A PEM PRIVATE KEY block
    Header to footer
  • Connection strings
    scheme://user:password@host
    The password only, and nothing else of the URI
  • Secret-named assignments
    STRIPE_KEY=... on an env line, a quoted api_key or token
    The value only, and only at eight characters or more

Left alone on purpose: code that only mentions a secret, anything found by entropy alone, personal data, and images, documents, tool definitions and thinking. A credential in a format not listed leaves as written, so redaction narrows what a provider sees rather than promising nothing sensitive leaves. --no-redact turns it off.

The parts

Thirteen parts, all of them the runtime's.

  1. No policyPassthrough mode

    The runtime started with no policy, serving every request as the model it names. A request for vitna/<lane> is refused by name, since there are no lanes.

  2. /v1/chat/completionsOpenAI dialect

    Streams and tools as the OpenAI SDKs send them, to OpenAI directly or through OpenRouter, whichever your keys and your allowlist reach.

  3. /v1/messagesAnthropic, as written

    A request naming a model goes to Anthropic with its anthropic-version and anthropic-beta headers, and its stream comes back byte for byte.

  4. CredentialsYour keys, not your client's

    The runtime answers with the keys in its own environment. Whatever credential your client sends is never forwarded.

  5. VITNA_ALLOW_PROVIDERSThe allowlist

    Read against the route a name takes: openai for OpenAI directly, openrouter for OpenRouter, anthropic for Anthropic. A route not listed is passed over, and with none left the request is refused by name.

  6. RedactionCredential detectors

    Known formats only, each with a shape of its own. Nothing is found by entropy, and code that only mentions a secret is left alone.

  7. Format-preservingStand-ins

    Each credential becomes a stand-in with its prefix and kinds of character, the same length or longer under twelve letters and digits, and the same one for the life of the process, so a prompt cache holds from turn to turn.

  8. RehydrationStream restoration

    Stand-ins are put back in text, in tool arguments and mid-stream, one split across two chunks included. Thinking is left as it came, since its signature covers its text.

  9. Opt-inResponse cache

    With --cache, a repeat of a deterministic request (temperature 0, one choice, not streamed) is answered from memory under X-Vitna-Cache: hit, and ledgered as a hit, never as a saving.

  10. JSONLThe ledger

    One row per request in ~/.vitna/relay/ledger.jsonl: the tokens the provider reported, its cache reads and writes, latency and status, and nulls where nothing was reported.

  11. LoopbackThe front door

    127.0.0.1:8787 by default. Any other VITNA_HOST needs VITNA_INBOUND_KEY, which every client then sends as a bearer token, or it refuses to start.

  12. TimeoutsBudgets

    A completion, a first byte and a silence inside a stream each have a budget, and a request past one is ended and counted rather than left to hang.

  13. /statusStatus and drain

    GET /status says what has been served, refused and lifted since start. On SIGTERM, responses under way are given time to finish.

08 / 10Proof and limits4 tested properties · 10 explicit boundaries

Four properties, each held by a test.

Relay is the runtime with defaults, not a fork of it, so it keeps what the runtime keeps.

  • Exactly the model namedNo policy, no lane, no fallback and no rule, so nothing can answer with a model you did not ask for.
  • Nothing to vitna.aiNot at start, not per request, and not to check for a newer version.
  • Loopback by defaultIt listens on 127.0.0.1:8787, and any other VITNA_HOST without VITNA_INBOUND_KEY refuses to start.
  • Nothing estimatedA provider that reports no usage gets nulls on the row, never a plausible number.
No fallback
A provider that fails answers with its own error. Nothing sends the request to another model.
No lanes
A request for vitna/<lane> is a 404 that says this runtime serves no policy.
No model list
There is no GET /v1/models, so a tool has to be given a fixed model name.
Known formats only
A credential in a format redaction does not list leaves as written, and images, documents, tool definitions and thinking go as written.
Stand-ins reset
A restart draws new stand-ins, so a cached prompt prefix that held a credential misses once.
Not from a web page
Relay sends no CORS headers, and with no inbound key it refuses a /v1 request that carries an Origin header, so a page on a website cannot use it.
Not from a hosted tool
A tool that calls its provider from its own servers rather than your machine cannot reach 127.0.0.1.
No image of its own
The runtime's container image starts vitna-runtime with a policy. Relay is meant for your own machine.
Refuses to start
With VITNA_POLICY or VITNA_POLICY_B64 set, with any other VITNA_HOST and no VITNA_INBOUND_KEY, with VITNA_REDACT_LANES, or with a VITNA_REDACT_PASSTHROUGH that is neither 1 nor 0.
Where it runs
Node 22.13 or later, on the machine your client runs on. The package has no dependencies.

No published measurements. Nothing has timed what Relay adds to a request on any machine, so the trace's offsets above are illustrative and this page prints no latency of its own.

09 / 10PricingApache-2.0 · nothing billed by Vitna

Relay costs nothing. Your providers bill your keys.

What a request costs is what the provider behind it charges the key Relay was started with. Vitna is not on the bill, and the ledger records tokens rather than prices.

  1. VitnaNothing

    vitna-runtime is Apache-2.0 on npm. There is no Vitna account, no Vitna key and no usage limit Vitna sets, and Relay never calls vitna.ai, so there is nothing to meter.

  2. Your providersTheir prices, on your keys

    OpenAI, Anthropic and OpenRouter bill each request to the key in Relay's environment, whatever your client is signed in as, and prompt-cache reads and writes at their own rates.

  3. OpenRouter's sellersThe seller OpenRouter picks

    A name sent through OpenRouter is served and priced by whichever seller OpenRouter picks, as it would be without Relay. Relay picks none; the exhibit below is what they list.

  4. Your machineWhat it already costs

    Relay runs beside your client as one Node process with no dependencies. There is no hosted part, no container and nothing to rent.

listPriceUsd and chargedUsd are null on every row Relay writes, and a response-cache hit is a row with no tokens. Costing a ledger means applying your provider's prices for the day it ran.

What each company selling these five models listed per million tokens when the seller mirror read OpenRouter on . List prices, not what anybody paid, and Relay routes on none of them.

ModelSellers listing a priceLowest listed, in / outHighest listed, in / out
DeepSeek V3 · deepseek/deepseek-chat3DeepInfra, fp4, $0.256 / $0.712DeepInfra, fp4, $0.32 / $0.89
Llama 3.3 70B · meta-llama/llama-3.3-70b-instruct7DeepInfra, fp8, $0.10 / $0.32Amazon Bedrock, $0.72 / $0.72
Qwen 2.5 72B · qwen/qwen-2.5-72b-instruct2DeepInfra, fp8, $0.288 / $0.32DeepInfra, fp8, $0.36 / $0.40
Llama 3.1 8B · meta-llama/llama-3.1-8b-instruct4DeepInfra, fp8, $0.02 / $0.04CoreWeave, bf16, $0.22 / $0.22
DeepSeek R1 · deepseek/deepseek-r10none listednone listed
Source: OpenRouter's public endpoints API. 1257 sellers across 359 models when the mirror ran, 186 of them served by more than one. Quantization is the seller's own declaration and is verified by nobody.Read
10 / 10QuestionsInstall · redaction · cache · privacy

Answers to the technical questions.

Install, redaction boundaries, local ledger storage and loopback security.

Can I install Relay today?

Yes. vitna-relay is a command in vitna-runtime, on npm since 0.2.0: install it with npm install -g vitna-runtime, set the provider keys you have, and run vitna-relay. Without a global install, npx -p vitna-runtime vitna-relay does the same. It needs Node 22.13 or later.

Does Relay pick a cheaper model or provider for me?

No. It serves exactly the model a request names, and nothing in it chooses: there is no policy, no lane, no fallback and no rule. A name sent through OpenRouter is served by whichever seller OpenRouter picks, as it would be without Relay. A decision about models or sellers is what a lane on vitna-runtime is for.

How do I point Claude Code at it?

Set ANTHROPIC_BASE_URL=http://127.0.0.1:8787 and give Claude Code any ANTHROPIC_AUTH_TOKEN, since on loopback nothing reads it. Requests go to Anthropic as written, billed to the ANTHROPIC_API_KEY Relay was started with, and thinking, prompt caching and every beta work as they do direct.

And an OpenAI SDK, or a tool built on one?

Set the base URL to http://127.0.0.1:8787/v1 and use the name the provider behind Relay uses: openai/gpt-5.6-luna through OpenRouter, gpt-5.6-luna directly. Nothing translates one into the other, and there is no GET /v1/models, so a tool that lists models before it sends has to be given the name. A tool that calls its provider from its own servers rather than from your machine cannot reach 127.0.0.1 at all.

What does redaction catch, and what does it miss?

Formats with a shape of their own: provider keys, cloud and service tokens, JWTs, private keys, the password in a connection string, and secret-named assignments. It skips images, documents, tool definitions and thinking, and finds nothing by entropy, so a credential in any other format leaves as written. --no-redact turns it off.

Does redaction break prompt caching, or code?

Not within a run. A credential keeps the same stand-in for as long as Relay runs, so a conversation's prefix is the same text every turn, and the stand-in has the credential's shape, so code that handles it still parses. A restart draws new stand-ins, and a cached prefix that held a credential misses once.

What stays on my disk?

One line per request in ~/.vitna/relay/ledger.jsonl: the model, the provider and route, the outcome and status, the latency, the tokens the provider reported, the provider's message when it refused, and how many credentials were lifted and put back. Not the prompt, not the answer and not a credential: the stand-ins live in Relay's memory and nowhere else. --no-ledger records nothing.

What does the response cache answer?

Nothing, unless you start Relay with --cache and a number of seconds. Then a repeat of a deterministic request, at temperature 0 with one choice and no stream, is answered from memory under X-Vitna-Cache: hit, and written to the ledger as a hit with no tokens and no cost. A request that says no-store is never kept.

What happens when a provider is down?

The request fails with that provider's own error. Relay has no fallback, because a fallback answers with a model you did not name. A lane on vitna-runtime fails over along a chain somebody signed.

Does it send anything to vitna.ai?

No. Not at start, not per request, and not to check for a newer version. Sending a ledger anywhere is vitna-runtime-push, a separate command, and it needs a policy Relay does not have.

Can someone else on my network use it?

Not unless you let them. It listens on 127.0.0.1:8787, and started on a network address it refuses to start without VITNA_INBOUND_KEY, which every client then sends as a bearer token.

How does Relay relate to vitna-runtime?

It is vitna-runtime. vitna-relay chooses a few defaults, a ledger in your home directory and redaction on, and starts the runtime with no policy. Everything that serves a request is the code that serves a lane.

Where do I get help?

Through the contact form on the start page, choosing Model infrastructure. Say which version GET /healthz reports and what Relay's start lines said. Relay sends nothing to vitna.ai, so nobody at Vitna can see your setup unless you describe it.

Exactly the model you named, on your own keys.

Relay is a command in vitna-runtime 0.2.0: npm install -g vitna-runtime, then vitna-relay. The docs say everything it does.