What is Mercury 2 API?
Mercury 2 is available through AIMLAPI.
Technical Specifications
- Supported inputs: Image, Text
- Output: Text
- Context window: 128,000 tokens / Max output: 50,000 tokens
- Endpoint: /chat/completions
Performance Benchmarks
[embed]
Mercury 2 API Pricing
- Input: $0.325 / 1M tokens
- Output: $0.975 / 1M tokens
Where to Use Mercury 2
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.
Code Sample
[embed]
Measured on the AI/ML API gateway across live traffic. Figures are medians unless stated. Last updated 2026-10-12.
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.
import requests r = requests.post( "https://api.aimlapi.com/v1/chat/completions", headers={"Authorization": "Bearer " + AIMLAPI_KEY}, json={ "model": "inception/mercury-2", "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": "inception/mercury-2", "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":"inception/mercury-2","messages":[{"role":"user","content":"Hello!"}]}'
OpenAI-compatible — swap the base URL and it works with your existing SDK.
| Type | Price |
|---|---|
| Input | |
| Output | |
| Cached input |
| Benchmark | Score | What it measures | Source | Retrieved |
|---|---|---|---|---|
| Intelligence | 11.5 | Composite score across standardised reasoning, knowledge and problem-solving evaluations, measured independently by Artificial Analysis | Source | September 12, 2026 |
| Coding | 31.1 | Composite score across standardised coding evaluations, measured independently by Artificial Analysis | Source | September 12, 2026 |
| AIME 2025 | 91.1 | Competition mathematics (AIME), 2025 | Source | September 21, 2026 |
| GPQA Diamond | 73.6 | Google-proof graduate science questions (hardest subset) | Source | September 21, 2026 |
| Humanity's Last Exam | 17.1% | Expert-level questions across many domains | Source | September 21, 2026 |
| Model | Input | Output | Context | Best for |
|---|---|---|---|---|
Mercury 2 This page | Reasoning + agents | |||
| Reasoning + agents | ||||
| Balanced coding + agents | ||||
| Long-context, multimodal & agentic workflows | ||||
| Reasoning + agents |
Mercury 2 has a 128,000 tokens context window and can return up to 50,000 tokens.
Mercury 2 takes image, text as input and returns text.
Use inception/mercury-2 as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.
Mercury 2 is priced at input $0.34385 / 1M tokens, output $1.03155 / 1M tokens, cached input $0.034385 / 1M tokens.
Yes, Mercury 2 can stream responses as they are generated.
Yes, Mercury 2 accepts image input alongside text.
No. Mercury 2 handles image and text input with text output only; audio is not supported.
Yes. It supports function calling, tool use, and parallel tool calls.
Yes. Mercury 2 includes reasoning as a supported feature and capability.