For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Connect Your Coding Assistant & Code Repository

Connect an AI coding assistant and your code repository, GitHub or GitLab, to see how your team uses AI coding tools and what those tools deliver. In under 10 minutes you have the assistant connected and your usage dashboards live: per-tool and per-developer usage and cost against API-equivalent value. Per-developer productivity metrics that pair AI spend with the pull requests your developers ship appear once your code host is connected and its first sync completes.

The recommended path is managed settings: Revenium generates the configuration, an administrator pastes it once, and it reaches every developer with nothing to install on their machines. You connect the assistant first, which alone populates the usage dashboards, then connect your code repository to add the per-developer productivity view.


Before you begin

You need a Revenium account. To roll out Claude Code for your whole organization you also need admin access to your Claude Team or Enterprise plan.

Sign in or Register


How it works

  1. You connect a coding assistant, which sends usage telemetry to Revenium.

  2. Revenium groups that usage by tool, team, and developer, and estimates its API-equivalent value.

  3. You connect GitHub or GitLab, which adds shipped pull requests as an output signal.

  4. Revenium cross-references spend against delivery and shows per-developer productivity metrics.


1. Open the assistant setup

In Revenium, select Quick Start in the sidebar. On the AI assistant card, select Set up (or Add another), then choose your assistant. The same setup is under Integrations → AI Assistants.

For Claude Code, Claude Cowork, Codex and Gemini, Revenium may ask how you pay for the assistant: Pay-as-you-go (billed per token or request) or Flat subscription or per-seat plan. If it asks, choose one and select Continue. Your answer sets how its usage is counted in your cost reports, and you can change it later. If your team has already answered, the setup opens directly.

2. Roll out with managed settings

For Claude Code, the setup opens on My whole org, which is the managed settings path.

  1. Select Copy JSON. The JSON is generated for your account and includes your Revenium metering key. If you have not created a metering key yet, the JSON shows a placeholder: create a key under Integrations → SDK Setup first.

  2. In the claude.ai admin console, open Claude Code > Managed settings and paste the JSON. The admin console is reachable from the Claude desktop app or a browser, and you need Team or Enterprise admin access.

  3. Save. Every developer in your Claude organization receives the settings the next time Claude Code starts. No per-developer install is needed.

Because the settings name a telemetry endpoint, Claude Code in the terminal asks each developer to approve them in a security dialog, so let your team know before you save. While you wait, the setup shows Waiting for your first event, then how many developers are reporting. For the full configuration, requirements and troubleshooting, see Setup Claude Code.

Claude Cowork, Cursor and GitHub Copilot also connect once for the whole organization. Codex and Gemini CLI are set up per developer; see Other ways to connect. For Cursor or GitHub Copilot, open Integrations → Providers, click + Link Provider, and select the tool.

  • Claude Cowork: enable OTLP telemetry once in the Claude for Work admin console. See Setup Claude Cowork.

  • Cursor: enter your Cursor Admin API key (team admin, with admin scope; a personal user key will not work). Revenium then syncs Cursor usage every 5 minutes. See Setup Cursor.

  • GitHub Copilot: enter a GitHub token plus your organization slug. Use a fine-grained token with the organization permissions Organization Copilot metrics and Administration (both read-only), or a classic token with admin:org and manage_billing:copilot. Revenium then refreshes Copilot usage once daily. Copilot Business or Enterprise must be active on your organization and the Copilot usage metrics policy enabled in your GitHub org settings. See Setup GitHub Copilot.

Run a short session in your assistant. Usage appears in Revenium after the next telemetry flush.

Other ways to connect

Managed settings is the recommended path for a team. Two alternatives suit other situations:

  • My repo (Claude Code): commit the generated settings as .claude/settings.json at your repo root, and they apply to everyone who clones the repo. This puts your metering key in version control. For stricter environments, use Claude Code's otelHeadersHelper setting, which supplies the auth header at runtime so no secret is committed.

  • Just me (Claude Code), and Codex and Gemini CLI, which are set up per developer: select Copy prompt in the setup and paste it into a new conversation in that assistant, which runs the setup for you. The prompt includes your metering key, so share it only with the people who set up the assistant.

To set up a single developer from the command line instead, install the Revenium CLI:

Each assistant then has its own setup command. Your metering key (it begins with rev_mk_) is under Integrations → SDK Setup.

Assistant
Setup command

Claude Code (single-user instructions)

revenium-metering setup --api-key <your-key>

Codex

revenium-codex setup --api-key <your-key>

Gemini CLI

revenium-gemini setup --api-key <your-key>

After setup, reload your environment so the assistant picks up the new configuration. The setup output tells you how (for example source ~/.claude/revenium.env for single-user Claude Code tracking, or exec $SHELL for Codex). Then confirm it worked:

If status or test fails with fetch failed on a company network, see Corporate networks: proxy or TLS inspection. The command line is also the way to import historical usage.

3. Connect your code repository for per-developer attribution

Your code host adds output data (merged pull requests, or merged requests on GitLab) so you can measure delivery next to spend. Revenium connects to GitHub and GitLab; the walkthrough below uses GitHub, and the GitLab flow is the same shape.

  1. In Revenium, open Integrations → Integrations, where GitHub, GitLab, and Slack are connected.

  2. On the GitHub card, choose Connect and enter your GitHub organization's short name: the part of its GitHub URL after github.com/, not its display name. Pasting the full org URL or an @handle also works; Revenium converts it and shows you the short name it will use.

  3. Provide a read-only token. Once the organization is filled in, Revenium gives you a Create a pre-filled token on GitHub button that pre-selects exactly the permissions needed: Pull requests and Metadata (read-only) under Repository permissions, plus Members (read-only) under Organization permissions. If you only have a classic token, repo (or public_repo for public-only orgs) plus read:org also works, though it grants more than Revenium needs. On GitHub, confirm the Resource owner picker shows your organization. If you see an Account tab instead of Organizations, the token belongs to your personal account; switch Resource owner to your organization and re-check the permissions, since switching resets them.

  4. Choose the repositories to track, or connect the whole organization; pull requests are counted across every repo in the org.

  5. Save the connection.

For GitLab, connect a personal access token with the read_api and read_user scopes; Revenium then counts merged merge requests per user across your group.

A fine-grained GitHub token may need org approval. When the token targets an organization, an org owner or admin has to approve it before it can read org data. Until then the connection can show as Connected while pull request and member data stays empty. Check Settings → Third-party Access → Personal access tokens → Pending requests in your GitHub org if nothing appears after a sync.

For per-developer attribution to line up, the email addresses on your developers' commits should match the email addresses Revenium has for those developers. Org members are auto-mapped by email, and you can edit the mapping for anyone who does not match automatically.

The first sync is not instant, so give it a few minutes before you expect to see pull request data.

Revenium splits merged pull requests into AI-assisted and human-authored using Co-Authored-By trailers on commits. It also checks matching markers in pull request descriptions and commit author email. The default pattern is noreply@anthropic.com. Add signatures for other assistants on the GitHub card, one pattern per line. A pull request without a matching signal counts as human-authored, even if AI helped. This split counts attributed pull requests, not lines of code: GitHub does not expose line-level AI authorship here. For consistent attribution, use each assistant's company-wide managed settings to add its trailer to every AI-assisted commit.

4. See your dashboards and productivity metrics

Open Intelligence → AI Assistants in the sidebar.

  • The Overview shows every connected tool side by side: active users and total cost per tool for the period you select, plus aggregate adoption, sessions per user, usage trend, and API-equivalent value.

  • Each tool has its own per-tool dashboard with a per-user breakdown: who is using it, how many sessions they run, how many tokens they consume, and what that costs.

  • On the Claude Code tab, once your code host is connected, the Value by User table gains three productivity columns:

    Column
    What it shows

    PRs Merged

    Pull requests the developer merged in the period

    PRs with Claude

    Pull requests where a commit was AI co-authored

    Cost/PR

    AI spend divided by pull requests merged

    Connect GitLab instead and the same columns count merged merge requests, labelled MRs and Cost/MR.

  • The By Employee tab rolls every connected assistant and direct API spend up to the individual, the view for chargebacks and for spotting concentrated spend. Start with the Attribution Coverage figure, which tells you how much of your identifiable AI spend is tied to a known person.

That is the full picture: usage, cost, and per-developer delivery, all in one place.

Where to go next

  • Analyze AI tooling spend: go deeper on who is using which assistant, how intensively, and whether the seats you bought are earning their cost.

  • Set budgets and alerts: put caps on that spend and get told in Slack when a team or tool spikes.


Instrument your own code or API traffic

The steps above connect off-the-shelf coding assistants. If instead you want to meter an application you build (your own AI calls or API traffic), Revenium acts as zero-latency middleware: install the SDK, set your keys, and wrap your client.

Install the SDK

transactionId is your correlation key. Generate a UUID in your application before the AI call and send it to Revenium. Re-use it on retries: Revenium dedupes by transactionId so retries won't double-count. Send only one of transactionId or spanId per request.

Set environment variables

Pick the right host for your key. Keys minted in production target https://api.revenium.ai. Keys minted in a dev or staging tenant target that environment's API host. The SDKs read the host from REVENIUM_METERING_BASE_URL, which you can set per environment; a direct API call uses the host in its URL. If a request returns 403 Forbidden, your key is for a different environment than the host it was sent to.

Wrap your client

Requires ESM: set "type": "module" in package.json, or wrap the call in an async function.

actual-api-key-value is a placeholder for the subscriber's credential. Revenium stores credential.value to match usage to a credential and masks it to its last four characters when read back. To avoid sending a live key, send a stable key ID or a hash of the key instead, as Manage Customers & Credentials explains.

traceId is the field you plan around. transactionId is auto-generated by the SDK (from the OpenAI response id) or by Revenium (if you omit it on a direct API call). What you control is traceId: use it to group multiple AI calls that belong to one user request, conversation, or workflow. Plan your traceId scheme (session, conversation, or job ID) before instrumenting, so related calls group consistently from the start.

For deeper attribution, budgets, and monetization, continue with Attribute Your Usage, Set Budgets & Alerts, and Monetize Your Apps.

Last updated

Was this helpful?