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 use | On Foundry |
|---|---|
POST /, /, / | The same paths under the new base URL, streamed or not, with tools and structured output. |
| Model ids with a vendor prefix | Read as the same model: openai/ names gpt-5. GET / shows how any id is read. |
:nitro, :floor | Read as :fastest and :cheapest. |
The provider object | order, only, ignore, allow_, sort, max_, zdr and data_. See Provider preferences. |
A models list | Fallback models, tried in order. See Fallbacks. |
HTTP-Referer and X-Title | Name your app on its requests, as before. |
| The model and key reads | GET /, /, /v1/models/{author}/{slug} and its /, /, / and /, in the same shapes. |
| OpenRouter | Foundry | |
|---|---|---|
| Base URL | https:/ | https:/ |
| Key | sk-or-. | sk_, from the dashboard |
| What you pay with | Credits | USDF: one dollar each, backed 1:1 by Global Dollar (USDG), issued by Paxos, redeemable at any time, and it never expires. |
| Price | The provider's price, plus a fee when you buy credits | Every model below its source price. The cheapest provider that meets your rules serves each request. |
| Per request | A generation record | A receipt on every answer, with the price and the saving. |
| Data | Set per account or per request | Zero 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.
- Create a key and add USDF to your balance.
- Change the base URL to
https://api.usdf.fi/v1. - Replace the key in your environment.
- Send one request and read its
receipt.