> 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.

# Strands Agents (gateway)

> 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`.

## Setup

#### Install packages

**`Python`**

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

**`TypeScript`**

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

#### Set environment variables

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

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

#### Point Strands Agents to the Respan gateway

**`Python`**

```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://api.respan.ai/api"),
    },
)

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

**`TypeScript`**

```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://api.respan.ai/api",
  },
});

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);
```

## Switch models

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

**`Python`**

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

**`TypeScript`**

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

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