Developer Dashboard

New Models Added: Kimi K3 and Mistral OCR 4

Date: 2026-07-17 / (1405-04-26)

Summary

AvalAI now supports Moonshot AI's Kimi K3 flagship and Mistral OCR 4. Kimi K3 adds always-on reasoning, native vision, and a 1M-token context window, while OCR 4 adds layout-aware extraction with bounding boxes, block classification, confidence data, and support for 170 languages.


New Models

Moonshot AI: Kimi K3

kimi-k3 is Moonshot AI's most capable flagship model to date. The sparse Mixture-of-Experts model has 2.8 trillion total parameters and uses Kimi Delta Attention and Attention Residuals for long-context workloads.

Key capabilities:

  • 1M-token context window
  • Native image understanding
  • Always-on reasoning with reasoning_effort: "max"
  • Long-horizon coding and repository-scale engineering
  • Structured output with strict JSON Schema
  • Custom tool calling and multi-turn tool workflows
  • Automatic prompt caching for unchanged prefixes
  • Output budgets up to 1,048,576 tokens through max_completion_tokens

Endpoint support:

EndpointSupport
v1/chat/completionsFull
v1/messagesFull
v1/responsesPartial

kimi-latest now resolves to kimi-k3. Existing requests that use the alias receive Kimi K3 capabilities and pricing. Use the explicit kimi-k3 ID when model-version reproducibility matters.

Pricing:

ModelInputCached InputOutput
kimi-k3 / kimi-latest$3.00/1M tokens$0.30/1M tokens$15.00/1M tokens

Moonshot AI pricing update: Moonshot AI has lifted Singapore's 9% GST. AvalAI has therefore removed the related 10% pricing overhead, and prices for Moonshot AI models on AvalAI are now aligned with the official provider pricing.

Mistral AI: Mistral OCR 4

mistral-ocr-4-0 is Mistral AI's latest document extraction and understanding model. It turns document pages into structured Markdown and adds location, type, and confidence information for each detected region.

Key capabilities:

  • Bounding boxes for highlighting, citations, and redaction
  • Block classification for titles, tables, equations, signatures, and other content types
  • Inline confidence information for automated validation and human review
  • Support for 170 languages across 10 language groups
  • Structured output for RAG, search, agentic document workflows, invoices, and forms
  • Support for common formats including PDF, DOC, PPT, OpenDocument, and images

Endpoint support:

EndpointSupport
v1/ocrFull

mistral-ocr-latest now resolves to mistral-ocr-4-0 and uses OCR 4 pricing. Existing alias-based integrations can continue to work, while the versioned ID is recommended for reproducible processing.

Pricing:

ModelOCR ExtractionDocument/Image Annotation
mistral-ocr-4-0 / mistral-ocr-latest$0.004/page$0.005/annotated page

API Request and Response Examples

Kimi K3 Chat Completions Request

Kimi K3 keeps thinking enabled. Use reasoning_effort: "max" and omit fixed sampling fields such as temperature and top_p.

bash
curl https://api.avalai.ir/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $AVALAI_API_KEY" \
  -d '{
    "model": "kimi-k3",
    "messages": [
      {
        "role": "user",
        "content": "Propose a safe migration plan for splitting a large Python monolith."
      }
    ],
    "reasoning_effort": "max",
    "max_completion_tokens": 4096
  }'

Kimi K3 Response

The following abbreviated response shows the fields used by a standard non-streaming integration:

json
{
  "id": "chatcmpl_example",
  "object": "chat.completion",
  "created": 1784275200,
  "model": "kimi-k3",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "reasoning_content": "[reasoning omitted]",
        "content": "Begin by defining service boundaries, characterization tests, and a reversible strangler migration..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 19,
    "completion_tokens": 248,
    "total_tokens": 267
  },
  "estimated_cost": {
    "unit": "0.004153",
    "irt": 0,
    "exchange_rate": 0
  }
}

For streaming responses, reasoning and final text can arrive separately through reasoning_content and content deltas. For multi-turn conversations or tool calls, append the complete assistant message returned by the API to the next request.

Mistral OCR 4 Request

bash
curl https://api.avalai.ir/v1/ocr \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $AVALAI_API_KEY" \
  -d '{
    "model": "mistral-ocr-4-0",
    "document": {
      "type": "document_url",
      "document_url": "https://example.com/invoice.pdf"
    },
    "include_image_base64": false
  }'

Mistral OCR 4 Response

The response below is abbreviated to show the page and usage structure without embedding extracted image data:

json
{
  "pages": [
    {
      "index": 0,
      "markdown": "# Invoice\n\nInvoice number: INV-1042...",
      "images": [],
      "dimensions": {
        "dpi": 200,
        "height": 2200,
        "width": 1700
      }
    }
  ],
  "model": "mistral-ocr-4-0",
  "usage_info": {
    "pages_processed": 1
  },
  "estimated_cost": {
    "unit": "0.004000",
    "irt": 0,
    "exchange_rate": 0
  }
}

SDK Usage

Kimi K3

bash
curl https://api.avalai.ir/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $AVALAI_API_KEY" \
  -d '{
    "model": "kimi-k3",
    "messages": [{"role": "user", "content": "Review this architecture for reliability risks."}],
    "reasoning_effort": "max"
  }'
python
from openai import OpenAI

client = OpenAI(api_key="your-avalai-api-key", base_url="https://api.avalai.ir/v1")

response = client.chat.completions.create(
    model="kimi-k3",
    messages=[
        {"role": "user", "content": "Review this architecture for reliability risks."}
    ],
    reasoning_effort="max",
)

print(response.choices[0].message.content)
javascript
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.AVALAI_API_KEY,
  baseURL: "https://api.avalai.ir/v1",
});

const response = await client.chat.completions.create({
  model: "kimi-k3",
  messages: [
    { role: "user", content: "Review this architecture for reliability risks." },
  ],
  reasoning_effort: "max",
});

console.log(response.choices[0].message.content);

Mistral OCR 4

bash
curl https://api.avalai.ir/v1/ocr \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $AVALAI_API_KEY" \
  -d '{
    "model": "mistral-ocr-4-0",
    "document": {
      "type": "document_url",
      "document_url": "https://example.com/document.pdf"
    }
  }'
python
import os
import requests

response = requests.post(
    "https://api.avalai.ir/v1/ocr",
    headers={
        "Authorization": f"Bearer {os.environ['AVALAI_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "model": "mistral-ocr-4-0",
        "document": {
            "type": "document_url",
            "document_url": "https://example.com/document.pdf",
        },
    },
)
response.raise_for_status()
print(response.json())
javascript
const response = await fetch("https://api.avalai.ir/v1/ocr", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AVALAI_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "mistral-ocr-4-0",
    document: {
      type: "document_url",
      document_url: "https://example.com/document.pdf",
    },
  }),
});

if (!response.ok) throw new Error(`OCR request failed: ${response.status}`);
console.log(await response.json());