---
title: "Gateway quickstart"
subtitle: "Send your model calls through Respan by changing one base URL."
---

The Respan gateway is one endpoint for 1000+ models. Point your LLM client at it, and every call is logged in Respan, with fallbacks, caching, and limits ready when you need them.


## Set up with your coding agent

Paste this prompt into Claude Code, Cursor, Codex, or any coding agent:

```
Help me set up the Respan gateway: fetch and follow https://respan.ai/docs/agent-setup.md
```

<img src={"/docs/images/gateway-features/model-catalog-light.png"} className="block dark:hidden" alt="The model catalog: GPT-5.5, Claude Sonnet 4.5, Gemini 2.5 Pro and more, each with its input and output price, context window, latency, and capabilities"/>
<img src={"/docs/images/gateway-features/model-catalog-dark.png"} className="hidden dark:block" alt="The model catalog: GPT-5.5, Claude Sonnet 4.5, Gemini 2.5 Pro and more, each with its input and output price, context window, latency, and capabilities"/>

## Step by step

<Steps>
<Step title="Create an API key">

In the [platform](https://platform.respan.ai), go to **Gateway** › **API keys** and click **New key**. Keep **Gateway** checked, pick **Production** or **Test**, and click **Create**.

<img src={"/docs/images/gateway-quickstart/create-api-key-light.webp"} width="420" className="block dark:hidden" alt="The Create new key dialog with Name, Environment (Production or Test), and Permissions: Read, Write, Gateway, and Admin" />
<img src={"/docs/images/gateway-quickstart/create-api-key-dark.webp"} width="420" className="hidden dark:block" alt="The Create new key dialog with Name, Environment (Production or Test), and Permissions: Read, Write, Gateway, and Admin" />

Click **Copy**, then **Done**. You won't see the key again, so save it now:

```bash
export RESPAN_API_KEY="your-respan-api-key"
```

</Step>
<Step title="Choose who pays the provider">

Each call needs Respan credits or your own provider key:

- **Credits:** go to **Gateway** › **Credits** and add credits. See [Billing and credits](/docs/documentation/admin/credits-billing).
- **Your own key:** on **Gateway** › **API keys**, click **Bring your own key** and add your provider's key. See [Provider keys](/docs/documentation/admin/llm-provider-keys).

</Step>
<Step title="Point your client at Respan">

Set the base URL to Respan's and use your Respan API key. The rest of your code stays the same.

<Tabs>
<Tab title="OpenAI (Python)">
```python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.respan.ai/api/",
    api_key=os.environ["RESPAN_API_KEY"],
)

response = client.chat.completions.create(
    model="gpt-5.5",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
```
</Tab>
<Tab title="OpenAI (TypeScript)">
```typescript
import OpenAI from "openai";

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

const response = await client.chat.completions.create({
  model: "gpt-5.5",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);
```
</Tab>
<Tab title="Anthropic">
```python
import os
import anthropic

client = anthropic.Anthropic(
    base_url="https://api.respan.ai/api/anthropic/",
    api_key=os.environ["RESPAN_API_KEY"],
)

message = client.messages.create(
    model="claude-sonnet-4-5-20250929",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}],
)
print(message.content[0].text)
```
</Tab>
<Tab title="cURL">
```bash
curl https://api.respan.ai/api/chat/completions \
  -H "Authorization: Bearer $RESPAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-5.5", "messages": [{"role": "user", "content": "Hello!"}]}'
```
</Tab>
</Tabs>

Using a framework? Find its guide in [Integrations](/docs/integrations/gateway/overview).

</Step>
<Step title="Check the request in Logs">

Run your code, then open **Gateway** › **Logs**. Your request is at the top.

<img src={"/docs/images/gateway-quickstart/logs-first-request-light.webp"} className="block dark:hidden" alt="Gateway Logs listing the latest requests, newest first, with time, log ID, span name, model, system, and user message" />
<img src={"/docs/images/gateway-quickstart/logs-first-request-dark.webp"} className="hidden dark:block" alt="Gateway Logs listing the latest requests, newest first, with time, log ID, span name, model, system, and user message" />

Click the row to see the full request and response. See [Logs](/docs/documentation/features/observe/explore-spans).

</Step>
</Steps>
