> For the complete documentation index, see [llms.txt](https://docs.revenium.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.revenium.io/instrument-your-agents/setup-claude-code-desktop.md).

# Setup — Claude Code desktop app (OTel telemetry to Revenium)

Set the values below once and your Claude Code desktop app usage is metered in Revenium alongside your CLI usage.

## Configure the desktop app

These settings are not under the app's settings screen, which is where most people look first. They belong to the environment the session runs in:

1. In the Claude desktop app, open the **Code** tab and start a **New session**.
2. Click the environment selector — it shows **Local** — and open its settings using the gear icon beside **Local**.
3. Add the Revenium OTLP settings below there.
4. Fully quit and relaunch the app.

Anthropic's own [desktop app quickstart](https://code.claude.com/docs/en/desktop-quickstart) covers the Code tab and choosing an environment if you are new to the app.

## Settings to add

Use a **Revenium metering key (`rev_mk_*`)**, not an Anthropic/OpenAI provider key — the Revenium key authenticates telemetry ingest.

```ini
CLAUDE_CODE_ENABLE_TELEMETRY=1
OTEL_EXPORTER_OTLP_ENDPOINT=https://api.revenium.ai/meter/v2/otlp
OTEL_EXPORTER_OTLP_HEADERS=x-api-key=rev_mk_your_tenant_yourkey
OTEL_EXPORTER_OTLP_PROTOCOL=http/json
OTEL_LOGS_EXPORTER=otlp
OTEL_METRICS_EXPORTER=none
OTEL_LOGS_EXPORT_INTERVAL=5000
```

Field meanings are identical to the CLI managed-settings page (endpoint = Revenium OTLP; header = your metering key; protocol `http/json`; logs exporter `otlp` is how Revenium receives per-call telemetry; metrics `none` because Revenium bills from log events only; logs export interval 5000 ms, a 5-second flush).

*Optional:* `OTEL_RESOURCE_ATTRIBUTES` for your own internal sub-segmentation. Desktop sessions are already distinguishable in Revenium by `service.name=claude-code-desktop` (set automatically), so no source tag is required for correct attribution.

## Verify your configuration

Run a short Claude Code desktop session; usage should appear in Revenium after the next telemetry flush. If nothing appears, check: the metering key is active, the OTLP endpoint matches your Revenium environment, and the app was fully quit and relaunched after the change.

## Why this is needed

Optional background — you do not need this to complete the steps above.

Claude Code CLI installs pick up your organization's Revenium telemetry configuration from your team's managed settings, so the CLI is metered as soon as you sign in. The desktop app reads its configuration from the environment a session runs in rather than from those managed settings, so the same values are entered there once, by hand. After that, desktop sessions are ingested and attributed in Revenium the same way CLI sessions are.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.revenium.io/instrument-your-agents/setup-claude-code-desktop.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
