{"uid":"cap_aePb-TejSxTuqjPzOW9h4","slug":"agent402-metered-openai-responses-api-517de159","name":"Agent402 Metered OpenAI Responses API","description":"OpenAI Responses API billed per request from what the call costs: the 402 quotes exact-BPE input (instructions + input items + tools) plus your max_output_tokens at the model's list price, times 1.15, never under $0.001; an upto (Permit2) or credits buyer settles actual usage under that quote. Point the OpenAI SDK's responses.create(), the OpenAI Agents SDK, or OpenAI Codex CLI's model_providers base_url at https://agent402.tools/v1/metered.","url":"https://agent402.tools/v1/metered/responses","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"zdr":{"type":"boolean","description":"Optional - zero-data-retention providers only"},"text":{"type":"object","description":"Optional {format: {type: \"text\"|\"json_schema\"|\"json_object\", ...}}"},"input":{"description":"A string, or an array of input items ({role, content} messages with input_text / input_image parts, function_call, function_call_output)"},"model":{"type":"string","description":"Model id (OpenRouter naming) - allowlisted per tier; omit (or \"auto\") on the auto tier"},"tools":{"type":"array","description":"Optional function tools ({type:\"function\", name, parameters}); server-side tools are not served"},"stream":{"type":"boolean","description":"Responses SSE events (response.created … response.completed)"},"reasoning":{"type":"object","description":"Optional {effort: \"none\"|\"minimal\"|\"low\"|\"medium\"|\"high\"|\"xhigh\"|\"max\"} - reasoning tokens count against max_output_tokens"},"instructions":{"type":"string","description":"Optional system/developer instructions"},"max_output_tokens":{"type":"integer","description":"Optional output cap (clamped to the tier cap)"}}},"responseSchema":{"type":"json","example":{"id":"resp_…","model":"openai/gpt-4o-mini","usage":{"input_tokens":14,"total_tokens":32,"output_tokens":18},"object":"response","output":[{"id":"msg_…","role":"assistant","type":"message","status":"completed","content":[{"text":"x402 is an HTTP-native way for agents to pay per request with USDC.","type":"output_text","annotations":[]}]}],"status":"completed"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_OkdaUzUceBWDowvnUspzv","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Drop-in OpenAI Responses API proxy that meters each call via x402 micropayments, billing exact token costs (input + max_output_tokens) at model list price × 1.15, minimum $0.001 USDC","exampleAgentPrompt":"Call the Agent402 metered endpoint with gpt-4o, using the instruction 'You are a helpful assistant', send my user message as input, cap the output at 1024 tokens, and stream the response back — it'll settle the USDC cost automatically per request.","exampleUseCases":[{"title":"Agent fleet with per-call billing","prompt":"I'm running an OpenAI Agents SDK fleet and want each agent call to be billed separately in USDC with no upfront subscription — point all agents at the Agent402 metered endpoint using model auto, system prompt 'You are a task routing agent', and let each call settle its own cost."},{"title":"Streaming chat with crypto micropayments","prompt":"Use the Agent402 metered responses endpoint to stream a gpt-4o reply to my question 'Summarize the history of Byzantine architecture' — cap output at 2048 tokens, enable streaming, and handle the x402 payment automatically."},{"title":"Function-calling agent with pay-per-use","prompt":"I want to run a function-calling workflow using Claude or GPT via Agent402's metered API — pass my three tool definitions, set reasoning effort to medium, limit output to 512 tokens, and let it charge USDC per call rather than a monthly plan."}],"resultDescription":"An OpenAI Responses API-compatible response object containing the model's generated text (or function call), token usage counts, and optionally a stream of SSE events (response.created through response.completed). The caller is charged the exact BPE-computed token cost at model list price × 1.15, settled via x402 Permit2 or credits, minimum $0.001 USDC.","failureModes":["Insufficient USDC balance or Permit2 allowance → 402 Payment Required with quoted cost","Model id not on allowlist for caller's tier → 400 Bad Request","max_output_tokens exceeds tier cap → value is clamped silently or rejected","Malformed input array or unsupported content part type → 422 Unprocessable Entity","Server-side tools requested → not supported, 400 error","Upstream model provider timeout → 504 Gateway Timeout propagated"],"whenToPreferThis":"Choose this endpoint when you need an OpenAI Responses API-compatible interface with zero upfront cost and per-request USDC billing via x402 micropayments — ideal for AI agents, agent fleets, or CLI tools (OpenAI Codex CLI) that already target the OpenAI SDK but need autonomous on-chain payment settlement. Prefer over direct OpenAI when you want crypto-native billing, multi-model routing under one base_url, or fine-grained cost attribution per agent call without a subscription.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T13:11:11.573Z","isFirstParty":false}