Skip to main content
Use OpenTelemetry when your application already calls an LLM provider directly and you want ReclaimLLM observability without routing provider traffic through a proxy. Your application continues to call OpenAI, Anthropic, or another provider. An instrumentor emits traces to ReclaimLLM in parallel, so provider latency and credentials stay outside the ReclaimLLM request path.
ReclaimLLM does not need or store your provider API key. The ReclaimLLM API key authenticates only the telemetry export.

When to use OpenTelemetry

OpenTelemetry capture supports OpenAI, Azure OpenAI, Anthropic, Gemini, Vertex AI, Bedrock, OpenInference-compatible frameworks, and valid generic OTLP traces from other providers.

Before you begin

You need:
  • A ReclaimLLM personal API key from Settings → API Keys
  • The provider API key your application already uses
  • Python 3.9 or later for the examples below
  • A non-sensitive test prompt

Attribute telemetry to another organization

The ReclaimLLM API key determines the user, organization, team, and data region. An org_id, team_id, resource attribute, or span attribute cannot override that identity.
1

Create a dedicated integration identity

Invite a dedicated user to the target organization. Use a separate identity for each application when you need separate attribution.
2

Assign one team

Add the integration user to one team. This keeps team attribution predictable.
3

Create the API key

Sign in as the integration user. Open Settings → API Keys and create a personal API key.
4

Configure the exporter

Set that key as RECLAIMLLM_API_KEY in the application or Collector that exports traces.
Do not reuse a key owned by a user in another organization. Do not add an organization ID to telemetry. ReclaimLLM intentionally derives ownership from the authenticated key.

Configure the exporter

Set the OTLP/HTTP endpoint and ReclaimLLM authentication header:
The endpoint also accepts Authorization: Bearer <reclaimllm-api-key> when your exporter cannot set X-API-Key. The examples use OpenInference instrumentors because they emit provider-neutral LLM attributes that ReclaimLLM normalizes. The endpoint also accepts current and legacy OpenTelemetry GenAI semantic conventions.

OpenAI example

Install the OpenAI client, OpenTelemetry exporter, and OpenInference instrumentor:
Create openai_example.py:
Run the example:

Anthropic Claude example

Install the Anthropic client, OpenTelemetry exporter, and OpenInference instrumentor:
Create anthropic_example.py:
Run the example:

Group calls into sessions

ReclaimLLM groups spans using this precedence:
  1. session.id
  2. gen_ai.conversation.id
  3. OpenTelemetry trace ID
Set a stable session.id on the parent workflow span to merge multiple LLM calls into one ReclaimLLM session. External identifiers are preserved for diagnostics. Internal session IDs are scoped to the authenticated ReclaimLLM user, so two organizations can safely use the same external identifier.

Add searchable session tags

Set reclaimllm.tags on a span or resource to attach your application metadata to the ReclaimLLM session. Use a string array when adding multiple tags; one string is also accepted.
ReclaimLLM trims empty values, removes duplicates, and merges tags from every span and late export in the session. Tags are descriptive only: they cannot change the user, organization, team, or data region selected by the ReclaimLLM API key.

Production Collector configuration

For production workloads, send application traces to a customer-managed OpenTelemetry Collector. Configure an otlphttp exporter with https://api.reclaimllm.com as its endpoint and supply the ReclaimLLM API key through the X-API-Key header from your secret manager. Enable the Collector batch processor, retry-on-failure behavior, and a bounded sending queue. The otlphttp exporter appends /v1/traces to its endpoint. Keep filtering or redaction processors before the ReclaimLLM exporter when content must be removed inside your network.

What ReclaimLLM captures

ReclaimLLM retains fields emitted by your instrumentor, including:
  • System instructions, prompts, responses, and multimodal references
  • Tool definitions, calls, arguments, results, and errors
  • Provider, requested and response models, finish reasons, and status
  • Input, output, cache-read, and cache-creation token usage
  • Trace IDs, span IDs, parent relationships, timestamps, events, links, resource attributes, and instrumentation scope
  • Unknown span attributes in a bounded canonical representation
Full input and output capture can include sensitive data. Use non-sensitive prompts while testing. Configure instrumentor privacy settings or Collector filtering before production if content must not leave your network.
ReclaimLLM can capture only the content your instrumentor emits. If messages or tool bodies are missing, check the instrumentor’s content-capture settings first.

Verify the integration

1

Send one test request

Run an example with a stable session.id and a non-sensitive prompt.
2

Inspect the session

Open the ReclaimLLM dashboard. Confirm the integration user, organization, team, provider, model, prompt, response, token usage, and trace ID.
3

Test idempotency

Export the same span again. The session’s span count, messages, and token totals should not increase.
4

Test session merging

Send a later call with the same session.id. It should merge into the existing session in telemetry timestamp order.

Endpoint behavior

The endpoint accepts application/x-protobuf and OTLP JSON. It supports identity and gzip content encodings. Configure retries for 429 and 503 responses.

Troubleshooting