Start Free with 100M Tokens
Every new account includes 100 million free tokens.
Models
| Model | Input Price (1M Tokens) | Cached Input Price (1M Tokens) | Output Price (1M Tokens) | Supported Endpoints | Context Window | Max Output Tokens | Features | Supported Formats |
|---|---|---|---|---|---|---|---|---|
| Mercury 2 | $0.25 | $0.025 | $0.75 | v1/chat/completions | Chat: 128K | 50,000 | Tool CallingStructured Outputs | Text |
| Mercury Edit 2 | $0.25 | $0.025 | $0.75 | v1/fim/completionsv1/edit/completions | FIM: 32K NextEdit: 32K | 8,192 | Text |
- Mercury 2
- Mercury Edit 2
The fastest reasoning LLM and our most powerful model.Export your API key as an environment variable in your terminal.
export INCEPTION_API_KEY="your_api_key_here"
set INCEPTION_API_KEY=your_api_key_here
$env:INCEPTION_API_KEY="your_api_key_here"
Example Usage
Chat Completions
v1/chat/completionscurl https://api.inceptionlabs.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $INCEPTION_API_KEY" \
-d '{
"model": "mercury-2",
"messages": [
{"role": "user", "content": "What is a diffusion model?"}
],
"max_tokens": 8192
}'
from inceptionai import Inception
client = Inception() # reads INCEPTION_API_KEY from the environment
completion = client.chat.completions.create(
model="mercury-2",
messages=[{"role": "user", "content": "What is a diffusion model?"}],
max_tokens=8192,
)
print(completion.choices[0].message.content)
import Inception from 'inceptionai';
const client = new Inception(); // reads INCEPTION_API_KEY from the environment
const completion = await client.chat.completions.create({
model: 'mercury-2',
messages: [{ role: 'user', content: 'What is a diffusion model?' }],
max_tokens: 8192,
});
console.log(completion.choices[0]?.message.content);
A code editing LLM for autocomplete (FIM) and next edit suggestions.Export your API key as an environment variable in your terminal.
export INCEPTION_API_KEY="your_api_key_here"
set INCEPTION_API_KEY=your_api_key_here
$env:INCEPTION_API_KEY="your_api_key_here"
Example Usage
Autocomplete (FIM)
v1/fim/completionscurl https://api.inceptionlabs.ai/v1/fim/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $INCEPTION_API_KEY" \
-d '{
"model": "mercury-edit-2",
"prompt": "def factorial(n):\n if n <= 1:\n return 1\n return n * ",
"suffix": "\n\nprint(factorial(5))",
"max_tokens": 1000
}'
from inceptionai import Inception
client = Inception() # reads INCEPTION_API_KEY from the environment
completion = client.fim.completions.create(
model="mercury-edit-2",
prompt="def factorial(n):\n if n <= 1:\n return 1\n return n * ",
suffix="\n\nprint(factorial(5))",
max_tokens=1000,
)
print(completion.choices[0].text)
import Inception from 'inceptionai';
const client = new Inception(); // reads INCEPTION_API_KEY from the environment
const completion = await client.fim.completions.create({
model: 'mercury-edit-2',
prompt: 'def factorial(n):\n if n <= 1:\n return 1\n return n * ',
suffix: '\n\nprint(factorial(5))',
max_tokens: 1000,
});
console.log(completion.choices[0]?.text);
Next-Edit
v1/edit/completionscurl https://api.inceptionlabs.ai/v1/edit/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $INCEPTION_API_KEY" \
--data-binary @- <<'JSON'
{
"model": "mercury-edit-2",
"messages": [
{"role": "user", "content": "<|recently_viewed_code_snippets|>\n\n<|/recently_viewed_code_snippets|>\n\n<|current_file_content|>\ncurrent_file_path: solver.py\n'''\nfunction: flagAllNeighbors\n----------\nThis function marks each of the covered neighbors of the cell at the given row\n<|code_to_edit|>\nand col as flagged.\n'''\ndef flagAllNeighbors(board<|cursor|>, row, col): \n for r, c in b.getNeighbors(row, col):\n if b.isValid(r, c):\n b.flag(r, c)\n\n<|/code_to_edit|>\n<|/current_file_content|>\n\n<|edit_diff_history|>\n--- /c:/Users/test/testing/solver.py\n+++ /c:/Users/test/testing/solver.py\n@@ -6,1 +6,1 @@\n-def flagAllNeighbors(b, row, col): \n+def flagAllNeighbors(board, row, col): \n\n<|/edit_diff_history|>"}
],
"max_tokens": 1000
}
JSON
from inceptionai import Inception
client = Inception() # reads INCEPTION_API_KEY from the environment
completion = client.edit.completions.create(
model="mercury-edit-2",
messages=[
{"role": "user", "content": "<|recently_viewed_code_snippets|>\n\n<|/recently_viewed_code_snippets|>\n\n<|current_file_content|>\ncurrent_file_path: solver.py\n'''\nfunction: flagAllNeighbors\n----------\nThis function marks each of the covered neighbors of the cell at the given row\n<|code_to_edit|>\nand col as flagged.\n'''\ndef flagAllNeighbors(board<|cursor|>, row, col): \n for r, c in b.getNeighbors(row, col):\n if b.isValid(r, c):\n b.flag(r, c)\n\n<|/code_to_edit|>\n<|/current_file_content|>\n\n<|edit_diff_history|>\n--- /c:/Users/test/testing/solver.py\n+++ /c:/Users/test/testing/solver.py\n@@ -6,1 +6,1 @@\n-def flagAllNeighbors(b, row, col): \n+def flagAllNeighbors(board, row, col): \n\n<|/edit_diff_history|>"}
],
max_tokens=1000,
)
print(completion.choices[0].message.content)
import Inception from 'inceptionai';
const client = new Inception(); // reads INCEPTION_API_KEY from the environment
const completion = await client.edit.completions.create({
model: 'mercury-edit-2',
messages: [
{ role: 'user', content: '<|recently_viewed_code_snippets|>\n\n<|/recently_viewed_code_snippets|>\n\n<|current_file_content|>\ncurrent_file_path: solver.py\n\'\'\'\nfunction: flagAllNeighbors\n----------\nThis function marks each of the covered neighbors of the cell at the given row\n<|code_to_edit|>\nand col as flagged.\n\'\'\'\ndef flagAllNeighbors(board<|cursor|>, row, col): \n for r, c in b.getNeighbors(row, col):\n if b.isValid(r, c):\n b.flag(r, c)\n\n<|/code_to_edit|>\n<|/current_file_content|>\n\n<|edit_diff_history|>\n--- /c:/Users/test/testing/solver.py\n+++ /c:/Users/test/testing/solver.py\n@@ -6,1 +6,1 @@\n-def flagAllNeighbors(b, row, col): \n+def flagAllNeighbors(board, row, col): \n\n<|/edit_diff_history|>' }
],
max_tokens: 1000,
});
console.log(completion.choices[0]?.message.content);