# MiniMax M4 API (reAPI)

## Overview

- What it does: Use MiniMax M4 through reAPI OpenAI Chat Completions or Anthropic Messages. Official parameters, adaptive thinking, image and video URLs, tool calls, and dated capability checks.
- Vendor: MiniMax
- Category: chat
- Wire model id: `MiniMax-M4`
- Endpoint: `POST https://api.reapi.ai/v1/chat/completions` (Bearer auth; synchronous, OpenAI-compatible — no task polling)
- Landing page: https://reapi.ai/models/minimax-m4
- API key: create one at https://reapi.ai/settings/apikeys and send it as `Authorization: Bearer YOUR_API_KEY`

## Group pricing: MiniMax-M4

Current reAPI group prices from the same snapshot as the model page, in USD per 1 million tokens.
Default group: minimax.

| Group | Model ID | Token type | USD per 1M tokens |
| --- | --- | --- | ---: |
| minimax | MiniMax-M4 | input | $0.56 |
| minimax | MiniMax-M4 | output | $2.17 |
| minimax | MiniMax-M4 | cacheRead | $0.035 |
| minimax | MiniMax-M4 | cacheWrite | $0.56 |
| minimax-official | MiniMax-M4:minimax-official | input | $0.72 |
| minimax-official | MiniMax-M4:minimax-official | output | $2.79 |
| minimax-official | MiniMax-M4:minimax-official | cacheRead | $0.045 |
| minimax-official | MiniMax-M4:minimax-official | cacheWrite | $0.72 |


## Pricing

The summary prices below use each model’s default group listed above.

Current reAPI prices from the same quote as the model page, in USD. 1 credit = $0.001. Successful delivered requests are settled from actual usage/cost; no per-request whole-credit rounding is applied to token prices. No task polling or automatic retry is required.
- reAPI price quote fetched at: 2026-12-06T13:00:13.075Z (UTC).
- Price refresh interval: 300 seconds. Fetch this URL again after the cache expires to obtain updated prices and discounts.

### Official price comparison

Official reference: [Anthropic pricing](https://platform.minimax.io/docs/pricing/overview), checked 2026-12-04. Standard input and output tokens, USD per 1 million tokens; not Batch, Priority, cache, or long-context pricing.

| Token type | Official price / 1M | Current reAPI price / 1M | Discount vs official |
| --- | ---: | ---: | ---: |
| Input | $0.8 | $0.56 | 30% |
| Output | $3.1 | $2.17 | 30% |

MiniMax M4 is currently 30% off official pricing for standard input and output tokens. Formula: (1 - current reAPI rate / official rate) × 100. This discount is already included in the reAPI prices; do not apply it again.

Cache reads, cache writes and any long-context tiers have their own published rates below. Do not assume the input/output discount applies to them. Official reference prices have a separate verification date; current reAPI prices refresh at the interval above.

- tokens / input: $0.56 per 1M tokens
- tokens / output: $2.17 per 1M tokens
- tokens / cacheRead: $0.035 per 1M tokens
- tokens / cacheWrite: $0.56 per 1M tokens

## Calling this model

Synchronous and OpenAI-compatible: point any OpenAI SDK at the base URL below and use the wire model id. Responses return in the same HTTP call — there is no task id and nothing to poll.

- Base URL: `https://api.reapi.ai/v1`

## Input schema

Kept 1:1 with the live request validator; constraints are enforced server-side too. All media inputs are public HTTP(S) URLs — base64 and `data:` URIs are rejected platform-wide.

- `model` (string, required, default "MiniMax-M4")
- `messages` (string, required) — OpenAI-style chat message array
- `thinking` (string, optional, default "{\"type\":\"adaptive\"}")
- `reasoning_effort` (enum, optional, default "max", one of: low | medium | high | xhigh | max)
- `reasoning_split` (boolean, optional, default true)
- `max_completion_tokens` (integer, optional, range 1–262144)
- `max_tokens` (integer, optional, range 1–262144) — Upper bound on generated tokens
- `stream` (boolean, optional, default false) — Stream the response as server-sent events
- `stream_options` (string, optional, default "{\"include_usage\":false}")
- `tools` (string, optional)

## Example request

```json
{
  "model": "MiniMax-M4",
  "messages": [
    {
      "role": "user",
      "content": "Audit this retry loop for race conditions."
    }
  ],
  "reasoning_effort": "low"
}
```

## Usage examples

### cURL

```bash
curl https://api.reapi.ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"MiniMax-M4","messages":[{"role":"user","content":"Audit this retry loop for race conditions."}],"reasoning_effort":"low"}'
```

### Python (OpenAI SDK)

```python
from openai import OpenAI

client = OpenAI(base_url="https://api.reapi.ai/v1", api_key="YOUR_API_KEY")
response = client.chat.completions.create(
    model="MiniMax-M4",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
```

### JavaScript (OpenAI SDK)

```javascript
import OpenAI from 'openai';

const client = new OpenAI({ baseURL: 'https://api.reapi.ai/v1', apiKey: 'YOUR_API_KEY' });
const response = await client.chat.completions.create({
  model: 'MiniMax-M4',
  messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(response.choices[0].message.content);
```

## Other agent-readable surfaces

This file covers one model. To find anything else:

- Full API reference (markdown, incl. task-type constraints and error semantics): https://reapi.ai/docs/minimax-m4.md
- Platform index: https://reapi.ai/llms.txt
- Machine-readable API spec (OpenAPI): https://api.reapi.ai/openapi.json · agent skills index: https://reapi.ai/.well-known/agent-skills/index.json
- Authentication guide: https://reapi.ai/auth.md
- Full documentation and blog as one file: https://reapi.ai/llms-full.txt
- Any other model: `https://reapi.ai/models/<slug>/llms.txt` — every model page serves this same agent-readable form.
