# Pay for LLM API calls with USDC, without an account or an API key

Updated November 14, 2026

With **OpenCheap**, an AI agent pays for one LLM call in USDC on Base, with no account and no API key. It sends the request with no key, the API answers `402 Payment Required` with the price of that completion, the agent signs the payment from its wallet and repeats the request, and the answer comes back in the same response. This is the open x402 protocol, so any x402 client works, and every chat model in the catalog can be paid this way.

[Get API key](https://opencheap.si/start?onboarding=signin)

**0** accounts or API keys needed

**$0.001** smallest payment for one call

**Base** network, USDC, x402 v2

## How one call is paid

Three steps, in one request and its retry.

1. **Call with no key** Send the chat completion with no Authorization header. Every chat model works.
2. **Read the 402** The answer is `402` with a `PAYMENT-REQUIRED` header: scheme `exact`, network `eip155:8453` (Base), the USDC asset, the payee and the amount in 6-decimal units. `x-quote-model` and `x-quote-max-tokens` say what the amount covers.
3. **Sign and repeat** The agent signs an EIP-3009 authorization for that amount and repeats the request with `PAYMENT-SIGNATURE` (the older `X-PAYMENT` works too). The completion is in that response; the transfer settles in the background.

## An agent on Base, in TypeScript

@x402/fetch reads the 402, signs with the wallet you give it, and retries.

agent.ts

```
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

const wallet = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY);
const pay = wrapFetchWithPaymentFromConfig(fetch, { schemes: [{ network: "eip155:*", client: new ExactEvmScheme(wallet) }] });

// No Authorization header: the API answers 402 with the price, pay() signs and retries.
const res = await pay("https://api.opencheap.si/v1/chat/completions", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ model: "claude-sonnet-5", max_tokens: 400, messages: [{ role: "user", content: "Summarise this page" }] }),
});
console.log((await res.json()).choices[0].message.content);
```

the same exchange by hand

```
# 1. Ask with no key
curl -i https://api.opencheap.si/v1/chat/completions -H "Content-Type: application/json" \
  -d '{ "model": "kimi-k3", "max_tokens": 256, "messages": [{ "role": "user", "content": "Hello" }] }'

# HTTP/2 402
# payment-required: <base64 x402 v2 challenge: scheme exact, network eip155:8453,
#                    asset USDC, payTo, amount in 6-decimal units>
# x-quote-model: kimi-k3
# x-quote-max-tokens: 256

# 2. Sign an EIP-3009 USDC authorization for that amount, then repeat the same request
#    with the header PAYMENT-SIGNATURE: <signed payload>. The completion is in that response.
```

The catalog with every model's rate needs no key either: `GET https://app.opencheap.si/api/v1/models`. The full protocol, the quote rules and streaming are in the [x402 docs](https://docs.opencheap.si/x402).

## Three ways an agent can pay

|   | Needs | Best for |
| --- | --- | --- |
| Per call with x402 | A Base wallet with USDC. No account, no key. | An agent that calls now and then, or that should never hold credentials. |
| A balance it tops up itself | An API key, and USDC on Base for the top-up. | Many calls: one balance, usage history, and a spend limit on the key. |
| Signed in with its wallet | A wallet that signs a Sign-In with Ethereum message. No email, no password. | An agent that runs its own account, keys and budgets from code or MCP. |

## Questions, answered

### Can an AI agent pay for LLM tokens without an account or an API key?

Yes. On OpenCheap an agent calls https://api.opencheap.si/v1/chat/completions with no key, gets a 402 Payment Required with the USDC price of that one completion, signs the payment from its own wallet and repeats the request. The answer comes back in that response. This is the open x402 protocol, on Base.

### What does the agent need?

A wallet that can sign an EIP-3009 USDC authorization on Base (eip155:8453), such as a viem account, and an x402 client, such as @x402/fetch with ExactEvmScheme. The private key stays with the agent.

### How is the price of one call set?

Before the first byte, from the model's catalog rates, the prompt (about four characters per token) and the output cap: max_tokens, 512 when you set none and 4,096 at most. The quote is at least $0.001. The agent pays the quote, and the provider is held to that cap.

### Which models can it pay for?

Every chat model in the catalog, ranked the same way as a call with a key: the cheapest healthy provider for that prompt, then the next one if it fails before the first byte. Decision models need a key.

### Is the agent charged if the call fails?

A 404, or a 503 before any provider accepts the request, is not settled. The USDC transfer is submitted once a provider accepts, through the Coinbase facilitator.

### Does it stream?

Yes. "stream": true returns server-sent events, the same chunks as a call with a key. The amount is still fixed up front from the output cap.

### What if the agent makes many calls?

It can hold a balance instead: an agent with a key adds USDC on Base from its own wallet (a 5.5 % fee), then every call draws from that balance and can carry a spend limit. It can also sign in with its wallet to hold an account of its own.

## More guides

- [Cheapest LLM API (Live Prices, Updated Daily)](https://opencheap.si/guides/cheapest-llm-api): Live prices per 1M tokens for popular models, routed to the cheapest healthy provider. One OpenAI-compatible key. Pay as you go; no monthly fee.
- [A cheaper DeepSeek API, with official prices side by side](https://opencheap.si/guides/cheapest-deepseek-api): Official DeepSeek API prices next to live OpenCheap rates for V4.1 Flash, V4 Pro and other DeepSeek models. One OpenAI-compatible key. Prices move; the tables are dated.
- [An LLM router that sends each request to the cheapest provider](https://opencheap.si/guides/cheapest-llm-router): OpenCheap routes each request to the cheapest healthy provider of your model, fails over before the first byte, and bills that provider's price.
- [One API key for all AI models](https://opencheap.si/guides/openai-compatible-api): One OpenCheap key calls Anthropic, Google, OpenAI, DeepSeek, Moonshot, Qwen and more through the OpenAI SDK: change the base URL and the key.
- [Set a daily spend limit on each API key your agents use](https://opencheap.si/guides/llm-api-spend-limits): Give each OpenCheap key a daily, weekly, monthly or lifetime spend limit, so an agent left running overnight can't spend more than you allow.
- [Connect Cursor, LiteLLM or the OpenAI SDK with the base URL](https://opencheap.si/guides/cursor-litellm-openai-sdk): Connect Cursor, LiteLLM and the OpenAI SDK to OpenCheap with a base URL, a key and a model id. Steps, env variables, code and common errors.
- [OpenCheap vs OpenRouter for cheapest pricing and failover](https://opencheap.si/guides/opencheap-vs-openrouter): OpenCheap routes to the cheapest provider by default; OpenRouter balances price, speed and uptime. Compare live prices, failover and fees.
- [A cheap Claude API, with official prices side by side](https://opencheap.si/guides/cheapest-claude-api): Anthropic's list prices next to live OpenCheap rates for Claude. One OpenAI-compatible key. Prices move; both tables are dated.
- [GPT API pricing, and the cheapest way to call it](https://opencheap.si/guides/cheapest-gpt-api): GPT API pricing per 1M tokens: OpenAI's list rates for GPT-6, GPT-5 and GPT-4 models next to live OpenCheap prices, on one OpenAI-compatible key.
- [The cheapest way to use Gemini through an API](https://opencheap.si/guides/cheapest-gemini-api): Gemini chat models on OpenCheap, with today's price per million input and output tokens from the same book as the pricing page.
- [The cheapest Qwen API, with official prices side by side](https://opencheap.si/guides/cheapest-qwen-api): Qwen API pricing per 1M tokens: Alibaba Cloud's list rates next to live OpenCheap prices for Qwen4 Max, Qwen3 Coder and more. One OpenAI-compatible key.
- [The cheapest Llama API, priced live](https://opencheap.si/guides/cheapest-llama-api): Llama API pricing per 1M tokens for Llama 4 Maverick, Scout, 3.3 70B and 3.1 8B, at the cheapest healthy provider. One OpenAI-compatible key.
- [The cheapest Kimi API, with official prices side by side](https://opencheap.si/guides/cheapest-kimi-api): Kimi API pricing per 1M tokens: Moonshot's list rates next to live OpenCheap prices for Kimi K3.1 Pro, K3 and K2.6. One OpenAI-compatible key.
- [Run Claude Code for less](https://opencheap.si/guides/claude-code-cheaper): Point Claude Code at OpenCheap and pick a model per task: Claude at the provider's price, or open models for a fraction, on one key with a spend limit.

---

Source: https://opencheap.si/guides/pay-for-llm-api-with-usdc · All models: https://opencheap.si/models · Prices as JSON: https://api.opencheap.si/v1/prices · Index for agents: https://opencheap.si/llms.txt
