Hey, thanks for the request. Yep, there’s an official way to do this, no private or undocumented API needed.
- Cursor CLI in headless/print mode:
cursor-agent -p "..." --output-format text|json|stream-json, auth in scripts or CI viaCURSOR_API_KEY. This is exactly what it’s built for, scripts, CI, automation. Docs: Using Headless CLI | Cursor Docs @cursor/sdkTypeScript: control local and cloud agents programmatically. Docs: Cursor TypeScript SDK | Cursor Documentation
On licensing and ToS, a teammate already answered an almost identical request in this thread: API / SDK - Terms of use - Question
Quick summary, quoting their answer: using Cursor as a backend AI service inside your product is a supported and intended use of the Cursor SDK. Main limits:
- you can’t resell Cursor itself as a standalone service, meaning you can’t give third parties access to Cursor or usage under your account
- you can’t use Cursor outputs to train a competing model
- regulated data like HIPAA, PCI, etc needs a separate agreement
Billing is usage based under the plan and limits of the account tied to the API key. There’s no separate engine license SKU. You’re on the Free tier right now, so for production you’ll need a paid plan and an API key. For commercial or enterprise details, it’s best to reach out to sales via [email protected].
Let me know if you want me to expand on any part of this.