---
title: "Strands Agents (gateway)"
description: "Set up Strands Agents with the Respan gateway."
---

Route Strands Agents model calls through the Respan gateway to use models and provider credentials configured in Respan. The OpenAI-compatible model adapter points at Respan's gateway endpoint with `RESPAN_API_KEY`.

Paste this into your coding agent:

```text
Help me set up the Respan gateway with the Strands Agents integration.
Follow https://www.respan.ai/docs/integrations/gateway/strands-agents.md
```

## Setup

<Steps>
<Step title="Install packages">

<Tabs>
<Tab title={"Python"}>

```bash
pip install "strands-agents[openai]"
```

</Tab>
<Tab title={"TypeScript"}>

```bash
npm install @strands-agents/sdk openai
```

</Tab>
</Tabs>

</Step>

<Step title="Set environment variables">

```bash
export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"
export RESPAN_BASE_URL="https://gateway.respan.ai"
export RESPAN_MODEL="gpt-5-mini"
```

No provider credentials are needed in your application; the Respan gateway handles provider authentication.

</Step>

<Step title="Point Strands Agents to the Respan gateway">

<Tabs>
<Tab title={"Python"}>

```python
import os
from strands import Agent
from strands.models.openai import OpenAIModel

model = OpenAIModel(
    model_id=os.getenv("RESPAN_MODEL", "gpt-5-mini"),
    client_args={
        "api_key": os.environ["RESPAN_API_KEY"],
        "base_url": os.getenv("RESPAN_BASE_URL", "https://gateway.respan.ai"),
    },
)

agent = Agent(model=model)
print(agent("What is the capital of France?"))
```

</Tab>
<Tab title={"TypeScript"}>

```typescript
import { Agent } from "@strands-agents/sdk";
import { OpenAIModel } from "@strands-agents/sdk/models/openai";

const model = new OpenAIModel({
  api: "chat",
  modelId: process.env.RESPAN_MODEL ?? "gpt-5-mini",
  apiKey: process.env.RESPAN_API_KEY,
  clientConfig: {
    baseURL: process.env.RESPAN_BASE_URL ?? "https://gateway.respan.ai",
  },
});

const agent = new Agent({
  name: "Assistant",
  model,
  systemPrompt: "You are a concise assistant.",
  printer: false,
});

const response = await agent.invoke("What is the capital of France?");
console.log(response);
```

</Tab>
</Tabs>

</Step>
</Steps>

## Switch models

Change the model parameter to another OpenAI-compatible model available through your Respan account.

<Tabs>
<Tab title={"Python"}>

```python
OpenAIModel(
    model_id="gpt-5.5",
    client_args={"api_key": os.environ["RESPAN_API_KEY"], "base_url": "https://gateway.respan.ai"},
)
```

</Tab>
<Tab title={"TypeScript"}>

```typescript
new OpenAIModel({
  api: "chat",
  modelId: "gpt-5.5",
  apiKey: process.env.RESPAN_API_KEY,
  clientConfig: { baseURL: "https://gateway.respan.ai" },
});
```

</Tab>
</Tabs>

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