Docs

Overview

AI Gateway lets each customer connect the AI provider account your application uses for them.

your backend
    │  OpenAI or Anthropic request
    │  customer ID: org_123

AI Gateway

    └── provider connected by org_123
        AWS Bedrock · Vertex AI · Azure AI Foundry
        OpenAI · Anthropic · Databricks

Your backend keeps one API integration. The customer’s provider credentials stay in their connection; your application receives an Alien API key instead.

Add it to an OpenAI client

Change the base URL, add the customer ID, and use the model ID shown by Alien:

import OpenAI from "openai"

const ai = new OpenAI({
  baseURL: "https://ai.alien.dev/v1",
  apiKey: process.env.ALIEN_AI_API_KEY,
  defaultHeaders: {
    "X-Alien-External-ID": customer.id,
  },
})

const response = await ai.chat.completions.create({
  model: "byo/claude-opus-5",
  messages: [{ role: "user", content: "Hello" }],
})

The three values that choose the route are visible in the example:

ValueChooses
Alien API keyYour project
X-Alien-External-IDThe customer connection
modelA model available through that connection

AI Gateway supports OpenAI Chat Completions, OpenAI Responses, Anthropic Messages, and model discovery.

On this page