USDF Links API

USDF sent by link: claimable by the first signed-in account to present it, or by the X account it is sent to.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 9

GET /v1/links/wallet Links as wallets: settings #
POST /v1/links/wallet Record a link #
POST /v1/links/wallet/view A link #
POST /v1/links/wallet/rpc Move a link's USDF, gas-free #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/usdf-fi:usdf-fi-links-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

usdf-fi-links-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Foundry Links API
  version: v1
  description: 'One API for every listed model, priced and settled in USDF: 1 USDF = $1 of compute, redeemable 1:1 for USDG. Pay with an API key (Authorization: Bearer sk_..., or x-api-key on the Messages API), or per request with no account under /x402 (x402, or MPP). The account''s keys, withdrawals, settings and wallet take a signed-in session. With a key, a request places a hold for its most possible cost and is charged the provider''s reported usage at the published price (GET /v1/pricing); over x402 it pays that most possible cost, its quote, up front, is charged its usage at the same price and gets the rest back. Every answer carries its receipt, and every request is a leaf in the public usage log (GET /v1/log/proof/{request_id}). Amounts are USDF base units as decimal strings (1 unit = 0.000001 USDF). Errors are {error: {message, type, code}}, except on the Messages API, which answers in its own envelope. Rate limits: GET /v1/limits.'
servers:
- url: https://api.usdf.fi
tags:
- name: Links
  description: 'USDF sent by link: claimable by the first signed-in account to present it, or by the X account it is sent to.'
paths:
  /v1/links:
    get:
      operationId: listLinks
      tags:
      - Links
      summary: Your links
      description: The links the account sent, with a session or one of the account's own keys.
      security:
      - apiKey: []
      - session: []
      responses:
        '200':
          description: The links.
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        default:
          $ref: '#/components/responses/Error'
    post:
      operationId: createLink
      tags:
      - Links
      summary: Send USDF by link
      description: 'Sets an amount aside from the balance behind a claim token, shown once in this answer. The first signed-in account to present it is credited; it can be cancelled while unclaimed and returns at its expiry. With to_x_handle the link is for the X account X names for that handle as the link is made, and only a session signed in with that X account claims it, whatever the handle is called by then. X is asked only once the balance covers the link (402 otherwise). Without X''s answer nothing is held: 400 x_handle_not_found when X has no account with the handle; 503 x_sends_unavailable when sends to an X handle are off on this gateway or X did not answer (retry after Retry-After, or send a plain link).'
      security:
      - session: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                units:
                  anyOf:
                  - type: string
                    pattern: ^[0-9]+$
                  - type: integer
                    minimum: 0
                  description: 'How much. In USDF base units (1 unit = 0.000001 USDF): a whole number, or a decimal string for values above 2^53.'
                memo:
                  type: string
                expires_in_days:
                  type: integer
                to_x_handle:
                  type: string
                  description: 'An X handle, with or without the @: the link is for the X account behind it now.'
                  pattern: ^@?[A-Za-z0-9_]{1,15}$
              required:
              - units
      responses:
        '201':
          description: The link and its token.
          content:
            application/json:
              schema:
                type: object
                properties:
                  link:
                    type: object
                    description: The link.
                  token:
                    type: string
                  claim_path:
                    type: string
                  claim_url:
                    anyOf:
                    - type: string
                    - type: 'null'
                  to_x:
                    type: object
                    description: 'For a link to an X handle: the X account it is for, as X named it.'
                    properties:
                      handle:
                        type: string
                      name:
                        anyOf:
                        - type: string
                        - type: 'null'
                      avatar_url:
                        anyOf:
                        - type: string
                        - type: 'null'
                    required:
                    - handle
                    - name
                    - avatar_url
                required:
                - link
                - token
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientBalance'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '503':
          $ref: '#/components/responses/Unavailable'
        default:
          $ref: '#/components/responses/Error'
  /v1/links/{token}:
    get:
      operationId: getLink
      tags:
      - Links
      summary: A link
      description: The amount, memo and status; never the sender.
      security: []
      parameters:
      - name: token
        in: path
        required: true
        description: The link's claim token.
        schema:
          type: string
          pattern: ^[A-Za-z0-9_-]{32,64}$
        example: q8Zp3VnR1xT6wYb9KdMf2hLs7cJg4aNe0uQiOtXyB5r
      responses:
        '200':
          description: The link.
          content:
            application/json:
              schema:
                type: object
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/Error'
  /v1/links/{token}/claim:
    post:
      operationId: claimLink
      tags:
      - Links
      summary: Claim a link
      description: 'Credits the link to the signed-in account. A link to an X handle is claimed only by a session signed in with the X account it was sent to (by its X user id, whatever its handle is now): send the sign-in''s identity token. 403 x_not_linked: no X account is linked; x_identity_mismatch: another X account.'
      security:
      - session: []
      parameters:
      - name: token
        in: path
        required: true
        description: The link's claim token.
        schema:
          type: string
          pattern: ^[A-Za-z0-9_-]{32,64}$
        example: q8Zp3VnR1xT6wYb9KdMf2hLs7cJg4aNe0uQiOtXyB5r
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                identity_token:
                  type: string
                  description: The sign-in's identity token, for a link to an X handle.
      responses:
        '200':
          description: Claimed.
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '410':
          $ref: '#/components/responses/Gone'
        '503':
          $ref: '#/components/responses/Unavailable'
        default:
          $ref: '#/components/responses/Error'
  /v1/links/wallet:
    get:
      operationId: getLinkWalletSettings
      tags:
      - Links
      summary: 'Links as wallets: settings'
      description: Whether links are on, the chain, the token, the Kernel and EntryPoint a link's gas-free transfer uses, the minimum, and the gas-free transfers a link has a day.
      security: []
      responses:
        '200':
          description: The settings.
          content:
            application/json:
              schema:
                type: object
        '404':
          $ref: '#/components/responses/NotFound'
        default:
          $ref: '#/components/responses/Error'
    post:
      operationId: recordLinkWallet
      tags:
      - Links
      summary: Record a link
      description: 'Without a hash: the link saved before any money moves (unfunded), so a save that fails stops the send with nothing sent. With tx_hash or user_op_hash, after the sender''s own wallet funded the link''s address: the gateway reads the transaction on chain (USDF to the address, from one of the account''s own wallets, at least 0.01 USDF) and keeps the address, the sender''s number for it, the amount and the memo; never the link''s key. A repeat answers the same link.'
      security:
      - session: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                address:
                  type: string
                  description: The link's address.
                index:
                  type: string
                  description: The sender's number for the link.
                tx_hash:
                  type: string
                  description: The funding transaction (or user_op_hash).
                user_op_hash:
                  type: string
                  description: The funding op (or tx_hash).
                memo:
                  type: string
                  description: Up to 140 characters.
              required:
              - address
              - index
      responses:
        '200':
          description: Recorded before.
          content:
            application/json:
              schema:
                type: object
        '201':
          description: Recorded.
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
        '451':
          $ref: '#/components/responses/UnavailableForLegalReasons'
        '503':
          $ref: '#/components/responses/Unavailable'
        default:
          $ref: '#/components/responses/Error'
  /v1/links/wallet/view:
    post:
      operationId: viewLinkWallet
      tags:
      - Links
      summary: A link
      description: The amount sent, the balance now, the memo and the status, for whoever proves they hold the link's key (its signature of `Foundry link view`); never the sender. A wrong proof answers as no link.
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                address:
                  type: string
                  description: The link's address.
                proof:
                  type: string
                  description: The link key's signature.
              required:
              - address
              - proof
      responses:
        '200':
          description: The link.
          content:
            application/json:
              schema:
                type: object
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/Error'
  /v1/links/wallet/rpc:
    post:
      operationId: linkWalletRpc
      tags:
      - Links
      summary: Move a link's USDF, gas-free
      description: 'JSON-RPC, as POST /v1/gas/rpc, for one op of the link''s own wallet: its whole USDF balance to the recipient its key named (`link`: the address, the recipient and the key''s signature of `Foundry link pays `). No sign-in. Refusals answer a JSON-RPC error whose data.reason says why.'
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  description: '2.0'
                id:
                  type: string
                  description: The request's id.
                method:
                  type: string
                  description: The method.
                link:
                  type: object
              required:
              - method
      responses:
        '200':
          description: The gas service's answer, or a JSON-RPC error.
          content:
            application/json:
              schema:
                type: object
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        default:
          $ref: '#/components/responses/Error'
  /v1/links/{id}/cancel:
    post:
      operationId: cancelLink
      tags:
      - Links
      summary: Cancel a link
      description: The sender takes back an unclaimed link.
      security:
      - session: []
      parameters:
      - name: id
        in: path
        required: true
        description: The link's id.
        schema:
          type: string
        example: 0d6c1f3e-8b2a-4c5d-9e7f-1a2b3c4d5e6f
      responses:
        '200':
          description: Cancelled.
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        default:
          $ref: '#/components/responses/Error'
components:
  headers:
    x-ratelimit-reset:
      description: 'On a 429: when a request is let through again, in milliseconds since the epoch.'
      schema:
        type: string
    x-request-id:
      description: The request's id (its receipt's request_id). Every error answer, 4xx and 5xx, carries one too.
      schema:
        type: string
    x-ratelimit-remaining:
      description: 'On a 429: what is left of it (0).'
      schema:
        type: string
    retry-after:
      description: Seconds to wait before retrying.
      schema:
        type: string
    x-ratelimit-limit:
      description: 'On a 429: the refusing limit, in requests per its window (0 where the refusal is not a count of requests).'
      schema:
        type: string
  schemas:
    Error:
      type: object
      description: The error envelope of every endpoint but the Messages API. Some errors carry more fields beside `error` (a 402 from an x402 path carries the quote).
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: What went wrong, in words.
            type:
              type: string
              description: 'The class of the error: invalid_request_error, authentication_error, insufficient_quota, permission_error, rate_limit_error, payment_required, upstream_error, service_unavailable, server_error.'
            code:
              anyOf:
              - type: string
              - type: integer
              - type: 'null'
              description: 'A stable code for the error, or null. In the router API''s envelope (where it is on: an API key on the router API''s paths, outside the site): the HTTP status as an integer, the stable code then in metadata.error_code.'
            param:
              anyOf:
              - type: string
                description: The request field at fault, where the error names one.
              - type: 'null'
            metadata:
              type: object
              description: Present on a 429, on a budget's refusal and on every error in the router API's envelope.
              properties:
                error_type:
                  type: string
                  description: rate_limit_exceeded on every 429; in the router API's envelope, its category of every error (invalid_request, authentication, payment_required, permission_denied, not_found, rate_limit_exceeded, provider_unavailable, timeout, server and the others it lists).
                error_code:
                  anyOf:
                  - type: string
                    description: 'In the router API''s envelope: the stable code (what code is in the other envelope).'
                  - type: 'null'
                scope:
                  type: string
                  description: 'In the router API''s envelope, on a budget''s refusal: key_limit.'
                provider_code:
                  type: string
                  description: 'In the router API''s envelope, on a stream''s failure: the provider''s own status, where it gave one.'
                limit_source:
                  type: string
                  description: 'On a budget''s refusal (402): key_limit for the key''s budgets, key_spend_limit for its trailing caps.'
                reset_interval:
                  anyOf:
                  - type: string
                    description: 'The interval a budget starts again on, at 00:00 UTC: a day, a week from Monday or a month; null for a lifetime budget or a trailing cap.'
                  - type: 'null'
                resets_at:
                  type: string
                  description: When the budget starts again (ISO 8601).
                window:
                  type: string
                  description: 'A trailing cap''s span: 1h, 24h or 30d.'
          required:
          - message
          - type
      required:
      - error
  responses:
    InsufficientBalance:
      description: The balance, the key's budget or a paused key cannot cover the request's hold, or the request is above its own price ceiling (price_ceiling_exceeded); nothing was charged.
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: 'No credentials, or credentials that are unknown, revoked, past their expiry (key_expired) or signed out. error.code says which: missing_api_key (a read that takes an API key or a signed-in session was sent neither), invalid_api_key (a route that takes an API key was sent none, or one the ledger rejects; on a read that takes an API key or a signed-in session, a credential that is neither), unauthenticated (a route that takes a signed-in session was sent none, or one that expired).'
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: No such object for these credentials, or a model that is not listed.
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Gone:
      description: The object existed and is no longer served.
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Over a rate limit; retry after the number of seconds in retry-after (GET /v1/limits lists every limit).
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        retry-after:
          $ref: '#/components/headers/retry-after'
        x-ratelimit-limit:
          $ref: '#/components/headers/x-ratelimit-limit'
        x-ratelimit-remaining:
          $ref: '#/components/headers/x-ratelimit-remaining'
        x-ratelimit-reset:
          $ref: '#/components/headers/x-ratelimit-reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: The request is malformed or asks for something this endpoint refuses; nothing was charged.
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error:
      description: An error.
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: 'The request conflicts with the object''s state (already used, already linked, closed, refused by the ledger), or a request that demands zero data retention itself (provider.zdr true) for a model, or a batch job, whose every route keeps request data (retention_required: send it without the demand, or pick a model with a zero-retention route), or one from an account whose settings deny data collection for a model marked may_train (data_collection_denied: the account''s data_collection allow serves it); nothing was charged.'
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnavailableForLegalReasons:
      description: 'Foundry is not offered in the caller''s country or region (region_blocked; GET /v1/regions lists them). Every request from there is refused before anything is held or charged; the body''s error.terms links the terms. From a restricted country (region_restricted: the United Kingdom) the public reads are served, and every request that signs up or in, uses a key or a session, or pays is refused the same way.'
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: 'The credentials are valid but may not do this (a key where a session is required, a key''s model list, a key used from an address off its IP allowlist: ip_not_allowed, another account''s object). A money or credential action with a session whose sign-in is older than its window is reauth_required (max_age_seconds: 300 for money leaving the account, 900 for keys, the wallet and the like): confirm it''s you (GET /v1/session/confirm) or sign in again, and send it once more. recent_link_hold: a sign-in method was added in the last 24 hours, so money and keys leave the account only from lifts_at, or now once this session confirms with a method it had before. API keys are never asked.'
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unavailable:
      description: 'The feature or a dependency is unavailable on this gateway right now, or none of a model''s zero-retention routes can take the request now while it has one (zero_retention_unavailable: a request for such a model is served on those alone); retry after retry-after where it is sent.'
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        retry-after:
          $ref: '#/components/headers/retry-after'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: sk_...
      description: 'An API key, as Authorization: Bearer sk_.... A key spends from the balance of the account it was made under (or its own budget), within its limits. Create keys with POST /v1/account/keys under a signed-in session.'
    messagesApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: 'The same API key in the x-api-key header, as the Messages API''s clients send it. Authorization: Bearer sk_... is accepted on the Messages API as well.'
    session:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'A signed-in session: the access token from signing in at usdf.fi, as Authorization: Bearer <token>. GET /v1/auth names the issuer, the app id and the key set it is checked against; POST /v1/session links a sign-in to its account. The account''s keys, withdrawals, settings and wallet, and sending, claiming or cancelling a link, take a session, not an API key.'
    x402:
      type: apiKey
      in: header
      name: payment-signature
      description: 'Pay per request with x402, no account. A request without payment is answered 402 with the payment requirements (the payment-required header, and in the body as `x402`) and the quote: the most the request can cost. Pay in USDF (a signature transfer, after a one-time approval of USDF to the signature-transfer contract) or USDG (a signed transferWithAuthorization), and send the same request again with the signed payment in payment-signature. The payment is the quote. A model request whose bound is below the minimum charge (the gas of returning a payment at the chain''s gas price now, with a margin, rounded up) is quoted that minimum instead (the quote''s minimum_charge, with floored true) and charged it whole. The paid answer carries payment-response; a request quoted above the minimum is charged what it used at that price, never more than the payment, the rest refunded in the asset paid (the receipt''s paid and refund) unless it is smaller than the gas of returning it, which is kept. A request that fails once paid is refunded in full, in the asset paid. Apart from the minimum charge, a request is charged at most its list price, never below cost. Every model is priced at or below its list price.'
    mpp:
      type: http
      scheme: Payment
      description: 'The same payment as an MPP credential: where MPP is on (GET /v1/reserve lists it per chain), a 402 from an x402 path also carries Payment challenges in WWW-Authenticate (method evm, intent charge, in USDG by a signed transfer authorization or USDF by signature transfer); the retry carries Authorization: Payment <credential>. A paid answer carries Payment-Receipt.'
    nodeCredential:
      type: http
      scheme: bearer
      bearerFormat: nk_...
      description: 'A node credential, as Authorization: Bearer nk_...: what a machine receives once its owner approves it (POST /v1/network/device, then POST /v1/network/device/token). It registers and runs that one node, with the payout address and terms its owner approved, and reads that node''s own figures and earnings; it claims nothing, spends nothing and is taken nowhere else. Removing the node revokes it.'
    videoReadToken:
      type: http
      scheme: bearer
      bearerFormat: vtk_...
      description: 'The read token of a video job paid with x402, from its 202 answer, as Authorization: Bearer vtk_.... It is shown only once, and the job cannot be read without it.'