Skip to content

Quickstart

Fresh

Get 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:

LibrarySetup
OpenAI PythonSet base_url="https://api.inceptionlabs.ai/v1"
LangChainUse ChatOpenAI with Inception base URL
LiteLLMConfigure as OpenAI-compatible provider
AISuiteAdd Inception as custom provider
Vercel AI SDKUse OpenAI-compatible adapter

Next Steps