---
title: 'x402 API: Pay per Request for AI Models in USDC, No API Key | RunAPI'
description: Call image, video, music, and audio models on RunAPI with x402. Your agent pays each request in USDC on Base, with no signup, API key, or credits.
url: https://runapi.ai/x402.md
canonical: https://runapi.ai/x402
locale: en
updated: '2026-09-24'
date: '2026-09-24'
site: RunAPI
image: https://runapi.ai/assets/opengraph-bfaaa0f0.png
alternates:
  en: https://runapi.ai/x402
  zh-CN: https://runapi.ai/zh-CN/x402
  es: https://runapi.ai/es/x402
  ja: https://runapi.ai/ja/x402
  de: https://runapi.ai/de/x402
  fr: https://runapi.ai/fr/x402
  pt-BR: https://runapi.ai/pt-BR/x402
  ko: https://runapi.ai/ko/x402
  it: https://runapi.ai/it/x402
  nl: https://runapi.ai/nl/x402
  pl: https://runapi.ai/pl/x402
  tr: https://runapi.ai/tr/x402
  zh-TW: https://runapi.ai/zh-TW/x402
  zh-HK: https://runapi.ai/zh-HK/x402
  ar: https://runapi.ai/ar/x402
  x-default: https://runapi.ai/x402
---

> HTML version: https://runapi.ai/x402
> Site index for agents: https://runapi.ai/llms.txt

# x402 API for AI models: pay per request in USDC

RunAPI accepts x402 payments on its per-call endpoints. An agent sends a normal request, receives a 402 quote, signs it with its wallet, and gets the result. No account, no API key, no prepaid credits.

_Updated September 24, 2026 · 6 min read_


## Key takeaways

- Eligible per-call RunAPI endpoints, priced up to 10 USDC, answer an unauthenticated request with a standard x402 v2 quote.
- Payment settles in USDC on Base through the Coinbase CDP facilitator. The payer signs an EIP-3009 authorization and pays no gas.
- A paid request returns the normal response plus a read-only poll URL, so an agent can fetch the finished task without an account.

- **155** resources payable with x402
- **Base** settlement network
- **USDC** payment asset
- **0** API keys required


## Four steps from request to result

1. **Send the request without a key** POST the same JSON body you would send with an API key, but leave out the Authorization header.
2. **Read the 402 quote** RunAPI answers 402 with a PAYMENT-REQUIRED header that lists the exact amount, asset, network, and recipient. The quote is valid for 300 seconds.
3. **Sign and retry** Your x402 v2 client signs an EIP-3009 authorization with the agent wallet and replays the request with a PAYMENT-SIGNATURE header.
4. **Poll the task** RunAPI settles the payment, starts the task, and returns 200 with a PAYMENT-RESPONSE receipt and a poll_url for the result.

## What the exchange looks like

The first request carries no credentials. For a payable endpoint, RunAPI replies with a 402 and the payment requirements:

```shell
curl -i -X POST "https://runapi.ai/api/v1/z_image/text_to_image" \
  -H 'Content-Type: application/json' \
  --data @request.json

# HTTP/2 402
# PAYMENT-REQUIRED: <base64 JSON with accepts: scheme, network, asset, amount, payTo>
```

Hand the response to any x402 v2 client connected to the agent wallet. The client handles signing and the retry:

```text
request  = {method: "POST", url: task_url, json: payload}
response = x402_client.send(request, wallet: agent_wallet)
# The x402 v2 client reads PAYMENT-REQUIRED, signs an EIP-3009
# authorization, and replays the request with PAYMENT-SIGNATURE.
response.status                       # => 200
response.headers["PAYMENT-RESPONSE"]  # settlement receipt
response.json["poll_url"]             # read-only task result URL
```

## Example prices

The lowest per-call price for a few models that accept x402 today. Prices come from the live catalog, and every 402 quote states the exact amount for that request.

| Model | Endpoint | Price per call |
| --- | --- | ---: |
| Z Image Text to image (`z-image`) | `POST /api/v1/z_image/text_to_image` | $0.01 |
| Flux Text to image (`flux-2-klein`) | `POST /api/v1/flux/text_to_image` | $0.03 |
| Suno Stitch audio (`suno-v4`) | `POST /api/v1/suno/stitch_audio` | $0.01 |
| Suno Stitch audio (`suno-v4.5`) | `POST /api/v1/suno/stitch_audio` | $0.01 |
| Recraft Upscale image (`recraft-crisp-upscale`) | `POST /api/v1/recraft/upscale_image` | $0.01 |
| Recraft Remove background (`recraft-remove-background`) | `POST /api/v1/recraft/remove_background` | $0.01 |

## Payment details

RunAPI follows the x402 v2 exact scheme and only accepts the values below. Anything else is rejected before RunAPI asks the facilitator to settle.

- Network: Base mainnet (eip155:8453)
- Asset: USDC, contract 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, 6 decimals
- Facilitator: Coinbase CDP
- Authorization: EIP-3009, so the payer needs USDC but no ETH for gas
- Limit: up to 10 USDC per request; quotes expire after 300 seconds

## Getting the result

Most media tasks finish asynchronously. The 200 response includes a poll_url with a read-only task access token. The token opens that one task and nothing else, and it stays valid for 30 days after the task finishes.


## If a task fails

x402 has no built-in refunds. When a paid task ends in a failed state, RunAPI records a refund obligation for the full amount it received. An operator then sends that amount back to the paying wallet in a separate USDC transfer; the refund is not automatic.


## Which endpoints qualify

x402 works on REST endpoints with a fixed per-call price. Models billed by tokens, seconds, or characters, including the LLM endpoints, still need an API key and credits. The MCP server does not take x402 payments.


## API keys still work

x402 is an extra way to pay. Requests that send a valid API key keep using account credits exactly as before, and a request with an invalid key gets a 401 instead of a payment quote.



## x402 FAQ

### What is x402?

x402 is an open payment protocol built on the HTTP 402 Payment Required status code. A server replies 402 with payment requirements, the client pays with a signed stablecoin authorization, and the request is retried. It is maintained by the x402 Foundation.

### Do I need a RunAPI account to pay with x402?

No. The wallet that pays is the identity. RunAPI creates an internal wallet profile only after the first successful settlement and never asks for an email or API key.

### What does the x402 facilitator do?

The facilitator verifies the signed payment and submits the USDC transfer on Base. RunAPI uses the Coinbase CDP facilitator, so the payer does not need to pay gas.

### How much does a request cost?

Each endpoint has a fixed per-call price. The 402 quote shows the exact USDC amount before you sign, and the model catalog lists current prices.

### Can agents discover RunAPI through the x402 Bazaar?

Each 402 quote includes a Bazaar discovery declaration with the input schema and an example, so x402 clients and directories can list the endpoint.

### What happens if I pay and the request fails before a task starts?

A request that fails validation is rejected before payment is settled, so nothing is charged. Once payment settles, a task that later fails gets a full refund obligation.



## Related pages

- [What is HTTP 402?](https://runapi.ai/http-402.md) - The status code behind x402, and why APIs return it.
- [Model catalog](https://runapi.ai/models.md) - Every model and endpoint available on RunAPI.
- [Developer docs](https://runapi.ai/docs/guides) - Request formats, task polling, and error codes.
- [CLI](https://runapi.ai/cli.md) - Run models from a terminal or an agent shell.


Claude visitors: new accounts receive $1.00 in bonus API credit within 30 days. One per person; usage credits only.


## Let your agent pay for its own API calls

Browse the models, pick a per-call endpoint, and send your first request without a key.

- [Browse models](https://runapi.ai/models.md)
- [Read the docs](https://runapi.ai/docs/guides)



---

## More from RunAPI

- [Home](https://runapi.ai/.md)
### Product
- [Model Catalog](https://runapi.ai/models.md)
- [Pricing](https://runapi.ai/pricing.md)
- [Providers](https://runapi.ai/models#all-models)
### Developers
- [Documentation](https://runapi.ai/docs/guides)
- [SDKs](https://runapi.ai/sdk.md)
- [CLI](https://runapi.ai/cli.md)
- [MCP Server](https://runapi.ai/mcp.md)
### Guides
- [Claude Code vs Cursor](https://runapi.ai/claude-code-vs-cursor.md)
- [Cursor API Setup](https://runapi.ai/cursor-api-setup.md)
- [RunAPI vs OpenRouter](https://runapi.ai/openrouter-alternative.md)
- [x402 API](https://runapi.ai/x402.md)
### Company
- [Enterprise](https://runapi.ai/contact.md)
- [Contact](https://runapi.ai/contact.md)
### Legal
- [Terms](https://runapi.ai/terms.md)
- [Privacy](https://runapi.ai/privacy.md)
- [Site index for agents](https://runapi.ai/llms.txt)

Contact: contact@runapi.ai

## Structured data

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/icon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "Article",
    "headline": "x402 API: Pay per Request for AI Models in USDC, No API Key",
    "description": "Call image, video, music, and audio models on RunAPI with x402. Your agent pays each request in USDC on Base, with no signup, API key, or credits.",
    "datePublished": "2026-09-24",
    "dateModified": "2026-09-24",
    "author": {
      "@type": "Organization",
      "name": "RunAPI"
    },
    "publisher": {
      "@type": "Organization",
      "name": "RunAPI",
      "url": "https://runapi.ai/"
    },
    "mainEntityOfPage": "https://runapi.ai/x402"
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "HowTo",
    "name": "How to pay for a RunAPI request with x402",
    "description": "An agent pays for one RunAPI request with USDC on Base using the x402 v2 protocol.",
    "totalTime": "PT5M",
    "step": [
      {
        "@type": "HowToStep",
        "position": 1,
        "name": "Send the request without a key",
        "text": "POST the same JSON body you would send with an API key, but leave out the Authorization header.",
        "url": "https://runapi.ai/x402#four-step-getting-started-step-1"
      },
      {
        "@type": "HowToStep",
        "position": 2,
        "name": "Read the 402 quote",
        "text": "RunAPI answers 402 with a PAYMENT-REQUIRED header that lists the exact amount, asset, network, and recipient. The quote is valid for 300 seconds.",
        "url": "https://runapi.ai/x402#four-step-getting-started-step-2"
      },
      {
        "@type": "HowToStep",
        "position": 3,
        "name": "Sign and retry",
        "text": "Your x402 v2 client signs an EIP-3009 authorization with the agent wallet and replays the request with a PAYMENT-SIGNATURE header.",
        "url": "https://runapi.ai/x402#four-step-getting-started-step-3"
      },
      {
        "@type": "HowToStep",
        "position": 4,
        "name": "Poll the task",
        "text": "RunAPI settles the payment, starts the task, and returns 200 with a PAYMENT-RESPONSE receipt and a poll_url for the result.",
        "url": "https://runapi.ai/x402#four-step-getting-started-step-4"
      }
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "FAQPage",
    "mainEntity": [
      {
        "@type": "Question",
        "name": "What is x402?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "x402 is an open payment protocol built on the HTTP 402 Payment Required status code. A server replies 402 with payment requirements, the client pays with a signed stablecoin authorization, and the request is retried. It is maintained by the x402 Foundation."
        }
      },
      {
        "@type": "Question",
        "name": "Do I need a RunAPI account to pay with x402?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "No. The wallet that pays is the identity. RunAPI creates an internal wallet profile only after the first successful settlement and never asks for an email or API key."
        }
      },
      {
        "@type": "Question",
        "name": "What does the x402 facilitator do?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "The facilitator verifies the signed payment and submits the USDC transfer on Base. RunAPI uses the Coinbase CDP facilitator, so the payer does not need to pay gas."
        }
      },
      {
        "@type": "Question",
        "name": "How much does a request cost?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Each endpoint has a fixed per-call price. The 402 quote shows the exact USDC amount before you sign, and the model catalog lists current prices."
        }
      },
      {
        "@type": "Question",
        "name": "Can agents discover RunAPI through the x402 Bazaar?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Each 402 quote includes a Bazaar discovery declaration with the input schema and an example, so x402 clients and directories can list the endpoint."
        }
      },
      {
        "@type": "Question",
        "name": "What happens if I pay and the request fails before a task starts?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "A request that fails validation is rejected before payment is settled, so nothing is charged. Once payment settles, a task that later fails gets a full refund obligation."
        }
      }
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "BreadcrumbList",
    "itemListElement": [
      {
        "@type": "ListItem",
        "position": 1,
        "name": "Home",
        "item": "https://runapi.ai/"
      },
      {
        "@type": "ListItem",
        "position": 2,
        "name": "x402 API",
        "item": "https://runapi.ai/x402"
      }
    ]
  }
]
```
