{"uid":"cap_FKzTN4wyfu3gfzEhxsHAr","slug":"agent-toolbox-gpt-oss-120b-chat-completions-27236216","name":"Agent Toolbox – GPT-OSS-120B Chat Completions","description":"OpenAI-compatible chat completion with gpt-oss-120b (OpenAI's open-weight reasoning model): set the base URL to /v1/llm/gpt-oss-120b in any OpenAI SDK. Up to 32,000 characters in and 2,048 tokens out per call, a fixed price per call, no streaming.","url":"https://agent-toolbox.zafermemon87.workers.dev/v1/llm/gpt-oss-120b/chat/completions?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string"},"content":{"type":"string"}}},"description":"OpenAI chat messages: [{role: system|user|assistant, content}] (up to 32,000 characters in total)"},"max_tokens":{"type":"integer","maximum":2048,"minimum":1,"description":"Default 2048"},"temperature":{"type":"number","maximum":2,"minimum":0},"response_format":{"type":"object","description":"{\"type\": \"json_object\"} for JSON output"}}},"responseSchema":{"type":"json","example":{"id":"chatcmpl-2f3cbf59f9204d269ba32770","model":"gpt-oss-120b","plain":"gpt-oss-120b: The capital of France is Paris.","usage":{"total_tokens":124,"prompt_tokens":78,"completion_tokens":46},"object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"The capital of France is Paris.","reasoning_content":"User asks: \"In one sentence, what is the capital of France?\" Answer: \"The capital of France is Paris.\" Provide one sentence."},"finish_reason":"stop"}],"created":1792850662}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_2zdqI5CYCTz8w4VedkuIo","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"OpenAI-compatible chat completion endpoint powered by gpt-oss-120b, an open-weight reasoning model, returning structured responses with visible reasoning traces.","exampleAgentPrompt":"Ask the gpt-oss-120b reasoning model: given the following financial data, reason step-by-step about which investment option carries the least risk and return your answer as a JSON object with fields 'recommendation' and 'rationale'.","exampleUseCases":[{"title":"Multi-step reasoning for complex questions","prompt":"I need you to think through this logic puzzle carefully and show your reasoning: a farmer has 17 sheep, all but 9 die — how many are left, and why? Use the 120B reasoning model and include the chain-of-thought in the response."},{"title":"Structured JSON extraction from natural language","prompt":"Parse this customer support ticket into a JSON object with fields: 'issue_type', 'urgency', and 'summary'. Ticket: 'My order #4821 never arrived and the tracking page has shown no updates for 6 days.' Use JSON output mode."},{"title":"Drafting nuanced long-form content","prompt":"Using the gpt-oss-120b model, write a detailed technical explanation (about 400 words) of how transformer attention mechanisms work, aimed at a software engineer who knows Python but has no ML background."}],"resultDescription":"Returns an OpenAI-format chat.completion JSON object containing the assistant's reply in choices[0].message.content, an optional reasoning_content field with the model's internal chain-of-thought, token usage breakdown (prompt_tokens, completion_tokens, total_tokens), a finish_reason, and metadata like model name, object type, and a unique completion ID.","failureModes":["Input exceeds 32,000 character limit — request rejected","max_tokens value above 2048 — validation error","Malformed messages array (missing role or content) — schema error","Payment failure or insufficient USDC balance — 402 response","Model unavailable or worker error — 5xx response","Temperature outside 0–2 range — validation error"],"whenToPreferThis":"Choose this endpoint when you need a large (120B parameter) open-weight reasoning model with visible chain-of-thought via the OpenAI SDK interface, especially for multi-step inference tasks, structured JSON output, or when you want a drop-in OpenAI-compatible API without OpenAI's proprietary model lock-in. Prefer over smaller models when reasoning quality matters more than latency. Not suitable for streaming use cases or inputs exceeding 32,000 characters.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T12:32:47.714Z","isFirstParty":false,"canonicalSlug":"agent-toolbox-gpt-oss-120b-chat-completions-27236216"}