Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ All API requests use this base URL with skill-specific endpoints (`/query`, `/de

Prefer an OpenAI-style chat interface? Moondream also offers an [OpenAI-compatible `/v1/chat/completions` endpoint](/openai) with multi-turn conversations, streaming, and image inputs.

### Model selection

Every direct API request must include a `model` field. Supported model values:

| Model | Notes |
|-------|-------|
| `moondream3.1-9B-A2B` | Moondream 3.1 model. |
| `moondream3-preview` | Moondream 3 Preview model. |
| `{base_model}/{finetune_id}@{step}` | Saved finetuned checkpoint. |

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Expand All @@ -26,6 +36,7 @@ curl -X POST https://api.moondream.ai/v1/query \
-H 'Content-Type: application/json' \
-H 'X-Moondream-Auth: YOUR_API_KEY' \
-d '{
"model": "moondream3.1-9B-A2B",
"image_url": "data:image/jpeg;base64,/9j//gAQTGF2YzYxLjE5LjEwMQD/2wBDAAg+Pkk+SVVVVVVVVWRdZGhoaGRkZGRoaGhwcHCDg4NwcHBoaHBwfHyDg4+Tj4eHg4eTk5ubm7q6srLZ2eD/////xABZAAADAQEBAQAAAAAAAAAAAAAABgcFCAECAQEAAAAAAAAAAAAAAAAAAAAAEAADAAMBAQEBAAAAAAAAAAAAAQIDIREEURKBEQEAAAAAAAAAAAAAAAAAAAAA/8AAEQgAGQAZAwESAAISAAMSAP/aAAwDAQACEQMRAD8A5/PQAAABirHyVS2mUip/Pm4/vQAih9ABuRUrVLqMEALVNead7/pFgAfc+d5NLSEEAAAA/9k=",
"question": "What is in this image?"
}'
Expand All @@ -49,6 +60,7 @@ curl -X POST https://api.moondream.ai/v1/detect \
-H 'Content-Type: application/json' \
-H 'X-Moondream-Auth: YOUR_API_KEY' \
-d '{
"model": "moondream3.1-9B-A2B",
"image_url": "data:image/jpeg;base64,/9j//gAQTGF2YzYxLjE5LjEwMQD/2wBDAAg+Pkk+SVVVVVVVVWRdZGhoaGRkZGRoaGhwcHCDg4NwcHBoaHBwfHyDg4+Tj4eHg4eTk5ubm7q6srLZ2eD/////xABZAAADAQEBAQAAAAAAAAAAAAAABgcFCAECAQEAAAAAAAAAAAAAAAAAAAAAEAADAAMBAQEBAAAAAAAAAAAAAQIDIREEURKBEQEAAAAAAAAAAAAAAAAAAAAA/8AAEQgAGQAZAwESAAISAAMSAP/aAAwDAQACEQMRAD8A5/PQAAABirHyVS2mUip/Pm4/vQAih9ABuRUrVLqMEALVNead7/pFgAfc+d5NLSEEAAAA/9k=",
"object": "moon"
}'
Expand Down Expand Up @@ -79,6 +91,7 @@ curl -X POST https://api.moondream.ai/v1/point \
-H 'Content-Type: application/json' \
-H 'X-Moondream-Auth: YOUR_API_KEY' \
-d '{
"model": "moondream3.1-9B-A2B",
"image_url": "data:image/jpeg;base64,/9j//gAQTGF2YzYxLjE5LjEwMQD/2wBDAAg+Pkk+SVVVVVVVVWRdZGhoaGRkZGRoaGhwcHCDg4NwcHBoaHBwfHyDg4+Tj4eHg4eTk5ubm7q6srLZ2eD/////xABZAAADAQEBAQAAAAAAAAAAAAAABgcFCAECAQEAAAAAAAAAAAAAAAAAAAAAEAADAAMBAQEBAAAAAAAAAAAAAQIDIREEURKBEQEAAAAAAAAAAAAAAAAAAAAA/8AAEQgAGQAZAwESAAISAAMSAP/aAAwDAQACEQMRAD8A5/PQAAABirHyVS2mUip/Pm4/vQAih9ABuRUrVLqMEALVNead7/pFgAfc+d5NLSEEAAAA/9k=",
"object": "moon"
}'
Expand Down Expand Up @@ -107,6 +120,7 @@ curl -X POST https://api.moondream.ai/v1/caption \
-H 'Content-Type: application/json' \
-H 'X-Moondream-Auth: YOUR_API_KEY' \
-d '{
"model": "moondream3.1-9B-A2B",
"image_url": "data:image/jpeg;base64,/9j//gAQTGF2YzYxLjE5LjEwMQD/2wBDAAg+Pkk+SVVVVVVVVWRdZGhoaGRkZGRoaGhwcHCDg4NwcHBoaHBwfHyDg4+Tj4eHg4eTk5ubm7q6srLZ2eD/////xABZAAADAQEBAQAAAAAAAAAAAAAABgcFCAECAQEAAAAAAAAAAAAAAAAAAAAAEAADAAMBAQEBAAAAAAAAAAAAAQIDIREEURKBEQEAAAAAAAAAAAAAAAAAAAAA/8AAEQgAGQAZAwESAAISAAMSAP/aAAwDAQACEQMRAD8A5/PQAAABirHyVS2mUip/Pm4/vQAih9ABuRUrVLqMEALVNead7/pFgAfc+d5NLSEEAAAA/9k=",
"length": "normal",
"stream": false
Expand Down Expand Up @@ -138,6 +152,7 @@ curl -X POST https://api.moondream.ai/v1/segment \
-H 'Content-Type: application/json' \
-H 'X-Moondream-Auth: YOUR_API_KEY' \
-d '{
"model": "moondream3.1-9B-A2B",
"image_url": "data:image/jpeg;base64,...",
"object": "cat"
}'
Expand All @@ -158,4 +173,3 @@ curl -X POST https://api.moondream.ai/v1/segment \

</TabItem>
</Tabs>

25 changes: 14 additions & 11 deletions docs/batch.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ The Batch API lets you process large volumes of images asynchronously. Upload a

**Pricing:** Batch API requests are billed at **50% off** standard API pricing. When using finetuned models, batch pricing is 50% off finetune pricing. See [pricing](https://moondream.ai/pricing) for details.

Each batch runs on a single model selected when you complete the upload. Set `model` to a base model ID such as `moondream3.1-9B-A2B` or `moondream3-preview`, or to a saved finetuned checkpoint in `{base_model}/{finetune_id}@{step}` format.

## When to use Batch API

- Processing thousands to 100,000 images
Expand Down Expand Up @@ -80,7 +82,7 @@ done
BATCH=$(curl -s -X POST "https://api.moondream.ai/v1/batch/$FILE_ID?action=mpu-complete&uploadId=$UPLOAD_ID" \
-H "X-Moondream-Auth: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"parts\": $PARTS}")
-d "{\"parts\": $PARTS, \"model\": \"moondream3.1-9B-A2B\"}")

BATCH_ID=$(echo $BATCH | jq -r '.id')
echo "Batch submitted: $BATCH_ID"
Expand Down Expand Up @@ -119,7 +121,7 @@ with open("batch_input.jsonl", "rb") as f:
batch = requests.post(
f"{BASE_URL}/{file_id}?action=mpu-complete&uploadId={upload_id}",
headers=headers,
json={"parts": parts}
json={"parts": parts, "model": "moondream3.1-9B-A2B"}
).json()

print(f"Batch submitted: {batch['id']}")
Expand Down Expand Up @@ -169,7 +171,7 @@ const batch = await fetch(
{
method: 'POST',
headers: { ...headers, 'Content-Type': 'application/json' },
body: JSON.stringify({ parts })
body: JSON.stringify({ parts, model: 'moondream3.1-9B-A2B' })
}
).then(r => r.json());

Expand Down Expand Up @@ -229,7 +231,7 @@ while (true) {
{
"id": "01JQXYZ9ABCDEF123456",
"status": "processing",
"model": "moondream3-preview",
"model": "moondream3.1-9B-A2B",
"progress": { "total": 1000, "completed": 450 },
"created_at": "2025-01-10T12:00:00Z"
}
Expand All @@ -240,7 +242,7 @@ while (true) {
{
"id": "01JQXYZ9ABCDEF123456",
"status": "completed",
"model": "moondream3-preview",
"model": "moondream3.1-9B-A2B",
"progress": { "total": 1000, "completed": 998, "failed": 2 },
"usage": { "input_tokens": 1500000, "output_tokens": 50000 },
"outputs": [
Expand Down Expand Up @@ -399,14 +401,14 @@ Content-Type: application/json
"parts": [
{ "partNumber": 1, "etag": "\"abc123...\"" }
],
"model": "moondream3-preview/finetune_id@step"
"model": "moondream3.1-9B-A2B"
}
```

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `parts` | array | Yes | Array of uploaded parts with `partNumber` and `etag` |
| `model` | string | No | Model to use. Default: `moondream3-preview`. For finetunes: `moondream3-preview/finetune_id@step` |
| `model` | string | Yes | Model ID or saved checkpoint, e.g. `moondream3.1-9B-A2B`, `moondream3-preview`, or `{base_model}/finetune_id@step` |

**Response:**
```json
Expand Down Expand Up @@ -471,7 +473,7 @@ GET /v1/batch/:batchId

| Code | Description |
|------|-------------|
| `invalid_model` | Model format invalid (must be `moondream3-preview` or `moondream3-preview/finetune_id@step`) |
| `invalid_model` | Model format invalid (must be a supported base model ID or saved checkpoint in `{base_model}/finetune_id@step` format) |
| `validation_error` | Invalid JSONL, blank lines, or bad UTF-8 |
| `limit_exceeded` | File or line limits exceeded |
| `empty_batch` | No valid lines in file |
Expand All @@ -489,19 +491,20 @@ GET /v1/batch/:batchId

## Using finetuned models

You can run batch jobs using your finetuned models by specifying the `model` parameter when completing the upload:
You can run batch jobs using your finetuned models by specifying a saved checkpoint in the `model` parameter when completing the upload:

```bash
curl -s -X POST "https://api.moondream.ai/v1/batch/$FILE_ID?action=mpu-complete&uploadId=$UPLOAD_ID" \
-H "X-Moondream-Auth: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"parts": [...],
"model": "moondream3-preview/YOUR_FINETUNE_ID@STEP"
"model": "{base_model}/YOUR_FINETUNE_ID@STEP"
}'
```

The model format is `moondream3-preview/finetune_id@step`, where:
The model format is `{base_model}/finetune_id@step`, where:
- `base_model` is the model family used for the finetune
- `finetune_id` is your finetune's ID (e.g., `01JQXYZ...`)
- `step` is the checkpoint step number

Expand Down
8 changes: 4 additions & 4 deletions docs/finetuning/http-api-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ Results are ordered by step (ascending). Only saved checkpoints are returned.

---

## POST /finetunes/:finetuneId/checkpoints/save
## POST /finetunes/:finetuneId/checkpoints/save {#save-checkpoint}

Save the current checkpoint and make it visible in the dashboard. The server resolves the
current step for the finetune.
Expand Down Expand Up @@ -625,7 +625,7 @@ Once you have saved a checkpoint, you can use it for inference by specifying the
### Model format

```
moondream3-preview/{finetune_id}@{step}
{base_model}/{finetune_id}@{step}
```

For example, if your finetune ID is `01HXYZ...` and you saved a checkpoint at step 500:
Expand Down Expand Up @@ -661,7 +661,7 @@ The `model` parameter is supported on the following inference endpoints:

### Notes

- The `model` parameter is optional. If omitted, requests use the base `moondream3-preview` model.
- Include the `model` parameter on inference requests.
- Only saved checkpoints can be used for inference. Use `POST /finetunes/:finetuneId/checkpoints/save` to save a checkpoint first.
- Both the `finetune_id` and `step` are required in the model string.
- The `base_model`, `finetune_id`, and `step` are required in the model string.
- Finetune inference is only available for authenticated API requests (not available in playground mode).
29 changes: 18 additions & 11 deletions docs/openai.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Moondream Cloud exposes an **OpenAI-compatible** chat endpoint at `/v1/chat/comp

## Setup

Use the OpenAI base URL `https://api.moondream.ai/v1`, your Moondream API key as the bearer token, and `moondream/moondream3-preview` as the model (the `moondream/` prefix is optional for this first-party model, so `moondream3-preview` also works). Grab a key from the [Moondream Cloud Console](https://moondream.ai/c/cloud/api-keys).
Use the OpenAI base URL `https://api.moondream.ai/v1`, your Moondream API key as the bearer token, and set `model` to one of the supported Moondream model IDs. The examples below use `moondream3.1-9B-A2B`. Grab a key from the [Moondream Cloud Console](https://moondream.ai/c/cloud/api-keys).

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
Expand All @@ -25,7 +25,7 @@ client = OpenAI(
)

response = client.chat.completions.create(
model="moondream/moondream3-preview",
model="moondream3.1-9B-A2B",
messages=[{"role": "user", "content": "What is 2 + 2?"}],
)
print(response.choices[0].message.content)
Expand All @@ -43,7 +43,7 @@ const client = new OpenAI({
});

const response = await client.chat.completions.create({
model: "moondream/moondream3-preview",
model: "moondream3.1-9B-A2B",
messages: [{ role: "user", content: "What is 2 + 2?" }],
});
console.log(response.choices[0].message.content);
Expand All @@ -57,7 +57,7 @@ curl https://api.moondream.ai/v1/chat/completions \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"model": "moondream/moondream3-preview",
"model": "moondream3.1-9B-A2B",
"messages": [{"role": "user", "content": "What is 2 + 2?"}]
}'
```
Expand All @@ -79,7 +79,7 @@ with open("image.jpg", "rb") as f:
data_url = "data:image/jpeg;base64," + base64.b64encode(f.read()).decode()

response = client.chat.completions.create(
model="moondream/moondream3-preview",
model="moondream3.1-9B-A2B",
messages=[{
"role": "user",
"content": [
Expand All @@ -99,7 +99,7 @@ curl https://api.moondream.ai/v1/chat/completions \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"model": "moondream/moondream3-preview",
"model": "moondream3.1-9B-A2B",
"messages": [{
"role": "user",
"content": [
Expand All @@ -119,7 +119,7 @@ Send the full message history — earlier turns are kept as context.

```python
response = client.chat.completions.create(
model="moondream/moondream3-preview",
model="moondream3.1-9B-A2B",
messages=[
{"role": "user", "content": "My name is Alice."},
{"role": "assistant", "content": "Nice to meet you, Alice!"},
Expand All @@ -135,7 +135,7 @@ Set `stream=True` to receive the response as Server-Sent Events.

```python
stream = client.chat.completions.create(
model="moondream/moondream3-preview",
model="moondream3.1-9B-A2B",
messages=[{"role": "user", "content": "Write a short poem about the moon."}],
stream=True,
)
Expand All @@ -149,7 +149,7 @@ By default a stream does not include token usage. To receive it, set `stream_opt

```python
stream = client.chat.completions.create(
model="moondream/moondream3-preview",
model="moondream3.1-9B-A2B",
messages=[{"role": "user", "content": "Hello!"}],
stream=True,
stream_options={"include_usage": True},
Expand All @@ -165,7 +165,7 @@ Moondream 3 can produce an explicit reasoning trace before its answer. Enable it

```python
response = client.chat.completions.create(
model="moondream/moondream3-preview",
model="moondream3.1-9B-A2B",
messages=[{"role": "user", "content": "If I have 5 apples and give away 2, how many are left?"}],
extra_body={"reasoning": True},
)
Expand All @@ -180,7 +180,7 @@ See [Reasoning](/reasoning) for more on how Moondream 3 reasons.

| Parameter | Type | Notes |
|---|---|---|
| `model` | string | `moondream/moondream3-preview`. See [Models](#models) for the available list. |
| `model` | string | Required. Supported values: `moondream3.1-9B-A2B` or `moondream3-preview`. |
| `messages` | array | OpenAI chat messages. `content` may be a string or an array of `text` / `image_url` parts. |
| `temperature` | number | Sampling temperature. |
| `top_p` | number | Nucleus sampling. |
Expand All @@ -199,3 +199,10 @@ List the available models with the standard OpenAI models endpoint:
curl https://api.moondream.ai/v1/models \
-H 'Authorization: Bearer YOUR_API_KEY'
```

Public model IDs:

| Model | Notes |
|-------|-------|
| `moondream3.1-9B-A2B` | Moondream 3.1 model. |
| `moondream3-preview` | Moondream 3 Preview model. |
4 changes: 4 additions & 0 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ curl -X POST https://api.moondream.ai/v1/query \
-H 'Content-Type: application/json' \
-H 'X-Moondream-Auth: YOUR_API_KEY' \
-d '{
"model": "moondream3.1-9B-A2B",
"image_url": "data:image/jpeg;base64,/9j//gAQTGF2YzYxLjE5LjEwMQD/2wBDAAg+Pkk+SVVVVVVVVWRdZGhoaGRkZGRoaGhwcHCDg4NwcHBoaHBwfHyDg4+Tj4eHg4eTk5ubm7q6srLZ2eD/////xABZAAADAQEBAQAAAAAAAAAAAAAABgcFCAECAQEAAAAAAAAAAAAAAAAAAAAAEAADAAMBAQEBAAAAAAAAAAAAAQIDIREEURKBEQEAAAAAAAAAAAAAAAAAAAAA/8AAEQgAGQAZAwESAAISAAMSAP/aAAwDAQACEQMRAD8A5/PQAAABirHyVS2mUip/Pm4/vQAih9ABuRUrVLqMEALVNead7/pFgAfc+d5NLSEEAAAA/9k=",
"question": "What is in this image?"
}'
Expand All @@ -41,6 +42,7 @@ curl -X POST https://api.moondream.ai/v1/detect \
-H 'Content-Type: application/json' \
-H 'X-Moondream-Auth: YOUR_API_KEY' \
-d '{
"model": "moondream3.1-9B-A2B",
"image_url": "data:image/jpeg;base64,/9j//gAQTGF2YzYxLjE5LjEwMQD/2wBDAAg+Pkk+SVVVVVVVVWRdZGhoaGRkZGRoaGhwcHCDg4NwcHBoaHBwfHyDg4+Tj4eHg4eTk5ubm7q6srLZ2eD/////xABZAAADAQEBAQAAAAAAAAAAAAAABgcFCAECAQEAAAAAAAAAAAAAAAAAAAAAEAADAAMBAQEBAAAAAAAAAAAAAQIDIREEURKBEQEAAAAAAAAAAAAAAAAAAAAA/8AAEQgAGQAZAwESAAISAAMSAP/aAAwDAQACEQMRAD8A5/PQAAABirHyVS2mUip/Pm4/vQAih9ABuRUrVLqMEALVNead7/pFgAfc+d5NLSEEAAAA/9k=",
"object": "moon"
}'
Expand Down Expand Up @@ -71,6 +73,7 @@ curl -X POST https://api.moondream.ai/v1/point \
-H 'Content-Type: application/json' \
-H 'X-Moondream-Auth: YOUR_API_KEY' \
-d '{
"model": "moondream3.1-9B-A2B",
"image_url": "data:image/jpeg;base64,/9j//gAQTGF2YzYxLjE5LjEwMQD/2wBDAAg+Pkk+SVVVVVVVVWRdZGhoaGRkZGRoaGhwcHCDg4NwcHBoaHBwfHyDg4+Tj4eHg4eTk5ubm7q6srLZ2eD/////xABZAAADAQEBAQAAAAAAAAAAAAAABgcFCAECAQEAAAAAAAAAAAAAAAAAAAAAEAADAAMBAQEBAAAAAAAAAAAAAQIDIREEURKBEQEAAAAAAAAAAAAAAAAAAAAA/8AAEQgAGQAZAwESAAISAAMSAP/aAAwDAQACEQMRAD8A5/PQAAABirHyVS2mUip/Pm4/vQAih9ABuRUrVLqMEALVNead7/pFgAfc+d5NLSEEAAAA/9k=",
"object": "moon"
}'
Expand Down Expand Up @@ -99,6 +102,7 @@ curl -X POST https://api.moondream.ai/v1/caption \
-H 'Content-Type: application/json' \
-H 'X-Moondream-Auth: YOUR_API_KEY' \
-d '{
"model": "moondream3.1-9B-A2B",
"image_url": "data:image/jpeg;base64,/9j//gAQTGF2YzYxLjE5LjEwMQD/2wBDAAg+Pkk+SVVVVVVVVWRdZGhoaGRkZGRoaGhwcHCDg4NwcHBoaHBwfHyDg4+Tj4eHg4eTk5ubm7q6srLZ2eD/////xABZAAADAQEBAQAAAAAAAAAAAAAABgcFCAECAQEAAAAAAAAAAAAAAAAAAAAAEAADAAMBAQEBAAAAAAAAAAAAAQIDIREEURKBEQEAAAAAAAAAAAAAAAAAAAAA/8AAEQgAGQAZAwESAAISAAMSAP/aAAwDAQACEQMRAD8A5/PQAAABirHyVS2mUip/Pm4/vQAih9ABuRUrVLqMEALVNead7/pFgAfc+d5NLSEEAAAA/9k=",
"length": "normal",
"stream": false
Expand Down
4 changes: 2 additions & 2 deletions docs/reasoning.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ id: reasoning
slug: /reasoning
title: Reasoning
---
```bash {7}
```bash {8}
curl -X POST https://api.moondream.ai/v1/query \
-H 'Content-Type: application/json' \
-H 'X-Moondream-Auth: YOUR_API_KEY' \
-d '{
"model": "moondream3.1-9B-A2B",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge Update the reasoning example highlight

Adding this model line shifts the fenced block’s existing {7} highlight down by one, so the Reasoning page now highlights the question line instead of "reasoning": true. In this context the rendered example no longer emphasizes the reasoning flag; bump the highlight to {8} or otherwise retarget it.

Useful? React with 👍 / 👎.

"image_url": "data:image/jpeg;base64,/9j//gAQTGF2YzYxLjE5LjEwMQD/2wBDAAg+Pkk+SVVVVVVVVWRdZGhoaGRkZGRoaGhwcHCDg4NwcHBoaHBwfHyDg4+Tj4eHg4eTk5ubm7q6srLZ2eD/////xABZAAADAQEBAQAAAAAAAAAAAAAABgcFCAECAQEAAAAAAAAAAAAAAAAAAAAAEAADAAMBAQEBAAAAAAAAAAAAAQIDIREEURKBEQEAAAAAAAAAAAAAAAAAAAAA/8AAEQgAGQAZAwESAAISAAMSAP/aAAwDAQACEQMRAD8A5/PQAAABirHyVS2mUip/Pm4/vQAih9ABuRUrVLqMEALVNead7/pFgAfc+d5NLSEEAAAA/9k=",
"question": "What is in this image?",
"reasoning": true
Expand Down Expand Up @@ -76,4 +77,3 @@ console.log(result.answer);

</TabItem>
</Tabs>

12 changes: 12 additions & 0 deletions docs/skills/caption.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ curl -X POST https://api.moondream.ai/v1/caption \
-H 'Content-Type: application/json' \
-H 'X-Moondream-Auth: YOUR_API_KEY' \
-d '{
"model": "moondream3.1-9B-A2B",
"image_url": "data:image/jpeg;base64,...",
"length": "normal",
"stream": false
Expand All @@ -99,6 +100,7 @@ curl -X POST https://api.moondream.ai/v1/caption \
-H 'Content-Type: application/json' \
-H 'X-Moondream-Auth: YOUR_API_KEY' \
-d '{
"model": "moondream3.1-9B-A2B",
"image_url": "data:image/jpeg;base64,...",
"length": "short",
"stream": false
Expand All @@ -109,6 +111,7 @@ curl -X POST https://api.moondream.ai/v1/caption \
-H 'Content-Type: application/json' \
-H 'X-Moondream-Auth: YOUR_API_KEY' \
-d '{
"model": "moondream3.1-9B-A2B",
"image_url": "data:image/jpeg;base64,...",
"length": "normal",
"stream": true
Expand Down Expand Up @@ -143,6 +146,15 @@ For streaming responses, you'll receive a series of data events:
- **"short"**: Brief 1-2 sentence summary (e.g., "A red car parked on a street.")
- **"normal"** (default): Detailed description covering elements, context, colors, positioning, etc.

## Parameters

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `model` | string | Yes | Model ID. Supported values include `moondream3.1-9B-A2B`, `moondream3-preview`, or a saved finetuned checkpoint in `{base_model}/{finetune_id}@{step}` format. |
| `image_url` | string | Yes | Base64 data URL for the input image. |
| `length` | string | No | Caption length: `short`, `normal`, or `long`. Defaults to `normal`. |
| `stream` | boolean | No | Stream caption chunks as Server-Sent Events. |

## Use Cases

- Generating alt text for accessibility
Expand Down
Loading
Loading