> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://www.respan.ai/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://www.respan.ai/docs/_mcp/server.

# AWS Bedrock (gateway)

> Set up Amazon Bedrock with the Respan gateway.

Route Bedrock calls through the Respan gateway to use 1000+ models from different providers. Only your `RESPAN_API_KEY` is needed. No separate AWS credentials are required in application code.

## Setup

#### Install packages

**`Python`**

```bash Python
pip install openai
```

**`TypeScript`**

```bash TypeScript
npm install openai
```

#### Set environment variables

```bash
export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"
```

No AWS credentials are needed in your application runtime. The Respan gateway handles provider authentication.

#### Point an OpenAI-compatible client to the Respan gateway

**`Python`**

```python Python
import os
from openai import OpenAI

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

response = client.chat.completions.create(
    model="bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0",
    messages=[{"role": "user", "content": "Say hello in three languages."}],
)
print(response.choices[0].message.content)
```

**`TypeScript`**

```typescript TypeScript
import OpenAI from "openai";

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

const response = await client.chat.completions.create({
  model: "bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0",
  messages: [{ role: "user", content: "Say hello in three languages." }],
});
console.log(response.choices[0]?.message?.content);
```

## Switch models

Change the `model` parameter to use 1000+ models from different providers through the same gateway.

**`Python`**

```python Python
response = client.chat.completions.create(model="bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0", messages=messages)
response = client.chat.completions.create(model="openai/gpt-6-sol", messages=messages)
response = client.chat.completions.create(model="gemini/gemini-3.8-flash", messages=messages)
```

**`TypeScript`**

```typescript TypeScript
await client.chat.completions.create({ model: "bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0", messages });
await client.chat.completions.create({ model: "openai/gpt-6-sol", messages });
await client.chat.completions.create({ model: "gemini/gemini-3.8-flash", messages });
```

See the [full model list](https://platform.respan.ai/platform/models).