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 OpenCode?
OpenCode is an open-source terminal-based AI coding assistant. It supports multiple LLM providers, can edit files, run commands, and handle multi-step coding tasks directly from your terminal.Setup
Prerequisite: OpenCode must be installed before integrating with Respan.
View your traces
Open the Traces page to see your OpenCode conversations with full hierarchy — thinking, tool calls, and responses.
Configuration
Customize the integration with flags:| Flag | Env var | Default | Description |
|---|---|---|---|
--global | — | — | Write user-level config (~/.config/opencode/plugins/otel.json). |
--local | — | Local | Write per-project config (.opencode/plugins/otel.json). |
--customer-id | RESPAN_CUSTOMER_ID | — | Customer/user identifier for traces. |
--project-id | RESPAN_PROJECT_ID | — | Respan project ID. |
--attrs | — | — | Custom attributes JSON (e.g. '{"env":"prod"}'). |
--base-url | RESPAN_BASE_URL | https://api.respan.ai/api | Respan API base URL. |
--dry-run | — | — | Preview changes without writing files. |
OpenCode uses the
opencode-otel community plugin. The respan integrate command installs the plugin and configures OTLP endpoints automatically.Captured Data
| Data | Description |
|---|---|
| User prompt | The user’s input text |
| Assistant response | OpenCode’s final response |
| Thinking blocks | Thinking / reasoning content |
| Tool calls | Tool name, input, and output (file operations, shell commands, etc.) |
| Token usage | Input, output, and cache tokens (when available) |
| Timing | Start time, end time, latency |
| Model | Model name used (varies by configured provider) |
Span Types
| Span | log_type | Description |
|---|---|---|
| Root | agent | The complete conversation turn |
| Thinking | generation | Thinking / reasoning blocks |
| Tool | tool | Tool invocations (file reads, writes, shell commands, etc.) |