Skip to content
Source
Sign inSign up
TanStack/schemas

Read the GPT-6.2 'rejects none' sentence as mandatory effort reasoning #712

Mergedtombeckenhammerged 1 commit intomain fromfix/711-openai-astra-sol-reasoningmerged by tombeckenham View on GitHub

Showing 4 changed files with 15 additions and 2 deletions (loading 1).

x
0 of 4 viewed, 4 left
3 additions and 1 deletionsrc/server/providers/fixtures/native-reasoning-docs.jsonModified
View file
@@ -15,5 +15,7 @@
"https://openrouter.ai/api/v1/models": "{\"data\": [{\"id\": \"bytedance-seed/seed-2-1-turbo\", \"canonical_slug\": \"bytedance-seed/seed-2-1-turbo-20260810\", \"hugging_face_id\": null, \"name\": \"ByteDance Seed: Seed 2.1 Turbo\", \"created\": 1786552176, \"description\": \"Seed 2.1 Turbo is a multimodal model from ByteDance Seed for coding and long-horizon agent workflows. It is suited for end-to-end software delivery, multi-step task execution, and understanding visual and...\", \"context_length\": 262144, \"architecture\": {\"modality\": \"text+image+video->text\", \"input_modalities\": [\"text\", \"image\", \"video\"], \"output_modalities\": [\"text\"], \"tokenizer\": \"Other\", \"instruct_type\": null}, \"pricing\": {\"prompt\": \"0.0000005\", \"completion\": \"0.0000025\"}, \"top_provider\": {\"context_length\": 262144, \"max_completion_tokens\": 235929, \"is_moderated\": false}, \"per_request_limits\": null, \"supported_parameters\": [\"frequency_penalty\", \"include_reasoning\", \"max_tokens\", \"reasoning\", \"response_format\", \"stop\", \"structured_outputs\", \"temperature\", \"tool_choice\", \"tools\", \"top_p\"], \"default_parameters\": {}, \"supported_voices\": null, \"knowledge_cutoff\": null, \"expiration_date\": null, \"links\": {\"details\": \"/api/v1/models/bytedance-seed/seed-2-1-turbo-20260810/endpoints\"}, \"reasoning\": {\"mandatory\": false}}, {\"id\": \"poolside/laguna-s-2.1\", \"canonical_slug\": \"poolside/laguna-s-2.1-20260720\", \"hugging_face_id\": \"poolside/Laguna-S-2.1\", \"name\": \"Poolside: Laguna S 2.1\", \"created\": 1784652683, \"description\": \"Laguna S 2.1 is the latest coding agent model from [Poolside](<https://poolside.ai/>). Laguna S 2.1 is a 118B total parameter model with 8B active parameters, scoring 70.2% on Terminal-Bench 2.1 and...\", \"context_length\": 1048576, \"architecture\": {\"modality\": \"text->text\", \"input_modalities\": [\"text\"], \"output_modalities\": [\"text\"], \"tokenizer\": \"Other\", \"instruct_type\": null}, \"pricing\": {\"prompt\": \"0.00000009\", \"completion\": \"0.00000018\", \"input_cache_read\": \"0.000000009\"}, \"top_provider\": {\"context_length\": 1048576, \"max_completion_tokens\": 131072, \"is_moderated\": false}, \"per_request_limits\": null, \"supported_parameters\": [\"include_reasoning\", \"max_tokens\", \"reasoning\", \"temperature\", \"tool_choice\", \"tools\"], \"default_parameters\": {}, \"supported_voices\": null, \"knowledge_cutoff\": null, \"expiration_date\": \"2026-10-31\", \"links\": {\"details\": \"/api/v1/models/poolside/laguna-s-2.1-20260720/endpoints\"}, \"reasoning\": {\"mandatory\": false, \"default_enabled\": true}}, {\"id\": \"qwen/qwen3-max\", \"canonical_slug\": \"qwen/qwen3-max\", \"hugging_face_id\": \"\", \"name\": \"Qwen: Qwen3 Max\", \"created\": 1758662808, \"description\": \"Qwen3-Max is an updated release built on the Qwen3 series, offering major improvements in reasoning, instruction following, multilingual support, and long-tail knowledge coverage compared to the January 2025 version. It...\", \"context_length\": 262144, \"architecture\": {\"modality\": \"text->text\", \"input_modalities\": [\"text\"], \"output_modalities\": [\"text\"], \"tokenizer\": \"Qwen3\", \"instruct_type\": null}, \"pricing\": {\"prompt\": \"0.00000078\", \"completion\": \"0.0000039\", \"input_cache_read\": \"0.000000156\", \"input_cache_write\": \"0.000000975\", \"overrides\": [{\"min_prompt_tokens\": 32000, \"prompt\": \"0.00000156\", \"completion\": \"0.0000078\", \"input_cache_read\": \"0.000000312\", \"input_cache_write\": \"0.00000195\"}, {\"min_prompt_tokens\": 128000, \"prompt\": \"0.00000195\", \"completion\": \"0.00000975\", \"input_cache_read\": \"0.00000039\", \"input_cache_write\": \"0.0000024375\"}]}, \"top_provider\": {\"context_length\": 262144, \"max_completion_tokens\": 65536, \"is_moderated\": false}, \"per_request_limits\": null, \"supported_parameters\": [\"frequency_penalty\", \"logprobs\", \"max_tokens\", \"presence_penalty\", \"response_format\", \"seed\", \"stop\", \"structured_outputs\", \"temperature\", \"tool_choice\", \"tools\", \"top_k\", \"top_logprobs\", \"top_p\"], \"default_parameters\": {\"temperature\": 1, \"top_p\": 1, \"frequency_penalty\": null}, \"supported_voices\": null, \"knowledge_cutoff\": \"2025-06-30\", \"expiration_date\": \"2026-10-09\", \"links\": {\"details\": \"/api/v1/models/qwen/qwen3-max/endpoints\"}, \"benchmarks\": {\"design_arena\": [{\"arena\": \"models\", \"category\": \"3d\", \"elo\": 1079, \"win_rate\": 43.5, \"rank\": 92}, {\"arena\": \"models\", \"category\": \"asciiart\", \"elo\": 1136, \"win_rate\": 47.2, \"rank\": 51}, {\"arena\": \"models\", \"category\": \"codecategories\", \"elo\": 1113, \"win_rate\": 44, \"rank\": 92}, {\"arena\": \"models\", \"category\": \"dataviz\", \"elo\": 1103, \"win_rate\": 41.2, \"rank\": 92}, {\"arena\": \"models\", \"category\": \"gamedev\", \"elo\": 1101, \"win_rate\": 43.8, \"rank\": 90}, {\"arena\": \"models\", \"category\": \"svg\", \"elo\": 1010, \"win_rate\": 37.2, \"rank\": 82}, {\"arena\": \"models\", \"category\": \"uicomponent\", \"elo\": 1083, \"win_rate\": 40.2, \"rank\": 95}, {\"arena\": \"models\", \"category\": \"website\", \"elo\": 1123, \"win_rate\": 44.5, \"rank\": 95}], \"artificial_analysis\": {\"intelligence_index\": 15.6, \"coding_index\": null, \"agentic_index\": null}}, \"reasoning\": {\"mandatory\": false}}]}",
"https://generativelanguage.googleapis.com/v1beta/models/gemini-flash-latest": "{\"name\": \"models/gemini-flash-latest\", \"version\": \"Gemini Flash Latest\", \"displayName\": \"Gemini Flash Latest\", \"description\": \"Latest release of Gemini Flash\", \"inputTokenLimit\": 1048576, \"outputTokenLimit\": 65536, \"supportedGenerationMethods\": [\"generateContent\", \"countTokens\", \"createCachedContent\", \"batchGenerateContent\"], \"temperature\": 1, \"topP\": 0.95, \"topK\": 64, \"maxTemperature\": 2, \"thinking\": true}",
"https://generativelanguage.googleapis.com/v1beta/models/gemma-4-31b-it": "{\"name\": \"models/gemma-4-31b-it\", \"version\": \"001\", \"displayName\": \"Gemma 4 31B IT\", \"description\": \"Gemma 4 31B IT\", \"inputTokenLimit\": 262144, \"outputTokenLimit\": 32768, \"supportedGenerationMethods\": [\"generateContent\", \"countTokens\"], \"temperature\": 1, \"topP\": 0.95, \"topK\": 64, \"maxTemperature\": 2, \"thinking\": true}",
- "https://docs.together.ai/docs/kimi-k3-quickstart.md": "> ## Documentation Index\n> Fetch the complete documentation index at: https://docs.together.ai/llms.txt\n> Use this file to discover all available pages before exploring further.\n\n# Kimi K3 quickstart\n\n> Call Kimi K3 on Together for long-horizon coding, vision-in-the-loop work, and deep reasoning.\n\nKimi K3 is Moonshot AI's flagship model and the first open-weight model in the 3-trillion-parameter class, at 2.8 trillion total parameters. It is built for frontier intelligence work: long-horizon coding, end-to-end knowledge work, and deep reasoning. It accepts both text and image inputs, thinks by default, and holds a 1.05M-token context window.\n\nThe model ID is `moonshotai/Kimi-K3`. Pricing is \\$3.00 per 1M input tokens, \\$15.00 per 1M output tokens, and \\$0.30 per 1M cached input tokens, flat across the full context window.\n\nTogether AI is working directly with the Moonshot team on this model.\n\n## Call Kimi K3\n\nThinking is on by default, so give `max_tokens` real headroom. The reasoning trace and the answer share the same completion budget, and a tight cap spends the whole allowance on reasoning and returns empty or truncated `content`.\n\n<CodeGroup>\n ```python Python theme={null}\n from together import Together\n\n client = Together()\n\n completion = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=[\n {\"role\": \"user\", \"content\": \"Introduce Kimi K3 in one sentence.\"}\n ],\n max_tokens=131072,\n )\n\n print(completion.choices[0].message.content)\n ```\n\n ```typescript TypeScript theme={null}\n import Together from \"together-ai\";\n\n const together = new Together();\n\n const completion = await together.chat.completions.create({\n model: \"moonshotai/Kimi-K3\",\n messages: [\n { role: \"user\", content: \"Introduce Kimi K3 in one sentence.\" },\n ],\n max_tokens: 131072,\n });\n\n console.log(completion.choices[0].message.content);\n ```\n\n ```bash cURL theme={null}\n curl -X POST \"https://api.together.ai/v1/chat/completions\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"moonshotai/Kimi-K3\",\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Introduce Kimi K3 in one sentence.\"}\n ],\n \"max_tokens\": 131072\n }'\n ```\n</CodeGroup>\n\n## Set the thinking effort\n\nK3 thinks by default at `reasoning_effort=\"max\"`. Lower the level to cut cost and latency:\n\n* `\"low\"`: shallow reasoning. Use for short, high-volume calls.\n* `\"high\"`: deep reasoning. Use for most coding and analysis work.\n* `\"max\"`: maximum reasoning, the default. Use for the hardest planning, architecture, and multi-step agentic problems, and set `max_tokens` generously.\n\nThe levels are coarse dials rather than a strictly monotonic scale, so measure token counts on your own prompts before you tune. Invalid effort strings are accepted silently instead of returning an error, so validate the value in your own code.\n\nTo skip thinking entirely on trivial turns, pass `reasoning={\"enabled\": False}`. No thinking tokens are generated or billed.\n\n<CodeGroup>\n ```python Python theme={null}\n from together import Together\n\n client = Together()\n\n # Adjust depth: \"low\" | \"high\" | \"max\"\n completion = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=[\n {\n \"role\": \"user\",\n \"content\": \"Prove that the square root of 2 is irrational.\",\n }\n ],\n reasoning_effort=\"max\",\n max_tokens=8192,\n )\n\n print(completion.choices[0].message.content)\n\n # Instant mode: no thinking tokens generated or billed\n fast = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=[{\"role\": \"user\", \"content\": \"What is the capital of France?\"}],\n reasoning={\"enabled\": False},\n max_tokens=256,\n )\n\n print(fast.choices[0].message.content)\n ```\n\n ```typescript TypeScript theme={null}\n import Together from \"together-ai\";\n\n const together = new Together();\n\n // Adjust depth: \"low\" | \"medium\" | \"high\" | \"max\"\n const completion = await together.chat.completions.create({\n model: \"moonshotai/Kimi-K3\",\n messages: [\n {\n role: \"user\",\n content: \"Prove that the square root of 2 is irrational.\",\n },\n ],\n reasoning_effort: \"max\",\n max_tokens: 8192,\n });\n\n console.log(completion.choices[0].message.content);\n\n // Instant mode: no thinking tokens generated or billed\n const fast = await together.chat.completions.create({\n model: \"moonshotai/Kimi-K3\",\n messages: [{ role: \"user\", content: \"What is the capital of France?\" }],\n reasoning: { enabled: false },\n max_tokens: 256,\n });\n\n console.log(fast.choices[0].message.content);\n ```\n</CodeGroup>\n\nFor broader guidance on reasoning controls and prompting, see [Reasoning](/docs/inference/chat/reasoning).\n\n## Stream the reasoning trace and the answer\n\nK3 returns two channels. The thinking trace arrives on `reasoning_content` and the final answer arrives on `content`. Handle both, and skip chunks where `choices` is empty, since Together emits a final usage-only chunk.\n\nK3 emits the trace under `reasoning_content` to match Moonshot, while other Together models use the newer `reasoning` alias. Reading both keys makes one handler work across models.\n\n<CodeGroup>\n ```python Python theme={null}\n from together import Together\n\n client = Together()\n\n stream = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=[{\"role\": \"user\", \"content\": \"Explain why the sky is blue.\"}],\n max_tokens=4096,\n stream=True,\n )\n\n in_answer = False\n for chunk in stream:\n if not chunk.choices:\n continue\n delta = chunk.choices[0].delta\n thinking = getattr(delta, \"reasoning_content\", None) or getattr(\n delta, \"reasoning\", None\n )\n if thinking:\n print(thinking, end=\"\", flush=True)\n if delta.content:\n if not in_answer:\n print(\"\\n--- answer ---\")\n in_answer = True\n print(delta.content, end=\"\", flush=True)\n ```\n\n ```typescript TypeScript theme={null}\n import Together from \"together-ai\";\n import type { ChatCompletionChunk } from \"together-ai/resources/chat/completions\";\n\n const together = new Together();\n\n // K3 emits the trace on reasoning_content; other models use reasoning\n type ReasoningDelta = ChatCompletionChunk.Choice.Delta & {\n reasoning_content?: string;\n reasoning?: string;\n };\n\n const stream = await together.chat.completions.create({\n model: \"moonshotai/Kimi-K3\",\n messages: [{ role: \"user\", content: \"Explain why the sky is blue.\" }],\n max_tokens: 4096,\n stream: true,\n });\n\n let inAnswer = false;\n for await (const chunk of stream) {\n if (!chunk.choices?.length) continue;\n const delta = chunk.choices[0]?.delta as ReasoningDelta;\n\n const thinking = delta?.reasoning_content || delta?.reasoning;\n if (thinking) process.stdout.write(thinking);\n\n if (delta?.content) {\n if (!inAnswer) {\n process.stdout.write(\"\\n--- answer ---\\n\");\n inAnswer = true;\n }\n process.stdout.write(delta.content);\n }\n }\n ```\n</CodeGroup>\n\nDisplay layers can render either channel. JSON parsers must read `content` only. History replay requires both, as described in [Preserve the thinking history](#preserve-the-thinking-history).\n\n## Send images\n\nK3 has native visual understanding. Pass `content` as an array of objects and supply the image as either a public URL or a base64 data URL. Together fetches public URLs server-side.\n\n<CodeGroup>\n ```python Python theme={null}\n import base64\n from pathlib import Path\n\n from together import Together\n\n client = Together()\n\n IMAGE_URL = \"https://raw.githubusercontent.com/pytorch/pytorch/main/docs/source/_static/img/pytorch-logo-dark.png\"\n\n # From a public URL\n completion = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n max_tokens=2048,\n messages=[\n {\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"image_url\", \"image_url\": {\"url\": IMAGE_URL}},\n {\"type\": \"text\", \"text\": \"Describe this image.\"},\n ],\n }\n ],\n )\n\n print(completion.choices[0].message.content)\n\n # From a local file\n image_data = base64.b64encode(Path(\"image.png\").read_bytes()).decode()\n\n completion = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n max_tokens=2048,\n messages=[\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": f\"data:image/png;base64,{image_data}\"\n },\n },\n {\"type\": \"text\", \"text\": \"Describe this image.\"},\n ],\n }\n ],\n )\n\n print(completion.choices[0].message.content)\n ```\n\n ```typescript TypeScript theme={null}\n import { readFileSync } from \"fs\";\n import Together from \"together-ai\";\n\n const together = new Together();\n\n const IMAGE_URL =\n \"https://raw.githubusercontent.com/pytorch/pytorch/main/docs/source/_static/img/pytorch-logo-dark.png\";\n\n // From a public URL\n const completion = await together.chat.completions.create({\n model: \"moonshotai/Kimi-K3\",\n max_tokens: 2048,\n messages: [\n {\n role: \"user\",\n content: [\n { type: \"image_url\", image_url: { url: IMAGE_URL } },\n { type: \"text\", text: \"Describe this image.\" },\n ],\n },\n ],\n });\n\n console.log(completion.choices[0].message.content);\n\n // From a local file\n const imageData = readFileSync(\"image.png\").toString(\"base64\");\n\n const fromFile = await together.chat.completions.create({\n model: \"moonshotai/Kimi-K3\",\n max_tokens: 2048,\n messages: [\n {\n role: \"user\",\n content: [\n {\n type: \"image_url\",\n image_url: { url: `data:image/png;base64,${imageData}` },\n },\n { type: \"text\", text: \"Describe this image.\" },\n ],\n },\n ],\n });\n\n console.log(fromFile.choices[0].message.content);\n ```\n</CodeGroup>\n\nVision limits:\n\n* There is no limit on the number of images per request, but the whole request body must stay under 100 MB. This is the binding constraint when you inline base64.\n* 4K (4096x2160) is the recommended maximum resolution. Higher resolutions cost processing time and tokens without improving understanding.\n* Token cost scales with resolution.\n* A public URL is fetched with a plain server-side HTTP GET, so hosts that block unfamiliar clients return an error. Fall back to base64 for those.\n\nMoonshot also publishes [Perception Bench](https://www.kimi.com/blog/perception-bench), a visual reasoning benchmark, if you want to evaluate K3's visual understanding yourself.\n\n## Constrain the output to a schema\n\nPass a JSON schema through `response_format` with `\"strict\": True` to constrain the final `content`.\n\nKeep `max_tokens` generous. The whole thinking trace is spent before the first schema-constrained token is emitted, so a tight cap truncates the JSON rather than the reasoning. Parse `content` only, never `reasoning_content`.\n\n<CodeGroup>\n ```python Python theme={null}\n import json\n\n from together import Together\n\n client = Together()\n\n completion = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n max_tokens=4096,\n messages=[{\"role\": \"user\", \"content\": \"Ada Lovelace was 36 years old.\"}],\n response_format={\n \"type\": \"json_schema\",\n \"json_schema\": {\n \"name\": \"person\",\n \"strict\": True,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\"type\": \"string\"},\n \"age\": {\"type\": \"integer\"},\n },\n \"required\": [\"name\", \"age\"],\n \"additionalProperties\": False,\n },\n },\n },\n )\n\n person = json.loads(completion.choices[0].message.content)\n print(person)\n # -> {'name': 'Ada Lovelace', 'age': 36}\n ```\n\n ```typescript TypeScript theme={null}\n import Together from \"together-ai\";\n\n const together = new Together();\n\n const completion = await together.chat.completions.create({\n model: \"moonshotai/Kimi-K3\",\n max_tokens: 4096,\n messages: [{ role: \"user\", content: \"Ada Lovelace was 36 years old.\" }],\n response_format: {\n type: \"json_schema\",\n json_schema: {\n name: \"person\",\n strict: true,\n schema: {\n type: \"object\",\n properties: {\n name: { type: \"string\" },\n age: { type: \"integer\" },\n },\n required: [\"name\", \"age\"],\n additionalProperties: false,\n },\n },\n },\n });\n\n const person = JSON.parse(completion.choices[0].message.content ?? \"{}\");\n console.log(person);\n // -> { name: 'Ada Lovelace', age: 36 }\n ```\n</CodeGroup>\n\nThe looser `{\"type\": \"json_object\"}` mode also works when you only need syntactically valid JSON.\n\n## Call tools\n\nDeclare functions in `tools`. When the model returns `tool_calls`, append the complete assistant message to history, append one `tool` message per call with the matching `tool_call_id`, then call again.\n\n`tool_choice` accepts four forms:\n\n| Value | Effect |\n| - | - |\n| `\"auto\"` | The model decides. This is also what omitting the field means. |\n| `\"required\"` | The model must call at least one tool this turn. Declare at least one callable tool. |\n| `\"none\"` | Tool calls are forbidden this turn. |\n| `{\"type\": \"function\", \"function\": {\"name\": \"get_weather\"}}` | Force one specific tool. |\n\nSet `tool_choice=\"required\"` on the first turn to force a tool call, then switch back to `\"auto\"`. Changing `tool_choice` between turns does not invalidate the prefix cache.\n\n`message.model_dump(exclude_none=True)` is the line that matters below. It round-trips the assistant turn whole, including `reasoning_content`, which K3 depends on. See [Preserve the thinking history](#preserve-the-thinking-history).\n\n<CodeGroup>\n ```python Python theme={null}\n import json\n\n from together import Together\n\n client = Together()\n\n tools = [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_weather\",\n \"description\": \"Get the current weather for a city.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"city\": {\n \"type\": \"string\",\n \"description\": \"City name, e.g. Paris\",\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [\"celsius\", \"fahrenheit\"],\n },\n },\n \"required\": [\"city\"],\n \"additionalProperties\": False,\n },\n },\n }\n ]\n\n\n def get_weather(city, unit=\"celsius\"):\n return {\n \"city\": city,\n \"temperature\": 21,\n \"unit\": unit,\n \"conditions\": \"sunny\",\n }\n\n\n messages = [{\"role\": \"user\", \"content\": \"What's the weather in Paris?\"}]\n choice_mode = \"required\" # Force a tool call on turn one\n\n for _ in range(5):\n response = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=messages,\n tools=tools,\n tool_choice=choice_mode,\n max_tokens=8192,\n )\n choice = response.choices[0]\n message = choice.message\n\n # Append the complete assistant message, thinking trace included\n messages.append(message.model_dump(exclude_none=True))\n\n if choice.finish_reason != \"tool_calls\" or not message.tool_calls:\n print(message.content)\n break\n\n for call in message.tool_calls:\n try:\n args = json.loads(call.function.arguments)\n except json.JSONDecodeError:\n args = {}\n messages.append(\n {\n \"role\": \"tool\",\n \"tool_call_id\": call.id,\n \"content\": json.dumps(get_weather(**args)),\n }\n )\n\n choice_mode = \"auto\" # Hand control back after the forced turn\n ```\n\n ```typescript TypeScript theme={null}\n import Together from \"together-ai\";\n\n const together = new Together();\n\n const tools = [\n {\n type: \"function\" as const,\n function: {\n name: \"get_weather\",\n description: \"Get the current weather for a city.\",\n parameters: {\n type: \"object\",\n properties: {\n city: { type: \"string\", description: \"City name, e.g. Paris\" },\n unit: { type: \"string\", enum: [\"celsius\", \"fahrenheit\"] },\n },\n required: [\"city\"],\n additionalProperties: false,\n },\n },\n },\n ];\n\n function getWeather(city: string, unit = \"celsius\") {\n return { city, temperature: 21, unit, conditions: \"sunny\" };\n }\n\n const messages: any[] = [\n { role: \"user\", content: \"What's the weather in Paris?\" },\n ];\n let choiceMode: \"required\" | \"auto\" = \"required\";\n\n for (let i = 0; i < 5; i++) {\n const response = await together.chat.completions.create({\n model: \"moonshotai/Kimi-K3\",\n messages,\n tools,\n tool_choice: choiceMode,\n max_tokens: 8192,\n });\n\n const choice = response.choices[0];\n const message = choice.message;\n\n // Append the complete assistant message, thinking trace included\n messages.push(message);\n\n if (choice.finish_reason !== \"tool_calls\" || !message.tool_calls?.length) {\n console.log(message.content);\n break;\n }\n\n for (const call of message.tool_calls) {\n let args: { city: string; unit?: string };\n try {\n args = JSON.parse(call.function.arguments);\n } catch {\n args = { city: \"\" };\n }\n messages.push({\n role: \"tool\",\n tool_call_id: call.id,\n content: JSON.stringify(getWeather(args.city, args.unit)),\n });\n }\n\n choiceMode = \"auto\"; // Hand control back after the forced turn\n }\n ```\n</CodeGroup>\n\n## Load tools dynamically\n\nK3 can pick up a tool mid-conversation. Place a complete tool definition (full `name`, `description`, and `parameters`) inside a `system` message that carries a `tools` field and no `content`. The tool becomes available from that message's position onward.\n\nRules to follow:\n\n* Dynamic declarations use exactly the same format as the top-level `tools` field.\n* The system message must have empty content. Sending both `content` and `tools` on it returns `400: a system message with dynamic tools must have empty content`.\n* Declarations apply per request and are not retained by the server. Keep the message in later request history yourself. Keeping it preserves both the tool's availability and the cached prefix. Dropping it means the model can no longer call that tool and the changed prefix may miss the cache.\n* Append declarations at the tail of `messages`. Appending does not affect the cached prefix, while removing or modifying an earlier declaration may hurt cache hits from that point onward.\n* Keep at least one tool in the top-level `tools` array whenever you send `tool_choice`.\n\nDon't put dozens or hundreds of tool definitions into every request. They eat context and make the model more likely to pick the wrong tool. Use search-then-inject instead:\n\n1. At conversation start, declare a single `search_tools` function backed by your own catalog, plus a few core tools, and advertise the searchable domain tags in the system prompt.\n2. On the first turn, set `tool_choice=\"required\"` to force retrieval before answering.\n3. Inject the full definitions of the matching tools through a `system` message based on the retrieval results.\n4. Let the model call the loaded tools directly in later generations.\n\nDecide `reasoning_effort` before the conversation starts, since changing it mid-conversation costs you cache hits.\n\n```python Python theme={null}\nimport json\n\nfrom together import Together\n\nclient = Together()\n\nCATALOG = {\n \"convert_currency\": {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"convert_currency\",\n \"description\": \"Convert an amount from one currency to another.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"amount\": {\"type\": \"number\"},\n \"from_currency\": {\"type\": \"string\"},\n \"to_currency\": {\"type\": \"string\"},\n },\n \"required\": [\"amount\", \"from_currency\", \"to_currency\"],\n \"additionalProperties\": False,\n },\n },\n },\n}\n\nsearch_tools = {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"search_tools\",\n \"description\": \"Search the tool catalog. Tags: finance, travel, files.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\"query\": {\"type\": \"string\"}},\n \"required\": [\"query\"],\n \"additionalProperties\": False,\n },\n },\n}\n\nmessages = [{\"role\": \"user\", \"content\": \"Convert 100 USD to EUR.\"}]\n\n# 1. Force retrieval before answering\nfirst = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=messages,\n tools=[search_tools],\n tool_choice=\"required\",\n max_tokens=8192,\n)\ncall = first.choices[0].message.tool_calls[0]\nmessages.append(first.choices[0].message.model_dump(exclude_none=True))\nmessages.append(\n {\n \"role\": \"tool\",\n \"tool_call_id\": call.id,\n \"content\": json.dumps(list(CATALOG)),\n }\n)\n\n# 2. Inject matching definitions at the tail: tools field, no content\nmessages.append({\"role\": \"system\", \"tools\": [CATALOG[\"convert_currency\"]]})\n\n# 3. The model calls the freshly loaded tool directly\nsecond = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=messages,\n tools=[search_tools],\n tool_choice=\"auto\",\n max_tokens=8192,\n)\nprint(second.choices[0].message.tool_calls)\n# -> convert_currency({\"amount\":100,\"from_currency\":\"USD\",\"to_currency\":\"EUR\"})\n```\n\n## Work with the 1.05M context and the cache\n\nK3 accepts up to 1.05M input tokens on Together, and context caching is automatic. There is no cache ID, TTL, or extra parameter. Keep your long prefix (system prompt, knowledge base, repo dump) byte-stable across requests so later calls hit the cache. Moonshot reports cache hit rates above 90% in coding workloads, which pulls effective input cost toward the \\$0.30 floor.\n\nMoonshot recommends placing fixed bulk context such as knowledge documents at the very beginning of the `messages` array, ahead of the system message, then appending questions and replies after it.\n\nRead the usage counters defensively. The `*_details` objects come back as plain dicts on some responses, and `completion_tokens_details` is absent entirely when you disable reasoning.\n\n```python Python theme={null}\ndef _get(obj, key, default=None):\n if obj is None:\n return default\n if isinstance(obj, dict):\n return obj.get(key, default)\n return getattr(obj, key, default)\n\n\nusage = completion.usage\nreasoning_tokens = _get(\n _get(usage, \"completion_tokens_details\"), \"reasoning_tokens\", 0\n)\ncached_tokens = _get(\n _get(usage, \"prompt_tokens_details\"),\n \"cached_tokens\",\n _get(usage, \"cached_tokens\", 0),\n)\n\nprint(\n f\"prompt={usage.prompt_tokens} cached={cached_tokens} \"\n f\"completion={usage.completion_tokens} thinking={reasoning_tokens}\"\n)\n# -> prompt=86 cached=64 completion=133 thinking=111\n```\n\n## Preserve the thinking history\n\nK3 was trained in preserved thinking history mode, so the trace is state that the next turn depends on. Return the complete assistant message on every turn, `reasoning_content` included. If you keep only `content`, generation quality becomes unstable.\n\nTogether accepts the trace back under either `reasoning_content` (what K3 emits) or the newer `reasoning` alias.\n\n```python Python theme={null}\nfrom together import Together\n\nclient = Together()\n\nprompt = (\n \"Pick a random 5-digit number and commit to it. \" \"Reply with exactly: OK\"\n)\n\n# Turn 1: let K3 think\nfirst = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=[{\"role\": \"user\", \"content\": prompt}],\n max_tokens=4000,\n)\n\n# Replay the assistant turn whole: model_dump keeps reasoning_content\nhistory = [\n {\"role\": \"user\", \"content\": prompt},\n first.choices[0].message.model_dump(exclude_none=True),\n {\n \"role\": \"user\",\n \"content\": \"What number did you pick? Reply with just the number.\",\n },\n]\n\nsecond = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=history,\n max_tokens=4000,\n)\nprint(second.choices[0].message.content)\n```\n\nDrop the trace from the replay and the model answers with a freshly invented number instead, because the commitment lived in the reasoning rather than in `content`.\n\n<Warning>\n Don't switch an ongoing session over to K3 from another model. K3 inherits a history that contains no K3 thinking at all, and quality degrades. Start K3 sessions on K3.\n</Warning>\n\n## Sampling parameters\n\nMost sampling parameters are fixed server-side. Omit them and let the defaults apply.\n\n| Parameter | Behavior on Together |\n| - | - |\n| `temperature` | Fixed at 1.0. |\n| `top_p` | Fixed at 0.95. Any other value returns `400`. |\n| `n` | Fixed at 1. Best-of-n has to live in your own harness. |\n| `presence_penalty`, `frequency_penalty` | Fixed at 0. |\n| `logprobs` | Not supported. Returns `400`. |\n| `top_k`, `min_p`, `repetition_penalty`, `stop`, `seed` | Accepted. |\n| `max_tokens` | No ceiling below the 1.05M context limit. Cap it yourself for short answers. |\n| `reasoning_effort` | `\"low\"`, `\"medium\"`, `\"high\"`, or `\"max\"` (default). Invalid strings are accepted silently, so validate client-side. |\n| `reasoning` | `{\"enabled\": False}` disables thinking entirely. |\n\n## Architecture\n\nTwo architectural changes form K3's backbone, both aimed at moving information through longer sequences and deeper into the network:\n\n* **Kimi Delta Attention (KDA):** A hybrid linear attention mechanism that provides an efficient foundation for scaling attention across very long contexts. This is Moonshot's first model to support a 1.05M context window.\n* **Attention Residuals (AttnRes):** Selectively retrieves representations across model depth rather than accumulating them uniformly.\n\nOn top of that, Moonshot pushed mixture-of-experts (MoE) sparsity further with the Stable LatentMoE framework, activating 16 of 896 experts. At roughly 2% of experts active per token, routing and optimization become first-order problems, so four supporting techniques keep training stable at 2.8T scale:\n\n* **Quantile Balancing:** Derives expert allocation directly from router-score quantiles, which eliminates heuristic updates and a sensitive balancing hyperparameter.\n* **Per-Head Muon:** Extends the Muon optimizer to optimize attention heads independently for more adaptive learning at scale.\n* **Sigmoid Tanh Unit (SiTU):** Improves activation control.\n* **Gated MLA:** Improves attention selectivity.\n\nK3 continues a sustained scaling push: in nine of the 12 months from July 2025 to July 2026, Kimi models set the upper bound of open-model scale. At 2.8T parameters, K3 is the largest open-weight model released to date.\n\n## Use cases\n\nK3 is strongest where a task runs long and needs little supervision:\n\n* **Long-horizon coding:** Sustained engineering sessions, navigation of massive repositories, and orchestration of terminal tools.\n* **Vision in the loop:** Iterating between code and live screenshots for game development, frontend engineering, and CAD, using visual feedback rather than a written description of the render.\n* **Research pipelines:** Reviewing literature, implementing a numerical pipeline, cross-validating results, and producing an interactive deliverable in one run.\n* **End-to-end knowledge work:** Deep research reports with interactive charts, timelines, and slides rather than a paragraph of prose.\n* **Large-repository refactoring:** Cross-file, multi-step engineering work held together by the 1.05M context window.\n* **Agentic tool orchestration:** Long tool-calling loops with reasoning between steps and tools loaded on demand.\n\n## Limitations\n\n* **Cost on short, high-volume calls:** Thinking defaults to `\"max\"`, so a pipeline that never sets `reasoning_effort` pays the maximum reasoning bill on every call. Reasoning tokens bill as output at \\$15.00 per 1M. Drop trivial calls to `\"low\"` or disable reasoning outright.\n* **Excessive proactiveness:** K3's training emphasizes long, difficult tasks, so it may make decisions on your behalf when it hits a minor issue or ambiguous intent mid-task. State hard constraints explicitly in the system prompt or in `AGENTS.md`.\n* **Mid-session model swaps:** Switching an in-flight session to K3 from another model leaves it without any K3 thinking history and destabilizes output.\n* **Cache fragility:** Restructuring earlier messages or editing an earlier tool declaration breaks the prefix cache and reprices the affected input from \\$0.30 to \\$3.00 per 1M tokens.\n\n## Usage tips\n\n| Tip | Rationale |\n| - | - |\n| **Give `max_tokens` real headroom** | The trace shares the completion budget with the answer. A tight cap returns empty or truncated `content`. |\n| **Return the complete assistant message every turn** | `message.model_dump(exclude_none=True)` keeps `reasoning_content` in history, which K3 was trained to depend on. |\n| **Read both `reasoning_content` and `reasoning`** | K3 emits the trace on `reasoning_content`. Other Together models use the `reasoning` alias. One handler then covers both. |\n| **Parse `content` only** | Never run JSON parsing over the thinking trace. |\n| **Set `reasoning_effort` deliberately** | `\"max\"` is the default and the most expensive setting. Match the level to the task. |\n| **Keep prefixes byte-stable** | Caching is automatic, so stable prefixes are what pull effective input cost toward \\$0.30 per 1M tokens. |\n| **Put bulk context first** | Place knowledge documents at the very start of `messages`, ahead of the system message, then append the conversation. |\n| **Inject dynamic tools at the tail** | Appending is cache-safe. Editing an earlier declaration invalidates everything after it. |\n| **Omit the fixed sampling parameters** | `top_p`, `n`, and the penalties are fixed server-side and return `400` on any other value. |\n| **Think in goals, not steps** | K3 is agentic. Give high-level objectives and let it orchestrate sub-tasks and tool calls. |\n\n## Next steps\n\n<CardGroup cols={2}>\n <Card title=\"Reasoning\" icon=\"brain\" href=\"/docs/inference/chat/reasoning\">\n Control reasoning depth and handle reasoning output across models.\n </Card>\n\n <Card title=\"Function calling\" icon=\"tool\" href=\"/docs/inference/function-calling/overview\">\n Build tool-calling loops against any function-calling model.\n </Card>\n\n <Card title=\"Vision\" icon=\"photo\" href=\"/docs/inference/vision/overview\">\n Send images to vision models and read the results.\n </Card>\n\n <Card title=\"Serverless models\" icon=\"stack-2\" href=\"/docs/serverless/models\">\n Browse every model, context length, and price on serverless inference.\n </Card>\n</CardGroup>\n\n\nThis documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform."
+ "https://docs.together.ai/docs/kimi-k3-quickstart.md": "> ## Documentation Index\n> Fetch the complete documentation index at: https://docs.together.ai/llms.txt\n> Use this file to discover all available pages before exploring further.\n\n# Kimi K3 quickstart\n\n> Call Kimi K3 on Together for long-horizon coding, vision-in-the-loop work, and deep reasoning.\n\nKimi K3 is Moonshot AI's flagship model and the first open-weight model in the 3-trillion-parameter class, at 2.8 trillion total parameters. It is built for frontier intelligence work: long-horizon coding, end-to-end knowledge work, and deep reasoning. It accepts both text and image inputs, thinks by default, and holds a 1.05M-token context window.\n\nThe model ID is `moonshotai/Kimi-K3`. Pricing is \\$3.00 per 1M input tokens, \\$15.00 per 1M output tokens, and \\$0.30 per 1M cached input tokens, flat across the full context window.\n\nTogether AI is working directly with the Moonshot team on this model.\n\n## Call Kimi K3\n\nThinking is on by default, so give `max_tokens` real headroom. The reasoning trace and the answer share the same completion budget, and a tight cap spends the whole allowance on reasoning and returns empty or truncated `content`.\n\n<CodeGroup>\n ```python Python theme={null}\n from together import Together\n\n client = Together()\n\n completion = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=[\n {\"role\": \"user\", \"content\": \"Introduce Kimi K3 in one sentence.\"}\n ],\n max_tokens=131072,\n )\n\n print(completion.choices[0].message.content)\n ```\n\n ```typescript TypeScript theme={null}\n import Together from \"together-ai\";\n\n const together = new Together();\n\n const completion = await together.chat.completions.create({\n model: \"moonshotai/Kimi-K3\",\n messages: [\n { role: \"user\", content: \"Introduce Kimi K3 in one sentence.\" },\n ],\n max_tokens: 131072,\n });\n\n console.log(completion.choices[0].message.content);\n ```\n\n ```bash cURL theme={null}\n curl -X POST \"https://api.together.ai/v1/chat/completions\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"moonshotai/Kimi-K3\",\n \"messages\": [\n {\"role\": \"user\", \"content\": \"Introduce Kimi K3 in one sentence.\"}\n ],\n \"max_tokens\": 131072\n }'\n ```\n</CodeGroup>\n\n## Set the thinking effort\n\nK3 thinks by default at `reasoning_effort=\"max\"`. Lower the level to cut cost and latency:\n\n* `\"low\"`: shallow reasoning. Use for short, high-volume calls.\n* `\"high\"`: deep reasoning. Use for most coding and analysis work.\n* `\"max\"`: maximum reasoning, the default. Use for the hardest planning, architecture, and multi-step agentic problems, and set `max_tokens` generously.\n\nThe levels are coarse dials rather than a strictly monotonic scale, so measure token counts on your own prompts before you tune. Invalid effort strings are accepted silently instead of returning an error, so validate the value in your own code.\n\nTo skip thinking entirely on trivial turns, pass `reasoning={\"enabled\": False}`. No thinking tokens are generated or billed.\n\n<CodeGroup>\n ```python Python theme={null}\n from together import Together\n\n client = Together()\n\n # Adjust depth: \"low\" | \"high\" | \"max\"\n completion = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=[\n {\n \"role\": \"user\",\n \"content\": \"Prove that the square root of 2 is irrational.\",\n }\n ],\n reasoning_effort=\"max\",\n max_tokens=8192,\n )\n\n print(completion.choices[0].message.content)\n\n # Instant mode: no thinking tokens generated or billed\n fast = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=[{\"role\": \"user\", \"content\": \"What is the capital of France?\"}],\n reasoning={\"enabled\": False},\n max_tokens=256,\n )\n\n print(fast.choices[0].message.content)\n ```\n\n ```typescript TypeScript theme={null}\n import Together from \"together-ai\";\n\n const together = new Together();\n\n // Adjust depth: \"low\" | \"medium\" | \"high\" | \"max\"\n const completion = await together.chat.completions.create({\n model: \"moonshotai/Kimi-K3\",\n messages: [\n {\n role: \"user\",\n content: \"Prove that the square root of 2 is irrational.\",\n },\n ],\n reasoning_effort: \"max\",\n max_tokens: 8192,\n });\n\n console.log(completion.choices[0].message.content);\n\n // Instant mode: no thinking tokens generated or billed\n const fast = await together.chat.completions.create({\n model: \"moonshotai/Kimi-K3\",\n messages: [{ role: \"user\", content: \"What is the capital of France?\" }],\n reasoning: { enabled: false },\n max_tokens: 256,\n });\n\n console.log(fast.choices[0].message.content);\n ```\n</CodeGroup>\n\nFor broader guidance on reasoning controls and prompting, see [Reasoning](/docs/inference/chat/reasoning).\n\n## Stream the reasoning trace and the answer\n\nK3 returns two channels. The thinking trace arrives on `reasoning_content` and the final answer arrives on `content`. Handle both, and skip chunks where `choices` is empty, since Together emits a final usage-only chunk.\n\nK3 emits the trace under `reasoning_content` to match Moonshot, while other Together models use the newer `reasoning` alias. Reading both keys makes one handler work across models.\n\n<CodeGroup>\n ```python Python theme={null}\n from together import Together\n\n client = Together()\n\n stream = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=[{\"role\": \"user\", \"content\": \"Explain why the sky is blue.\"}],\n max_tokens=4096,\n stream=True,\n )\n\n in_answer = False\n for chunk in stream:\n if not chunk.choices:\n continue\n delta = chunk.choices[0].delta\n thinking = getattr(delta, \"reasoning_content\", None) or getattr(\n delta, \"reasoning\", None\n )\n if thinking:\n print(thinking, end=\"\", flush=True)\n if delta.content:\n if not in_answer:\n print(\"\\n--- answer ---\")\n in_answer = True\n print(delta.content, end=\"\", flush=True)\n ```\n\n ```typescript TypeScript theme={null}\n import Together from \"together-ai\";\n import type { ChatCompletionChunk } from \"together-ai/resources/chat/completions\";\n\n const together = new Together();\n\n // K3 emits the trace on reasoning_content; other models use reasoning\n type ReasoningDelta = ChatCompletionChunk.Choice.Delta & {\n reasoning_content?: string;\n reasoning?: string;\n };\n\n const stream = await together.chat.completions.create({\n model: \"moonshotai/Kimi-K3\",\n messages: [{ role: \"user\", content: \"Explain why the sky is blue.\" }],\n max_tokens: 4096,\n stream: true,\n });\n\n let inAnswer = false;\n for await (const chunk of stream) {\n if (!chunk.choices?.length) continue;\n const delta = chunk.choices[0]?.delta as ReasoningDelta;\n\n const thinking = delta?.reasoning_content || delta?.reasoning;\n if (thinking) process.stdout.write(thinking);\n\n if (delta?.content) {\n if (!inAnswer) {\n process.stdout.write(\"\\n--- answer ---\\n\");\n inAnswer = true;\n }\n process.stdout.write(delta.content);\n }\n }\n ```\n</CodeGroup>\n\nDisplay layers can render either channel. JSON parsers must read `content` only. History replay requires both, as described in [Preserve the thinking history](#preserve-the-thinking-history).\n\n## Send images\n\nK3 has native visual understanding. Pass `content` as an array of objects and supply the image as either a public URL or a base64 data URL. Together fetches public URLs server-side.\n\n<CodeGroup>\n ```python Python theme={null}\n import base64\n from pathlib import Path\n\n from together import Together\n\n client = Together()\n\n IMAGE_URL = \"https://raw.githubusercontent.com/pytorch/pytorch/main/docs/source/_static/img/pytorch-logo-dark.png\"\n\n # From a public URL\n completion = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n max_tokens=2048,\n messages=[\n {\n \"role\": \"user\",\n \"content\": [\n {\"type\": \"image_url\", \"image_url\": {\"url\": IMAGE_URL}},\n {\"type\": \"text\", \"text\": \"Describe this image.\"},\n ],\n }\n ],\n )\n\n print(completion.choices[0].message.content)\n\n # From a local file\n image_data = base64.b64encode(Path(\"image.png\").read_bytes()).decode()\n\n completion = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n max_tokens=2048,\n messages=[\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"image_url\",\n \"image_url\": {\n \"url\": f\"data:image/png;base64,{image_data}\"\n },\n },\n {\"type\": \"text\", \"text\": \"Describe this image.\"},\n ],\n }\n ],\n )\n\n print(completion.choices[0].message.content)\n ```\n\n ```typescript TypeScript theme={null}\n import { readFileSync } from \"fs\";\n import Together from \"together-ai\";\n\n const together = new Together();\n\n const IMAGE_URL =\n \"https://raw.githubusercontent.com/pytorch/pytorch/main/docs/source/_static/img/pytorch-logo-dark.png\";\n\n // From a public URL\n const completion = await together.chat.completions.create({\n model: \"moonshotai/Kimi-K3\",\n max_tokens: 2048,\n messages: [\n {\n role: \"user\",\n content: [\n { type: \"image_url\", image_url: { url: IMAGE_URL } },\n { type: \"text\", text: \"Describe this image.\" },\n ],\n },\n ],\n });\n\n console.log(completion.choices[0].message.content);\n\n // From a local file\n const imageData = readFileSync(\"image.png\").toString(\"base64\");\n\n const fromFile = await together.chat.completions.create({\n model: \"moonshotai/Kimi-K3\",\n max_tokens: 2048,\n messages: [\n {\n role: \"user\",\n content: [\n {\n type: \"image_url\",\n image_url: { url: `data:image/png;base64,${imageData}` },\n },\n { type: \"text\", text: \"Describe this image.\" },\n ],\n },\n ],\n });\n\n console.log(fromFile.choices[0].message.content);\n ```\n</CodeGroup>\n\nVision limits:\n\n* There is no limit on the number of images per request, but the whole request body must stay under 100 MB. This is the binding constraint when you inline base64.\n* 4K (4096x2160) is the recommended maximum resolution. Higher resolutions cost processing time and tokens without improving understanding.\n* Token cost scales with resolution.\n* A public URL is fetched with a plain server-side HTTP GET, so hosts that block unfamiliar clients return an error. Fall back to base64 for those.\n\nMoonshot also publishes [Perception Bench](https://www.kimi.com/blog/perception-bench), a visual reasoning benchmark, if you want to evaluate K3's visual understanding yourself.\n\n## Constrain the output to a schema\n\nPass a JSON schema through `response_format` with `\"strict\": True` to constrain the final `content`.\n\nKeep `max_tokens` generous. The whole thinking trace is spent before the first schema-constrained token is emitted, so a tight cap truncates the JSON rather than the reasoning. Parse `content` only, never `reasoning_content`.\n\n<CodeGroup>\n ```python Python theme={null}\n import json\n\n from together import Together\n\n client = Together()\n\n completion = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n max_tokens=4096,\n messages=[{\"role\": \"user\", \"content\": \"Ada Lovelace was 36 years old.\"}],\n response_format={\n \"type\": \"json_schema\",\n \"json_schema\": {\n \"name\": \"person\",\n \"strict\": True,\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\"type\": \"string\"},\n \"age\": {\"type\": \"integer\"},\n },\n \"required\": [\"name\", \"age\"],\n \"additionalProperties\": False,\n },\n },\n },\n )\n\n person = json.loads(completion.choices[0].message.content)\n print(person)\n # -> {'name': 'Ada Lovelace', 'age': 36}\n ```\n\n ```typescript TypeScript theme={null}\n import Together from \"together-ai\";\n\n const together = new Together();\n\n const completion = await together.chat.completions.create({\n model: \"moonshotai/Kimi-K3\",\n max_tokens: 4096,\n messages: [{ role: \"user\", content: \"Ada Lovelace was 36 years old.\" }],\n response_format: {\n type: \"json_schema\",\n json_schema: {\n name: \"person\",\n strict: true,\n schema: {\n type: \"object\",\n properties: {\n name: { type: \"string\" },\n age: { type: \"integer\" },\n },\n required: [\"name\", \"age\"],\n additionalProperties: false,\n },\n },\n },\n });\n\n const person = JSON.parse(completion.choices[0].message.content ?? \"{}\");\n console.log(person);\n // -> { name: 'Ada Lovelace', age: 36 }\n ```\n</CodeGroup>\n\nThe looser `{\"type\": \"json_object\"}` mode also works when you only need syntactically valid JSON.\n\n## Call tools\n\nDeclare functions in `tools`. When the model returns `tool_calls`, append the complete assistant message to history, append one `tool` message per call with the matching `tool_call_id`, then call again.\n\n`tool_choice` accepts four forms:\n\n| Value | Effect |\n| - | - |\n| `\"auto\"` | The model decides. This is also what omitting the field means. |\n| `\"required\"` | The model must call at least one tool this turn. Declare at least one callable tool. |\n| `\"none\"` | Tool calls are forbidden this turn. |\n| `{\"type\": \"function\", \"function\": {\"name\": \"get_weather\"}}` | Force one specific tool. |\n\nSet `tool_choice=\"required\"` on the first turn to force a tool call, then switch back to `\"auto\"`. Changing `tool_choice` between turns does not invalidate the prefix cache.\n\n`message.model_dump(exclude_none=True)` is the line that matters below. It round-trips the assistant turn whole, including `reasoning_content`, which K3 depends on. See [Preserve the thinking history](#preserve-the-thinking-history).\n\n<CodeGroup>\n ```python Python theme={null}\n import json\n\n from together import Together\n\n client = Together()\n\n tools = [\n {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"get_weather\",\n \"description\": \"Get the current weather for a city.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"city\": {\n \"type\": \"string\",\n \"description\": \"City name, e.g. Paris\",\n },\n \"unit\": {\n \"type\": \"string\",\n \"enum\": [\"celsius\", \"fahrenheit\"],\n },\n },\n \"required\": [\"city\"],\n \"additionalProperties\": False,\n },\n },\n }\n ]\n\n\n def get_weather(city, unit=\"celsius\"):\n return {\n \"city\": city,\n \"temperature\": 21,\n \"unit\": unit,\n \"conditions\": \"sunny\",\n }\n\n\n messages = [{\"role\": \"user\", \"content\": \"What's the weather in Paris?\"}]\n choice_mode = \"required\" # Force a tool call on turn one\n\n for _ in range(5):\n response = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=messages,\n tools=tools,\n tool_choice=choice_mode,\n max_tokens=8192,\n )\n choice = response.choices[0]\n message = choice.message\n\n # Append the complete assistant message, thinking trace included\n messages.append(message.model_dump(exclude_none=True))\n\n if choice.finish_reason != \"tool_calls\" or not message.tool_calls:\n print(message.content)\n break\n\n for call in message.tool_calls:\n try:\n args = json.loads(call.function.arguments)\n except json.JSONDecodeError:\n args = {}\n messages.append(\n {\n \"role\": \"tool\",\n \"tool_call_id\": call.id,\n \"content\": json.dumps(get_weather(**args)),\n }\n )\n\n choice_mode = \"auto\" # Hand control back after the forced turn\n ```\n\n ```typescript TypeScript theme={null}\n import Together from \"together-ai\";\n\n const together = new Together();\n\n const tools = [\n {\n type: \"function\" as const,\n function: {\n name: \"get_weather\",\n description: \"Get the current weather for a city.\",\n parameters: {\n type: \"object\",\n properties: {\n city: { type: \"string\", description: \"City name, e.g. Paris\" },\n unit: { type: \"string\", enum: [\"celsius\", \"fahrenheit\"] },\n },\n required: [\"city\"],\n additionalProperties: false,\n },\n },\n },\n ];\n\n function getWeather(city: string, unit = \"celsius\") {\n return { city, temperature: 21, unit, conditions: \"sunny\" };\n }\n\n const messages: any[] = [\n { role: \"user\", content: \"What's the weather in Paris?\" },\n ];\n let choiceMode: \"required\" | \"auto\" = \"required\";\n\n for (let i = 0; i < 5; i++) {\n const response = await together.chat.completions.create({\n model: \"moonshotai/Kimi-K3\",\n messages,\n tools,\n tool_choice: choiceMode,\n max_tokens: 8192,\n });\n\n const choice = response.choices[0];\n const message = choice.message;\n\n // Append the complete assistant message, thinking trace included\n messages.push(message);\n\n if (choice.finish_reason !== \"tool_calls\" || !message.tool_calls?.length) {\n console.log(message.content);\n break;\n }\n\n for (const call of message.tool_calls) {\n let args: { city: string; unit?: string };\n try {\n args = JSON.parse(call.function.arguments);\n } catch {\n args = { city: \"\" };\n }\n messages.push({\n role: \"tool\",\n tool_call_id: call.id,\n content: JSON.stringify(getWeather(args.city, args.unit)),\n });\n }\n\n choiceMode = \"auto\"; // Hand control back after the forced turn\n }\n ```\n</CodeGroup>\n\n## Load tools dynamically\n\nK3 can pick up a tool mid-conversation. Place a complete tool definition (full `name`, `description`, and `parameters`) inside a `system` message that carries a `tools` field and no `content`. The tool becomes available from that message's position onward.\n\nRules to follow:\n\n* Dynamic declarations use exactly the same format as the top-level `tools` field.\n* The system message must have empty content. Sending both `content` and `tools` on it returns `400: a system message with dynamic tools must have empty content`.\n* Declarations apply per request and are not retained by the server. Keep the message in later request history yourself. Keeping it preserves both the tool's availability and the cached prefix. Dropping it means the model can no longer call that tool and the changed prefix may miss the cache.\n* Append declarations at the tail of `messages`. Appending does not affect the cached prefix, while removing or modifying an earlier declaration may hurt cache hits from that point onward.\n* Keep at least one tool in the top-level `tools` array whenever you send `tool_choice`.\n\nDon't put dozens or hundreds of tool definitions into every request. They eat context and make the model more likely to pick the wrong tool. Use search-then-inject instead:\n\n1. At conversation start, declare a single `search_tools` function backed by your own catalog, plus a few core tools, and advertise the searchable domain tags in the system prompt.\n2. On the first turn, set `tool_choice=\"required\"` to force retrieval before answering.\n3. Inject the full definitions of the matching tools through a `system` message based on the retrieval results.\n4. Let the model call the loaded tools directly in later generations.\n\nDecide `reasoning_effort` before the conversation starts, since changing it mid-conversation costs you cache hits.\n\n```python Python theme={null}\nimport json\n\nfrom together import Together\n\nclient = Together()\n\nCATALOG = {\n \"convert_currency\": {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"convert_currency\",\n \"description\": \"Convert an amount from one currency to another.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"amount\": {\"type\": \"number\"},\n \"from_currency\": {\"type\": \"string\"},\n \"to_currency\": {\"type\": \"string\"},\n },\n \"required\": [\"amount\", \"from_currency\", \"to_currency\"],\n \"additionalProperties\": False,\n },\n },\n },\n}\n\nsearch_tools = {\n \"type\": \"function\",\n \"function\": {\n \"name\": \"search_tools\",\n \"description\": \"Search the tool catalog. Tags: finance, travel, files.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\"query\": {\"type\": \"string\"}},\n \"required\": [\"query\"],\n \"additionalProperties\": False,\n },\n },\n}\n\nmessages = [{\"role\": \"user\", \"content\": \"Convert 100 USD to EUR.\"}]\n\n# 1. Force retrieval before answering\nfirst = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=messages,\n tools=[search_tools],\n tool_choice=\"required\",\n max_tokens=8192,\n)\ncall = first.choices[0].message.tool_calls[0]\nmessages.append(first.choices[0].message.model_dump(exclude_none=True))\nmessages.append(\n {\n \"role\": \"tool\",\n \"tool_call_id\": call.id,\n \"content\": json.dumps(list(CATALOG)),\n }\n)\n\n# 2. Inject matching definitions at the tail: tools field, no content\nmessages.append({\"role\": \"system\", \"tools\": [CATALOG[\"convert_currency\"]]})\n\n# 3. The model calls the freshly loaded tool directly\nsecond = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=messages,\n tools=[search_tools],\n tool_choice=\"auto\",\n max_tokens=8192,\n)\nprint(second.choices[0].message.tool_calls)\n# -> convert_currency({\"amount\":100,\"from_currency\":\"USD\",\"to_currency\":\"EUR\"})\n```\n\n## Work with the 1.05M context and the cache\n\nK3 accepts up to 1.05M input tokens on Together, and context caching is automatic. There is no cache ID, TTL, or extra parameter. Keep your long prefix (system prompt, knowledge base, repo dump) byte-stable across requests so later calls hit the cache. Moonshot reports cache hit rates above 90% in coding workloads, which pulls effective input cost toward the \\$0.30 floor.\n\nMoonshot recommends placing fixed bulk context such as knowledge documents at the very beginning of the `messages` array, ahead of the system message, then appending questions and replies after it.\n\nRead the usage counters defensively. The `*_details` objects come back as plain dicts on some responses, and `completion_tokens_details` is absent entirely when you disable reasoning.\n\n```python Python theme={null}\ndef _get(obj, key, default=None):\n if obj is None:\n return default\n if isinstance(obj, dict):\n return obj.get(key, default)\n return getattr(obj, key, default)\n\n\nusage = completion.usage\nreasoning_tokens = _get(\n _get(usage, \"completion_tokens_details\"), \"reasoning_tokens\", 0\n)\ncached_tokens = _get(\n _get(usage, \"prompt_tokens_details\"),\n \"cached_tokens\",\n _get(usage, \"cached_tokens\", 0),\n)\n\nprint(\n f\"prompt={usage.prompt_tokens} cached={cached_tokens} \"\n f\"completion={usage.completion_tokens} thinking={reasoning_tokens}\"\n)\n# -> prompt=86 cached=64 completion=133 thinking=111\n```\n\n## Preserve the thinking history\n\nK3 was trained in preserved thinking history mode, so the trace is state that the next turn depends on. Return the complete assistant message on every turn, `reasoning_content` included. If you keep only `content`, generation quality becomes unstable.\n\nTogether accepts the trace back under either `reasoning_content` (what K3 emits) or the newer `reasoning` alias.\n\n```python Python theme={null}\nfrom together import Together\n\nclient = Together()\n\nprompt = (\n \"Pick a random 5-digit number and commit to it. \" \"Reply with exactly: OK\"\n)\n\n# Turn 1: let K3 think\nfirst = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=[{\"role\": \"user\", \"content\": prompt}],\n max_tokens=4000,\n)\n\n# Replay the assistant turn whole: model_dump keeps reasoning_content\nhistory = [\n {\"role\": \"user\", \"content\": prompt},\n first.choices[0].message.model_dump(exclude_none=True),\n {\n \"role\": \"user\",\n \"content\": \"What number did you pick? Reply with just the number.\",\n },\n]\n\nsecond = client.chat.completions.create(\n model=\"moonshotai/Kimi-K3\",\n messages=history,\n max_tokens=4000,\n)\nprint(second.choices[0].message.content)\n```\n\nDrop the trace from the replay and the model answers with a freshly invented number instead, because the commitment lived in the reasoning rather than in `content`.\n\n<Warning>\n Don't switch an ongoing session over to K3 from another model. K3 inherits a history that contains no K3 thinking at all, and quality degrades. Start K3 sessions on K3.\n</Warning>\n\n## Sampling parameters\n\nMost sampling parameters are fixed server-side. Omit them and let the defaults apply.\n\n| Parameter | Behavior on Together |\n| - | - |\n| `temperature` | Fixed at 1.0. |\n| `top_p` | Fixed at 0.95. Any other value returns `400`. |\n| `n` | Fixed at 1. Best-of-n has to live in your own harness. |\n| `presence_penalty`, `frequency_penalty` | Fixed at 0. |\n| `logprobs` | Not supported. Returns `400`. |\n| `top_k`, `min_p`, `repetition_penalty`, `stop`, `seed` | Accepted. |\n| `max_tokens` | No ceiling below the 1.05M context limit. Cap it yourself for short answers. |\n| `reasoning_effort` | `\"low\"`, `\"medium\"`, `\"high\"`, or `\"max\"` (default). Invalid strings are accepted silently, so validate client-side. |\n| `reasoning` | `{\"enabled\": False}` disables thinking entirely. |\n\n## Architecture\n\nTwo architectural changes form K3's backbone, both aimed at moving information through longer sequences and deeper into the network:\n\n* **Kimi Delta Attention (KDA):** A hybrid linear attention mechanism that provides an efficient foundation for scaling attention across very long contexts. This is Moonshot's first model to support a 1.05M context window.\n* **Attention Residuals (AttnRes):** Selectively retrieves representations across model depth rather than accumulating them uniformly.\n\nOn top of that, Moonshot pushed mixture-of-experts (MoE) sparsity further with the Stable LatentMoE framework, activating 16 of 896 experts. At roughly 2% of experts active per token, routing and optimization become first-order problems, so four supporting techniques keep training stable at 2.8T scale:\n\n* **Quantile Balancing:** Derives expert allocation directly from router-score quantiles, which eliminates heuristic updates and a sensitive balancing hyperparameter.\n* **Per-Head Muon:** Extends the Muon optimizer to optimize attention heads independently for more adaptive learning at scale.\n* **Sigmoid Tanh Unit (SiTU):** Improves activation control.\n* **Gated MLA:** Improves attention selectivity.\n\nK3 continues a sustained scaling push: in nine of the 12 months from July 2025 to July 2026, Kimi models set the upper bound of open-model scale. At 2.8T parameters, K3 is the largest open-weight model released to date.\n\n## Use cases\n\nK3 is strongest where a task runs long and needs little supervision:\n\n* **Long-horizon coding:** Sustained engineering sessions, navigation of massive repositories, and orchestration of terminal tools.\n* **Vision in the loop:** Iterating between code and live screenshots for game development, frontend engineering, and CAD, using visual feedback rather than a written description of the render.\n* **Research pipelines:** Reviewing literature, implementing a numerical pipeline, cross-validating results, and producing an interactive deliverable in one run.\n* **End-to-end knowledge work:** Deep research reports with interactive charts, timelines, and slides rather than a paragraph of prose.\n* **Large-repository refactoring:** Cross-file, multi-step engineering work held together by the 1.05M context window.\n* **Agentic tool orchestration:** Long tool-calling loops with reasoning between steps and tools loaded on demand.\n\n## Limitations\n\n* **Cost on short, high-volume calls:** Thinking defaults to `\"max\"`, so a pipeline that never sets `reasoning_effort` pays the maximum reasoning bill on every call. Reasoning tokens bill as output at \\$15.00 per 1M. Drop trivial calls to `\"low\"` or disable reasoning outright.\n* **Excessive proactiveness:** K3's training emphasizes long, difficult tasks, so it may make decisions on your behalf when it hits a minor issue or ambiguous intent mid-task. State hard constraints explicitly in the system prompt or in `AGENTS.md`.\n* **Mid-session model swaps:** Switching an in-flight session to K3 from another model leaves it without any K3 thinking history and destabilizes output.\n* **Cache fragility:** Restructuring earlier messages or editing an earlier tool declaration breaks the prefix cache and reprices the affected input from \\$0.30 to \\$3.00 per 1M tokens.\n\n## Usage tips\n\n| Tip | Rationale |\n| - | - |\n| **Give `max_tokens` real headroom** | The trace shares the completion budget with the answer. A tight cap returns empty or truncated `content`. |\n| **Return the complete assistant message every turn** | `message.model_dump(exclude_none=True)` keeps `reasoning_content` in history, which K3 was trained to depend on. |\n| **Read both `reasoning_content` and `reasoning`** | K3 emits the trace on `reasoning_content`. Other Together models use the `reasoning` alias. One handler then covers both. |\n| **Parse `content` only** | Never run JSON parsing over the thinking trace. |\n| **Set `reasoning_effort` deliberately** | `\"max\"` is the default and the most expensive setting. Match the level to the task. |\n| **Keep prefixes byte-stable** | Caching is automatic, so stable prefixes are what pull effective input cost toward \\$0.30 per 1M tokens. |\n| **Put bulk context first** | Place knowledge documents at the very start of `messages`, ahead of the system message, then append the conversation. |\n| **Inject dynamic tools at the tail** | Appending is cache-safe. Editing an earlier declaration invalidates everything after it. |\n| **Omit the fixed sampling parameters** | `top_p`, `n`, and the penalties are fixed server-side and return `400` on any other value. |\n| **Think in goals, not steps** | K3 is agentic. Give high-level objectives and let it orchestrate sub-tasks and tool calls. |\n\n## Next steps\n\n<CardGroup cols={2}>\n <Card title=\"Reasoning\" icon=\"brain\" href=\"/docs/inference/chat/reasoning\">\n Control reasoning depth and handle reasoning output across models.\n </Card>\n\n <Card title=\"Function calling\" icon=\"tool\" href=\"/docs/inference/function-calling/overview\">\n Build tool-calling loops against any function-calling model.\n </Card>\n\n <Card title=\"Vision\" icon=\"photo\" href=\"/docs/inference/vision/overview\">\n Send images to vision models and read the results.\n </Card>\n\n <Card title=\"Serverless models\" icon=\"stack-2\" href=\"/docs/serverless/models\">\n Browse every model, context length, and price on serverless inference.\n </Card>\n</CardGroup>\n\n\nThis documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.",
+ "https://developers.openai.com/api/docs/models/gpt-6.2-astra.md": "# GPT-6.2 Astra\n\n> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.\n\n> Our most capable model for your hardest projects, from start to finish.\n\nModel ID: `gpt-6.2-astra`\n\nGPT-6.2 Astra can build and revise software, use a computer, and work with documents.\nIt accepts text and images and responds with text.\nIn the Responses API, use the [Multi-agent beta](/api/docs/guides/responses-multi-agent) to delegate work to subagents.\n\nThe API rejects requests that set reasoning effort to `none`.\n\nThe Responses API supports [discounted background completion windows](/api/docs/guides/background#use-discounted-completion-windows) in public beta.\n\n## Model details\n\n- Input modalities: text, image\n- Output modalities: text\n- Unsupported modalities: audio, video\n- 1,050,000 context window\n- Maximum input tokens: 922,000\n- 128,000 max output tokens\n- May 18, 2026 knowledge cutoff\n- Reasoning token support\n\n## Pricing\n\nPrices are per 1M tokens. See the [pricing page](/api/docs/pricing) for processing tiers and billing details.\n\n### Text tokens\n\n| Metric | Price | Unit |\n| --- | ---: | --- |\n| Input | $8 | 1M tokens |\n| Cached input | $0.4 | 1M tokens |\n| Cache writes | $10 | 1M tokens |\n| Output | $40 | 1M tokens |\n\n- The cache write price is for 30 minutes of retention. A 12-hour cache write costs $20 per million tokens for short-context requests at Standard pricing.\n- For requests with more than 272K input tokens, input and cache rates double and output costs 1.5 times the short-context rate for the full request.\n- Batch costs 50% of Standard rates. Fast mode costs twice the Standard rate for the same context length.\n- Ultrafast costs 3 times the Standard rate through February 28, 2027, and 6 times the Standard rate starting March 1, 2027 (Pacific time).\n\n## Endpoints\n\n| Endpoint | Route | Support |\n| --- | --- | --- |\n| Chat Completions | `v1/chat/completions` | Supported |\n| Responses | `v1/responses` | Supported |\n| Realtime | `v1/realtime` | Not supported |\n| Assistants | `v1/assistants` | Not supported |\n| Batch | `v1/batch` | Supported |\n| Fine-tuning | `v1/fine-tuning` | Not supported |\n| Image generation | `v1/images/generations` | Not supported |\n| Videos | `v1/videos` | Not supported |\n| Image edit | `v1/images/edits` | Not supported |\n| Speech generation | `v1/audio/speech` | Not supported |\n| Transcription | `v1/audio/transcriptions` | Not supported |\n| Translation | `v1/audio/translations` | Not supported |\n\n## Supported features\n\n- streaming\n- structured_outputs\n- function_calling\n- file_search\n- image_input\n- web_search\n- prompt_caching\n\n## Unsupported features\n\n- fine_tuning\n- predicted_outputs\n\n## Supported tools\n\nTools supported by this model when using the Responses API.\n\n- web_search\n- file_search\n- image_generation\n- code_interpreter\n- hosted_shell\n- apply_patch\n- skills\n- computer_use\n- mcp\n- tool_search\n\n## Model IDs\n\n- `gpt-6.2-astra`\n\n## Cloud providers\n\nModel IDs across cloud providers.\n\n| Provider | Model ID |\n| --- | --- |\n| [Google Cloud](/api/docs/guides/google-cloud)<br>Private preview | `gpt-6.2-astra` |\n\n## Rate limits\n\nRate limits ensure fair and reliable access to the API by placing specific caps on requests, tokens, audio duration, or other usage within a given time period. Your usage tier determines how high these limits are set and automatically increases as you send more requests and spend more on the API.\n\n### Standard\n\n| Tier | RPM | TPM |\n| --- | ---: | ---: |\n| Build | 5,000 | 1,000,000 |\n| Launch | 10,000 | 4,000,000 |\n| Grow | 15,000 | 40,000,000 |\n",
+ "https://developers.openai.com/api/docs/models/gpt-6.2-sol.md": "# GPT-6.2 Sol\n\n> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.\n\n> Our go-to model for everyday work, from coding to powering agents at scale.\n\nModel ID: `gpt-6.2-sol`\n\nGPT-6.2 Sol accepts text and image inputs and produces text. Use it with the\nResponses API to call tools such as web search and computer use, or to delegate\nwork to subagents with the [Multi-agent beta](/api/docs/guides/responses-multi-agent).\n\nThe API rejects requests that set reasoning effort to `none`.\n\nThe Responses API supports [discounted background completion windows](/api/docs/guides/background#use-discounted-completion-windows) in public beta.\n\n## Model details\n\n- Input modalities: text, image\n- Output modalities: text\n- Unsupported modalities: audio, video\n- 1,050,000 context window\n- Maximum input tokens: 922,000\n- 128,000 max output tokens\n- Jun 01, 2026 knowledge cutoff\n- Reasoning token support\n\n## Pricing\n\nPrices are per 1M tokens. See the [pricing page](/api/docs/pricing) for processing tiers and billing details.\n\n### Text tokens\n\n| Metric | Price | Unit |\n| --- | ---: | --- |\n| Input | $2 | 1M tokens |\n| Cached input | $0.1 | 1M tokens |\n| Cache writes | $2.5 | 1M tokens |\n| Output | $10 | 1M tokens |\n\n- The cache write price is for 30 minutes of retention. A 12-hour cache write costs $5 per million tokens for short-context requests at Standard pricing.\n- For requests with more than 272K input tokens, input and cache rates double and output costs 1.5 times the short-context rate for the full request.\n- Batch costs 50% of Standard rates. Fast mode costs twice the Standard rate for the same context length.\n- Ultrafast costs 3 times the Standard rate through February 28, 2027, and 6 times the Standard rate starting March 1, 2027 (Pacific time).\n\n## Endpoints\n\n| Endpoint | Route | Support |\n| --- | --- | --- |\n| Chat Completions | `v1/chat/completions` | Supported |\n| Responses | `v1/responses` | Supported |\n| Realtime | `v1/realtime` | Not supported |\n| Assistants | `v1/assistants` | Not supported |\n| Batch | `v1/batch` | Supported |\n| Fine-tuning | `v1/fine-tuning` | Not supported |\n| Image generation | `v1/images/generations` | Not supported |\n| Videos | `v1/videos` | Not supported |\n| Image edit | `v1/images/edits` | Not supported |\n| Speech generation | `v1/audio/speech` | Not supported |\n| Transcription | `v1/audio/transcriptions` | Not supported |\n| Translation | `v1/audio/translations` | Not supported |\n\n## Supported features\n\n- streaming\n- structured_outputs\n- function_calling\n- file_search\n- image_input\n- web_search\n- prompt_caching\n\n## Unsupported features\n\n- fine_tuning\n- predicted_outputs\n\n## Supported tools\n\nTools supported by this model when using the Responses API.\n\n- web_search\n- file_search\n- image_generation\n- code_interpreter\n- hosted_shell\n- apply_patch\n- skills\n- computer_use\n- mcp\n- tool_search\n\n## Model IDs\n\n- `gpt-6.2-sol`\n\n## Cloud providers\n\nModel IDs across cloud providers.\n\n| Provider | Model ID |\n| --- | --- |\n| [Google Cloud](/api/docs/guides/google-cloud)<br>Private preview | `gpt-6.2-sol` |\n\n## Rate limits\n\nRate limits ensure fair and reliable access to the API by placing specific caps on requests, tokens, audio duration, or other usage within a given time period. Your usage tier determines how high these limits are set and automatically increases as you send more requests and spend more on the API.\n\n### Standard\n\n| Tier | RPM | TPM |\n| --- | ---: | ---: |\n| Build | 5,000 | 1,000,000 |\n| Launch | 10,000 | 4,000,000 |\n| Grow | 15,000 | 40,000,000 |\n"
3 additions and 1 deletionsrc/server/providers/model-facts.tsModified
View file
@@ -282,7 +282,9 @@
// markdown page states (#543). A v40 page entry has no markdown price
// and would log pricing_lost until the TTL.
// v42: the BytePlus pricing entry gained `named` (#646); a v41 entry has none.
-const DOCS_CACHE_VERSION = 'v42'
+// v43: an OpenAI page that rejects `none` effort is effort mode, mandatory
+// true (#711). A v42 entry would keep GPT-6.2 reasoning null for six hours.
+const DOCS_CACHE_VERSION = 'v43'
​
/** Fresh-window key for one parsed docs page. Shared with the stale copy. */
export function docsCacheKey(url: string): string {