---
title: Clipia AI Gateway
description: One OpenAI-compatible API for Claude, GPT, Gemini, DeepSeek and Grok, paid with Clipia credits. Get a key and send your first request in a couple of minutes.
icon: MessagesSquare
---

Clipia AI Gateway is a single **OpenAI-compatible** API to flagship language models: Claude, GPT, Gemini, DeepSeek and Grok. One key, one contract, billed with your Clipia account credits. If you already have code on the `openai` SDK or LangChain, just point `base_url` at `https://api.clipia.ai/v1` and use a Clipia key.

<Callout type="info" title="Base URL">
`https://api.clipia.ai/v1` — compatible with OpenAI Chat Completions. Authenticate with a regular Clipia API key: `Authorization: Bearer clipia_...`. **It's the same key and the same credit balance you use for image and video generation.** You don't need a separate Gateway key: chat is part of the `generate` permission that every key has (see [Authentication](/en/docs/getting-started/authentication#scopes)). Both `clipia_live_…` and `clipia_test_…` work; a test key returns a canned reply that costs 0.
</Callout>

## What's inside

<Cards>
  <Card title="Chat Completions" href="/en/docs/llm-gateway/chat-completions">
    `POST /v1/chat/completions` — streaming and non-streaming responses, tool calling, structured outputs.
  </Card>
  <Card title="Models & pricing" href="/en/docs/llm-gateway/models">
    The `GET /v1/models` catalog and prices in US dollars per 1M tokens.
  </Card>
  <Card title="LangChain" href="/en/docs/llm-gateway/langchain">
    `ChatOpenAI` with our `base_url` — chat, tools and agents.
  </Card>
</Cards>

## Quickstart

<Steps>

<Step>

### Get an API key

Create a key in the [developer console](/en/developer) → **API keys** tab. The full key is shown **only once** — save it immediately. It is a server-side secret; never put it in a browser or a public repository.

```bash
export CLIPIA_KEY=clipia_live_xxxxxxxxxxxxxxxxxxxxxx
```

</Step>

<Step>

### Make your first request

Use the official `openai` SDK — change only `base_url` and the key. The model is passed as a string (see the [catalog](/en/docs/llm-gateway/models)).

<Tabs items={['Python', 'Node.js', 'cURL']}>
<Tab value="Python">

```python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["CLIPIA_KEY"],
    base_url="https://api.clipia.ai/v1",
)

resp = client.chat.completions.create(
    model="claude-opus-5-5",
    messages=[
        {"role": "user", "content": "Hi! Tell me three facts about Mars."},
    ],
)

print(resp.choices[0].message.content)
```

</Tab>
<Tab value="Node.js">

```ts
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.CLIPIA_KEY,
  baseURL: "https://api.clipia.ai/v1",
});

const resp = await client.chat.completions.create({
  model: "claude-opus-5-5",
  messages: [
    { role: "user", content: "Hi! Tell me three facts about Mars." },
  ],
});

console.log(resp.choices[0].message.content);
```

</Tab>
<Tab value="cURL">

```bash
curl https://api.clipia.ai/v1/chat/completions \
  -H "Authorization: Bearer $CLIPIA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-5-5",
    "messages": [
      { "role": "user", "content": "Hi! Tell me three facts about Mars." }
    ]
  }'
```

</Tab>
</Tabs>

</Step>

<Step>

### Read the response

The response is a standard `chat.completion` object. The text is in `choices[0].message.content`, the spend is in `usage`.

```json
{
  "id": "chatcmpl-3f9a1c7e2b41",
  "object": "chat.completion",
  "created": 1782300000,
  "model": "claude-opus-5-5",
  "provider": "Clipia",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "1. ...\n2. ...\n3. ..." },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 18,
    "completion_tokens": 72,
    "total_tokens": 90,
    "prompt_tokens_details": { "cached_tokens": 0 }
  }
}
```

`usage` is the input and output token spend. The cost in **credits** is charged to the account balance at the model's rate (see [pricing](/en/docs/llm-gateway/models)); you can look it up by the response `id` with `GET /v1/generation` — see [Key and limits](/en/docs/llm-gateway/account#cost).

</Step>

</Steps>

<Callout type="info" title="Sandbox, no charge">
A key prefixed `clipia_test_` returns a canned reply in the same format and charges nothing, so you can debug response parsing before going live. See [Sandbox](/en/docs/getting-started/sandbox).
</Callout>

## Compatibility

The gateway responds in the OpenAI Chat Completions format, so clients built for the OpenAI contract work out of the box: the `openai` SDK (Python and Node.js), LangChain, and agent tools that accept a custom `base_url`. Streaming (SSE with `data: [DONE]`), tool calling (`tools`), structured outputs (`response_format`) and the standard OpenAI error envelope are all supported.

<Callout type="warn" title="Long answers in a stream">
A long-running non-streaming request can get a `504`: use `stream: true` for long answers and reasoning models, and the `Idempotency-Key` header for safe retries — see [Timeouts and retries](/en/docs/llm-gateway/chat-completions#timeouts).
</Callout>

<Callout type="info" title="What's next">
- [Chat Completions](/en/docs/llm-gateway/chat-completions) — parameters, streaming, tools, errors.
- [Models & pricing](/en/docs/llm-gateway/models) — catalog and rates.
- [LangChain](/en/docs/llm-gateway/langchain) — chat and agents.
- [Key and limits](/en/docs/llm-gateway/account) — `GET /v1/key`, request cost by `id` and request limits.
- More about the product on the [Clipia AI Gateway](/en/ai-gateway) page.

The same models are available as an MCP `chat` tool — see the [MCP](/en/docs/mcp) section.
</Callout>
