Set up Respan
Set up Respan
- Sign up — Create an account at platform.respan.ai
- Create an API key — Generate one on the API keys page
- Add credits or a provider key — Add credits on the Credits page or connect your own provider key on the Integrations page
Use AI
Use AI
Add the Docs MCP to your AI coding tool to get help building with Respan. No API key needed.
What is OpenAI Agents SDK?
The OpenAI Agents SDK (openai-agents) is a lightweight framework for building multi-agent workflows with tools, handoffs, and guardrails. Respan gives you full observability over every agent run, LLM generation, tool call, and handoff.
Example projects
Example projects
Setup
View your trace
Open the Traces page to see your workflow with agent spans, LLM generations, tool calls, and handoffs.
This step applies to Tracing and Both setups. The Gateway-only setup does not produce traces.
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | None | None | Falls back to RESPAN_API_KEY env var. |
base_url | str | None | None | Falls back to RESPAN_BASE_URL env var. |
instrumentations | list | [] | Plugin instrumentations to activate (e.g. OpenAIAgentsInstrumentor()). |
customer_identifier | str | None | None | Default customer identifier for all spans. |
metadata | dict | None | None | Default metadata attached to all spans. |
environment | str | None | None | Environment tag (e.g. "production"). |
Attributes
In Respan()
Set defaults at initialization — these apply to all spans.With propagate_attributes
Override per-request using a context scope.| Attribute | Type | Description |
|---|---|---|
customer_identifier | str | Identifies the end user in Respan analytics. |
thread_identifier | str | Groups related messages into a conversation. |
metadata | dict | Custom key-value pairs. Merged with default metadata. |
Decorators (optional)
Decorators are not required. All agent runs, LLM calls, tool calls, and handoffs are auto-traced by the instrumentor. Use@workflow and @task to add structure when you want to group agent runs into named workflows with nested tasks.
Examples
Tool calls
Tool calls are automatically captured as spans with inputs, outputs, and timing.Handoffs
Agent-to-agent handoffs are traced with full context.Streaming
Stream agent responses with real-time text deltas.Gateway features
The features below require the Gateway or Both setup from Step 3.
Switch models
Change themodel parameter on your agents to use 250+ models from different providers through the same gateway.