• Tech Dev NotesTech Dev Notes
Apps
  • App lookup
  • App compare
Market movement
  • App charts
  • App rankings
Visual proof
  • App screens
  • App listing screenshots
  • App icons
Build intelligence
  • App tech stacks
  • Tool releases
  • Developers
More
  • X feature flags
  • Grokipedia
  • Blog
  • Follow on X
Skip to content
All content/ filesChangelog

cursor-docs/latest/content · Jun 26, 20:20 UTC

pages/api.txt

TXT·8.6 KB·199 lines

content/

  • pages

    • api.txt
    • approval-agents.txt
    • bugbot.txt
    • cloud-agent.txt
    • customize-cursor.txt
    • enterprise.txt
    • evals.txt
    • extension-api.txt
    • hooks.txt
    • mcp.txt
    • models-and-pricing.txt
    • plugins.txt
    • rules.txt
  • pages/account

    • regions.txt
    • update-access.txt
  • pages/account/enterprise

    • billing-groups.txt
    • cyber-safeguards.txt
    • service-accounts.txt
  • pages/account/organizations

    • organization-admin-api.txt
  • pages/account/pricing

    • request-based-legacy.txt
  • pages/account/teams

    • admin-api.txt
    • ai-code-tracking-api.txt
    • analytics-api.txt
    • analytics.txt
    • dashboard.txt
    • members.txt
    • pricing.txt
    • scim.txt
    • setup.txt
    • sso.txt
  • pages/agent

    • agent-review.txt
    • agents-window.txt
    • debug-mode.txt
    • design-mode.txt
    • overview.txt
    • plan-mode.txt
    • prompting.txt
    • security.txt
  • pages/agent/security

    • run-modes.txt
  • pages/agent/tools

    • browser.txt
    • canvas.txt
    • search.txt
    • terminal.txt
  • pages/cli

    • acp.txt
    • changelog.txt
    • github-actions.txt
    • headless.txt
    • installation.txt
    • mcp.txt
    • overview.txt
    • shell-mode.txt
    • using.txt
  • pages/cli/reference

    • authentication.txt
    • configuration.txt
    • output-format.txt
    • parameters.txt
    • permissions.txt
    • slash-commands.txt
    • terminal-setup.txt
  • pages/cloud-agent

    • automations.txt
    • best-practices.txt
    • capabilities.txt
    • choose-runtime.txt
    • my-machines.txt
    • private-workers.txt
    • security-network.txt
    • self-hosted-cloud-run.txt
    • self-hosted-k8s.txt
    • self-hosted-pool.txt
    • settings.txt
    • setup.txt
  • pages/cloud-agent/api

    • endpoints.txt
    • webhooks.txt
  • pages/configuration

    • worktrees.txt
  • pages/configuration/migrations

    • vscode.txt
  • pages/cursor-review

    • merge-queue.txt
    • overview.txt
    • pr-inbox.txt
    • pr-page.txt
  • pages/cursor-review/cli

    • authentication.txt
    • parameters.txt
    • stacking.txt
  • pages/customizing

    • aws-bedrock.txt
  • pages/enterprise

    • baa.txt
    • compliance-and-monitoring.txt
    • deployment-patterns.txt
    • endpoint-security.txt
    • identity-and-access-management.txt
    • llm-safety-and-controls.txt
    • model-and-integration-management.txt
    • network-configuration.txt
    • organization-groups.txt
    • organizations.txt
    • pooled-usage.txt
    • privacy-and-data-governance.txt
    • private-connectivity.txt
    • security-hardening.txt
  • pages/get-started

    • quickstart.txt
  • pages/integrations

    • azure-devops.txt
    • bitbucket.txt
    • cursor-blame.txt
    • github.txt
    • gitlab.txt
    • jetbrains.txt
    • jira.txt
    • linear.txt
    • microsoft-teams.txt
    • notion.txt
    • slack.txt
    • xcode.txt
  • pages/mcp

    • install-links.txt
  • pages/models

    • claude-4-5-haiku.txt
    • claude-4-5-sonnet.txt
    • claude-4-6-sonnet.txt
    • claude-4-sonnet-1m.txt
    • claude-4-sonnet.txt
    • claude-fable-5.txt
    • claude-opus-4-5.txt
    • claude-opus-4-6-fast.txt
    • claude-opus-4-6.txt
    • claude-opus-4-7-fast.txt
    • claude-opus-4-7.txt
    • claude-opus-4-8.txt
    • cursor-composer-1-5.txt
    • cursor-composer-1.txt
    • cursor-composer-2-5.txt
    • cursor-composer-2.txt
    • gemini-2-5-flash.txt
    • gemini-3-1-pro.txt
    • gemini-3-5-flash.txt
    • gemini-3-flash.txt
    • gemini-3-pro-image-preview.txt
    • gemini-3-pro.txt
    • glm-5-2.txt
    • gpt-5-1-codex-max.txt
    • gpt-5-1-codex-mini.txt
    • gpt-5-1-codex.txt
    • gpt-5-2-codex.txt
    • gpt-5-2.txt
    • gpt-5-3-codex.txt
    • gpt-5-4-mini.txt
    • gpt-5-4-nano.txt
    • gpt-5-4.txt
    • gpt-5-5.txt
    • gpt-5-codex.txt
    • gpt-5-fast.txt
    • gpt-5-mini.txt
    • gpt-5.txt
    • grok-4-20.txt
    • grok-4-3.txt
    • grok-build-0-1.txt
    • kimi-k2-5.txt
  • pages/reference

    • deeplinks.txt
    • ignore-file.txt
    • keyboard-shortcuts.txt
    • permissions.txt
    • plugins.txt
    • sandbox.txt
    • third-party-hooks.txt
  • pages/sdk

    • python.txt
route: /docs/api
title: Cursor APIs Overview
description: Learn about authentication, rate limiting, and best practices for Cursor's APIs.

Cursor APIs Overview
Cursor provides multiple APIs for programmatic access to your team's data, AI-powered coding agents, and analytics.
Available APIs
API
Description
Availability
Admin API
Manage team members, settings, usage data, and spending. Build custom dashboards and monitoring tools.
Enterprise teams
Analytics API
Comprehensive insights into team's Cursor usage, AI metrics, active users, and model usage.
Enterprise teams
AI Code Tracking API
Track AI-generated code contributions at commit and change levels for attribution and analytics.
Enterprise teams
Cloud Agents API
Programmatically create and manage AI-powered coding agents for automated workflows and code generation.
Beta (All Plans)
TypeScript SDK
Run Cursor agents from TypeScript with one interface for local and cloud runtimes.
All users
Python SDK
Run Cursor agents from Python with sync and async clients for local and cloud runtimes.
All users
Authentication
All Cursor APIs accept Basic Authentication. The Cloud Agents API additionally accepts Bearer tokens — pick whichever is easier for your HTTP client.
Basic Authentication
Use your API key as the username in basic authentication (leave password empty):
curl https://api.cursor.com/teams/members \
-u YOUR_API_KEY:
Or set the Authorization header directly:
Authorization: Basic {base64_encode('YOUR_API_KEY:')}
Bearer Authentication (Cloud Agents API)
The Cloud Agents API also accepts Authorization: Bearer <key> headers. Both schemes behave identically — use whichever your HTTP client makes easier:
curl https://api.cursor.com/v1/me \
-H "Authorization: Bearer YOUR_API_KEY"
Creating API Keys
Team administrators can create and manage API keys from the API Keys page in the dashboard.
Admin API & AI Code Tracking API
Navigate to cursor.com/dashboard → API Keys
Click New API Key
Give your key a descriptive name (e.g., "Usage Dashboard Integration")
Copy the generated key immediately. You won't see it again
Key format: crsr_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Required scope: admin:*
Analytics API
Generate an API key from Cursor Dashboard → API Keys.
Cloud Agents API
Create a user API key from Cursor Dashboard → API Keys, or use a service account API key from team settings.
API keys are tied to your organization and viewable by all admins. Keys are unaffected by the original creator's account status.
Rate Limits
All APIs implement rate limiting to ensure fair usage and system stability. Rate limits are enforced per team and reset every minute.
Rate Limits by API
API
Endpoint Type
Rate Limit
Admin API
Most endpoints
20 requests/minute
Admin API
/teams/user-spend-limit
250 requests/minute
Analytics API
Most team-level endpoints
100 requests/minute
Analytics API
/analytics/team/conversation-insights
20 requests/minute
Analytics API
By-user endpoints
50 requests/minute
AI Code Tracking API
All endpoints
20 requests/minute per endpoint
Cloud Agents API
All endpoints
Standard rate limiting
Rate Limit Response
When you exceed the rate limit, you'll receive a 429 Too Many Requests response:
{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Please try again later."
}
Caching
Several APIs support HTTP caching with ETags to reduce bandwidth usage and improve performance.
Supported APIs
Analytics API: All endpoints (both team-level and by-user) support HTTP caching
AI Code Tracking API: Endpoints support HTTP caching
How Caching Works
Initial Request: Make a request to any supported endpoint
Response Includes ETag: The API returns an ETag header in the response
Subsequent Requests: Include the ETag value in an If-None-Match header
304 Not Modified: If data hasn't changed, you'll receive a 304 Not Modified response with no body
Example
# Initial request
curl -X GET "https://api.cursor.com/analytics/team/dau" \
-H "Authorization: Bearer YOUR_API_KEY" \
-D headers.txt
# Response includes: ETag: "abc123xyz"
# Subsequent request with ETag
curl -X GET "https://api.cursor.com/analytics/team/dau" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "If-None-Match: \"abc123xyz\""
# Returns 304 Not Modified if data hasn't changed
Cache Duration
Cache duration: 15 minutes (Cache-Control: public, max-age=900)
Responses include an ETag header
Include If-None-Match header in subsequent requests to receive 304 Not Modified when data hasn't changed
Benefits
Reduces bandwidth usage: 304 responses contain no body
Faster responses: Avoids processing unchanged data
Rate limit friendly: 304 responses don't count against rate limits
Better performance: Especially useful for frequently polled endpoints
Best Practices
1. Implement Exponential Backoff
When you receive a 429 response, wait before retrying with increasing delays:
import time
import requests
def make_request_with_backoff(url, headers, max_retries=5):
for attempt in range(max_retries):
response = requests.get(url, headers=headers)
if response.status_code == 429:
# Exponential backoff: 1s, 2s, 4s, 8s, 16s
wait_time = 2 ** attempt
print(f"Rate limited. Waiting {wait_time}s before retry...")
time.sleep(wait_time)
continue
return response
raise Exception("Max retries exceeded")
2. Distribute Requests Over Time
Spread your API calls over time rather than making burst requests:
Schedule batch jobs to run at different intervals
Add delays between requests when processing large datasets
Use queuing systems to smooth out traffic spikes
3. Leverage Caching
For Analytics API and AI Code Tracking API:
These APIs support HTTP caching with ETags. See the Caching section above for details on how to use ETags to reduce bandwidth usage and avoid unnecessary requests.
Key benefits:
Reduces bandwidth usage
Faster responses when data hasn't changed
Doesn't count against rate limits (for 304 responses)
Use date shortcuts (7d, 30d) instead of timestamps for better caching support in Analytics API.
4. Monitor Your Usage
Track your request patterns to stay within limits:
Log API call timestamps and response codes
Set up alerts for 429 responses
Monitor daily/weekly usage trends
Adjust polling intervals based on actual needs
5. Batch Wisely
For endpoints with pagination:
Use appropriate page sizes to get more data per request
For Analytics API by-user endpoints: Use users parameter to filter specific users
For large data extractions: Use CSV endpoints when available (they stream data efficiently)
6. Poll at Appropriate Intervals
Don't over-poll endpoints that update infrequently:
Admin API /teams/daily-usage-data: Poll at most once per hour (data aggregated hourly)
Admin API /teams/filtered-usage-events: Poll at most once per hour (data aggregated hourly)
Admin API /organizations/pooled-usage: Poll at most once per hour (data aggregated hourly)
Admin API /organizations/filtered-usage-events: Poll at most once per hour (data aggregated hourly)
Analytics API: Use date shortcuts (7d, 30d) for better caching support
AI Code Tracking API: Data is ingested in near real-time but polling every few minutes is sufficient
7. Handle Errors Gracefully
Implement proper error handling for all API calls:
async function fetchAnalytics(endpoint) {
try {
const response = await fetch(`https://api.cursor.com${endpoint}`, {
headers: {
'Authorization': `Basic ${btoa(API_KEY + ':')}`
}
});
if (response.status === 429) {
// Rate limited - implement backoff
throw new Error('Rate limit exceeded');
}
if (response.status === 401) {
// Invalid API key
throw new Error('Authentication failed');
}
if (response.status === 403) {
// Insufficient permissions
throw new Error('Enterprise access required');
}
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
return await response.json();
} catch (error) {
console.error('API request failed:', error);
throw error;
}
Common Error Responses
All APIs use standard HTTP status codes:
400 Bad Request
Request parameters are invalid or mis
…
Previouspages/agent/tools/terminal.txtNextpages/approval-agents.txt

© 2026 Tech Dev Notes

RSSAboutAPIPrivacyTermsSitemap@techdevnotes