---
title: "Google ADK (gateway)"
description: "Set up Google ADK with the Respan gateway."
---

Route Google ADK model calls through the Respan gateway to use models and provider credentials configured in Respan. The gateway setup uses `RESPAN_API_KEY` for the model request path.

Paste this into your coding agent:

```text
Help me set up the Respan gateway with the Google ADK integration.
Follow https://www.respan.ai/docs/integrations/gateway/google-adk.md
```

## Setup

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

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

```bash
pip install "google-adk[extensions]"
```

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

```bash
npm install @google/adk
```

</Tab>
</Tabs>

</Step>

<Step title="Set environment variables">

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

No provider credentials are needed in your application when the request is routed through the Respan gateway.

</Step>

<Step title="Point ADK to the Respan gateway">

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

```python
import os
from google.adk.agents import Agent
from google.adk.models.lite_llm import LiteLlm

agent = Agent(
    name="assistant",
    model=LiteLlm(
        model="gpt-5-mini",
        api_key=os.environ["RESPAN_API_KEY"],
        api_base="https://gateway.respan.ai",
    ),
    instruction="You are a concise assistant.",
)
```

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

```typescript
import { ApigeeLlm, InMemoryRunner, LlmAgent } from "@google/adk";

const agent = new LlmAgent({
  name: "assistant",
  model: new ApigeeLlm({
    model: "apigee/gemini/v1beta/gemini-3.5-flash",
    proxyUrl: "https://gateway.respan.ai",
    apiKey: process.env.RESPAN_API_KEY,
  }),
  instruction: "You are a concise assistant.",
});

const runner = new InMemoryRunner({
  appName: "google-adk-gateway-demo",
  agent,
});

for await (const event of runner.runEphemeral({
  userId: "demo-user",
  newMessage: {
    role: "user",
    parts: [{ text: "Say hello in one sentence." }],
  },
})) {
  console.log(event.content?.parts?.map((part) => part.text).join(""));
}
```

</Tab>
</Tabs>

</Step>
</Steps>

## Switch models

Change the configured model to another model available through your Respan account.

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

```python
agent = Agent(
    name="assistant",
    model=LiteLlm(
        model="gpt-5.5",
        api_key=os.environ["RESPAN_API_KEY"],
        api_base="https://gateway.respan.ai",
    ),
)
```

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

```typescript
const agent = new LlmAgent({
  name: "assistant",
  model: new ApigeeLlm({
    model: "apigee/gemini/v1beta/gemini-3.1-flash-lite",
    proxyUrl: "https://gateway.respan.ai",
    apiKey: process.env.RESPAN_API_KEY,
  }),
});
```

</Tab>
</Tabs>

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