> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bytespike.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MiniMax M2.7

> MiniMax's current flagship — refined M2.5 with longer context, vision support, and stronger general-purpose reasoning.

**Vendor:** MiniMax
**Model ID:** `minimax-m2.7`
**Capability:** 200K context · vision · tool use · streaming · structured output · CJK-native
**Pricing:** per-token, mid tier ([live rate](https://bytespike.ai/pricing#text))

MiniMax M2.7 is the current production flagship — strong creative-writing
quality with general-purpose reasoning lifted to compete with
Kimi K2.6 and GLM-5.1. The 200K context window plus native vision make
it the right MiniMax choice for any new work.

## Request

```bash theme={null}
curl https://llm.bytespike.ai/v1/chat/completions \
  -H "Authorization: Bearer $BYTESPIKE_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "minimax-m2.7",
    "messages": [{"role": "user", "content": "为这款产品写一份小红书风格的种草文案。"}]
  }'
```

### Body parameters

| Field             | Type    | Required | Default   | Notes                                                 |
| ----------------- | ------- | -------- | --------- | ----------------------------------------------------- |
| `model`           | string  | yes      | —         | `minimax-m2.7`                                        |
| `messages`        | array   | yes      | —         | CJK accepted natively. Vision via `image_url` blocks. |
| `max_tokens`      | integer | no       | model max | Max: 16384.                                           |
| `tools`           | array   | no       | —         | Function calling supported (parallel).                |
| `response_format` | object  | no       | —         | JSON / structured output.                             |
| `stream`          | boolean | no       | false     | SSE streaming.                                        |

## Response

```json theme={null}
{
  "id": "chatcmpl-…",
  "object": "chat.completion",
  "model": "minimax-m2.7",
  "choices": [{"index": 0, "message": {"role": "assistant", "content": "..."}, "finish_reason": "stop"}],
  "usage": {"prompt_tokens": 142, "completion_tokens": 487, "total_tokens": 629}
}
```

## Code examples

<CodeGroup>
  ```bash cURL theme={null}
  curl https://llm.bytespike.ai/v1/chat/completions \
    -H "Authorization: Bearer $BYTESPIKE_API_KEY" \
    -H "content-type: application/json" \
    -d '{"model": "minimax-m2.7", "messages": [{"role": "user", "content": "种草文案"}]}'
  ```

  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(base_url="https://llm.bytespike.ai/v1", api_key="$BYTESPIKE_API_KEY")
  resp = client.chat.completions.create(
      model="minimax-m2.7",
      messages=[{"role": "user", "content": "为这款产品写一份小红书风格的种草文案。"}],
  )
  print(resp.choices[0].message.content)
  ```

  ```javascript Node theme={null}
  import OpenAI from "openai"

  const client = new OpenAI({
    baseURL: "https://llm.bytespike.ai/v1",
    apiKey: process.env.BYTESPIKE_API_KEY,
  })
  const resp = await client.chat.completions.create({
    model: "minimax-m2.7",
    messages: [
      { role: "user", content: "为这款产品写一份小红书风格的种草文案。" },
    ],
  })
  console.log(resp.choices[0].message.content)
  ```
</CodeGroup>

## Streaming + caching

`"stream": true` for SSE. Automatic prompt caching.

## Errors

| Code                        | Trigger  | Billed?         |
| --------------------------- | -------- | --------------- |
| 400 / 401 / 402 / 422 / 429 | Standard | No              |
| 5xx                         | Upstream | No (auto-retry) |

## When to use

* Default MiniMax for new work — Chinese-market creative writing,
  marketing copy, character-voice dialogue.
* Long-document summarisation in Chinese (200K window).
* For Chinese general-purpose alternatives, see [Kimi K2.6](/api-reference/text/kimi-k2-6), [GLM-5.1](/api-reference/text/glm-5-1).

## Limits

| Limit                   | Value          |
| ----------------------- | -------------- |
| Context window          | 200K tokens    |
| Max output              | 16384 tokens   |
| Supports tool use       | Yes (parallel) |
| Supports vision         | Yes            |
| Supports streaming      | Yes            |
| Supports prompt caching | Automatic      |
