Get started
Accounts, keys and balances.
Sign in, link a wallet, fund a balance, and give each key its own limits.
On this page
An account gives you API keys, its own Foundry wallet, a Foundry balance, credits, claim links, and a linked X account and wallet. Buying, swapping, redeeming and pay per request work with a wallet alone.
Sign in at /auth. Each section below names the dashboard tab that does the same with no code.
The samples show the calls themselves. Each one takes the signed-in session's access token as a Bearer token:
Authorization: Bearer <session token>
- Samples read the token from
$SESSION. The SDK readsUSDF_, and the command line stores one withSESSION_ TOKEN usdf login --token -. GET /v1/authnames the sign-in in force and the endpoints it takes.- A session lasts about an hour. An expired or signed-out one gets
401: sign in again. - Managing keys, withdrawing and creating links take a session, not an API key.
A linked wallet is where deposits come from and withdrawals go to. Linking it takes one signature. On the dashboard: Balance.
1. Ask for the message
Request
curl -X POST https://api.usdf.fi/v1/account/wallet/nonce \ -H "Authorization: Bearer $SESSION" \ -H "Content-Type: application/json" \ -d '{"address": "<wallet address>"}'
Response
{ "nonce": "<nonce>", "message": "<message to sign>", "expires_in_seconds": … }2. Sign it
Sign message with personal_ from the wallet.
3. Link the wallet
Request
curl -X POST https://api.usdf.fi/v1/account/wallet \ -H "Authorization: Bearer $SESSION" \ -H "Content-Type: application/json" \ -d '{ "address": "<wallet address>", "signature": "<personal_sign of the message>", "nonce": "<nonce>" }'
Response
{
"wallet_address": "<wallet address>",
"credited_units": "<units>",
"signature": { "kind": "eoa" }
}The rules:
- One wallet per account, and a wallet belongs to one account.
- It can be replaced only while the account and the agents it owns together hold under 0.10 USDF. Withdraw first, then link the new wallet.
- Contract wallets (a Safe, a smart account) link through ERC-1271.
- USDF sent from a wallet that is not linked is held until that wallet is linked.
Four ways to add to the balance. Sending USDF is on the dashboard under Balance.
| Way | How | Credited |
|---|---|---|
| Send USDF | To your own Foundry wallet: its address is deposit. in GET /, null until you turn the wallet on. Foundry's own wallets take no deposits. | After confirmations, usually within a minute or two |
| The Buy page | /buy | As the transaction confirms |
| Any token | Pay with any token | As the swap confirms |
| Buy by card | GET / returns the card widget's settings for the account and the purchase the payment becomes; / lists purchases | Once the USDG it delivers is converted to USDF |
A card purchase is paid in the card provider's own window; the gateway never sees the card. Its status moves through pending, paid, swapping, delivered, minted and credited, or ends failed or refunded with nothing credited. Foundry charges no fee: what arrives is credited 1:1 as USDF, and the provider's own fee is in its quote before you pay. GET /v1/account/deposit/card/history lists each purchase with what was paid, delivered and credited.
Integrators never handle USDG themselves. A wallet with USDC or PYUSD on Ethereum, or USDC on Arbitrum, adds to a balance in one flow, and a balance or a payout goes back out as USDC or USDG on Arbitrum or Ethereum. The wallet signs and sends every order itself, so the funds go from the wallet to the recipient, never through Foundry. The gateway quotes each order and follows it until it lands.
| Step | Call |
|---|---|
| The routes served now, each with its minimum | GET /, with ?purpose=deposit or ?purpose=cashout |
| A quote: the transaction to sign, what is received, the fee and the expected time | POST / |
| The quote recorded as the account's order, before the wallet sends it | POST / with quote_ and purpose |
| The hash of the transaction the wallet sent | POST / |
| The order until it lands | GET /, or any order on the network: GET / |
Send exactly the quote's transaction.: the messaging fee on a route between chains, 0 on one chain. An order moves through quoted, submitted and stuck, and ends fulfilled, failed or expired.
Payouts as USDC
Providers, Mac operators and marketplace sellers are paid on Robinhood Chain. PUT /v1/account/payout-preference sets how payouts are converted: USDC or USDG on Arbitrum (42161) or Ethereum (1), to the linked wallet's own address there, or to an address set from the signed-in session after a recent sign-in. With a preference, each paid payout carries convert, the conversion filled in. GET /v1/transit/payout/steps returns what the wallet holds and the steps it signs in order: USDF redeemed 1:1 for USDG when needed, the approval when needed, then the order with exactly its value. Record the order with purpose payout before the wallet sends it.
In the SDKs: usdf. adds funds in one call, usdf. cashes out, usdf. sets how payouts are converted, and usdf. follows an order until it lands. See SDKs.
Create keys on the dashboard (API Keys), or with the API under a session. A key is shown once; only its hash is kept.
Create a key
curl -X POST https://api.usdf.fi/v1/account/keys \ -H "Authorization: Bearer $SESSION" \ -H "Content-Type: application/json" \ -d '{ "label": "research", "budget_units": "5000000" }'
Response, 201
{
"object": "api_key",
"key_id": "<key_id>",
"api_key": "sk_…",
"prefix": "<prefix>",
"note": "Shown once: store the key now. It spends from this account's balance."
}The key endpoints:
| Endpoint | What it does |
|---|---|
POST / | Creates a key: label, budget_ (a lifetime spend limit), rate_, and project_ to make it in a project. |
GET / | Active keys. ?state=revoked lists revoked ones; ?count=1 counts them. |
PATCH / | Changes label, budget_ or rate_; clear_ removes the budget; project_ moves the key (null takes it out of its project). |
POST / | A new key with the old one's controls; the old key is revoked in the same step. See Rotate a key. |
DELETE / | Revokes the key. |
An account's active keys, the keys it creates in an hour and each key's requests a minute have their limits; a key's is No limit (1–5999 req/min, configurable)
Each key can carry hourly, daily and monthly caps, a model allowlist, a pause, privacy flags and a webhook. Set them with PATCH / under the session. On the dashboard: API Keys, then Key controls.
| Parameter | Type | Notes |
|---|---|---|
spend_, spend_, spend_ | String of units, or null | Trailing hour, day and 30 days. Null clears the cap. |
allowed_ | Array, or null | Model ids, or a prefix ending in *. Null allows every listed model; [] allows none. |
paused | Boolean | A manual pause is never lifted by the gateway. Requests get 403 key_. |
no_ | Boolean | While true, prompt and completion text are never written anywhere. True unless the key opts in with retain. |
retain | Boolean | true keeps this key's requests in the account's request logs; false keeps the key in no-logs mode whatever the account's setting. |
private_ | Boolean | Every request runs on attested routes. Implies no_. |
webhook_ | String, or null | Https on a public host. Receives pause and resume events. |
guardrails | Object, or null | The key's own rules: allowed_, blocked_, max_, zdr_, redact and injection. The account's guardrails apply too, and the stricter wins. Null removes the key's. |
expires_ | Time, or null | When the key stops serving. See Expiry. |
ip_ | Array, or null | The addresses the key serves from. See IP allowlist. |
An unknown field refuses the whole request, and everything is checked before anything is written. A request for a model the list does not allow gets 403 model_not_allowed and costs nothing.
Set caps and an allowlist
curl -X PATCH https://api.usdf.fi/v1/keys/<key_id> \ -H "Authorization: Bearer $SESSION" \ -H "Content-Type: application/json" \ -d '{ "spend_limit_hour_units": "1000000", "spend_limit_day_units": "5000000", "spend_limit_month_units": "50000000", "allowed_models": ["deepseek-v4.1-flash", "qwen*"], "webhook_url": "https://example.com/usdf-hooks" }'
Pause a key
curl -X PATCH https://api.usdf.fi/v1/keys/<key_id> \ -H "Authorization: Bearer $SESSION" \ -H "Content-Type: application/json" \ -d '{"paused": true}'
Read a key's state with GET /:
Read a key's limits
curl https://api.usdf.fi/v1/keys/<key_id>/limits \
-H "Authorization: Bearer $SESSION"Response, trimmed
{
"key_id": "<key_id>",
"spend": {
"hour": {
"window": "…", "spent_units": "<units>", "limit_units": "1000000",
"remaining_units": "<units>", "at_limit": false
},
"day": { … },
"month": { … }
},
"models": { "allowed": ["deepseek-v4.1-flash", "qwen*"], "enforced": true, … },
"paused": { "state": false, "at": null, "reason": null, "auto_resume": null },
"privacy": { "no_logs": false, "private_tier": false, … },
"webhook": { "url": "https://example.com/usdf-hooks", … }
}A key pauses by itself at a cap or at zero balance, and resumes by itself:
| Reason | Resumes when |
|---|---|
zero_ | A deposit lands. |
hour_, day_, month_ | The trailing window moves on. |
manual | The owner sets paused to false. |
Two more controls on PATCH / limit where and until when a key works. On the dashboard: API Keys, then Key safety.
| Field | Effect |
|---|---|
expires_ | A time with its offset. Past it, every request on the key gets 401 key_. A later time, or null, serves the key again. To stop a key now, pause or revoke it. |
ip_ | IPv4 or IPv6 addresses or CIDR blocks. A request from any other address gets 403 ip_. null allows any address; an empty list is refused. |
Nothing is held or charged on a refused request. The address is the caller's as the gateway sees it: your_ in GET /v1/keys/safety shows yours.
Set an expiry and an allowlist
curl -X PATCH https://api.usdf.fi/v1/keys/<key_id> \ -H "Authorization: Bearer $SESSION" \ -H "Content-Type: application/json" \ -d '{ "expires_at": "<time>", "ip_allowlist": ["<IPv4 or IPv6 address>", "<CIDR block>"] }'
Read every key's safety
GET /v1/keys/safety lists every active key: when it was made and last used, and from which address, its expiry and allowlist, the last request refused for either, and its flags. Each flag also lists the keys that carry it: never_, stale, old, expired, expiring_, no_, no_, no_, paused and refused_. thresholds gives the day counts behind them.
Read key safety
curl https://api.usdf.fi/v1/keys/safety \
-H "Authorization: Bearer $SESSION"Response, trimmed
{
"object": "key_safety",
"your_ip": "<your address>",
"keys": [
{
"key_id": "<key_id>",
"label": "research",
"last_used": { "at": "<time>", "ip": "<address>", … },
"expires_at": "<time>",
"ip_allowlist": ["<CIDR block>"],
"refused": { "ip": "<address>", "at": "<time>", "reason": "ip_not_allowed" },
"flags": ["refused_recently"],
…
}
],
"never_used": [ … ], "stale": [ … ], "old": [ … ], "expired": [ … ], "expiring_soon": [ … ], "refused_recently": [ … ],
"thresholds": { … }
}Rotate a key
POST / makes a new key with the old one's label, scope and every control: what is left of its budget, the rate limit, the caps, the model allowlist, the pause, the flags, the webhook, the guardrails and its project. The old key is revoked in the same step: both happen, or neither. The new key's trailing windows start empty, and it is shown once.
Rotate a key
curl -X POST https://api.usdf.fi/v1/account/keys/<key_id>/rotate \
-H "Authorization: Bearer $SESSION"Response, 201
{
"object": "api_key",
"key_id": "<new key_id>",
"api_key": "sk_…",
"prefix": "<prefix>",
"rotated_from": "<key_id>",
"old_key_revoked": true,
"kept": { … },
"note": "Shown once: store the key now. The old key is revoked; …"
}An agent's key rotates with POST /.
A project groups keys under one monthly budget. It belongs to the account, or to a team with ?org=: a team's owner and admins make and change its projects, and every member reads them. On the dashboard: API Keys, and each team under Teams.
| Endpoint | What it does |
|---|---|
GET / | The projects, live ones first, newest first. state: active (default), archived or all; org; limit and before to page. max_ is the most live projects an owner may hold. |
POST / | Makes one: name, and budget_ for a monthly budget (leave it out for none). |
GET / | Its budget and what is left, what its requests did this UTC month, and its live keys. |
PATCH / | Changes name or budget_ (null removes the budget). |
POST / | Its keys leave it and keep working in no project. It is never changed again, and its usage keeps it. This cannot be undone. |
Make a project with a budget
curl -X POST https://api.usdf.fi/v1/projects \ -H "Authorization: Bearer $SESSION" \ -H "Content-Type: application/json" \ -d '{"name": "research", "budget_units": "20000000"}'
Response, 201, trimmed
{
"object": "project",
"id": "prj_…",
"name": "research",
"budget": {
"limit": { "units": "20000000", … },
"spent": { … }, "held": { … }, "left": { … },
"month": "<YYYY-MM>",
"resets_at": "<time>"
},
"key_count": …,
"archived": false,
"links": { "self": "…", "archive": "…", "usage": "…", "activity": "…" },
…
}A key is in at most one project. Make it there with project_ on POST /v1/account/keys, or move it later:
Move a key into a project
curl -X PATCH https://api.usdf.fi/v1/account/keys/<key_id> \ -H "Authorization: Bearer $SESSION" \ -H "Content-Type: application/json" \ -d '{"project_id": "<project_id>"}'
A team key takes project_ on POST / too, and moves with PATCH /.
The monthly budget
- The budget caps what the project's keys are charged from the balance in a UTC calendar month. The count starts again at midnight UTC on the first of the month (budget.resets_at).
- A request that does not fit in what is left gets
402 project_budget_exceededand costs nothing. Withoutmax_, a request's output shrinks to what is left.tokens - What credit pays is not counted. A key's own budget and caps still hold beside the project's: the tighter wins.
- Lowering a budget below what was spent stops the project's keys until the month ends.
Usage by project: GET /v1/analytics/series?group_by=project, or ?project= with a project id (none: keys in no project). The same project filter works on GET /v1/account/activity.
The gateway posts JSON events to https URLs you set. On the dashboard, set a key's under API Keys and the low-balance alert's under Settings. An agent's is set with PATCH /.
| Event type | Set with | Carries | Deduplicate on |
|---|---|---|---|
key., key. | webhook_ on PATCH / | The key, the reason, the trailing spend and the caps | event_ |
approval. | The agent's webhook_ | The agent, the action and the owner's decision (status) | approval_ |
batch., batch., batch. | The job's webhook_ | The job, its cost, and its result once done | id, the job id |
balance. | low_ and low_ in the account settings | The available balance and the threshold | event_ |
key., account., model., model., notification. | webhook_ in the notification rules | The rule and what it measured | notification_ |
- Each event is a JSON POST. A success status is delivery; anything else, a redirect included, is a failure.
- Failed deliveries are retried, then given up. Deduplicate on the field above: a retry can repeat an event.
- A URL must be https on a public host.
- Every delivery to a URL your account set is signed with the account's own secret. See Webhook signatures.
One body of each kind. A key. event has the same fields, with spend set to null. Money is { "units", "usd", "usdf" }, as everywhere.
key.paused
{
"type": "key.paused",
"event_id": "<event id>",
"key_id": "<key_id>",
"key_prefix": "<prefix>",
"label": "research",
"reason": "day_limit",
"spend": { "hour": { … }, "day": { … }, "month": { … } },
"limits": { "hour": { … }, "day": { … }, "month": { … } },
"month_read_at": "<time>",
"at": "<time>",
"gateway": "https://api.usdf.fi"
}approval.decided
{
"type": "approval.decided",
"approval_id": "<id>",
"agent_id": "<agent id>",
"action": "Run the research batch",
"status": "approved",
"decided_at": "<time>",
"gateway": "https://api.usdf.fi"
}batch.done, trimmed
{
"type": "batch.done",
"id": "batch_…",
"status": "done",
"model": "<model>",
"provider": "<provider>",
"usage": { … },
"cost": { "units": "<units>", "usd": "<usd>", "usdf": "<usdf>" },
"error": null,
"result": { "choices": [ … ], "receipt": { … }, … },
"poll": "https://api.usdf.fi/v1/batches/batch_…",
"result_url": "https://api.usdf.fi/v1/batches/batch_…/result",
"receipt": "https://api.usdf.fi/v1/receipts/batch_…",
"ended_at": "<time>",
"gateway": "https://api.usdf.fi"
}balance.low
{
"type": "balance.low",
"event_id": "<event id>",
"account_id": "<account id>",
"available": { "units": "<units>", "usd": "<usd>", "usdf": "<usdf>" },
"threshold": { "units": "<units>", "usd": "<usd>", "usdf": "<usdf>" },
"at": "<time>",
"gateway": "https://api.usdf.fi",
"note": "…"
}Before acting on an event, read the state it reports from the gateway itself:
| Event | Read |
|---|---|
key., key. | GET / |
approval. | GET / |
batch., batch., batch. | GET / |
balance. | GET / |
Every webhook delivery to a URL your account set is signed with the account's own secret: notifications, the low-balance alert, a key's pause and resume, an agent's approvals and a batch job's result. A platform's sub-key and a team member's key set their own URLs, so those deliveries carry no account signature.
| Endpoint | What it does |
|---|---|
GET / | The secret, when it was made and when it was last rotated. Made now if the account has none. |
POST / | A new secret. The old one stops signing at once. |
Both take the signed-in session only. The first secret is also made when the account first saves a webhook URL or is first sent a delivery.
Read the secret
curl https://api.usdf.fi/v1/account/webhook-secret \
-H "Authorization: Bearer $SESSION"Response
{
"object": "webhook_secret",
"enabled": true,
"secret": "whsec_…",
"created_at": "<time>",
"rotated_at": null,
"header": "x-usdf-signature",
"timestamp_header": "x-usdf-timestamp",
"destination_header": "x-usdf-destination",
"note": "…"
}Rotate the secret
curl -X POST https://api.usdf.fi/v1/account/webhook-secret \
-H "Authorization: Bearer $SESSION"Each signed delivery carries three headers:
| Header | Value |
|---|---|
x-usdf-timestamp | The Unix time, in seconds, the delivery was signed at. |
x-usdf-destination | The URL it was sent to, exactly as you saved it. |
x-usdf-signature | v1= and the hex HMAC-SHA256, keyed by the secret, of the timestamp, a newline, the URL, a newline and the raw body. |
To verify a delivery:
- Recompute the signature with the URL you saved (not the header's: it only tells you which of your URLs it was meant for) and the body exactly as received, before parsing it.
- Compare in constant time.
- Refuse a timestamp more than 300 seconds from your own clock.
- Deliveries are at least once: deduplicate on the event's id (
notification_,id event_,id approval_or the job'sid id).
Signing the URL means a body signed for one of your receivers does not verify at another, and the timestamp means it cannot be replayed later.
Check a saved delivery with openssl
SECRET='whsec_…' URL='https://example.com/usdf-hooks' # the URL you saved TS='<x-usdf-timestamp>' SIG='<x-usdf-signature>' # body.json: the delivery's raw body, saved as received WANT="v1=$( { printf '%s\n%s\n' "$TS" "$URL"; cat body.json; } | openssl dgst -sha256 -hmac "$SECRET" | sed 's/^.*= //')" NOW=$(date +%s) [ "$WANT" = "$SIG" ] && [ $(( NOW - TS )) -le 300 ] && [ $(( TS - NOW )) -le 300 ] && echo verified || echo refused
Verify a delivery
import { createHmac, timingSafeEqual } from "crypto";
export function verify(secret: string, url: string, rawBody: string, timestamp?: string, signature?: string): boolean {
if (!timestamp || !/^\d+$/.test(timestamp) || !signature) return false;
if (Math.abs(Math.floor(Date.now() / 1000) - Number(timestamp)) > 300) return false;
const want = Buffer.from("v1=" + createHmac("sha256", secret).update(`${timestamp}\n${url}\n${rawBody}`).digest("hex"));
const got = Buffer.from(signature);
return want.length === got.length && timingSafeEqual(want, got);
}Rules the account sets. Each notification is posted to one webhook, and emailed too when email is on and the gateway sends email. On the dashboard: Settings, then Alerts.
| Endpoint | What it does |
|---|---|
GET / | The webhook, the email state, each rule with what it fired, the low-balance alert and the account's limits. |
PUT / | The fields sent replace what they name; one left out is kept. rules replaces every rule ([] removes them all; a rule sent again keeps what it fired). PATCH and POST are taken the same. |
GET / | The last 90 days of notifications, newest first, each with its data and what became of its webhook and email. limit and before to page. |
POST / | One signed notification. POST to the webhook, answered with what the receiver said. 409 no_ when none is set. |
The rules:
| Kind | Fields | Fires |
|---|---|---|
key_ | key_ (or null for every key with a limit), percent | A key's spend reached that share of one of its limits: the trailing hour, day or month, or its budget. Once per crossing; again after the spend falls back below. |
account_ | period (day or month), threshold in USDF or threshold_ | The account's spend in the UTC day or month reached the threshold. Once per period. |
model_ | None | A model the account used in the last 30 days changed its price or left the price sheet. Once per change. |
balance_ | threshold in USDF, or null | The low-balance alert: the same setting as low_. With no low-balance webhook of its own, it goes to this webhook and email. |
Each rule takes "enabled": false to keep it without firing. The answer's limits give the most rules, the most key_ rules and the most notifications sent an hour; past that an hour's notifications are kept and listed, not sent.
Set the rules
curl -X PUT https://api.usdf.fi/v1/account/notifications/rules \ -H "Authorization: Bearer $SESSION" \ -H "Content-Type: application/json" \ -d '{ "webhook_url": "https://example.com/usdf-hooks", "email": true, "rules": [ {"kind": "key_spend", "key_id": null, "percent": 80}, {"kind": "account_spend", "period": "day", "threshold": "25"}, {"kind": "model_change"} ], "balance_low": {"threshold": "5"} }'
email. says whether email goes out: off, not_ (this gateway sends no email), no_ (the sign-in has no verified email) or ready.
Send a test
curl -X POST https://api.usdf.fi/v1/account/notifications/test \
-H "Authorization: Bearer $SESSION"Response
{
"object": "notification_test",
"ok": true,
"status": …,
"error": null,
"signed": true,
"at": "<time>"
}key.spend_threshold, trimmed
{
"type": "key.spend_threshold",
"notification_id": "<id>",
"account_id": "<account id>",
"rule_id": "<rule id>",
"kind": "key_spend",
"at": "<time>",
"data": {
"key_id": "<key_id>",
"key_label": "research",
"window": "day",
"percent": …,
"spent": { … },
"limit": { … }
},
"gateway": "https://api.usdf.fi",
"note": "…"
}GET /v1/account/settings reads the account's defaults and PATCH changes them. They apply to the next request from every key on the account. On the dashboard: Settings.
| Field | Effect |
|---|---|
zdr | Zero retention is already the default wherever a zero-retention route exists. true also refuses every model marked provider may keep data. |
data_ | "deny": only routes that do not train on content. |
sort | "price" or "latency": the order routes are tried in. |
provider_, provider_ | Route types to allow or exclude: hosted, network or private. |
allow_ | false: the first route only, with no failover. |
max_ | { input, output } in USD per 1M tokens. |
no_, private_ | Flags for keys created after they are set. |
retain | true turns on the account's request logs: its keys' requests are kept for 30 days, except a key set to no-logs on its own and a Private-tier key. |
low_, low_ | The low-balance alert. |
Change the defaults
curl -X PATCH https://api.usdf.fi/v1/account/settings \ -H "Authorization: Bearer $SESSION" \ -H "Content-Type: application/json" \ -d '{ "zdr": true, "data_collection": "deny", "sort": "price", "no_logs_default": true, "low_balance_units": "2000000", "low_balance_webhook_url": "https://example.com/usdf-hooks" }'
A request's own provider field overrides the routing defaults; zdr: true and data_collection: "deny" hold whatever a request sends.
Everything the dashboard shows is an endpoint. All take the session. On the dashboard: Activity and Analytics.
| Endpoint | Returns |
|---|---|
GET / | Balance, held, available, recent spend, top models, the last deposit and withdrawal. |
GET /, . | Every request, newest first, with filters: key, model, status, provider (the route type: hosted, network or private), project, min_, from, to. Each row links to its detail, and to its request log while your request logs keep one (logging on, 30 days). The next page: cursor. |
GET / | One request in full. Below. |
GET /, / | Usage rows, and those not in a settlement batch. |
GET / | Deposits, newest first. |
GET / | Withdrawals, newest first. |
GET / | A numbered receipt (DR-…) for one credited deposit, also as .: the amount, the sender, the transaction, when it was credited and whether it is final. |
GET / | Every month of the account, newest first, with its statement number (ST-…) and state: open, closing, closed or issued. |
GET / | A monthly statement, also as . or .. |
GET /, . | Spend by day, model and tool. ?days= and ?key=. A key can read its own. |
GET /, ., . | Requests, refunds, spend, tokens and latency by the hour or the day. Below. |
One request in full
GET / takes the answer's id or its x-request-id. It returns the route that served the request and every route tried, the fallbacks, the finish reason, latency, tokens, the cost by who paid it, the preset, the settlement and links to the receipt and the log proof. A session reads the account's requests, with the logged prompt and response where they were kept (bodies); a key reads only its own, without the texts.
Read one request
curl https://api.usdf.fi/v1/requests/<request_id> \
-H "Authorization: Bearer $SESSION"Response, trimmed
{
"object": "request",
"id": "<request_id>",
"model": "deepseek-v4.1-flash",
"provider": "<provider>",
"status": "ok",
"finish_reason": "stop",
"route": { "provider": "<provider>", "why": "cheapest", … },
"attempts": [{ "provider": "<provider>", "outcome": "served", … }],
"latency": { "total_ms": …, "ttft_ms": …, "generation_ms": …, "overhead_ms": … },
"usage": { "prompt_tokens": …, "completion_tokens": …, "cached_tokens": …, "total_tokens": … },
"cost": { "total": { … }, "charged": { … }, "free_credit": { … }, … },
"preset": null,
"settlement": { "status": "unsettled", … },
"bodies": { "available": false, "reason": "no_logs" },
"links": { "receipt": "…", "proof": "…", … }
}Usage over time
GET /v1/analytics/series takes a session or a key (a key reads its own usage). Every bucket is listed, and every series has a point for each:
| Parameter | Values |
|---|---|
bucket | hour or day. |
range | A rolling window ending now: 1h, 24h, 7d, 30d or 90d. Or from and to. |
group_ | none, model, key, provider (the route type: hosted, network or private), member (with org) or project. |
key, model, provider (the route type: hosted, network or private), project | Filters. |
org | A team you are a member of: its usage. |
top | The groups kept, largest spend first; the rest are one group, _. |
The answer's exports link the same view as . and ., and query is the query string that reproduces it. A window that is too long by the hour is refused with 400 window_too_long: ask by the day.
Statements
A month is open while it runs and closing for a day after it ends. Once closed, its first read issues it, with its number; from then on every read, in any format, is that statement, never changed, and the list gives its sha256. An older account's first read can answer 503 statement_issuing while the earlier months are issued: try again.
A team (an org) is a balance its members share. Its keys spend from the team's balance. Every team route takes a session. On the dashboard: Teams.
| Endpoint | What it does |
|---|---|
GET / | The teams you belong to. |
POST / | Creates a team with a name. You become its owner. |
GET / | Members, invites, keys, usage and funding. |
POST / | Invites by email or account_, as admin, member or viewer, or changes a member's role. Owner or admin. |
GET / | The open invites addressed to you. |
POST /, / | Joins the team with the invite's role, or declines. |
DELETE / | Withdraws an open invite. Owner or admin. |
DELETE / | Removes a member (owner or admin), or leaves (yourself). |
POST / | Moves units of your available balance into the team's. Owner or admin. |
POST / | Moves units of the team's available balance back to the owner. Owner. |
DELETE / | Deletes the team. Its available balance moves back to the owner first; then every team key stops working, and its members and open invites are removed. Refused while requests on its keys are in flight. Owner. |
POST / | Leaves the team. Any team keys you made stop working at once. Anyone but the owner. |
POST / | Creates a team key: label, budget_, rate_, project_. Owner or admin. |
DELETE / | Revokes a team key. The owner revokes any; an admin, any the owner did not create. |
Roles are owner, admin, member and viewer. The owner is the creator and cannot be removed or leave; the owner deletes the team instead. Membership is by invite: an account joins only when it accepts with its own session.
A viewer reads the team (its balance, members, keys, usage and projects) and changes nothing of it: no key, funding, member, invite, role or project. It holds no team key, so it spends nothing of the team's balance. A member set to viewer loses the team keys it made.
Your balance has two parts: USDF, which is money (backed 1:1, withdrawable, redeemable), and credits, which pay for compute. GET /v1/balance returns them separately, each credit grant with what is left of it and its expiry date.
- Credits are free compute in your Foundry account, spent before your USDF.
- Credits pay for models and Foundry's own tools. Marketplace services, agent payments and payment links are paid in USDF.
- Credits stay in the account they were granted to and are spent there.
- Credits last 60 days from the day they are granted, unless a grant says otherwise. Unused credit goes back to the pool.
Session and dashboard calls are limited per account. Signed in, each limit is listed here, read live from GET /v1/limits.