All guides

OpenTelemetry GenAI LLM Cost Tracking

Use OpenTelemetry GenAI attributes to bring direct provider calls into Cloptima's LLM spend analytics.

9 min read Updated June 2026Connect your AI stack
On this page
  1. 01Why telemetry comes first for some apps
  2. 02Send GenAI traces to Cloptima
  3. 03Use alongside gateway adoption
  4. 04Validate quality

01

Why telemetry comes first for some apps

Not every app can move through a gateway immediately. OpenTelemetry-based ingest lets teams start measuring usage and attribution before changing request paths.

02

Send GenAI traces to Cloptima

Point your OTLP/HTTP trace exporter at Cloptima's GenAI receiver and authenticate with a virtual key. Emit OpenTelemetry GenAI semantic-convention attributes (gen_ai.system, gen_ai.request.model, token usage) and add Cloptima attribution as resource/span attributes.

bash
# OTLP/HTTP exporter -> Cloptima GenAI receiver
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="https://api.cloptima.ai/v1/ai/integrations/otlp/traces"
export OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer clop_vk_dPXO67p…"

# emit gen_ai.* attributes plus attribution, e.g.
#   gen_ai.system="openai", gen_ai.request.model="gpt-5.4-mini"
#   cloptima.team="search", cloptima.app="ranking", cloptima.environment="production"

03

Use alongside gateway adoption

Telemetry and gateway usage coexist. Cloptima is built for mixed adoption while teams decide which workloads need real-time enforcement.

04

Validate quality

Review attribution quality regularly. Missing team, app, or environment metadata should become an onboarding task for the owning team.

Put This Guide Into Practice

Cloptima automates the strategies described in this guide.

No credit card required
5-minute setup
Free trial