{"uid":"cap_KZpCCogn4eC1tSgShGvX4","slug":"agent-data-tools-revmesh2074-workers-dev-openai-compatible-chat-1cb5dca2","name":"OpenAI-compatible Chat Completion (Llama 4 Scout / Llama 3.3 70B / gpt-oss-120b / Qwen3)","description":"OpenAI chat completions request shape, answered by the same models and at the same prices as /ai/chat ($0.002, 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-4-scout-17b-16e-instruct (default, $0.002), or llama-3.3-70b / gpt-oss-120b ($0.01)"},"tools":{"type":"array","items":{"type":"object"},"description":"OpenAI function tools (Llama 4 Scout, the default model): the answer carries tool_calls"},"stream":{"type":"boolean","description":"true answers OpenAI server-sent events ending in [DONE]"},"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"},"tool_choice":{"description":"auto, none, required or one named function"},"response_format":{"type":"object","description":"{\"type\":\"json_object\"} or a json_schema"}}},"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":[],"displayCostAmount":"0.002","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.002/call (dynamic — varies by input)","primary":{"kind":"dynamic","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"dynamic","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_5lto4fFzAZcrVRY6d5y_4","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":"agent-data-tools.revmesh2074.workers.dev","brandSlug":"agent-data-tools-revmesh2074-workers-dev-x402","brandBaseUrl":"https://agent-data-tools.revmesh2074.workers.dev","brandDocsUrl":null,"whatItDoes":"Accepts an OpenAI-shaped chat completion request and returns an assistant reply from open models (Llama 4 Scout default at $0.002, or Llama 3.3 70B / gpt-oss-120b at $0.01), paid per-call via x402 or prepaid credits.","exampleAgentPrompt":"Ask the Llama 4 Scout model: 'You are a helpful assistant. User: What are three ways to reduce churn for a SaaS product?' — keep the reply under 400 tokens and return it as plain text.","exampleUseCases":[{"title":"Structured JSON extraction from text","prompt":"Use the Llama 4 Scout model to extract the company name, founding year, and CEO from this paragraph and return the result as a JSON object: 'Acme Corp was founded in 2010 by Jane Doe, who still serves as CEO today.'"},{"title":"Function-calling agent step","prompt":"Send these messages to Llama 4 Scout with tool use enabled — system: 'You are a data assistant', user: 'What is the weather in Paris?' — and return any tool_calls it emits so I can execute them."},{"title":"Large-model reasoning with gpt-oss-120b","prompt":"Using the gpt-oss-120b model, give me a step-by-step analysis of the pros and cons of a microservices vs monolith architecture for a startup, max 800 tokens."}],"resultDescription":"Returns an OpenAI-shaped chat completion object with a choices array containing the assistant message (content and optional tool_calls), finish_reason, model name, completion id, created timestamp, and a usage block with prompt_tokens, completion_tokens, total_tokens, and an estimated flag.","failureModes":["402 Payment Required returned on first unpaid call — includes x402 quote; retry with payment header to get the completion","model name not recognized — defaults silently to Llama 4 Scout or may return a 400","messages array missing or empty — returns 400 validation error","max_tokens exceeds 1024 — capped or rejected","temperature outside 0–1.5 range — rejected with validation error","network timeout on slow inference — no charge on failure","streaming (stream: true) may not be supported by all callers despite being in schema"],"whenToPreferThis":"Choose this endpoint when you already have an OpenAI SDK or toolchain and want to point it at open models (Llama 4 Scout, Llama 3.3 70B, gpt-oss-120b, Qwen3) with strict pay-per-call pricing (from $0.002), no subscription, no account, and crypto (x402/USDC) or card payment. It is ideal for agents that need drop-in OpenAI API compatibility with open-weight models, function calling, JSON mode, or structured output at low per-call cost. Prefer the larger model tier (llama-3.3-70b or gpt-oss-120b) for complex reasoning tasks; use the default Llama 4 Scout for cost-sensitive, high-volume inference.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-04T13:07:41.071Z","isFirstParty":false,"canonicalSlug":"agent-data-tools-revmesh2074-workers-dev-openai-compatible-chat-1cb5dca2"}