Open source / developer preview

Give each AI job
a spending boundary.

Run an OpenAI- and Anthropic-compatible gateway that reserves budget before model calls, including concurrent calls, and records what each job costs.

Start on your own machine.

Copy-paste example
pip install inferrail==0.4.18
inferrail demo
# Offline fake provider, DEMO prices, no API key or purchase.
inferrail serve --quickstart --app-mode --daily-budget-usd 5.00
# Real inference requires your own provider key in the gateway environment.

Open the local dashboard URL printed by the gateway. Use http://127.0.0.1:8000/v1 as your OpenAI SDK base URL; Anthropic clients use http://127.0.0.1:8000 . Your provider bills inference separately.

Give calls a shared run ID and ceiling.

Copy-paste example
from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8000/v1", api_key="unused")
response = client.chat.completions.create(
    model="gpt-4o-mini",
    max_tokens=200,
    messages=[{"role": "user", "content": "Summarize this contract."}],
    extra_headers={
        "X-Inferrail-Attribute-Work-Id": "contract-review-42",
        "X-Inferrail-Budget-Usd": "0.50",
    },
)

Only execute this example after authorizing provider charges and configuring the provider key. Calls routed through the gateway share the run budget. An admission check reserves a conservative estimate; actual provider usage can exceed an estimate, in which case the overrun is recorded and later calls are refused. It does not control unrelated wallets, tools or calls outside the gateway.

Configuration, receipts and storage · Framework recipes and scoped budgets

See the boundary working.

Recorded gateway run using a local stand-in model: four calls answered and two refused, with spending shown in the dashboard.

Recorded execution with a local stand-in model and labelled fixture pricing. How it was recorded . The hosted trial is separate from paid Web Read.

Receipts keep the economics, not the conversation.

Gateway receipt fields include provider, model, usage, price, cost, timing, status and caller tags. Prompt and response bodies are excluded. Tags are stored as supplied, so keep sensitive content out of them. The gateway handles request content in memory and the model provider still sees the full request.

Copy-paste example
inferrail verify-payload-free

A schema inspection, not an external security audit. Canary tests and boundaries .

Read-only MCP exposes get_spend and get_health ; it cannot purchase external tools.

A focused gateway contract.

OpenAI-compatible /v1/chat/completions and Anthropic-compatible /v1/messages , with streaming and tool-call passthrough. No OpenAI Responses, embeddings, image generation, native Gemini or native Bedrock APIs. Unknown pricing stays unknown.

Your application sends calls through the local gateway to your provider. Separate payload-free receipts feed reports, dashboard and read-only MCP.

Detailed current scope · Architecture · Shared Hosted budgets