Get started

Build with USDF.

One OpenAI-compatible endpoint for every listed model. Pay per request in USDF with no account, or from a prepaid balance with an API key.

203Models available
On this page

Get started

Make a first request, with or without an account.

Pay per request

Quote, sign one payment and send the request again.

API reference

Every endpoint with its parameters and samples.

USDF

Wrap, redeem and send USDF, and check the reserve.

Earn with sUSDF

The sUSDF vault and how its figures are read.

Agents

Agents with their own balance, key and spending policy.

SDKs and MCP

The TypeScript SDK, OpenAI clients, MCP and the CLI.

Platforms and providers

Sub-keys for platforms, and serving your own endpoint.

Trust

Data handling, privacy and verification.

USDF is the dollar of the machine economy: the dollar agents pay with, and the dollar compute is priced in.

Every other way to buy compute turns money into credits: a fee to get in, locked to one platform, no way back out, earning nothing. USDF stays money. Every USDF is backed 1:1 by USDG in a stock contract with no admin keys, redeemable at any time, with no fee in and no fee out. Spend it on 100+ models, send it, borrow against it, or stake it as sUSDF and earn from the whole network.

ReasonWhat it means
Zero fee in, zero fee outBuying wraps USDG into USDF one to one and redeeming unwraps it. The contract takes no fee, and the gateway pays the gas on deposits and withdrawals.
Still your dollarWithdraw it, send it to anyone by link or address, or borrow against it.
It earnsUSDF Rewards pay holders 100% of the Paxos reserve rewards plus 50% of network revenue: compute, launch and provider fees, tools and lending.
Agents hold itAn agent pays per request in USDF with no account and no API key.
Backed 1:1, in publicA stock OpenZeppelin contract with no owner. The reserve is onchain and published at Transparency.

Foundry issues USDF, the dollar of the machine economy: backed 1:1 by Paxos USDG in a stock contract, zero fees, redeemable any time, spent per request on 100+ models by people, apps and agents, and staked as sUSDF to earn from the whole network. No owner, no admin keys, and the reserve is public.

USDF is a dollar for compute on Robinhood Chain. 1 USDF = $1 of compute, redeemable 1:1 for USDG at any time.

The gateway at https://api.usdf.fi serves chat, embeddings, images, speech, transcription, rerank and video through one OpenAI-compatible API. Every request is metered in USDF and returns a receipt.

200+ agents run on USDF. They pay for their own compute per request, from a wallet or from a balance with spend limits.

There are two ways to pay. Pay per request needs no account and no key: ask for a quote, sign one payment, send the request again. A prepaid balance with API keys suits sustained volume.

Every surface, its address and what it takes:

SurfaceURLAuth
Pay per requesthttps://api.usdf.fi/x402/v1/…A signed payment per request
OpenAI-compatible APIhttps://api.usdf.fi/v1API key
MCP serverhttps://api.usdf.fi/mcpAPI key, or a payment per call
Receipt of any requesthttps://api.usdf.fi/x402/v1/receipts/{id}None
Agent skillhttps://api.usdf.fi/skill.mdNone
Machine-readable maphttps://api.usdf.fi/llms.txtNone
Signed model cataloghttps://api.usdf.fi/v1/catalogNone

The chain and the token, read live from the gateway:

ItemValue
ChainRobinhood Chain – eip155:<chain-id>
RPC URL
Explorer
USDF contract
USDG contract
Decimals6 decimals, for both tokens
Base unit1 unit = $0.000001

Samples use <model>, the first available chat model.

You need a wallet on Robinhood Chain that holds USDF or USDG. No USDF yet? Buy it on the Buy page, or swap any token for it. Payments cost no gas: the gateway submits every transfer.

Paying in USDF needs a one-time approval to Permit2. That approval is the only transaction you send, and it needs a little ETH on Robinhood Chain for gas. Paying in USDG needs no approval and no gas.

1. Ask for a quote

Send the request with no credentials. The gateway answers 402 with the exact amount and the two payments it accepts. An unpaid quote costs nothing.

Request

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

Response, trimmed

402 Payment Required
payment-required: <base64 JSON: x402Version, resource, accepts>
www-authenticate: Payment id="…", method="evm", intent="charge", …

{
  "error": { "message": "payment required", "type": "payment_required", "code": "x402" },
  "quote": {
    "model": "<model>",
    "max_tokens": 64,
    "price_version": "<price sheet>",
    "amount": { "units": "<units>", "usd": "<usd>", "usdf": "<usdf>" },
    "accepted": [
      { "symbol": "USDF", "method": "permit2" },
      { "symbol": "USDG", "method": "eip3009" }
    ]
  },
  "x402": { "x402Version": 2, "accepts": [ … ] }
}

2. Pay and send

Sign one of the accepted payments and send the identical request with it. The TypeScript SDK does both steps for you, and pays in USDF when the wallet has approved Permit2, otherwise in USDG.

Paid request

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

<encoded payment> is the signed payment, base64-encoded JSON. How to sign it.

3. Read the answer and its receipt

The answer is a normal chat completion with a receipt. The quote is what you pay. The metered cost is reported beside it.

Response, excerpt

{
  "id": "<request_id>",
  "choices": [ … ],
  "receipt": {
    "request_id": "<request_id>",
    "paid": { "units": "<units>", "usd": "<usd>", "usdf": "<usdf>" },
    "usage_cost": { "units": "<units>", "usd": "<usd>", "usdf": "<usdf>" },
    "payment": { "tx": "<transaction hash>", "asset": "USDF", "method": "permit2" },
    "settlement": { "scheme": "x402 exact", "network": "eip155:<chain-id>" }
  }
}

Next: every payment detail and every paid endpoint

Use a prepaid balance and API keys for sustained volume. Requests are held, charged and receipted against the balance.

1. Sign in and create a key

Sign in, then create a key on the dashboard. A key starts with sk_ and is shown once. Store it as USDF_API_KEY.

2. Fund the balance

Send USDF from your linked wallet, add USDG without gas, or buy on the Buy page. Every way is in Fund the balance.

3. Set the base URL

Point any OpenAI-compatible client at:

https://api.usdf.fi/v1

4. Send a request

Chat completion

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": 256
  }'

Response

{
  "id": "<request_id>",
  "object": "chat.completion",
  "model": "<model>",
  "choices": [ … ],
  "usage": { "prompt_tokens": …, "completion_tokens": … },
  "receipt": {
    "request_id": "<request_id>",
    "status": "ok",
    "cost": { "units": "<units>", "usd": "<usd>", "usdf": "<usdf>" },
    "balance": { "units": "<units>", "usd": "<usd>", "usdf": "<usdf>" },
    "settlement": {
      "status": "unsettled",
      "lookup": "https://api.usdf.fi/v1/receipts/<request_id>"
    }
  }
}

Next: keys, caps and balances

Next: the full API reference

Authentication

Each credential goes in one header. Keys are stored only as a hash.

CredentialHeaderUsed for
API keyAuthorization: Bearer sk_…/v1 and MCP
Session tokenAuthorization: Bearer <session token>Account, keys and agents
x402 paymentPAYMENT-SIGNATURE: <encoded payment>/x402
MPP credential (Machine Payments Protocol)Authorization: Payment <credential>/x402
Read tokenAuthorization: Bearer <read_token>A video job paid per request

Holds and charges

The ledger is the gateway's record of every balance, hold and charge. Spend in it settles onchain in batches; see Settlement.

  • Before a request runs, a hold for its worst case is taken: the prompt plus max_tokens.
  • The charge is the provider's reported usage at the sheet price, rounded up to the unit. The rest of the hold is released.
  • A request that fails after its hold is marked failed_refunded, with cost zero.

Paid per request, the quote is the charge. Each price sheet promises its rates for 30 days.

Receipts

Every response carries a receipt:

  • Its id is the x-request-id header. On a chat or text completion it is also the response's id.
  • A response that is not streamed also sends the cost in x-cost-units. A chat or text completion paid per request does not: read receipt.paid.
  • A stream sends the receipt as its last comment line, before [DONE].

Receipt, trimmed

"receipt": {
  "request_id": "<request_id>",
  "model": "<model>",
  "status": "ok",
  "usage": { "prompt_tokens": …, "completion_tokens": … },
  "price": { "version": "<price sheet>", "input": …, "output": … },
  "cost": { "units": "<units>", "usd": "<usd>", "usdf": "<usdf>" },
  "settlement": { "status": "unsettled", "next_batch_after": "<time>" }
}

Look one up with GET /v1/receipts/{id} and the key that made it, or with GET /x402/v1/receipts/{id} and no key at all.

Next: receipts, settlement and the public log

Units

Every amount is an integer number of units. USDF and USDG both have 6 decimals.

AmountUnitsValue
1 unit1$0.000001
1 USDF1,000,000 units$1
1 USDG1,000,000 units1 USDF

Amounts come back as { "units", "usd", "usdf" } strings, so no precision is lost. Prices are per 1M tokens for text, embeddings and rerank, per million characters for speech, per minute for transcription, per image unit for images and per second for video. Each model's unit is in GET /v1/pricing.

Every figure below is read live from GET /v1/limits. A request over its limit gets 429, the error code shown, and Retry-After in seconds.

Applies toScopeLimitError code

Other public reads and jobs carry their own limits:

Applies toScopeLimitError code

Session and dashboard calls have per-account limits too. They are listed in Account limits.

A refused request has this shape, on every endpoint:

{ "error": { "message": "…", "type": "…", "code": "…" } }

type is the class of error and code the exact reason. The common ones:

StatusCommon codeWhat to do
400null for a plain validation error, or a reason such as context_length_exceededFix the request. Sending it again unchanged fails again.
401invalid_api_keySend a valid key as a Bearer token.
402insufficient_balance or x402Fund the balance, or pay the quote.
403key_pausedResume the key, or use another one.
429rate_limitedWait for Retry-After, then send it again.
502upstream_unavailableNothing was charged. Retry, or pick another model.

Next: status codes and error codes by area

Every docs page, by what you are doing:

Get started

Overview

This page: the endpoint, both ways to pay, billing, limits and errors.

Pay per request

Quote, sign one payment and send the request again. No account and no key.

Open Pay per request

Accounts and keys

Sign in, link a wallet, fund a balance, and give each key its own caps.

Open Accounts and keys

Build

API reference

The model endpoints, chat parameters, streaming, models, batch jobs, tools and public data.

Open API reference

Modalities

Embeddings, images, speech, transcription, rerank and video on one balance.

Open Modalities

Routing

Routing shortcuts, provider preferences, a price ceiling and fallbacks.

Open Routing

Receipts and verification

Read a receipt, follow its settlement and check it in the public log.

Open Receipts and verification

Errors

Status codes, error codes by area, whether anything was charged, and what to do.

Open Errors

Developer tools

SDKs, MCP and CLI

Open SDKs, MCP and CLI

Affiliates

Open Affiliates

Agents and integrations

Agents

Agents with their own balance, key, spending policy and approvals.

Open Agents

SDKs and MCP

The TypeScript SDK, the AI SDK provider, OpenAI clients, MCP and the CLI.

Open SDKs and MCP

Platforms and providers

Sub-keys and markup for platforms, embeds, referrals, and serving your own endpoint.

Open Platforms and providers

USDF and trust

USDF token

Wrap, redeem and send USDF, and check the reserve behind it.

Open USDF token

Free credits

Open Free credits

Data handling

What is stored for a request, what never is, and for how long.

Open Data handling

Privacy

What the gateway keeps, and how private inference works.

Open Privacy

Coin and fees

Does USDF change in price?

1 USDF = $1 of compute, redeemable 1:1 for USDG at any time. At the token contract the rate never moves: anyone can wrap USDG into USDF and redeem USDF for USDG 1:1, with no fee. USDF also trades in the USDF/USDG pool on Uniswap, where the market sets the price and it can differ from 1:1; the contract's 1:1 is there beside it at any time. Redemption depends on USDG transfers succeeding: USDG is issued by a regulated issuer that retains pause and freeze powers over its own token.

Does USDF expire?

No.

Do I need an account?

No. Pay per request with a wallet and nothing else.

Which clients work?

Any OpenAI chat completions client, the AI SDK, LangChain, and any MCP client. See SDKs and MCP.

Is the Responses API served?

No. Use chat completions. Where a library offers both, pick the chat completions path.

How is the reserve verified?

Read it live on Transparency, or run every check in your browser on Verify.