Moondream 3.1 API

moondream/moondream3.1-9b-a2b
Moondream 3.1 is Moondream's current vision-language model, a 9B mixture-of-experts with 2B active parameters.
Context
32K tokens
Input
$0.41262 / 1M tokens
Output
$3.4385 / 1M tokens
Released
Oct 15, 2026

Overview

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

  • Developer: Moondream
  • Available on AI/ML API since: 15 October 2026
  • Architecture: mixture of experts, 9B total / 2B active parameters
  • Context window: 32,000 tokens
  • Max output: 4,096 tokens
  • 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.

Pricing on AI/ML API

Input is billed at $0.41262 per 1M tokens and output at $3.4385 per 1M tokens.

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.

How to use Moondream 3.1 API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to moondream/moondream3.1-9b-a2b.
import requests

r = requests.post(
    "https://api.aimlapi.com/v1/chat/completions",
    headers={"Authorization": "Bearer " + AIMLAPI_KEY},
    json={
      "model": "moondream/moondream3.1-9b-a2b",
      "messages": [
        {
          "role": "user",
          "content": "Hello!"
        }
      ]
    },
)
print(r.json())
const r = 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": "Hello!"
      }
    ]
  }),
});
console.log(await r.json());
curl -X POST 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":"Hello!"}]}'

OpenAI-compatible — swap the base URL and it works with your existing SDK.

Moondream 3.1 API Pricing

TypePrice
Input
$0.41262 / 1M tokens
Output
$3.4385 / 1M tokens

Billed per token: $0.41262 / 1M input tokens and $3.4385 / 1M output tokens.

Moondream 3.1 vs other models

ModelInputOutputContextBest for
Moondream 3.1
This page
$0.41262 / 1M tokens
$3.4385 / 1M tokens
32K tokens
Image Q&A, captions and OCR
$0.41262 / 1M tokens
$3.4385 / 1M tokens
32K tokens
Image Q&A, captions and OCR
$0.34385 / 1M tokens
$2.0631 / 1M tokens
1M tokens
Documents, GUI screenshots and video

Frequently asked questions

Yes. Moondream 3.1 is live on AI/ML API as moondream/moondream3.1-9b-a2b, through the chat completions endpoint.

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.

Visual question answering, captioning, OCR and visual reasoning over images. It takes text and images as input and returns text.

32,000 tokens, with up to 4,096 output tokens per request.

Input $0.41262 / 1M tokens and output $3.4385 / 1M tokens.

Start building with Moondream 3.1

Get API Key
1000+ models, one API.