Background Agents API

The Background Agents API allows you to programmatically create and manage AI-powered coding agents that work autonomously on your repositories. You can use the API to automatically respond to user feedback, fix bugs, update docs, and much more!
Background Agents API is currently in beta, we’d love your feedback on it!

Key features

  • Autonomous code generation - Create agents that can understand your prompt and make changes to your codebase
  • Repository integration - Work directly with GitHub repositories
  • Follow-up prompts - Add additional instructions to running agents
  • Usage-based pricing - Pay only for the tokens you use
  • Scalable - Support for up to 256 active agents per API key

Quick start

1. Get your API key

Navigate to Cursor Dashboard → Integrations to create your API key.

2. Start using the API

All API endpoints are relative to:
https://api.cursor.com
See the API reference for a detailed list of endpoints.

Authentication

All API requests require authentication using a Bearer token:
Authorization: Bearer YOUR_API_KEY
API keys are created in the Cursor Dashboard. Keys are scoped to your account and grant permission to create and manage agents (subject to your plan limits and repository access).

Pricing

The API is currently in beta with the same pricing as Background Agents. Pricing may change as we scale the service. See Background Agent pricing.

Next steps