> 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/track-and-control-costs/analyze-ai-tooling-spend/setup-cursor.md).

# Setup Cursor

Revenium tracks Cursor IDE usage by syncing data from the Cursor Admin API. The recommended setup is through the Revenium dashboard, where the backend handles syncing automatically. A CLI is also available for backfilling historical data and debugging.

## Requirements

* Cursor IDE with an active subscription (Pro, Business, or Enterprise)
* Cursor **team** API key (from your Cursor team settings — this is different from a personal user key)
* Revenium account with access to the Providers page

## 1. Add Cursor as a provider

1. In the Revenium dashboard, go to **Connections > Providers**.
2. Select **Cursor** from the list of available providers.
3. Enter your **Cursor team API key**. This key is issued from your Cursor team settings and grants access to the team usage API.
4. Save the configuration.

Once saved, Revenium syncs Cursor usage data automatically every 5 minutes. No CLI installation or local configuration is required.

{% hint style="info" %}
**Team API key required.** Cursor has both personal user keys and team keys. Revenium uses the `/teams/filtered-usage-events` endpoint, which requires a **team** API key. A personal key will not work.
{% endhint %}

## 2. Verify data is flowing

After saving, allow up to 10 minutes for the first sync cycle to complete. Then check **AI Assistants > Cursor** in the dashboard to confirm usage data is appearing.

## CLI (optional)

The Revenium CLI provides additional tools for backfilling historical data and diagnosing connectivity issues. It is not required for standard operation.

### Install

Requires Node.js >= 20.19.0. Check with `node --version`.

```bash
npm install -g @revenium/cli
```

### CLI setup

Run the setup wizard to configure local credentials before using any CLI command:

```bash
revenium-cursor setup
```

The wizard prompts for your Cursor team API key, Revenium API key, subscription tier, and optional attribution fields. Configuration is saved to `~/.cursor/revenium/revenium.env`.

### Backfill historical data

To import Cursor usage data from before you enabled the integration:

```bash
revenium-cursor backfill --since 2025-01-01 --to 2025-06-01

# Preview without sending:
revenium-cursor backfill --since 2025-01-01 --to 2025-06-01 --dry-run

# Control batch size and delay between batches:
revenium-cursor backfill --since 2025-01-01 --batch-size 50 --delay 1000
```

### Diagnose connectivity

```bash
revenium-cursor status
```

Checks that both the Cursor API and Revenium endpoint are reachable with the provided credentials, and prints the current sync state.

### Send a test metric

```bash
revenium-cursor test --verbose
```

Sends a zero-cost synthetic event to verify the pipeline. Check **AI Assistants > Cursor > Integration Logs** to confirm receipt.

### Command reference

| Command                                               | Description                                  |
| ----------------------------------------------------- | -------------------------------------------- |
| `revenium-cursor setup`                               | Interactive setup wizard for CLI credentials |
| `revenium-cursor status`                              | Verify connectivity to Cursor and Revenium   |
| `revenium-cursor test --verbose`                      | Send a synthetic test event                  |
| `revenium-cursor backfill --since <date> --to <date>` | Import historical data                       |
| `revenium-cursor backfill --dry-run`                  | Preview backfill output without sending      |
| `revenium-cursor reset`                               | Remove CLI configuration and start fresh     |

## Troubleshooting

### No data appears after adding the provider

The backend syncs every 5 minutes. Allow up to 10 minutes for the first data to appear. If nothing shows after that:

1. Confirm you used a **team** API key, not a personal user key.
2. Verify the key in **Connections > Providers > Cursor** is correct and has not been regenerated.
3. Confirm your Cursor subscription (Pro, Business, or Enterprise) is active.

### Cursor API key rejected

* The key must be a **Cursor team API key** from your Cursor team settings.
* Personal user API keys do not have access to the team usage endpoint.
* Regenerate the key in Cursor if in doubt and update it in **Connections > Providers**.

### Revenium API key issues (CLI only)

* Cursor telemetry authenticates with a **Revenium** API key (`hak_` or `rev_` prefix), not a Cursor key.
* Get one from **Connections > SDK Setup** in the Revenium dashboard.
* Run `revenium-cursor setup` to update credentials.


---

# 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/track-and-control-costs/analyze-ai-tooling-spend/setup-cursor.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.
