Kimi K2.7 Code HighSpeed API

The high-speed Kimi K2.7 Code variant is about five to six times faster, or roughly 180 tokens per second for typical coding tasks.

POST /v1/chat/completions

kimi-k2.7-code-highspeed: Chat completions, required fields, nested response schema and a fictional example.

Basic request

Required parameters: model, messages

Available parameters: model, messages, stream, max_tokens

Request parameters

ParameterTypeRequiredDescription
modelstringYesExact model identifier shown on this page. Options: kimi-k2.7-code-highspeed
messagesarrayYesMessages in conversation order.
streambooleanNoUse SSE streaming; omitted means non-streaming.
max_tokensintegerNoOptional output limit; visible text and reasoning can differ. Support depends on this model.
## Usage and response conventions - Follow required fields and the nested schema. Optional settings without a documented numeric default use the current model default. - Context, output budgets and media constraints differ by model. Unverified limits are not universal guarantees. - An absent value differs from a reported zero. Read status, content and usage as actually returned. - Replace example.invalid addresses with readable media you are authorized to use. - Save generated files promptly; result links need not remain available indefinitely. ### Conversations and streaming The basic example is non-streaming. Preserve the history required by this protocol. Match tool-call identifiers with their tool results before the next turn. Parse complete SSE events rather than network chunks, and inspect the final event or finish reason. ## Reference Terminology: [OpenAI Chat Completions](https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create). Use this page's platform base URL and exact model identifier for requests. Reviewed: 2026-11-07. ## Complete nested field reference Array elements use []. Required flags apply only when the enclosing object or content-block variant is used. Response fields can be absent or null as described; false does not imply a fabricated zero. ### Request headers | Field path | Type | Required in its object | Meaning | |---|---|---|---| | `Content-Type` | string | Yes | JSON request-body content type. | ### Request body | Field path | Type | Required in its object | Meaning | |---|---|---|---| | `model` | string | Yes | Exact model identifier shown on this page. Values: kimi-k2.7-code-highspeed | | `messages` | array[object] | Yes | Messages in conversation order. | | `messages[].role` | string | Yes | Message role. Values: system, user, assistant, tool | | `messages[].content` | string | Yes | Text content; multimodal input requires the model-specific content-block format. | | `messages[].tool_call_id` | string | No | Matching tool-call identifier for a tool-result message. | | `stream` | boolean | No | Use SSE streaming; omitted means non-streaming. Default: false | | `max_tokens` | integer | No | Optional output limit; visible text and reasoning can differ. Support depends on this model. Minimum: 1 | ### Response 200 | Field path | Type | Required in its object | Meaning | |---|---|---|---| | `id` | string | No | Opaque identifier returned by the API. | | `object` | string | No | Response object type. | | `created` | integer | No | Creation time in Unix seconds. | | `model` | string | No | Exact model identifier shown on this page. | | `choices` | array[object] | No | Generated choices. | | `choices[].index` | integer | No | Choice index. | | `choices[].message` | object | No | Generated message. | | `choices[].message.role` | string | No | Message role. | | `choices[].message.content` | string | No | Text content; multimodal input requires the model-specific content-block format. | | `choices[].message.reasoning_content` | string | No | Reasoning content, only when supplied by the model. | | `choices[].message.tool_calls` | array[object] | No | Function calls, when supported and returned. | | `choices[].message.tool_calls[].id` | string | No | Opaque identifier returned by the API. | | `choices[].message.tool_calls[].type` | string | No | Type discriminator. | | `choices[].message.tool_calls[].function` | object | No | Function call. | | `choices[].message.tool_calls[].function.name` | string | No | Function name. | | `choices[].message.tool_calls[].function.arguments` | string | No | JSON-encoded argument string. | | `choices[].finish_reason` | string | No | Finish reason such as stop, length, or tool_calls. | | `usage` | object | No | Reported usage; absent breakdowns must remain unknown. | | `usage.prompt_tokens` | integer | No | Input token count. | | `usage.completion_tokens` | integer | No | Output token count, which may include reasoning. | | `usage.total_tokens` | integer | No | Total tokens reported by the service. | | `usage.prompt_tokens_details` | object | No | Input breakdown. | | `usage.prompt_tokens_details.cached_tokens` | integer | No | Cached input tokens, a subset of input. | | `usage.completion_tokens_details` | object | No | Output breakdown. | | `usage.completion_tokens_details.reasoning_tokens` | integer | No | Reasoning breakdown; do not add it to an inclusive output total. | ### Error response structure | Field path | Type | Required in its object | Meaning | |---|---|---|---| | `error` | object | No | Error details for this request. | | `error.message` | string | No | Generated message. | | `error.type` | string | No | Type discriminator. | | `error.code` | string | No | Error code; it may be empty. |

Request example

curl --request POST https://api.router.ai/v1/chat/completions \
  --header "Authorization: Bearer $API_KEY" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "model": "kimi-k2.7-code-highspeed",
  "messages": [
    {
      "role": "user",
      "content": "Describe a fictional blue paper boat in one sentence."
    }
  ],
  "stream": false
}'

Endpoint reference: Create a chat completion (OpenAI-compatible)