{"uid":"cap_pPARD02fK33dlL39drKQs","slug":"agent-data-tools-ai-chat-completions-llm-inference-4768b5ca","name":"Agent Data Tools: AI Chat Completions (LLM Inference)","description":"OpenAI chat completions request shape, answered by the same models and at the same prices as /ai/chat ($0.01, default) and /ai/chat-large ($0.01; pick it with model \"llama-3.3-70b\" or \"gpt-oss-120b\"): send messages (system, user, assistant), get one assistant message back. No streaming. Point an OpenAI SDK at https://agent-data-tools.revmesh2074.workers.dev/v1 with an x402 or MPP fetch wrapper; the unpaid request returns the 402 quote and the paid retry returns the completion. Failed calls are never charged.","url":"https://agent-data-tools.revmesh2074.workers.dev/v1/chat/completions?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","required":["messages"],"properties":{"model":{"type":"string","description":"@cf/meta/llama-3.1-8b-instruct-fp8 (default, $0.01), or llama-3.3-70b / gpt-oss-120b ($0.01)"},"stream":{"type":"boolean","description":"Must be false or absent"},"messages":{"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"enum":["system","user","assistant"],"type":"string"},"content":{"type":"string"}}},"minItems":1},"max_tokens":{"type":"integer","maximum":1024,"minimum":1,"description":"Maximum output tokens (default 400)"},"temperature":{"type":"number","maximum":1.5,"minimum":0,"description":"Default 0.6"}}},"responseSchema":{"type":"object","properties":{"id":{"type":"string"},"model":{"type":"string"},"usage":{"type":"object","properties":{"estimated":{"type":"boolean"},"total_tokens":{"type":"integer"},"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"}}},"object":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"message":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}}},"finish_reason":{"type":"string"}}}},"created":{"type":"integer"}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USD","priceDynamic":true,"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":"dynamic","summary":"$0.01/call (dynamic — varies by input)","primary":{"kind":"dynamic","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"dynamic","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_oTRkY-cOJVJvFDJ0Nh4oU","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Runs OpenAI-compatible chat completions via LLaMA or GPT models with x402 micropayment billing, backed by a 175-tool agent data suite","exampleAgentPrompt":"Ask the LLaMA 3.1 8B model to summarize the following text in three bullet points, using the Agent Data Tools chat endpoint with pay-per-call billing: 'Decentralized finance has grown significantly in recent years, with billions locked in smart contracts across multiple chains.'","exampleUseCases":[{"title":"On-demand LLM reasoning for agent pipelines","prompt":"Use the Agent Data Tools chat completions endpoint to ask LLaMA 3.1 8B: 'Given a wallet address with 5 ETH and gas at 30 gwei, estimate the cost of 10 ERC-20 transfers and summarize the result in one sentence.'"},{"title":"Upgrade to large model for complex analysis","prompt":"Switch the model to llama-3.3-70b and ask it to analyze the following smart contract description for security risks, then give me a risk rating from 1 to 5 with a brief explanation."},{"title":"Zero-subscription AI Q&A with per-call payment","prompt":"I just need a quick AI answer — no subscription. Ask the chat completions endpoint with default settings: 'What are the top three differences between Polygon PoS and Ethereum mainnet in terms of transaction fees and finality?'"}],"resultDescription":"Returns an OpenAI-compatible JSON object containing one assistant message in the choices array, along with the model name, finish reason, token usage (prompt, completion, total), and a completion ID. No streaming; the full response is returned in a single payload after micropayment is processed.","failureModes":["402 Payment Required on first unpaid call — returns x402 payment quote; agent must retry with payment","stream:true not supported — request will fail if streaming is requested","max_tokens exceeds 1024 — validation error","messages array empty or missing — 400 bad request","Model name not recognized — defaults to 8B or errors depending on implementation","Payment fails or insufficient funds — call not charged but no response returned"],"whenToPreferThis":"Choose this endpoint when you need OpenAI SDK-compatible chat completions on a strict per-call budget without a subscription, especially if your agent is already using other Agent Data Tools capabilities (token prices, wallet data, OFAC screening). The x402 micropayment model means you only pay for successful calls. Prefer the default 8B model for speed and cost ($0.003/call) and upgrade to llama-3.3-70b or gpt-oss-120b ($0.01/call) only for tasks requiring deeper reasoning.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-21T11:35:30.625Z","isFirstParty":false,"canonicalSlug":"agent-data-tools-ai-chat-completions-llm-inference-4768b5ca"}