For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DiscordPlatform
DocumentationIntegrationsAPI referenceSDKsChangelog
DocumentationIntegrationsAPI referenceSDKsChangelog
    • Overview
  • Tracing
  • Gateway
      • OpenAI Agents
      • Claude Agent SDK
      • Vercel AI SDK
      • Pydantic AI
      • CrewAI
      • Haystack
      • LangChain
      • LangGraph
      • Langflow
      • LlamaIndex
      • AutoGen
      • DSPy
      • Google ADK
      • Smolagents
      • Strands Agents
      • AgentSpec
      • Guardrails
      • Agno
      • MCP
      • BeeAI
      • Pipecat
      • Superagent
  • Others
  • Migrating
    • Braintrust
    • Portkey
    • Langfuse
LogoLogo
DiscordPlatform
On this page
  • Setup
  • Switch models
GatewayAgent Frameworks

Google ADK (gateway)

Was this page helpful?
Previous

Smolagents (gateway)

Next
Built with

Route Google ADK’s underlying LLM calls through the Respan gateway to use 250+ models from different providers. The examples use ADK’s LiteLlm adapter and load keys from the repo root .env.

Setup

1

Install packages

$pip install respan-ai respan-instrumentation-google-adk "google-adk[extensions]"
2

Set environment variables

$export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"
$export RESPAN_MODEL="gpt-4o-mini"

Set RESPAN_GATEWAY_API_KEY or RESPAN_GATEWAY_BASE_URL only if they differ from your tracing key or base URL.

3

Point Google ADK to the Respan gateway

Use LiteLlm with the OpenAI-compatible Respan endpoint to route ADK’s LLM calls.

1import os
2from google.adk.agents import Agent
3from google.adk.models.lite_llm import LiteLlm
4
5model_name = os.getenv("RESPAN_MODEL", "gpt-4o-mini")
6if "/" not in model_name:
7 model_name = f"openai/{model_name}"
8
9agent = Agent(
10 name="assistant",
11 model=LiteLlm(
12 model=model_name,
13 api_key=os.getenv("RESPAN_GATEWAY_API_KEY") or os.environ["RESPAN_API_KEY"],
14 api_base=os.getenv("RESPAN_GATEWAY_BASE_URL", "https://api.respan.ai/api"),
15 ),
16 instruction="You are a concise assistant.",
17)

Switch models

Change the model parameter on LiteLlm to use different gateway-backed providers through the same endpoint.

1LiteLlm(model="openai/gpt-4o-mini", api_key=..., api_base="https://api.respan.ai/api")
2LiteLlm(model="openai/gemini-2.5-flash", api_key=..., api_base="https://api.respan.ai/api")

See the full model list.