Mercury 2 overview
Mercury 2 specs
- Model ID
inception/mercury-2- Developer
- Inception
- Context window
- 128,000 tokens
- Max output
- 50,000 tokens
- Input
- Image, Text
- Output
- Text
- API
- OpenAI-compatible, base URL
https://api.aimlapi.com/v1
Coding and code review
Generate, debug, and review code across languages, reading whole files or repos in a single prompt.
Agentic and multi-step workflows
Reliable tool-calling and instruction-following suit agent loops that plan, call tools, and iterate.
Complex reasoning
Extended reasoning improves reliability on multi-step math, logic, and technical analysis.
Long-document analysis
Summarize and extract from contracts, papers, and reports without aggressive chunking.
Use cases
Coding and editing: Mercury 2 is documented for autocomplete, next-edit suggestions, refactors, and interactive code agents, where the developer stays in the loop and pauses break flow.
Agentic loops: It is described as suited to multi-step agent workflows, including loops where latency compounds across many inference calls and tighter feedback cycles improve controllability and trust.
Search and RAG pipelines: Mercury 2 is documented for multi-hop retrieval, reranking, and summarization workflows, where it can add reasoning to search loops without exceeding the latency budget.
Real-time voice and interaction: It is described as suitable for voice interfaces and other latency-sensitive interactions, including support and sales voice agents, customer support copilots, interactive tutoring Q&A, and real-time translation.
Capabilities
- Function calling
- Reasoning
- Streaming
- Structured outputs
- Web search
Mercury 2 benchmarks by
Artificial Analysis
See how Mercury 2 scores on independent evaluations. Data retrieved Nov 3, 2026.
Benchmark results
Compare 15 models available on AI/ML API across 5 independent benchmarks.
Humanity's Last Exam
Expert-written questions across academic subjects.
GPQA Diamond
Graduate-level science questions written to resist web search.
Terminal-Bench 4.0
Agentic tasks completed in a command-line environment.
AA-LCR
Reasoning across long documents of about 100k tokens.
SciCode
Python coding tasks drawn from scientific research.
Mercury 2 API pricing
| Usage | Price | Unit |
|---|---|---|
| Input | $0.2645 | 1M tokens |
| Output | $0.7935 | 1M tokens |
| Cached input | $0.0265 | 1M tokens |
Prices from the AI/ML API price list, checked on Nov 4, 2026.
Mercury 2 vs other models: token prices
AI/ML API input and output rates for 5 models, per million tokens.
| Model | Input | Output |
|---|---|---|
| Mercury 2 | $0.2645 | $0.7935 |
| $0.2116 | $0.7406 | |
| $0.2116 | $0.7935 | |
| $0.1984 | $0.7935 | |
| $0.529 | $0.7935 |
How to use the Mercury 2 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": "inception/mercury-2",
"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": "inception/mercury-2",
"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": "inception/mercury-2",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());Related articles
Mercury 2 FAQ
What is the context window of Mercury 2?
Mercury 2 has a 128,000 tokens context window and can return up to 50,000 tokens.
What inputs and outputs does Mercury 2 support?
Mercury 2 takes image, text as input and returns text.
What is the model ID for Mercury 2?
Use inception/mercury-2 as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.
How much does Mercury 2 cost?
Mercury 2 costs $0.2645 input and $0.7935 output per 1M tokens on AI/ML API, billed as you go with no subscription.
Does Mercury 2 support streaming?
Yes, Mercury 2 can stream responses as they are generated.
Can Mercury 2 read images?
Yes, Mercury 2 accepts image input alongside text.
Does Mercury 2 have voice or audio capabilities?
No. Mercury 2 handles image and text input with text output only; audio is not supported.
Can Mercury 2 call external tools or functions?
Yes. It supports function calling, tool use, and parallel tool calls.
Does Mercury 2 support reasoning capabilities?
Yes. Mercury 2 includes reasoning as a supported feature and capability.

