Pay-per-call LLM API, no API key
LLM inference API: OpenAI-compatible chat completions for 140 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.
POST https://modelaccessgateway.com/v1/chat/completions (OpenAI format, model in body.model)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
- Claude Opus 5.5
/llm/claude-opus-5.5 - Claude Sonnet 5.5
/llm/claude-sonnet-5.5 - Claude Haiku 5.5
/llm/claude-haiku-5.5 - GPT-6 Astra
/llm/gpt-6-astra - GPT-6.1 Sol
/llm/gpt-6.1-sol - GPT-5.5
/llm/gpt-5.5 - GPT-6 Luna
/llm/gpt-6-luna - Gemini 4 Argon
/llm/gemini-4-argon - Gemini 3.1 Pro
/llm/gemini-3.1-pro - Gemini 3.8 Flash
/llm/gemini-3.8-flash - Grok 4.7
/llm/grok-4.7 - Kimi K3
/llm/kimi-k3 - GLM-5.3
/llm/glm-5.3 - DeepSeek V4 Pro
/llm/deepseek-v4-pro - DeepSeek V4.1 Flash
/llm/deepseek-v4.1-flash - DeepSeek Chat (V4.1 Flash)
/llm/deepseek-chat - Qwen3.8 Max
/llm/qwen3.8-max - MiniMax M3
/llm/minimax-m3 - Llama 3.3 70B
/llm/llama-3.3-70b - Mistral Large 4
/llm/mistral-large-4 - OpenAI GPT OSS 120B
/llm/gpt-oss-120b - Claude Opus 5
/llm/claude-opus-5 - Claude Sonnet 5
/llm/claude-sonnet-5 - Gemini 3.6 Flash
/llm/gemini-3.6-flash
How to call it
- POST your OpenAI-style request to
https://modelaccessgateway.com/v1/chat/completionswithout payment. The answer is HTTP 402 with aPAYMENT-REQUIREDheader: the exact price in USDC for that prompt andmax_tokens(x402 v2, schemeexact, Base mainnet). - Sign the payment with any x402 client (EIP-3009
transferWithAuthorization; the wallet needs USDC on Base, no ETH). - Send the same request again with the
PAYMENT-SIGNATUREheader. You get a standardchat.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}'
Use a prepaid key in your tools
Besides x402, the same models are sold with a prepaid key: buy credit with USDC on Base at /en/top-up (or with x402 at POST https://modelaccessgateway.com/v1/credits/topup?amount=5) and you get a key that starts with sk-mag-. Any OpenAI-compatible client works with base URL https://modelaccessgateway.com/v1 and that key; each answer carries the amount charged in the x-credit-charged-usdc header, and GET https://modelaccessgateway.com/v1/credits shows what is left. The price depends on the model, the prompt and max_tokens.
openclaw plugins install clawhub:openclaw-model-access --accept-capabilities openclaw onboard --auth-choice model-access-api-key # or: export MODELACCESS_API_KEY=sk-mag-... openclaw models set model-access/anthropic/claude-sonnet-5.5
opencode.json){
"$schema": "https://opencode.ai/config.json",
"provider": {
"modelaccess": {
"npm": "@ai-sdk/openai-compatible",
"name": "Model Access Gateway",
"options": { "baseURL": "https://modelaccessgateway.com/v1", "apiKey": "{env:MODELACCESS_API_KEY}" },
"models": {
"anthropic/claude-sonnet-5.5": { "name": "Claude Sonnet 5.5", "limit": { "context": 64000, "output": 8192 } },
"deepseek/deepseek-chat": { "name": "DeepSeek V4 Flash Chat", "limit": { "context": 64000, "output": 8192 } }
}
}
},
"model": "modelaccess/anthropic/claude-sonnet-5.5"
}~/.continue/config.yaml, IDE extension or cn CLI)name: Model Access Gateway
version: 1.0.0
schema: v1
models:
- name: Claude Sonnet 5.5
provider: openai
model: anthropic/claude-sonnet-5.5
apiBase: https://modelaccessgateway.com/v1
apiKey: ${{ secrets.MODELACCESS_API_KEY }}
roles: [chat, edit, apply]
defaultCompletionOptions:
maxTokens: 8192config.yaml; the SDK takes the same model, api_base and api_key)model_list:
- model_name: claude-sonnet-5.5
litellm_params:
model: openai/anthropic/claude-sonnet-5.5
api_base: https://modelaccessgateway.com/v1
api_key: os.environ/MODELACCESS_API_KEY
use_chat_completions_api: true
general_settings:
master_key: os.environ/LITELLM_MASTER_KEYuse_chat_completions_api: true turns its Responses calls into chat completions). In ~/.codex/config.toml:model_provider = "modelaccess" model = "claude-sonnet-5.5" [model_providers.modelaccess] name = "Model Access Gateway (via LiteLLM)" base_url = "http://127.0.0.1:4000/v1" env_key = "LITELLM_MASTER_KEY" wire_api = "responses"
https://modelaccessgateway.com/v1, API key sk-mag-..., model ids as in /v1/models (for example anthropic/claude-sonnet-5.5).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.