LLM Reference

Devstral Small 2 on Vercel AI Gateway

Devstral · MistralAI

ServerlessOpen Source

Last refreshed 2026-05-22. Next refresh: weekly.

Why use Devstral Small 2 on Vercel AI Gateway?

Vercel AI Gateway offers Devstral Small 2 with pay-as-you-go pricing at $0.10/1M input tokens. Vercel AI Gateway is a unified AI proxy providing a single OpenAI-compatible API endpoint to 275+ models from 25+ providers including Anthropic, OpenAI, Google, Meta, Mistral, DeepSeek, xAI, Alibaba, Amazon, ByteDance, Cohere, MiniMax, MoonshotAI, KwaiPilot, Black Forest Labs, Recraft, Voyage AI, NVIDIA, and more.

Input / 1M
$0.10
Output / 1M
$0.30
Cache
Not sourced
Batch
Not sourced

Setup recipe

Python + curl
Install
pip install openai
Auth
export AI_GATEWAY_API_KEY=...
Call
import os
from openai import OpenAI
client = OpenAI(
    api_key=os.environ["AI_GATEWAY_API_KEY"],
Model ID
mistral/devstral-small-2

Request example

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AI_GATEWAY_API_KEY"],
    base_url="https://ai-gateway.vercel.sh/v1"
)
response = client.chat.completions.create(
    model="mistral/devstral-small-2",
    messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)

Gotchas

  • Use provider model ID "mistral/devstral-small-2", not the LLMReference slug "devstral-small-2".
  • creator/model-name e.g. kwaipilot/kat-coder-pro-v2
  • The examples expect AI_GATEWAY_API_KEY; rename it only if your application config maps the new variable.

Pricing

TypePrice (per 1M)
Input tokens$0.10
Output tokens$0.30

Capabilities

VisionMultimodalFunction CallingTool UseStructured OutputsCode Execution

About Devstral Small 2

Devstral Small 2 is Mistral AI's 24B open-weights coding agent model, released December 9, 2025 under Apache 2.0. It scores 68.0% on SWE-bench Verified and supports agentic software engineering tasks, multi-step reasoning, and tool use. Runs on a single RTX 4090 GPU or a Mac with 32GB RAM. Multimodal, with support for image inputs.

FAQ

What does Devstral Small 2 cost on Vercel AI Gateway?

On Vercel AI Gateway, Devstral Small 2 costs $0.1 per 1M input tokens and $0.3 per 1M output tokens.

What is the context window for Devstral Small 2 on Vercel AI Gateway?

Devstral Small 2 supports a 256,000 token context window on Vercel AI Gateway.

What API model ID do I use for Devstral Small 2 on Vercel AI Gateway?

Use the model ID mistral/devstral-small-2 when calling Vercel AI Gateway's API.

Who created Devstral Small 2?

Devstral Small 2 was created by MistralAI as part of the Devstral model family.

Is Devstral Small 2 open source?

Devstral Small 2 is open source according to the seed data.

Get Started

Model Specs

Released2025-12-09
Parameters24B
Context256K