One API key for every frontier model

Claude and GPT through the SDKs you already use. Swap your base URL, pay per token from a prepaid balance, and pay a fraction of list price.

Starter credit included No card No monthly fee

Illustration: the dashboard's overview, with the credit balance, the month's spend, the request count, a chart of spend per day and the latest requests.

Request receipt Example · POST /api/v1/chat/completions
Model
claude-sonnet-4-6
Input
12,400 tok
Output
2,100 tok
At list price
$0.0687
You paid
$0.0196
Saved 71%

x-openrelay-cost-usd 0.019646100

An example request, priced from the live catalogueat the catalogue's default rates. Every real response carries its own cost in the x-openrelay-cost-usd header.

Works with the tools you already use

  • OpenAI SDK
  • Anthropic SDK
  • Claude Code
  • Vercel AI SDK
  • Cursor
  • LiteLLM
  • LibreChat
  • Continue

Compatible API

Drop-in gateway

Swap the base URL. Keep everything else.

Both wire formats are spoken natively, so the SDK, framework or agent you use today keeps working. The whole migration is the highlighted line.

  1. Create an account. Starter credit is on the house, no card needed.
  2. Mint an API key with its own budget, rate limit and model allowlist.
  3. Swap your base URL. Your code does the rest.

OpenAI SDK · Python

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["OPENRELAY_API_KEY"],
    base_url="https://your-gateway/api/v1",
)

stream = client.chat.completions.create(
    model="claude-sonnet-4-6",
    messages=[{"role": "user", "content": "Hello!"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

Anthropic SDK · Python

import os
import anthropic

client = anthropic.Anthropic(
    api_key=os.environ["OPENRELAY_API_KEY"],
    base_url="https://your-gateway/api",
)

message = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}],
)
print(message.content[0].text)

Claude Code · shell

# Claude Code, pointed at this gateway
export ANTHROPIC_BASE_URL="https://your-gateway/api"
export ANTHROPIC_AUTH_TOKEN="$OPENRELAY_API_KEY"

claude

Vercel AI SDK · TypeScript

import { createOpenAI } from '@ai-sdk/openai';
import { streamText } from 'ai';

const relay = createOpenAI({
  apiKey: process.env.OPENRELAY_API_KEY,
  baseURL: 'https://your-gateway/api/v1',
});

const result = streamText({
  model: relay.chat('claude-sonnet-4-6'),
  prompt: 'Hello!',
});

for await (const text of result.textStream) process.stdout.write(text);

curl · OpenAI wire format

curl https://api.openai.com/v1/chat/completions \
curl https://your-gateway/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENRELAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "claude-sonnet-4-6",
       "messages": [{"role": "user", "content": "Hello!"}]}'

Pay per token

Prepaid credit

Frontier models at a fraction of list price.

Put in what you spend a month going direct, at vendor list price. The estimate uses the median saving across the live catalogue: 71% right now.

Read the rate card

For $500 a month at list price:

You'd pay
$145a month
You keep
$355a month
Over a year
$4,260kept

An estimate: your mix of models sets the exact figure, and every response reports its real cost in its headers.

Keys & limits

Guardrails

A ceiling you set, on every key.

Your balance is already a hard limit. On top of it, each key carries its own budget, rate limit, concurrency cap and model allowlist, and every request lands in your activity log with its tokens, cost and latency.

Create a free account

Illustration: an API key's settings, with a $100 budget of which $42.18 is spent, a rate limit of 600 requests a minute, 8 concurrent streams and three allowed models.

Every frontier model, relayed at a fraction of list price.

OpenRelay speaks the OpenAI and Anthropic APIs natively, bills to the token from a prepaid balance, and puts the cost of every request in its response headers.

models on one key
20
median saving vs list price
71%
monthly fee, seats or minimum
$0
wire formats, both native
2

Pricing

The rate card.

Per million tokens, read live from the catalogue: what you see is what you pay. No platform fee on top, no seats, no minimum. Vendor list price is shown struck through beneath each rate.

Loading the live catalogue… The live rate card needs JavaScript. GET /api/v1/models
Price per million tokens for each model, with the vendor list price and the saving against it.
Model Input / 1M Output / 1M Context vs list
Loading the live catalogue… The full catalogue is always available as JSON at /api/v1/models.

Cached input is billed at a lower rate again.

The fine print

It is short, and every clause is in your favour.

  • No monthly fee. No minimum.

    Credit is prepaid and drawn down per request. If you stop calling, you stop paying; there is nothing to cancel.

  • Billed to the token.

    Streams are metered in flight, so a request that disconnects halfway is billed for exactly what was produced. Each response states its own cost in x-openrelay-cost-usd.

  • A ceiling you set.

    Your balance is already a hard limit. On top of it, every key can carry its own budget, rate limit, concurrency cap and model allowlist.

  • Native on every path.

    Chat Completions, Responses, Anthropic Messages and image generation, on the routes your SDK already calls, with errors in its own shape so your retries keep working.

  • Every request on the record.

    Model, tokens, cost, latency and time-to-first-token for each call, in your dashboard. Costs reconcile to the token, not to an estimate.

  • Leave whenever you like.

    It is the standard API. Point the base URL back and every line of your code still runs.

Questions

Asked, answered.

The short version: change two lines, pay for what you use, and leave whenever you like.

Do I have to change my code?

Only the base URL and the API key. Requests and responses are the standard OpenAI and Anthropic shapes, so SDKs, frameworks and tools like Claude Code, Cursor, Continue, LibreChat and LiteLLM work unmodified.

How is a request priced?

Per token, at the rates on the rate card: input, output, and a cheaper rate for cached input. The exact cost of every request is returned in the x-openrelay-cost-usd response header and recorded in your activity log.

What happens if I run out of credit?

New requests are refused with a normal 402 rather than failing silently, and a small allowance absorbs any request already in flight, so a long stream is never cut off mid-sentence. Top up and you are going again immediately.

Is streaming supported?

Yes, on both wire formats, including tool calls and reasoning tokens. Chunks are relayed as they arrive, with no added buffering.

Do you train on my data?

No. Requests are relayed to the upstream provider and not used for training. What is kept is the metadata in your usage log (model, token counts, cost and timing), never prompt or completion content.

Can I set a hard spending limit?

Yes. Credit is prepaid, so your balance is already a ceiling, and each key can carry its own lifetime budget and rate limit on top.

Start with a single line.

Create an account, mint a key, point your base URL here. That is the whole setup.