/v1/chat/completions). Pick the context tier that fits your input length — pricing scales with the tier.
Available models
Quick example
Parameters
API Reference
View the interactive API playground.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Moonshot V1 generation models — text and vision, 8k / 32k / 128k context tiers.
/v1/chat/completions). Pick the context tier that fits your input length — pricing scales with the tier.
| 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 |
curl https://api.upmore.net/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "moonshot-v1-8k",
"messages": [
{ "role": "user", "content": "Write a product description for a mechanical keyboard." }
]
}'
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.upmore.net/v1"
)
response = client.chat.completions.create(
model="moonshot-v1-8k-vision-preview",
messages=[
{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}},
{"type": "text", "text": "Describe this image."}
]}
]
)
print(response.choices[0].message.content)
| 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 |