Docs›Cursor Integration
Cursor Integration
Route Cursor AI traffic through Grepture for observability, cost tracking, and PII protection. Set up in under 2 minutes.
Overview
Cursor is an AI-powered code editor. By routing Cursor through Grepture, you get:
- Observability — log every request and response in your Grepture dashboard
- Cost tracking — see per-request token usage and spend across your team
- PII redaction — detect and redact sensitive data before it reaches OpenAI
Setup takes under 2 minutes. Just paste one URL in Cursor settings.
Prerequisites
- A Grepture account (sign up here)
- Your Grepture API key (find it in the dashboard under API)
- An OpenAI API key configured in Cursor
Configuration
In Cursor → Settings → Models → Override OpenAI Base URL, paste:
https://proxy.grepture.com/cursor/grp_your-key-here/v1
Replace grp_your-key-here with your actual Grepture API key.
No other changes needed. Cursor sends your OpenAI API key via the Authorization: Bearer header automatically — Grepture forwards it to OpenAI on your behalf.
How it works
When Cursor makes a request:
- The request is sent to
https://proxy.grepture.com/cursor/<greptureKey>/v1/chat/completions - Grepture extracts your Grepture API key from the URL path and authenticates you
- Your detection rules are applied (PII redaction, secret scanning, etc.)
- The request is forwarded to
https://api.openai.com/v1/chat/completionswith your OpenAI key - The response flows back through Grepture, where it is logged and any redacted tokens are restored
The /cursor/<greptureKey> prefix is stripped before forwarding, so OpenAI receives a standard request.
Verify it works
After configuring, use Cursor normally. Then open your Grepture dashboard. You should see Cursor requests appearing in the traffic log with:
- Model name (e.g.
gpt-4o) - Token counts (input + output)
- Cost per request
- Full request/response bodies (if logging is enabled)
Team setup
For teams, share the base URL with your Grepture team API key. Each developer configures it in their own Cursor settings. This gives you a single dashboard view of all Cursor usage across your organization.
Detection rules
All Grepture detection rules apply to Cursor traffic, including:
- PII detection — emails, phone numbers, SSNs, credit cards, and 50+ patterns
- Secret scanning — API keys, tokens, connection strings
- Custom regex rules — your own patterns (Pro plan)
- AI-powered NER — names, organizations, addresses (Pro plan)
Configure rules in the Grepture dashboard under Rules.
Troubleshooting
Cursor returns an authentication error
Verify your OpenAI API key is valid by testing directly:
curl https://api.openai.com/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4o","max_tokens":10,"messages":[{"role":"user","content":"Hi"}]}'
Requests don't appear in the dashboard
Check that your Grepture API key in the URL is correct. The URL must follow the exact format: https://proxy.grepture.com/cursor/grp_your-key-here/v1.
Latency increase
The proxy adds minimal latency (typically under 10ms). Grepture is EU-hosted — if your team is outside Europe, contact us about regional deployment options.