Developer tools

SDKs, MCP and CLI.

Use USDF from the client, framework, terminal or agent runtime you already use.

0.1.1SDK version@usdf/sdk
On this page

One package for TypeScript and one for Python. Each pays per request from a wallet, or charges a prepaid key. To write a single request by hand, use the request builder.

npm install @usdf/sdk viem
import { USDF } from "@usdf/sdk";
import { privateKeyToAccount } from "viem/accounts";
const wallet = privateKeyToAccount(process.env.PAYER_KEY as `0x${string}`);
const usdf = new USDF({ wallet }); // or new USDF({ apiKey: process.env.USDF_API_KEY })
const result = await usdf.run("<model>", "Hello");

npm: @usdf/sdk@0.1.1

The MCP server is stateless. Use the same USDF payment path or a prepaid key for list_models, quote, chat, balance and receipt.

Endpoint

POST https://api.usdf.fi/mcp

Client configuration

{
  "mcpServers": {
    "usdf": {
      "url": "https://api.usdf.fi/mcp"
    }
  }
}
ToolWhat it doesAccess

The SDK ships a command. Run it with npx, or install it globally as usdf.

CLI

npx @usdf/sdk balance
npx @usdf/sdk keys
npx @usdf/sdk run <model> "Hello" --cost
npx @usdf/sdk receipts

Any OpenAI SDK works by changing its base URL.

OpenAI client

curl
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"}]}'

TypeScript

const client = new OpenAI({
  baseURL: "https://api.usdf.fi/v1",
  apiKey: process.env.USDF_API_KEY
});
FileWhat it holds
https://api.usdf.fi/skill.mdThe agent skill: how to pay and call the API.
https://api.usdf.fi/llms.txtWhat USDF is and where every surface lives.
https://api.usdf.fi/v1/catalogThe signed model catalog (signer at /v1/catalog/signer).

Full reference: API reference.