/v1/chat/completions). Pick the context tier that fits your input length — pricing scales with the tier.
Available models
| Model | Notes |
|---|---|
moonshot-v1-8k | Short-form generation, 8k context |
moonshot-v1-32k | Long-form generation, 32k context |
moonshot-v1-128k | Very long documents, 128k context |
moonshot-v1-8k-vision-preview | Vision — understands images, 8k context |
moonshot-v1-32k-vision-preview | Vision — understands images, 32k context |
moonshot-v1-128k-vision-preview | Vision — understands images, 128k context |
Quick example
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | One of the model IDs from the table above |
messages | array | Yes | List of { role, content } objects; vision models accept image_url content items |
stream | boolean | No | Enable SSE streaming. Default: false |
temperature | float | No | Controls randomness. Default: 1 |
max_tokens | integer | No | Maximum output tokens to generate |
stop | string / array | No | Sequences that stop generation |
API Reference
View the interactive API playground.