Traces
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
Add the Docs MCP to your AI coding tool to get help building with Respan. No API key needed.
The Respan tracing SDK provides decorators and wrappers to instrument your code. This page covers the detailed features.
Quickstart
If you want traces as fast as possible, install Respan, pick your framework, run one request, then open the Traces page.
1. Set your API key
If your framework calls the provider directly instead of going through Respan Gateway, also set the provider key such as OPENAI_API_KEY or ANTHROPIC_API_KEY.
2. Choose your framework
OpenAI SDK
OpenAI Agents SDK
Claude Agent SDK
Vercel AI SDK
3. Need raw OTLP instead?
If you already have OpenTelemetry set up, skip the framework SDKs and send spans directly to the OTLP endpoint or follow the manual ingestion guide.
Decorators & span types
Use decorators (Python) or wrapper methods (JS/TS) to create spans. Each decorator creates a different span type in the trace tree.
For the full SDK API reference, see the Python SDK or TypeScript SDK.
Class-based workflows
Apply @workflow to a class with method_name to designate the entry point. Use @task on individual methods.
Override span input & output
Control what appears as a span’s input/output in the trace UI using OpenTelemetry attributes:
Use update_current_span(attributes=...) for overriding displayed input/output. Values must be JSON-serializable strings via json.dumps(...).
Integration frameworks
Respan supports 90+ integrations with popular AI frameworks. See the Integrations overview for the full list, or jump to:
Manual ingestion
Use manual ingestion when you have existing log data, custom telemetry pipelines, or OpenTelemetry setups that need to send traces to Respan without using a framework SDK.
OTLP endpoint
If you have an existing OpenTelemetry setup, send traces directly to Respan’s OTLP-compatible endpoint. This works with any OpenTelemetry SDK or collector.
Environment variable configuration
SDK configuration
Python
JS/TS
cURL
Respan automatically parses OTel spans, extracts Gen AI semantic conventions and Respan-specific attributes, and maps them to the Respan data model. For the full OTLP schema and recognized attributes, see the OTLP ingest API reference.
Legacy JSON ingest API
Use this endpoint when you already have span-shaped JSON and need the legacy v1 ingest path. For new OpenTelemetry integrations, prefer the OTLP endpoint at /api/v2/traces.
Construct traces by posting spans as JSON. Every span is a JSON object. Spans with the same trace_unique_id are grouped into a single trace. Parent-child relationships are defined via span_parent_id.
Endpoint
Request body shapes
This legacy endpoint accepts either of these JSON payloads:
Response
Returns 200 OK with a message like:
Span fields
For the full list, see Span fields reference.