Skip to main content
InceptionLabs develops diffusion-based language models for fast, efficient text generation. InceptionLabs requires you to bring your own key—ngrok-managed keys are not available.

Setup

1

Create an AI Gateway endpoint

If you don’t have one yet, follow the quickstart to create your AI Gateway endpoint.
2

Get an InceptionLabs API key

Sign up at inceptionlabs.ai and obtain an API key.
3

Make a request

Pass your key directly—the gateway forwards it to InceptionLabs.
from openai import OpenAI

client = OpenAI(
    base_url="https://your-ai-gateway.ngrok.app/v1",
    api_key="..."  # Your InceptionLabs key, forwarded by gateway
)

response = client.chat.completions.create(
    model="inceptionlabs:mercury-coder-small-beta",
    messages=[{"role": "user", "content": "Hello!"}]
)

print(response.choices[0].message.content)

Store key in the gateway

Instead of each client passing their own key, you can store it once in ngrok Secrets and have the gateway inject it automatically.
Storing your provider key in the gateway makes your endpoint publicly accessible. You must add authorization to prevent unauthorized use and unexpected charges. See Protecting BYOK Endpoints.
1

Store your key in ngrok secrets

ngrok api secrets create \
  --name inceptionlabs \
  --secret-data '{"api-key": "..."}'
Or use the Vaults & Secrets dashboard.
2

Configure your traffic policy

on_http_request:
  - type: ai-gateway
    config:
      providers:
        - id: "inceptionlabs"
          api_keys:
            - value: ${secrets.get('inceptionlabs', 'api-key')}
3

Make a request

Clients no longer need an InceptionLabs key—pass any value for api_key.
from openai import OpenAI

client = OpenAI(
    base_url="https://your-ai-gateway.ngrok.app/v1",
    api_key="unused"  # Gateway injects your InceptionLabs key
)

response = client.chat.completions.create(
    model="inceptionlabs:mercury-coder-small-beta",
    messages=[{"role": "user", "content": "Hello!"}]
)

print(response.choices[0].message.content)

Next steps