{ "model_id": "minimax/m3", "provider_id": "minimax", "name": "MiniMax M3", "description": "MiniMax's M3 language model with frontier coding and agentic capabilities, a 1M token context window, and multilingual support.", "task": "Text Generation", "tags": [ "LLM", "Multilingual" ], "context_length": 1000000, "max_output_tokens": 4096, "schema_version": "1.0.0", "pricing": { "Input <=512k (per 1M)": 0.3, "Output <=512k (per 1M)": 1.2, "Cached input <=512k (per 1M)": 0.06, "Input >512k (per 1M)": 0.6, "Output >512k (per 1M)": 2.4, "Cached input >512k (per 1M)": 0.12 }, "examples": [ { "name": "Simple Conversation", "description": "Basic chat completion request", "input": { "max_tokens": 2048, "messages": [ { "content": "What is the capital of France?", "role": "user" } ] }, "output": { "text": "The capital of France is **Paris**." }, "raw_response": { "id": "066cf8a95614a7ebfcaa6ffd7f2cd663", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "The capital of France is **Paris**.", "name": "MiniMax AI", "audio_content": "", "reasoning_content": "The user is asking a simple factual question: \"What is the capital of France?\" This is straightforward - the capital of France is Paris.", "reasoning_details": [ { "type": "reasoning.text", "id": "reasoning-text-1", "format": "MiniMax-response-v1", "index": 0, "text": "The user is asking a simple factual question: \"What is the capital of France?\" This is straightforward - the capital of France is Paris." } ] }, "finish_reason": "stop" } ], "created": 1780336041, "model": "MiniMax-M3", "object": "chat.completion", "usage": { "total_tokens": 221, "prompt_tokens": 183, "completion_tokens": 38, "total_characters": 0, "prompt_tokens_details": { "cached_tokens": 114 } }, "input_sensitive": false, "output_sensitive": false, "base_resp": { "status_code": 0, "status_msg": "" }, "input_sensitive_type": 0, "output_sensitive_type": 0, "output_sensitive_int": 0, "gatewayMetadata": { "keySource": "Unified" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'minimax/m3',\n { max_tokens: 2048, messages: [{ content: 'What is the capital of France?', role: 'user' }] },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"minimax/m3\",\n \"max_tokens\": 2048,\n \"messages\": [\n {\n \"content\": \"What is the capital of France?\",\n \"role\": \"user\"\n }\n ]\n}'" } ] }, { "name": "With System Prompt", "description": "Using a system prompt to guide behavior", "input": { "max_tokens": 2048, "messages": [ { "content": "You are a helpful cooking assistant. Give concise recipes with metric measurements.", "role": "system" }, { "content": "How do I make a simple pasta aglio e olio?", "role": "user" } ], "temperature": 0.7 }, "output": { "text": "# Pasta Aglio e Olio\n\nA classic Italian dish that comes together in minutes with just a few ingredients.\n\n**Serves:** 2 | **Prep:** 5 min | **Cook:** 15 min\n\n## Ingredients\n- 200 g spaghetti or linguine\n- 80 ml extra virgin olive oil\n- 4 garlic cloves, thinly sliced\n- 1\u20132 small dried red chilies, crushed (or \u00bc tsp chili flakes)\n- Salt, for pasta water\n- 15 g fresh flat-leaf parsley, chopped\n- Grated Parmesan or Pecorino (optional, traditionalists skip it)\n\n## Method\n1. **Boil pasta:** Bring a large pot of well-salted water to a rolling boil. Cook the pasta until al dente (about 1 minute less than package instructions). Reserve 1 cup of pasta water before draining.\n2. **Infuse oil:** While the pasta cooks, gently heat the olive oil in a wide pan over low-medium heat. Add the garlic and chilies, and cook slowly for 2\u20133 minutes until the garlic turns pale golden. **Don't let it brown** \u2014 it will turn bitter.\n3. **Combine:** Add the drained pasta to the pan with a splash of reserved pasta water. Toss vigorously over medium heat for about 1 minute so the pasta absorbs the oil.\n4. **Finish:** Add more pasta water as needed to create a light, silky sauce that coats the noodles. Stir in the parsley and season with salt.\n5. **Serve** immediately, topped with cheese if using.\n\n## Tips\n- Cold olive oil + slow heat = better flavor extraction.\n- The starch in the pasta water is key to a glossy, emulsified sauce.\n\nBuon appetito! \ud83c\udf5d" }, "raw_response": { "id": "066cf8abfaba58c357c660ebfad38073", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "# Pasta Aglio e Olio\n\nA classic Italian dish that comes together in minutes with just a few ingredients.\n\n**Serves:** 2 | **Prep:** 5 min | **Cook:** 15 min\n\n## Ingredients\n- 200 g spaghetti or linguine\n- 80 ml extra virgin olive oil\n- 4 garlic cloves, thinly sliced\n- 1\u20132 small dried red chilies, crushed (or \u00bc tsp chili flakes)\n- Salt, for pasta water\n- 15 g fresh flat-leaf parsley, chopped\n- Grated Parmesan or Pecorino (optional, traditionalists skip it)\n\n## Method\n1. **Boil pasta:** Bring a large pot of well-salted water to a rolling boil. Cook the pasta until al dente (about 1 minute less than package instructions). Reserve 1 cup of pasta water before draining.\n2. **Infuse oil:** While the pasta cooks, gently heat the olive oil in a wide pan over low-medium heat. Add the garlic and chilies, and cook slowly for 2\u20133 minutes until the garlic turns pale golden. **Don't let it brown** \u2014 it will turn bitter.\n3. **Combine:** Add the drained pasta to the pan with a splash of reserved pasta water. Toss vigorously over medium heat for about 1 minute so the pasta absorbs the oil.\n4. **Finish:** Add more pasta water as needed to create a light, silky sauce that coats the noodles. Stir in the parsley and season with salt.\n5. **Serve** immediately, topped with cheese if using.\n\n## Tips\n- Cold olive oil + slow heat = better flavor extraction.\n- The starch in the pasta water is key to a glossy, emulsified sauce.\n\nBuon appetito! \ud83c\udf5d", "name": "MiniMax AI", "audio_content": "", "reasoning_content": "The user is asking for a simple pasta aglio e olio recipe. The system prompt says I should give concise recipes with metric measurements. Let me provide a classic, simple recipe.", "reasoning_details": [ { "type": "reasoning.text", "id": "reasoning-text-1", "format": "MiniMax-response-v1", "index": 0, "text": "The user is asking for a simple pasta aglio e olio recipe. The system prompt says I should give concise recipes with metric measurements. Let me provide a classic, simple recipe." } ] }, "finish_reason": "stop" } ], "created": 1780336043, "model": "MiniMax-M3", "object": "chat.completion", "usage": { "total_tokens": 595, "prompt_tokens": 197, "completion_tokens": 398, "total_characters": 0, "prompt_tokens_details": { "cached_tokens": 114 } }, "input_sensitive": false, "output_sensitive": false, "base_resp": { "status_code": 0, "status_msg": "" }, "input_sensitive_type": 0, "output_sensitive_type": 0, "output_sensitive_int": 0, "gatewayMetadata": { "keySource": "Unified" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'minimax/m3',\n {\n max_tokens: 2048,\n messages: [\n {\n content:\n 'You are a helpful cooking assistant. Give concise recipes with metric measurements.',\n role: 'system',\n },\n { content: 'How do I make a simple pasta aglio e olio?', role: 'user' },\n ],\n temperature: 0.7,\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"minimax/m3\",\n \"max_tokens\": 2048,\n \"messages\": [\n {\n \"content\": \"You are a helpful cooking assistant. Give concise recipes with metric measurements.\",\n \"role\": \"system\"\n },\n {\n \"content\": \"How do I make a simple pasta aglio e olio?\",\n \"role\": \"user\"\n }\n ],\n \"temperature\": 0.7\n}'" } ] }, { "name": "Multi-turn Conversation", "description": "Continuing a conversation with context", "input": { "max_tokens": 2048, "messages": [ { "content": "What are the main differences between TCP and UDP?", "role": "user" }, { "content": "TCP is connection-oriented and guarantees delivery, while UDP is connectionless and faster but without delivery guarantees.", "role": "assistant" }, { "content": "When would I choose UDP over TCP?", "role": "user" } ], "temperature": 0.5 }, "output": { "text": "Use UDP for time-sensitive applications like video streaming, online gaming, or VoIP where speed matters more than perfect reliability." }, "raw_response": { "id": "066cf8bb1c666fc68c6810518100c7ba", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Use UDP for time-sensitive applications like video streaming, online gaming, or VoIP where speed matters more than perfect reliability.", "name": "MiniMax AI", "audio_content": "", "reasoning_content": "" }, "finish_reason": "stop" } ], "created": 1780336059, "model": "MiniMax-M3", "object": "chat.completion", "usage": { "total_tokens": 250, "prompt_tokens": 225, "completion_tokens": 25, "total_characters": 0, "prompt_tokens_details": { "cached_tokens": 114 } }, "input_sensitive": false, "output_sensitive": false, "base_resp": { "status_code": 0, "status_msg": "" }, "input_sensitive_type": 0, "output_sensitive_type": 0, "output_sensitive_int": 0, "gatewayMetadata": { "keySource": "Unified" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'minimax/m3',\n {\n max_tokens: 2048,\n messages: [\n { content: 'What are the main differences between TCP and UDP?', role: 'user' },\n {\n content:\n 'TCP is connection-oriented and guarantees delivery, while UDP is connectionless and faster but without delivery guarantees.',\n role: 'assistant',\n },\n { content: 'When would I choose UDP over TCP?', role: 'user' },\n ],\n temperature: 0.5,\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"minimax/m3\",\n \"max_tokens\": 2048,\n \"messages\": [\n {\n \"content\": \"What are the main differences between TCP and UDP?\",\n \"role\": \"user\"\n },\n {\n \"content\": \"TCP is connection-oriented and guarantees delivery, while UDP is connectionless and faster but without delivery guarantees.\",\n \"role\": \"assistant\"\n },\n {\n \"content\": \"When would I choose UDP over TCP?\",\n \"role\": \"user\"\n }\n ],\n \"temperature\": 0.5\n}'" } ] }, { "name": "Creative Writing", "description": "Higher temperature for creative output", "input": { "max_tokens": 2048, "messages": [ { "content": "Write a haiku about programming.", "role": "user" } ], "temperature": 0.9 }, "output": { "text": "Fingers on the keys,\nBuilding worlds from empty void\u2014\nCode becomes the light." }, "raw_response": { "id": "066cf8be5675980f2ff647974879fb77", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Fingers on the keys,\nBuilding worlds from empty void\u2014\nCode becomes the light.", "name": "MiniMax AI", "audio_content": "", "reasoning_content": "The user wants a haiku about programming. A haiku is a traditional Japanese poem with three lines following a 5-7-5 syllable pattern. I should create one that captures something meaningful about programming.\n\nLet me think of a few options:\n\n1. About debugging:\nLines (5-7-5):\n- \"Bugs hide in the code\" (4) - need 5\n- \"Silent errors whisper\" (6) - need 7\n- \"Find them, fix, deploy\" (5) \u2713\n\nLet me recount:\n- \"Bugs hide in the code\" - Bugs(1) hide(2) in(3) the(4) code(5) = 5 \u2713\n- \"Silent errors whisper\" - Si-lent(2) er-rors(4) whis-per(6) = 6, need 7\n- Try: \"Silent errors always whisper\" - 7 \u2713\n- \"Find them, fix, deploy\" - Find(1) them(2) fix(3) de-ploy(5) = 5 \u2713\n\n2. About code in general:\n- \"Logic flows like streams\" (5) - Lo-gic(2) flows(3) like(4) streams(5) = 5 \u2713\n- \"Through brackets and curved braces\" (7) - Through(1) brack-ets(3) and(4) curved(5) bra-ces(7) = 7 \u2713\n- \"Dreams made into life\" (5) - Dreams(1) made(2) in-to(4) life(5) = 5 \u2713\n\n3. Another option:\n- \"Fingers on the keys\" (5) - Fin-gers(2) on(3) the(4) keys(5) = 5 \u2713\n- \"Building worlds from nothing\" (7) - Build-ing(2) worlds(3) from(4) no-thing(6) = 6, need 7\n- Try: \"Building worlds from empty void\" - Build-ing(2) worlds(3) from(4) emp-ty(6) void(7) = 7 \u2713\n- \"Code becomes the light\" (5) - Code(1) be-comes(3) the(4) light(5) = 5 \u2713\n\nLet me go with option 2 or 3, both are nice. I'll provide one clean haiku and maybe offer an alternative.\n\nActually, let me just give one good one. Option 3 feels more poetic and evocative.\n\nLet me verify option 3 once more:\n- \"Fingers on the keys\" - Fin-gers(2) on(3) the(4) keys(5) = 5 \u2713\n- \"Building worlds from empty void\" - Build-ing(2) worlds(3) from(4) emp-ty(6) void(7) = 7 \u2713\n- \"Code becomes the light\" - Code(1) be-comes(3) the(4) light(5) = 5 \u2713\n\nThat works well. I could also provide a simpler one focused on a different aspect of programming.\n\nI'll give a haiku with a clean delivery. Let me also think about a second option to make it more useful, or just stick with one well-crafted one.\n\nI'll provide one haiku and keep it concise.", "reasoning_details": [ { "type": "reasoning.text", "id": "reasoning-text-1", "format": "MiniMax-response-v1", "index": 0, "text": "The user wants a haiku about programming. A haiku is a traditional Japanese poem with three lines following a 5-7-5 syllable pattern. I should create one that captures something meaningful about programming.\n\nLet me think of a few options:\n\n1. About debugging:\nLines (5-7-5):\n- \"Bugs hide in the code\" (4) - need 5\n- \"Silent errors whisper\" (6) - need 7\n- \"Find them, fix, deploy\" (5) \u2713\n\nLet me recount:\n- \"Bugs hide in the code\" - Bugs(1) hide(2) in(3) the(4) code(5) = 5 \u2713\n- \"Silent errors whisper\" - Si-lent(2) er-rors(4) whis-per(6) = 6, need 7\n- Try: \"Silent errors always whisper\" - 7 \u2713\n- \"Find them, fix, deploy\" - Find(1) them(2) fix(3) de-ploy(5) = 5 \u2713\n\n2. About code in general:\n- \"Logic flows like streams\" (5) - Lo-gic(2) flows(3) like(4) streams(5) = 5 \u2713\n- \"Through brackets and curved braces\" (7) - Through(1) brack-ets(3) and(4) curved(5) bra-ces(7) = 7 \u2713\n- \"Dreams made into life\" (5) - Dreams(1) made(2) in-to(4) life(5) = 5 \u2713\n\n3. Another option:\n- \"Fingers on the keys\" (5) - Fin-gers(2) on(3) the(4) keys(5) = 5 \u2713\n- \"Building worlds from nothing\" (7) - Build-ing(2) worlds(3) from(4) no-thing(6) = 6, need 7\n- Try: \"Building worlds from empty void\" - Build-ing(2) worlds(3) from(4) emp-ty(6) void(7) = 7 \u2713\n- \"Code becomes the light\" (5) - Code(1) be-comes(3) the(4) light(5) = 5 \u2713\n\nLet me go with option 2 or 3, both are nice. I'll provide one clean haiku and maybe offer an alternative.\n\nActually, let me just give one good one. Option 3 feels more poetic and evocative.\n\nLet me verify option 3 once more:\n- \"Fingers on the keys\" - Fin-gers(2) on(3) the(4) keys(5) = 5 \u2713\n- \"Building worlds from empty void\" - Build-ing(2) worlds(3) from(4) emp-ty(6) void(7) = 7 \u2713\n- \"Code becomes the light\" - Code(1) be-comes(3) the(4) light(5) = 5 \u2713\n\nThat works well. I could also provide a simpler one focused on a different aspect of programming.\n\nI'll give a haiku with a clean delivery. Let me also think about a second option to make it more useful, or just stick with one well-crafted one.\n\nI'll provide one haiku and keep it concise." } ] }, "finish_reason": "stop" } ], "created": 1780336062, "model": "MiniMax-M3", "object": "chat.completion", "usage": { "total_tokens": 912, "prompt_tokens": 183, "completion_tokens": 729, "total_characters": 0, "prompt_tokens_details": { "cached_tokens": 114 } }, "input_sensitive": false, "output_sensitive": false, "base_resp": { "status_code": 0, "status_msg": "" }, "input_sensitive_type": 0, "output_sensitive_type": 0, "output_sensitive_int": 0, "gatewayMetadata": { "keySource": "Unified" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'minimax/m3',\n {\n max_tokens: 2048,\n messages: [{ content: 'Write a haiku about programming.', role: 'user' }],\n temperature: 0.9,\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"minimax/m3\",\n \"max_tokens\": 2048,\n \"messages\": [\n {\n \"content\": \"Write a haiku about programming.\",\n \"role\": \"user\"\n }\n ],\n \"temperature\": 0.9\n}'" } ] } ], "default_example": null, "code_snippets": [], "supports_async": false, "zdr": true, "zdr_comment": null, "external_info": "https://www.minimax.io/blog/minimax-m3", "terms": "https://www.minimaxi.com/terms", "cover_image_url": "https://pub-26f1392c1b674324be6786695bd72257.r2.dev/minimax/m3.png", "metadata": { "Architecture": "Transformer", "fedrampAvailable": "true" }, "request_formats": [ "chat-completions", "anthropic-messages" ], "providers": null, "provider_details": [ { "id": "minimax", "pricing": { "under_512k_per_1m_input_tokens": 0.3, "under_512k_per_1m_output_tokens": 1.2, "under_512k_per_1m_input_cached_tokens": 0.06, "over_512k_per_1m_input_tokens": 0.6, "over_512k_per_1m_output_tokens": 2.4, "over_512k_per_1m_input_cached_tokens": 0.12 } } ], "banner": null, "created_at": "2026-06-01 20:11:36", "schema": { "input": { "$schema": "https://json-schema.org/draft/2020-12/schema", "oneOf": [ { "type": "object", "properties": { "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string", "enum": [ "system", "user", "assistant", "tool" ] }, "name": { "type": "string" }, "content": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" } }, "required": [ "type", "text" ], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "image_url" }, "image_url": { "type": "object", "properties": { "url": { "type": "string" } }, "required": [ "url" ], "additionalProperties": false } }, "required": [ "type", "image_url" ], "additionalProperties": false } ] } } ] }, "tool_calls": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "const": "function" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } }, "required": [ "name", "arguments" ], "additionalProperties": false } }, "required": [ "id", "type", "function" ], "additionalProperties": false } } }, "required": [ "role", "content" ], "additionalProperties": {} } }, "temperature": { "type": "number", "minimum": 0, "maximum": 1 }, "max_tokens": { "type": "number", "exclusiveMinimum": 0 }, "max_completion_tokens": { "type": "number", "exclusiveMinimum": 0 }, "top_p": { "type": "number", "minimum": 0, "maximum": 1 }, "stream": { "type": "boolean" }, "stream_options": { "type": "object", "properties": { "include_usage": { "type": "boolean" } }, "additionalProperties": false }, "tools": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "const": "function" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "parameters": {} }, "required": [ "name", "description", "parameters" ], "additionalProperties": false } }, "required": [ "type", "function" ], "additionalProperties": false } }, "tool_choice": { "type": "string", "enum": [ "none", "auto" ] }, "response_format": { "type": "object", "properties": { "type": { "type": "string", "const": "json_schema" }, "json_schema": { "type": "object", "properties": { "name": { "type": "string", "maxLength": 64 }, "description": { "type": "string" }, "schema": { "type": "object", "properties": { "type": { "type": "string", "const": "object" }, "properties": {} }, "required": [ "type", "properties" ], "additionalProperties": false } }, "required": [ "name", "schema" ], "additionalProperties": false } }, "required": [ "type", "json_schema" ], "additionalProperties": false }, "mask_sensitive_info": { "type": "boolean" } }, "required": [ "messages" ], "additionalProperties": false, "title": "Chat Completions" }, { "type": "object", "properties": { "messages": { "type": "array", "items": { "type": "object", "properties": { "role": { "type": "string", "enum": [ "user", "assistant", "system" ] }, "content": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "text": { "type": "string" }, "source": {}, "cache_control": { "type": "object", "properties": { "type": { "type": "string", "const": "ephemeral" }, "ttl": { "type": "string", "enum": [ "5m", "1h" ] } }, "required": [ "type" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": {} } } ] } }, "required": [ "role", "content" ], "additionalProperties": false } }, "max_tokens": { "type": "number", "exclusiveMinimum": 0 }, "system": { "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string", "const": "text" }, "text": { "type": "string" }, "cache_control": { "type": "object", "properties": { "type": { "type": "string", "const": "ephemeral" }, "ttl": { "type": "string", "enum": [ "5m", "1h" ] } }, "required": [ "type" ], "additionalProperties": false } }, "required": [ "type", "text" ], "additionalProperties": {} } } ] }, "temperature": { "type": "number", "minimum": 0, "maximum": 1 }, "top_p": { "type": "number", "minimum": 0, "maximum": 1 }, "top_k": { "type": "number", "exclusiveMinimum": 0 }, "stream": { "type": "boolean" }, "metadata": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": {} } }, "required": [ "messages", "max_tokens" ], "additionalProperties": {}, "title": "Messages" } ] }, "output": { "$schema": "https://json-schema.org/draft/2020-12/schema", "oneOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "choices": { "type": "array", "items": { "type": "object", "properties": { "index": { "type": "number" }, "message": { "type": "object", "properties": { "role": { "type": "string", "const": "assistant" }, "content": { "type": "string" }, "tool_calls": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "const": "function" }, "function": { "type": "object", "properties": { "name": { "type": "string" }, "arguments": { "type": "string" } }, "required": [ "name", "arguments" ], "additionalProperties": false } }, "required": [ "id", "type", "function" ], "additionalProperties": false } } }, "required": [ "role", "content" ], "additionalProperties": {} }, "finish_reason": { "type": "string", "enum": [ "stop", "length", "tool_calls" ] } }, "required": [ "index", "message", "finish_reason" ], "additionalProperties": {} } }, "created": { "type": "number" }, "model": { "type": "string" }, "object": { "type": "string", "enum": [ "chat.completion", "chat.completion.chunk" ] }, "usage": { "type": "object", "properties": { "total_tokens": { "type": "number" }, "prompt_tokens": { "type": "number" }, "completion_tokens": { "type": "number" } }, "required": [ "total_tokens", "prompt_tokens", "completion_tokens" ], "additionalProperties": {} }, "input_sensitive": { "type": "boolean" }, "output_sensitive": { "type": "boolean" }, "base_resp": { "type": "object", "properties": { "status_code": { "type": "number" }, "status_msg": { "type": "string" } }, "required": [ "status_code", "status_msg" ], "additionalProperties": false } }, "required": [ "id", "choices", "created", "model", "object" ], "additionalProperties": {}, "title": "Chat Completions" }, { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "const": "message" }, "role": { "type": "string", "const": "assistant" }, "content": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "text": { "type": "string" } }, "required": [ "type" ], "additionalProperties": {} } }, "model": { "type": "string" }, "stop_reason": { "type": [ "string", "null" ] }, "usage": { "type": "object", "properties": { "input_tokens": { "type": "number" }, "output_tokens": { "type": "number" }, "cache_creation_input_tokens": { "type": [ "number", "null" ] }, "cache_read_input_tokens": { "type": [ "number", "null" ] }, "speed": { "type": [ "string", "null" ] } }, "required": [ "input_tokens", "output_tokens" ], "additionalProperties": {} } }, "required": [ "id", "type", "role", "content", "model", "stop_reason", "usage" ], "additionalProperties": {}, "title": "Messages" } ] } } }