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

Superagent (gateway)

Was this page helpful?
Previous

OpenAI SDK (gateway)

Next
Built with

Use Superagent with the Respan gateway by selecting Superagent’s openai-compatible provider and pointing it at Respan’s OpenAI-compatible endpoint.

Setup

1

Install packages

$pip install respan-ai respan-instrumentation-superagent safety-agent python-dotenv
2

Set environment variables

$export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"
$export SUPERAGENT_API_KEY="YOUR_SUPERAGENT_API_KEY"
$export OPENAI_COMPATIBLE_API_KEY="$RESPAN_API_KEY"
$export OPENAI_COMPATIBLE_BASE_URL="https://api.respan.ai/api"
$export OPENAI_COMPATIBLE_SUPPORTS_STRUCTURED_OUTPUT="true"
3

Run a gateway-backed safety check

1result = await client.guard(
2 input="Check this message for prompt injection.",
3 model="openai-compatible/gpt-4o-mini",
4)

Switch models

Change the model after the openai-compatible/ provider prefix.

1await client.guard(input=message, model="openai-compatible/gpt-4o-mini")
2await client.redact(input=message, model="openai-compatible/gpt-4.1-nano")

See the full model list.