Foundry: prepaid AI compute in USDF

fi.usdfPublished by usdf.fiOfficial publisherv1.0.0Updated Oct 26, 2026

Prepaid AI compute in USDF: models, quotes and chat with a receipt; pay per call (x402) or by key

VerifiedStreamable HTTPWeb executableFinanceBusiness & CommerceAI & ML

Overview

AI-generated overview

Gateway for prepaid AI compute in USDF: list models and tools, get price quotes, run chat completions and paid API calls, and read balances and receipts.

What you can do
  • List served models with prices, context windows and availability, and list callable tools with their prices and inputs
  • Get cost estimates for a chat request or a tool call before running it
  • Run chat completions and return the text with a receipt of tokens, price, cost and balance
  • Search a market of per-call agents and APIs, and call a listing by its id within a price cap
  • Pay x402-protected URLs on your behalf and charge the cost to your key
  • Check spendable balance and budget, and fetch receipts for past requests
When to use it
Use it when you want an assistant to call hosted language models or third-party paid APIs from a single prepaid USDF balance, with per-request price quotes and receipts. Useful when cost visibility and pay-per-call billing matter more than streaming or long-running responses.
Requirements
Remote endpoint at api.usdf.fi over streamable HTTP; no local package. An API key sent as an Authorization bearer header is needed for key-based chat, tool calls, market calls and balance reads. Without a key, chat is paid per call via x402 and balance can be read from a wallet address. Network access required.
Before you install
Every chat, tool and market call spends real prepaid funds from the account tied to the key; x402 payments add a fee of up to 5 percent. Quotes are estimates, not ceilings, and completed requests are billed on reported usage. The Authorization header carries a spend-capable API key, so treat it as a secret. Calls write to the account balance and settlement records.

Installation

In SourceWeft

  1. Open Foundry: prepaid AI compute in USDF in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/fi.usdf%2Fgateway/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "mcpServers": {
    "foundry-prepaid-ai-compute-in-usdf": {
      "type": "http",
      "url": "https://api.usdf.fi/mcp"
    }
  }
}

Tools

10

list_models

List models

Models the gateway serves with their prices (USD per 1M tokens, the same figure in USDF), context window, output limits and whether a route is available right now. No key needed.

Takes no parameters.

quote

Quote a request

The hold the chat tool places before running a request, in USDF and USD (output capped at 4096 tokens). It is an estimate, not a ceiling: a completed request is billed the provider's reported usage, normally less. Pass prompt or messages. No key needed; a request for attested hardware (a :private model id or provider.private), and any request from a Private-tier key, is quoted on its attested routes, at the model's price.

Parametersmodelrequiredpromptmessagesprovidermax_tokens

list_tools

List tools

Tools you can call through POST /v1/tools/{id}, paid from the same balance and key as chat, each with its price in USDF (what it costs plus 5% at most) and the input it takes, ordered by title. Every tool listed can be called now. q keeps the tools whose id, title or description has those words; a page holds up to 200, and page.next names the next one. No key needed.

Parametersqcursor

quote_tool

Quote a tool call

What a call to a tool would hold for this input before it runs (its most it can cost), in USDF and USD, with the tool's price. It checks the input as the call would, and runs and holds nothing. No key needed.

Parameterstoolrequiredinput

x402_pay

Pay an x402 URL

Calls a URL that asks for an x402 payment and pays it for you: the gateway pays the seller in USDC from its own float and charges this key in USDF cost plus 5% at most, no minimum (the seller's amount and a fee of at most 5% of it; never free credit), within the key's and its agent's limits. Needs an API key. Returns the seller's answer with the payment and its receipt; a payment is charged only once the chain shows it, and one that never settles costs nothing. quote: true answers what it would cost and pays nothing. Third-party tools to call this way are listed under marketplace in list_tools (GET /v1/tools?source=marketplace).

Parametersurlrequiredbodyquotemethodheadersnetworkmax_price

agents_market_call

Call a listing

Calls a listing of the agents market by its id (svc_..., from agents_market_search), paid from this key's USDF balance (never free credit) within the key's and its agent's limits and at most max_price: what one call costs and nothing on top; a call its seller does not answer 2xx costs nothing, or no more than what its seller kept of it. Every listing is called the same way, and answers 503 market_calls_unarmed while calls to the market are not switched on. Needs an API key. Returns the seller's answer and the receipt. The input goes to the seller, whose own policy governs what it keeps.

Parametersidrequiredinputmax_pricerequired

chat

Chat completion

Runs a chat completion and returns the text with its receipt (tokens, price, cost, balance, settlement). With an API key it spends from that key's balance, holding the most the request can cost first. Not streamed. Output is capped at 4096 tokens. A call without a progress token answers within 55 s of arriving. With a progress token, progress is sent every 15 s and the call may run 10 minutes, so the client must reset its timeout on progress (resetTimeoutOnProgress: true in the TypeScript SDK) or wait that long. At its deadline, or when the client's connection closes, a call is cut: the text produced so far is returned with finish_reason "length" and billed on the provider's usage report where the provider gives one, otherwise on an estimate never above max_tokens; for a model whose reasoning is not streamed, at the held output budget. Cancellation messages are not supported: a call the client stops waiting for without disconnecting runs to completion or its deadline and is billed. With no key, the call is paid with x402 in USDF (signature transfer) or USDG (signed transfer), as POST /x402/v1/chat/completions: without a payment it returns isError with the payment requirements (x402Version, resource, accepts) as structuredContent; sign one accept and call again with the payment in _meta["x402/payment"], the payment argument or the PAYMENT-SIGNATURE header. The quote is the call's maximum cost at the published price (prompt at one token per byte, output at max_tokens, capped as above, no minimum), paid up front; the call is charged what it uses at that price and the rest is refunded in the asset paid, the gateway paying the gas. A paid call runs to its end or its deadline whether or not the client waits and returns the receipt and _meta["x402/payment-response"]; at the deadline the text so far is returned with finish_reason "length" and a note, charged what it used and the rest refunded. A call no provider accepted before its deadline, or whose provider failed or ende

Parametersmodelrequiredpaymentmessagesrequiredmax_tokenstemperature

balance

Balance

With an API key: what the key can spend now, the account's balance and the amount held for requests running, and what is left of the key's budget, in USDF. With address instead, and no key: that wallet's USDF and USDG on the chain now, and how much USDF it lets the signature-transfer contract spend, which x402 payments come from.

Parametersaddress

receipt

Receipt

With the API key that made the request: its receipt, with the usage, the price sheet version, the cost and, once settled, the settlement, its transaction and the rows behind the onchain digest. With no key: the public receipt of any request id, x402 ones included, with its line in the usage log, the payment, the settlement and where its proof is (GET /x402/v1/receipts/{id}).

Parametersrequest_idrequired

Version history

1
  1. v1.0.0LatestOct 16, 2026

Score

83% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts

    Declare a GitHub repository with a README, or serve resource_documentation in the OAuth protected-resource metadata.

  • LicenseNot applicable

    A hosted service is used under its provider's terms, so no license is expected here. This check is left out of the percentage.