Skip to content

Developers

OpenTelemetry ingestion

Already tracing your agents? Point an OTLP exporter at eBRBe and every model call becomes an agent run, priced and ready to bill.

Endpoint

Value
URLhttps://ebrbe.com/api/v1/otel/v1/traces
ProtocolOTLP/HTTP: application/json or application/x-protobuf, optionally Content-Encoding: gzip
AuthAuthorization: Bearer <API key> with the telemetry:write scope (agent_runs:write also works). Optional eBRBe-Workspace: <slug>.
Limits4 MB per request (16 MB decompressed), 10,000 spans and 1,000 gen-AI spans per request, and the key's API rate limit per request.
Response200 with an OTLP ExportTraceServiceResponse; spans that can't be logged are reported as partial success (rejected spans and the reason), so exporters don't retry them.
Environment (any OpenTelemetry SDK or Collector)
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://ebrbe.com/api/v1/otel/v1/traces
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_TRACES_HEADERS="Authorization=Bearer ebrbe_...,eBRBe-Workspace=acme"

With a Collector, add an otlphttp exporter with traces_endpoint set to the URL above and the same headers, and a filter so only gen-AI spans are forwarded.

How spans become runs

Spans that carry token usage under the OpenTelemetry GenAI semantic conventions become one run each. Other spans are accepted and ignored.

Run fieldFrom
modelgen_ai.response.model, else gen_ai.request.model
providergen_ai.provider.name (or gen_ai.system)
input / output tokensgen_ai.usage.input_tokens / output_tokens
cache read / writegen_ai.usage.cache_read.input_tokens / cache_write.input_tokens (or cache_creation.input_tokens)
toolebrbe.tool, else gen_ai.agent.name, else resource service.name
started, durationspan start and end time
project / client / work itemebrbe.project_id, ebrbe.client_id, ebrbe.work_item_id (span or resource attributes, UUIDs)
costeBRBe's price table for the model, or ebrbe.cost_usd if you set it
billableebrbe.billable (default true)
external_idotel:<trace id>:<span id>
  • No double counting: gen_ai.usage.input_tokens includes cache reads and writes, so eBRBe subtracts them. When a span and one of its descendants in the same request both carry usage (an SDK client span around the server span, around anthropic.model_request), only the deepest counts. Send one source per request (SDK spans or API spans) if they arrive in different batches.
  • Idempotent: re-sending a batch adds nothing; the response headers eBRBe-Runs-Created and eBRBe-Runs-Duplicate say what happened.
  • Runs act as the key's owner: the same permissions, project checks, prices, markup and webhooks as runs logged over the REST API.
  • Models without a price are rejected unless the span has ebrbe.cost_usd.

Try it

Terminal
curl https://ebrbe.com/api/v1/otel/v1/traces \
  -H "Authorization: Bearer $EBRBE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"resourceSpans":[{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"support-bot"}}]},
       "scopeSpans":[{"spans":[{"traceId":"5b8efff798038103d269b633813fc60c","spanId":"eee19b7ec3c1b174",
       "name":"chat claude-opus-5-5","startTimeUnixNano":"1793260800000000000","endTimeUnixNano":"1793260803000000000",
       "attributes":[{"key":"gen_ai.request.model","value":{"stringValue":"claude-opus-5-5"}},
                     {"key":"gen_ai.usage.input_tokens","value":{"intValue":"1200"}},
                     {"key":"gen_ai.usage.output_tokens","value":{"intValue":"300"}}]}]}]}]}'

The run appears in Agent costs with source otel. For Claude Code sessions, the CLI hook is simpler; for a provider's whole bill, use the usage sync.