Quickstart
FreshGet up and running with the Inception Labs Mercury API in minutes.
Prerequisites
- An Inception Labs account (Sign up)
- New accounts receive 10 million free tokens
Step 1: Get Your API Key
Generate an API key from the Dashboard.
Step 2: Set Environment Variable
bash
export INCEPTION_API_KEY="your_api_key_here"bash
set INCEPTION_API_KEY="your_api_key_here"Step 3: Make Your First Request
bash
curl https://api.inceptionlabs.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $INCEPTION_API_KEY" \
-d '{
"model": "mercury-2",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is a diffusion model?"}
]
}'python
import os
import requests
response = requests.post(
"https://api.inceptionlabs.ai/v1/chat/completions",
headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {os.environ['INCEPTION_API_KEY']}"
},
json={
"model": "mercury-2",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is a diffusion model?"}
]
}
)
print(response.json())javascript
const response = await fetch("https://api.inceptionlabs.ai/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${process.env.INCEPTION_API_KEY}`
},
body: JSON.stringify({
model: "mercury-2",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "What is a diffusion model?" }
]
})
});
const data = await response.json();
console.log(data);Workflow Overview
Using Third-Party Libraries
The Inception API is OpenAI-compatible, so you can use existing libraries:
| Library | Setup |
|---|---|
| OpenAI Python | Set base_url="https://api.inceptionlabs.ai/v1" |
| LangChain | Use ChatOpenAI with Inception base URL |
| LiteLLM | Configure as OpenAI-compatible provider |
| AISuite | Add Inception as custom provider |
| Vercel AI SDK | Use OpenAI-compatible adapter |
Next Steps
- Chat Completions — Full chat API reference
- Models & Pricing — Available models and costs
- IDE Integrations — Use Mercury in your editor