Agents and integrations

Move from OpenRouter.

Change the base URL and the key. Your requests, model ids and provider settings keep working, and every answer carries a receipt.

On this page

Point your client at https://api.usdf.fi/v1 and send a Foundry key in place of your OpenRouter key. Nothing else in the request has to change.

Before

const client = new OpenAI({
  baseURL: "https://openrouter.ai/api/v1",
  apiKey: process.env.OPENROUTER_API_KEY,
});

After

curl https://api.usdf.fi/v1/chat/completions \
  -H "Authorization: Bearer $USDF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "<model>", "messages": [{"role": "user", "content": "Hello"}], "max_tokens": 64}'

Environment

# Before
OPENROUTER_API_KEY=sk-or-...
# After
USDF_API_KEY=sk_...
# Base URL: https://openrouter.ai/api/v1  ->  https://api.usdf.fi/v1
# Messages API clients (Claude Code, the Anthropic SDK): https://api.usdf.fi, no /v1

The key goes in the same header, Authorization: Bearer. Clients built on the Messages API take the address without /v1; see Messages API clients and coding agents.

You useOn Foundry
POST /chat/completions, /responses, /messagesThe same paths under the new base URL, streamed or not, with tools and structured output.
Model ids with a vendor prefixRead as the same model: openai/gpt-5 names gpt-5. GET /v1/models/resolve?id= shows how any id is read.
:nitro, :floorRead as :fastest and :cheapest.
The provider objectorder, only, ignore, allow_fallbacks, sort, max_price, zdr and data_collection. See Provider preferences.
A models listFallback models, tried in order. See Fallbacks.
HTTP-Referer and X-TitleName your app on its requests, as before.
The model and key readsGET /v1/models, /v1/models/count, /v1/models/{author}/{slug} and its /endpoints, /v1/key, /v1/credits and /v1/generation, in the same shapes.
OpenRouterFoundry
Base URLhttps://openrouter.ai/api/v1https://api.usdf.fi/v1
Keysk-or-...sk_..., from the dashboard
What you pay withCreditsUSDF: one dollar each, backed 1:1 by Global Dollar (USDG), issued by Paxos, redeemable at any time, and it never expires.
PriceThe provider's price, plus a fee when you buy creditsEvery model below its source price. The cheapest provider that meets your rules serves each request.
Per requestA generation recordA receipt on every answer, with the price and the saving.
DataSet per account or per requestZero retention by default on every request.

Holding USDF also earns from the network, hourly. See the USDF token.

Create a key in the dashboard and fund it with USDF. A key can have a budget, a model allowlist and an IP allowlist. See Accounts and keys.

No account at all: send the same request under https://api.usdf.fi/x402. The gateway quotes the price, your wallet signs one USDF payment, and you send the request again with it. See Pay per request.

Every answer carries a receipt: the request id, the model, what was charged and what it saved against the source price. Read it again any time with GET /v1/receipts/{request_id}. See Receipts.

Every request asks for zero data retention, so it runs only on providers that keep nothing. You do not have to set zdr.

A few models have no provider that keeps nothing. They are listed with a small "provider may keep data" label (may_keep_data: true on GET /v1/models). Picking one of them is the opt-in; there is no extra switch. See Data handling.

  1. Create a key and add USDF to your balance.
  2. Change the base URL to https://api.usdf.fi/v1.
  3. Replace the key in your environment.
  4. Send one request and read its receipt.

Next: SDKs, coding agents and MCP

Foundry documentation