Responses nano (OpenAI Responses API)
POST /v1/nano/responsesOpenAI Responses API over x402 - point the OpenAI SDK's responses.create() (or the OpenAI Agents SDK) at base_url https://agent402.tools/v1/nano and pay $0.003 per call in USDC, no API key, no signup. Send POST /v1/nano/responses with the required field input and pay quoted per request from $0.003 over x402 or MPP (there is no free tier). It returns a JSON object with id, object, status, model, output and 1 more.
Same models, caps and price as this tier's /chat/completions route; any model here is served through the Responses wire. Up to 12,000 input chars and 768 output tokens; streaming supported; function tools and tool namespaces yes (a namespace is flattened into its functions; function_call items carry a namespace field on non-streamed output), server-side tools (web_search, file_search, computer, mcp) no; no stored conversation state (send the full input each call). Omit "model" and the tier serves openai/gpt-6-luna (named back in agent402_default_model); the price does not change.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
model | string | no | Model id (OpenRouter naming) - allowlisted per tier; omit (or "auto") on the auto tier |
input | any | yes | A string, or an array of input items ({role, content} messages with input_text / input_image parts, function_call, function_call_output) Also accepted as data, str, string, body, content. |
instructions | string | no | Optional system/developer instructions |
max_output_tokens | integer | no | Optional output cap (clamped to the tier cap) |
tools | array | no | Optional function tools ({type:"function", name, parameters}); server-side tools are not served |
text | object | no | Optional {format: {type: "text"|"json_schema"|"json_object", ...}} |
reasoning | object | no | Optional {effort: "none"|"minimal"|"low"|"medium"|"high"|"xhigh"|"max"} - reasoning tokens count against max_output_tokens. An effort above low, or a reasoning.max_tokens budget, that leaves no room for an answer inside a small max_output_tokens is lowered before the call, and an answer that still comes back empty is retried once on the same model at its lowest supported effort when the call's price and time allow; either change is named in agent402_reasoning_adjusted {field, requested, used, reason} (the X-Agent402-Reasoning-Adjusted header on a stream) |
stream | boolean | no | Responses SSE events (response.created … response.completed) |
zdr | boolean | no | Optional - zero-data-retention providers only |
Example request
curl -i -X POST https://agent402.tools/v1/nano/responses \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-5.6-luna","input":"Summarize x402 in one sentence.","max_output_tokens":128}'Without payment this returns HTTP 402 Payment Required with the exact price for v1-chat-nano-responses; any x402 v2 or MPP client pays it and retries.
Example response
{
"id": "resp_…",
"object": "response",
"status": "completed",
"model": "openai/gpt-6-luna",
"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
}
}| Field | Type | Always present | In the example |
|---|---|---|---|
id | string | yes | resp_… |
object | string | yes | response |
status | string | yes | completed |
model | string | yes | openai/gpt-6-luna |
output | array of objects | yes | 1 item in the example |
usage | object | yes | 3 fields: input_tokens, output_tokens, total_tokens |
From an MCP client
catalog.call {
"slug": "v1-chat-nano-responses",
"params": {
"model": "openai/gpt-5.6-luna",
"input": "Summarize x402 in one sentence.",
"max_output_tokens": 128
}
}The hosted connector at https://agent402.tools/mcp needs a payment for v1-chat-nano-responses; the stdio package pays it from a wallet or from an AGENT402_CREDITS_KEY issued earlier. Local install: npx -y agent402-mcp@0.13.32.
Errors and behavior
inputis required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement runs after the tool and only on a successful response. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool runs a model, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - Model-backed: the answer is generated by a model, so the same input can produce a different result.
- Priced per request: the 402 quotes this body, between $0.003 and $0.5.
- Flat per call for the models this tier serves. A body naming another flat tier's model (nano, base, pro, premium) is quoted at that tier's price in the 402 and served under that tier; model "auto" is quoted and served as the auto tier. The answer names the tier in agent402_tier. The live 402 is always the price.
- A
GETorHEADto /v1/nano/responses returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB and a streamed response are not replayed).
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();
client.setSpendControls?.({ maxAmountPerPayment: "$0.50" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/v1/nano/responses", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"model": "openai/gpt-5.6-luna",
"input": "Summarize x402 in one sentence.",
"max_output_tokens": 128
}),
});Related tools
Responses auto (OpenAI Responses API)
OpenAI Responses API over x402 - point the OpenAI SDK's responses.create() (or the OpenAI Agents SDK) at base_url.
Responses metered (OpenAI Responses API)
OpenAI Responses API priced per request from the request itself.
Responses premium (OpenAI Responses API)
OpenAI Responses API over x402 - point the OpenAI SDK's responses.create() (or the OpenAI Agents SDK) at base_url.
Responses pro (OpenAI Responses API)
OpenAI Responses API over x402 - point the OpenAI SDK's responses.create() (or the OpenAI Agents SDK) at base_url.
Responses base (OpenAI Responses API)
OpenAI Responses API over x402 - point the OpenAI SDK's responses.create() (or the OpenAI Agents SDK) at base_url.
Text-to-speech (OpenAI-compatible)
OpenAI-compatible text-to-speech over x402 - point any OpenAI SDK's audio.speech.create() at base_url.