Pay-per-call LLM API, no API key

LLM inference API: OpenAI-compatible chat completions for 136 AI models (Claude, GPT, Gemini, Grok, DeepSeek, Qwen, Kimi, GLM), paid per call in USDC on Base with x402. No account, no API key, automatic refund if the model fails.

Endpoint: POST https://modelaccessgateway.com/v1/chat/completions (OpenAI format, model in body.model)
Models: 136, live list at /v1/models; one short route per model, for example /llm/claude-opus-5.5
Payment: x402 v2 on Base (USDC), one payment per request, from $0.0010; the exact price is in the 402 quote before you pay
Compatible: streaming (SSE), function calling, response_format, temperature, stop; max_tokens optional
Refunds: automatic, onchain, if the model fails to answer

When to use it

For AI agents, scripts and apps that need LLM inference on demand and can pay from a wallet: no sign-up, no monthly plan, no key to store. Each call is quoted and paid on its own.

Popular models

All models · Reference prices

How to call it

  1. POST your OpenAI-style request to https://modelaccessgateway.com/v1/chat/completions without payment. The answer is HTTP 402 with a PAYMENT-REQUIRED header: the exact price in USDC for that prompt and max_tokens (x402 v2, scheme exact, Base mainnet).
  2. Sign the payment with any x402 client (EIP-3009 transferWithAuthorization; the wallet needs USDC on Base, no ETH).
  3. Send the same request again with the PAYMENT-SIGNATURE header. You get a standard chat.completion (or server-sent events with "stream": true). If the model fails to answer, the payment is refunded automatically.
// npm i @x402/core @x402/evm @x402/fetch viem
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.WALLET_KEY), networks: ["eip155:8453"] });
const pay = wrapFetchWithPayment(fetch, client);
const r = await pay("https://modelaccessgateway.com/v1/chat/completions", { method: "POST", headers: { "content-type": "application/json" },
  body: JSON.stringify({ messages: [{ role: "user", content: "Hello" }], max_tokens: 256 }) });
console.log((await r.json()).choices[0].message.content);

Quote only (free): curl -i -X POST https://modelaccessgateway.com/v1/chat/completions -H 'content-type: application/json' -d '{"messages":[{"role":"user","content":"Hello"}],"max_tokens":256}'

Machine-readable

OpenAPI 3.1 · llms.txt · x402 manifest · pricing.json · Terms of use

The gateway is independent and not affiliated with any model provider; model names only identify the model that answers.