Use OTel when you want near real-time coding telemetry in addition to provider admin/cost APIs. Claude Code and Codex CLI are the primary use cases here: both can export OTLP telemetry when these environment variables are set in your tool/runtime config.Documentation Index
Fetch the complete documentation index at: https://docs.costhawk.ai/llms.txt
Use this file to discover all available pages before exploring further.
Endpoint
Set your exporter endpoint to:/v1/metrics/v1/logs/v1/traces(accepted; trace storage can be enabled later)
Authentication
Use a CostHawk token in OTLP headers:otel:ingest. If you installed MCP with:
otel:ingest included.
Example Configuration
Best Practices
- Use a dedicated ingest key per environment (dev/staging/prod)
- Rotate ingest keys periodically
- Keep MCP enabled for interactive queries in Claude Code/Codex
- Use Admin API sync for provider-level billing truth; use OTel for real-time activity signals
Common Troubleshooting
401 Unauthorized: invalid/missingx-costhawk-key415 Unsupported Media Type: exporter not sending OTLP protobuf/json- No events in dashboard: verify endpoint is
https://ingest.costhawk.ai(no extra/v1)
Related Concepts
If you are wiring telemetry and trying to decide what data to keep, read OpenTelemetry for the protocol model and Logging for the request metadata you should preserve alongside traces.Admin API Sync
Low-friction org-level cost visibility
MCP Operations
Verify local MCP + auto-sync health
OpenTelemetry Glossary
Terminology and cost context for OTLP-based telemetry
Logging Glossary
What to record so telemetry stays useful for cost analysis
