Moondream 3.1 overview
Moondream 3.1 by Moondream
Send an image with a text prompt to the chat completions endpoint and receive a text answer.
Moondream 3.1 specs
- Model ID
moondream/moondream3.1-9b-a2b- Developer
- Moondream
- Context window
- 32,000 tokens
- Max output
- 4,096 tokens
- Input
- Text, Image
- Output
- Text
- API
- OpenAI-compatible, base URL
https://api.aimlapi.com/v1
What Is Moondream 3.1?
Moondream 3.1 is a vision-language model from Moondream and the successor to Moondream 3 Preview. It is a mixture-of-experts model with 9B total parameters, of which 2B are active for each token. It reads images together with a text prompt and answers in text, covering visual question answering, captioning, OCR and visual reasoning. It is available on AI/ML API as moondream/moondream3.1-9b-a2b.
Specifications
- Available on AI/ML API since: 15 October 2026
- Architecture: mixture of experts, 9B total / 2B active parameters
- Input: text and images, output: text
- Capabilities: vision, streaming
Moondream 3.1 vs Moondream 3 Preview
Both models share the 9B/2B mixture-of-experts layout, the 32,000-token context window, the 4,096-token output limit and the same price on AI/ML API. Moondream 3.1 is the newer release of the line; Moondream 3 Preview remains available for workloads that were built and evaluated on it.
What It Is Built For
The model is sized for high-volume image understanding: answering questions about photos and screenshots, writing captions, reading text in images and reasoning about what an image shows, at a per-token price well below larger multimodal models.
Use cases
Visual question answering over photos, screenshots and product images, where an application needs a short, specific text answer.
Captioning and alt text generation for image libraries, catalogues and user uploads.
OCR on signs, labels, receipts, documents and UI screenshots.
A low-cost vision step inside a larger pipeline, for example classifying or describing an image before passing it to another model or tool.
Capabilities
- Streaming
- Vision
Moondream 3.1 API pricing
| Usage | Price | Unit |
|---|---|---|
| Input | $0.3174 | 1M tokens |
| Output | $2.65 | 1M tokens |
Prices from the AI/ML API price list, checked on Nov 4, 2026.
Moondream 3.1 vs other models: token prices
AI/ML API input and output rates for 5 models, per million tokens.
| Model | Input | Output |
|---|---|---|
| $0.3174 | $2.65 | |
| $0.3174 | $2.65 | |
| Nova 2 Lite | $0.3174 | $2.65 |
| $0.529 | $2.65 | |
| $0.6348 | $2.65 |
How to use the Moondream 3.1 API
View docsBuild with your agent
Give your agent the model details, code and documentation.
1Get your API key
Create API keyexport AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"2Make your first request
curl 'https://api.aimlapi.com/v1/chat/completions' \
-H "Authorization: Bearer $AIMLAPI_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "moondream/moondream3.1-9b-a2b",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}'import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['AIMLAPI_KEY']}",
"Content-Type": "application/json",
}
payload = {
"model": "moondream/moondream3.1-9b-a2b",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}
response = requests.post("https://api.aimlapi.com/v1/chat/completions", headers=headers, json=payload, timeout=120)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.aimlapi.com/v1/chat/completions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "moondream/moondream3.1-9b-a2b",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());Moondream 3.1 FAQ
Is Moondream 3.1 available on AI/ML API?
Yes. Moondream 3.1 is live on AI/ML API as moondream/moondream3.1-9b-a2b, through the chat completions endpoint.
What is new in Moondream 3.1?
Moondream 3.1 is the successor to Moondream 3 Preview. It keeps the same 9B total / 2B active mixture-of-experts layout, limits and price on AI/ML API.
What can Moondream 3.1 do?
Visual question answering, captioning, OCR and visual reasoning over images. It takes text and images as input and returns text.
What is the context window of Moondream 3.1?
32,000 tokens, with up to 4,096 output tokens per request.
How much does Moondream 3.1 cost?
Moondream 3.1 costs $0.3174 input and $2.65 output per 1M tokens on AI/ML API, billed as you go with no subscription.
What is the Moondream 3.1 model ID?
Use moondream/moondream3.1-9b-a2b as the model parameter. Requests go to the OpenAI-compatible endpoint with your AI/ML API key.