For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

You will connect the assistant first — that 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.

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. Get your metering key

In Revenium, open Connections → SDK Setup and copy your metering key (it begins with rev_mk_). This key authenticates telemetry from your coding assistant into your Revenium account. Keep it handy for the next step.

2. Connect your coding assistant

Revenium connects Claude Code, Codex, Gemini CLI, GitHub Copilot, and Cursor. In Connections, each assistant has a ready-to-paste setup prompt — select your tool, copy the prompt, and paste it into that assistant. The prompt already contains your key and the exact commands, so this is the quickest path. Repeat for each assistant you want to track.

Four of the five are set up from the command line, using one package:

Each assistant then has its own setup command:

Assistant
Setup command

Claude Code

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 Claude Code, or exec $SHELL for Codex). Then confirm it worked:

Cursor and GitHub Copilot are different — they need no CLI install. Both are synced by Revenium directly: in the dashboard open Connections → Providers, click Link Provider, and select the provider.

  • Cursor — enter your Cursor team API key (a personal user key will not work). Revenium then syncs Cursor usage every 5 minutes.

  • 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.

Rolling out to a whole team? Coding assistants that support centrally-managed configuration can be set up once by an administrator and delivered to every developer automatically, with no per-developer install. See your assistant's centrally-managed configuration documentation for that; the per-user command above is for fast individual onboarding and for importing historical usage.

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

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 Connections → Integrations, where GitHub, GitLab, and Slack are connected.

  2. On the GitHub card, choose Connect and enter your GitHub organization.

  3. Provide a read-only token. 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.

  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 — give it a few minutes before you expect to see pull request data.

Revenium splits AI-assisted from human-authored work using the Co-Authored-By trailers at the bottom of commits. The default pattern is noreply@anthropic.com, which covers Claude Code. If your team uses other AI assistants that sign commits, add their signatures — one pattern per line — on the same card; work without a matching trailer simply counts as human-authored.

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.

Pick the right host for your key. Keys minted in production target https://api.revenium.ai. Keys minted in a dev/staging tenant target that environment's API host — the SDKs read this from REVENIUM_METERING_BASE_URL (overrideable per environment). If the curl above returns 403 Forbidden, your key is for a different environment than the host it was sent to.

Set environment variables

Wrap your client

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

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?