Responses premium (OpenAI Responses API)
POST /v1/premium/responsesOpenAI Responses API over x402 - point the OpenAI SDK's responses.create() (or the OpenAI Agents SDK) at base_url https://agent402.tools/v1/premium and pay $0.50 per call in USDC, no API key, no signup. Same models, caps and price as this tier's /chat/completions route; any model here is served through the Responses wire. Up to 200,000 input chars and 8192 output tokens; streaming supported; function tools yes, server-side tools (web_search, file_search, computer, mcp) no; no stored conversation state (send the full input each call).
Input
| Field | Type | Description |
|---|---|---|
model | string | Model id (OpenRouter naming) - allowlisted per tier; omit (or "auto") on the auto tier |
input * | any | A string, or an array of input items ({role, content} messages with input_text / input_image parts, function_call, function_call_output) |
instructions | string | Optional system/developer instructions |
max_output_tokens | integer | Optional output cap (clamped to the tier cap) |
tools | array | Optional function tools ({type:"function", name, parameters}); server-side tools are not served |
text | object | Optional {format: {type: "text"|"json_schema"|"json_object", ...}} |
reasoning | object | Optional {effort: "none"|"minimal"|"low"|"medium"|"high"|"xhigh"|"max"} - reasoning tokens count against max_output_tokens |
stream | boolean | Responses SSE events (response.created … response.completed) |
zdr | boolean | Optional - zero-data-retention providers only |
Example output
{
"id": "resp_…",
"object": "response",
"status": "completed",
"model": "openai/gpt-4o-mini",
"output": [
{
"id": "msg_…",
"type": "message",
"role": "assistant",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "x402 is an HTTP-native way for agents to pay per request with USDC.",
"annotations": []
}
]
}
],
"usage": {
"input_tokens": 14,
"output_tokens": 18,
"total_tokens": 32
}
}
Try it - see the 402 challenge (free)
curl -i -X POST https://agent402.tools/v1/premium/responses \
-H "Content-Type: application/json" \
-d '{"model":"anthropic/claude-opus-5","input":"Summarize x402 in one sentence.","max_output_tokens":128}'
The response is HTTP 402 Payment Required with exact payment requirements. Any x402 v2 client pays automatically and retries:
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/v1/premium/responses", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"model": "anthropic/claude-opus-5",
"input": "Summarize x402 in one sentence.",
"max_output_tokens": 128
}),
});
Related tools
Chat completions - nano tier
POST /v1/nano/chat/completionsOpenAI-compatible chat completions, nano tier: gpt-4.1-nano, gpt-5-nano, gemini flash-lite, small llama/ministral/qwen, …
try in playground →Chat completions - auto tier (eval-ranked routing)
POST /v1/auto/chat/completionsOpenAI-compatible chat completions with server-side model choice: omit "model" (or send "auto") and the gateway routes t…
try in playground →Grounded chat (web search, OpenAI-compatible)
POST /v1/grounded/chat/completionsOpenAI-compatible chat completions GROUNDED in a live web search on every call: the gateway runs an Exa search (up to 5 …
try in playground →