{"uid":"cap_vzw9c_4i85i84xx84lhja","slug":"agent402-tools-chat-completions-x402-pay-per-call-a2a50c28","name":"agent402.tools Chat Completions (x402 Pay-Per-Call)","description":"OpenAI-compatible chat completions paid per call in USDC: point any OpenAI SDK at this base URL and send a normal chat request, with the model chosen from a curated list and streaming supported. Use it when an agent needs a model answer without an API key or an account, one call at a time, with a receipt for each.","url":"https://agent402.tools/v1/chat/completions?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"zdr":{"type":"boolean"},"model":{"type":"string"},"tools":{"type":"array"},"messages":{"type":"array"},"reasoning":{"type":"object"},"max_tokens":{"type":"number"},"cache_control":{},"model_fallback":{"type":"boolean"},"max_completion_tokens":{"type":"integer"}}},"responseSchema":{"type":"json","example":{"id":"gen-…","model":"openai/gpt-4o-mini","usage":{"total_tokens":13,"prompt_tokens":12,"completion_tokens":1},"object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"OK"},"finish_reason":"stop"}],"created":1750000000}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","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":{"p10Cents":"2.0000","medianCents":"2.0000","p90Cents":"2.0000","minCents":"2.0000","maxCents":"2.0000","p95Cents":"2.0000","sampleCount":1,"varies":false,"failureChargeRate":1},"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_jKsDsc6w5CklecO6M2N9o","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"OpenAI-compatible chat completions endpoint that accepts requests via the OpenAI SDK format and charges per call in USDC over the x402 payment protocol — no API key or signup required.","exampleAgentPrompt":"Send this conversation to gpt-4o-mini and get a reply — I want to pay per call in USDC, no API key: messages are [{\"role\":\"user\",\"content\":\"Summarize the French Revolution in 3 bullet points\"}], cap the output at 300 tokens.","exampleUseCases":null,"resultDescription":"An OpenAI-compatible chat completion object containing the assistant's reply message, finish reason, and token usage counts (prompt, completion, total). The response mirrors the standard OpenAI /v1/chat/completions response schema.","failureModes":["Payment insufficient or x402 handshake fails — upstream returns 402 with a payment-required header","Model ID not on the allowed tier allowlist — returns an error listing valid model IDs","ZDR requested but no zero-data-retention provider available for the chosen model — walks failover chain and may error","max_tokens exceeds tier maximum — clamped silently or rejected","Provider upstream timeout or outage — error propagated from OpenRouter"],"whenToPreferThis":"Choose this endpoint when you need OpenAI-SDK-compatible chat completions but want to pay per call in USDC via x402 rather than managing API keys or subscriptions. It is ideal for agents operating on crypto-native payment rails (Base, Solana, Polygon, Arbitrum, Stellar), serverless or wallet-authenticated workflows, or when you want budget model access (gpt-4o-mini, Claude Haiku, Gemini Flash) without committing to a monthly plan. Prefer it over the auto-routing sibling endpoint when you want explicit model control.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":1,"lastUsedAt":"2026-09-24T19:13:02.209Z","lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T00:35:45.868Z","isFirstParty":false,"canonicalSlug":"agent402-tools-chat-completions-x402-pay-per-call-a2a50c28"}