Don't expect an OpenAI-style endpoint you post prompts to. Cursor CLI is Cursor's coding agent running in your terminal, and if you already chain steps together with tools like Activepieces, you can think of it as one more step that runs on its own.
You get access through a Cursor account, and scripts can authenticate with an API key.
Cursor CLI is a command-line coding agent from Cursor that you run in your terminal, interactively or from scripts, to read, edit and run code in a project, with usage metered and rate-limited under your Cursor account's plan.

Cursor CLI terminal agent versus model API
What the CLI does and what it doesn't expose
You will not get a clean completion out of the CLI. There's no chat-completions route, no fixed request and response schema, and no promise that the same prompt takes the same path twice.
What it does is read your repository, decide which tools to run, edit files and spend metered usage while it works.
Treat it like a worker you supervise, with timeouts, scoped permissions and output you verify, not like a function you call.
On macOS and Linux, run this in a shell:
Treat it like a worker you supervise, with timeouts, scoped permissions and output you verify, not like a function you call.
curl -fsSL https://x.ai/cli/unified/install.sh | bash
On Windows, use PowerShell:
irm 'https://cursor.com/install?win32=true' | iex
Read the script first on any machine that matters, because piping it into your shell means you're trusting that URL. Afterward, sign in with cursor-agent login, or set an API key in the environment for non-interactive runs.

Because plans, limits and prices change often, confirm anything that affects your budget on Cursor's pricing and docs pages before you build on it.
If you are running this arithmetic for your own team, see what the same workload costs on Activepieces.
Cursor CLI authentication and API keys
Before anything runs, the CLI needs an authenticated Cursor account. Which route you use depends on whether a person or a script is running it: browser login for you at a keyboard, an API key for anything unattended.
- Install the CLI with the command in Cursor's CLI docs for your operating system.
- Decide how it'll run: browser login for interactive use, or a key for headless use.
- For headless use, generate an API key in the Cursor dashboard.
- Give the key to the CLI through the
CURSOR_API_KEYenvironment variable, or pass it with the--api-keyflag. - Run
agent statusto confirm which account the CLI is acting as.
Run agent login. It opens a browser window, you approve the session, and the CLI stores the credential locally. That suits a laptop, but it can't work on a build server with no browser, and the credential belongs to you personally.

Prefer the environment variable over the flag. A key passed with --api-key lands in shell history and process listings, while a variable can come from your CI system's secret store.
Treat the key as a password, and revoke it in the dashboard if it ever appears in a log.
Cursor CLI free tier versus paid plans
Don't expect the key to raise your limits. A script draws on the same allowance as your interactive sessions, so a loop that runs freely on a paid plan can exhaust a free one quickly.
Cursor's pricing page lists what each plan includes and how it bills usage beyond that, and the page changes.
The models and modes available in Cursor CLI
19 models from four providers appear in the CLI. You choose them with a flag or a slash command, so a script should name its model explicitly rather than inherit whatever the picker defaults to.

Per AgentModels, Anthropic supplies 10 of them, which means most of your real choice sits with one vendor. OpenAI, Google and xAI have 3 each, so a fallback to another provider is a short list.
To see how you select each model group and mode, read the table. Cursor doesn't price anything here per mode: you pay for the model underneath.
| Name | How it's selected | Plans that can use it | Pricing unit in the docs |
|---|---|---|---|
| Anthropic models (10) | --model flag, or /model interactively |
Set by your plan; the picker shows what you have | Usage against your plan's pool |
| OpenAI models (3) | Same | Same | Same |
| Google models (3) | Same | Same | Same |
| xAI models (3) | Same | Same | Same |
| Agent | Default mode | All plans | Usage of the chosen model |
| Plan | --mode=plan or /plan |
All plans | Usage of the chosen model |
| Ask | --mode=ask or /ask |
All plans | Usage of the chosen model |
In interactive mode you approve steps as a session runs. Non-interactive mode runs one prompt and exits, via -p (--print). In a scheduled job, that's the only form that finishes without a person present. Use plan or ask there when the job shouldn't edit files.
For --output-format, pick text, json or stream-json. Parse json for a single result, and stream-json when you need progress as it happens. Don't scrape text: its wording can change between releases and break your parser.
Cursor CLI pricing and rate limits
$20, $60 and $200 a month are the paid individual plans. Cursor bills usage past the included amount per token, and I found no published hard rate limit, so treat the ceiling as unknown.
Cursor CLI plan prices and included usage
Each step up costs three to over three times more, so move up only after your own usage shows you outgrowing the tier below.
I haven't tabulated Hobby and Teams/Enterprise prices, or the included-usage amounts for every tier, because they are not in the figures I confirmed. Read them off Cursor's plans page before you budget.
Cursor CLI overage and usage-based billing
To price a scripted run, start with per-token prices. LLMRates lists input tokens from $0.1 to $30 per million across Cursor's models, so you can't estimate your bill without knowing which one you're actually using.
LLMRates lists output tokens from $0.5 to $150 per million. Both ends of the range span 300 times, so the model flag in a script can matter more to the bill than the plan tier.
Expect output to cost five times input at both ends. A job that generates long diffs or explanations spends faster than one that reads a lot and answers briefly. In CI, pin the model explicitly and don't leave it to a default.

The job around the agent has its own meter, and Activepieces meters by credits: a run costs 1 credit however many steps it has, and AI steps cost more (less with your own AI keys).
A ten-step flow that pulls the failed build, calls the CLI, checks the diff and posts the result costs the same as a two-step version, whereas Zapier bills per task and Make per module.
Every plan, including the free one with 1,000 credits a month, allows unlimited flows, so splitting the work into smaller steps doesn't raise the bill.
Published versus unpublished rate limits
I found no hard figure for requests per minute or tokens per minute on any plan.
Write your scripts to expect a refusal or a slowdown at any point, back off and retry, and cap the number of runs in a scheduled job.
Worth checking against a plan that does not meter every step: one credit covers a whole run on Activepieces.
Minimal working Cursor CLI request
Four moves make the smallest working run: install the CLI, authenticate, send one prompt in print mode, and read what comes back.
First non-interactive Cursor CLI run
Install with the script from Cursor's CLI page, which covers macOS and Linux.
Then sign in with agent login, or set CURSOR_API_KEY for scripts, since a browser login does nothing for a headless job.
Run one prompt with cursor-agent -p "explain what this repo's entry point does". The -p flag prints the answer and exits, so it can sit in a pipeline.
Add --output-format json when another program parses the result, because scraping prose breaks the first time the wording changes.
Cursor CLI config files and environment variables
Look under ~/.cursor/ for user-level settings; a project can carry its own .cursor/ directory with rules and permissions. Keep permissions in the project so the same limits apply on your laptop and in CI.
Project rules and AGENTS.md shape behavior, but they don't enforce it, so don't treat them as a security boundary. Keep the API key in the environment, never in a committed file.

cursor-agentopens the interactive session.cursor-agent -p "..."runs one non-interactive prompt.agent loginauthenticates in a browser.agent statusshows who you are signed in as.cursor-agent --model <name>picks a model for that run.
Cursor CLI errors and limits hit in production
When a run fails in production, it is usually one of three groups: rejected credentials, exhausted usage, or runs that never exit. Each needs a different response in a script.
The agent won't tell you which one you hit unless you capture the output and exit code yourself.
Cursor CLI authentication and API key errors
When authentication fails, the CLI couldn't prove who you are, so nothing else in the run is trustworthy. In a script the usual causes are an expired login or an API key that was revoked or pasted with a trailing newline.
Another is an environment variable that exists in your shell but not in the job's.
Fix it by checking where the credential is read from, then re-running the sign-in or reissuing the key from the dashboard. Don't retry these automatically: a bad key stays bad, and a retry loop only adds noise to your logs.
Usage and rate limit errors
When you hit a limit error, the account or plan has run out of allowance, or you're sending requests faster than it permits.
A limit can trip sooner when a heavier model is selected, among other causes, but these are community-reported and not confirmed by Cursor. Treat them as hypotheses to test against your own logs.
Unlike a key error, a limit error can clear on its own, so retry it, but with exponential backoff and a maximum attempt count. The safeguards below cover the rest, and the list is short enough to apply in full:
- Timeout on every run
- Exponential backoff on limit errors
- Spend cap in the dashboard
- Log prompt, model and exit code per run
- Tag community-reported causes
Cursor CLI jobs that hang in CI
When a job hangs, it is usually the agent waiting for something no one is there to give it, such as an approval or a prompt in a non-interactive shell.
Run it in its non-interactive mode, as listed by cursor-agent --help on your version, and wrap every invocation in a hard timeout so a stall fails the pipeline instead of holding a runner.
Cursor CLI in CI and app access
Since nobody is watching it hang, a CI run of the Cursor CLI, a metered unattended job, needs the key stored as a secret, a hard timeout, and a log you can audit afterward.
Cursor CLI CI and scheduled job costs
The task you give the agent, not the pipeline, sets the bill.
Per AI Cost Estimator, test generation costs 0.092 $ per build, the highest of the five. A repo with hundreds of builds a day shouldn't generate tests on every push.
Log triage runs 0.058 $, which is cheap enough to attach to failed builds only. Code review is 0.042 $, so it fits every pull request.
At 0.015 $ for a security summary and 0.012 $ for a PR summary, both are safe defaults to run everywhere. Test generation costs roughly eight times a PR summary, so that's where a runaway loop hurts most.
These are third-party estimates; check them against your own usage in Cursor's dashboard.
- Store the API key as a CI secret, never in the repo or a script.
- Add the Activepieces MCP server (activepieces.com/mcp) to the CLI's MCP config.
- Set a schedule or webhook trigger for the job.
- Run the CLI with a timeout, so a stalled session ends the job instead of burning minutes.
- Collect the log as a build artifact, and tag hangs as community-reported until Cursor's pages confirm them.
Through the CLI's MCP config, the agent can call your apps instead of only editing files. Take the config location and format from Cursor's own docs, because they've changed before.
Each tool you add is an action the agent can take unattended, so connect only what the job needs.
One server entry gives the agent access to all 751 integrations in the open source monorepo, because each integration that runs as a step in a flow is also served as an MCP tool by the project's Activepieces MCP server, and roughly 60% of those integrations are community-contributed.
It can also fire the webhook or schedule that starts the job.
It doesn't replace the CLI: the agent still does the work, and Activepieces supplies the tools and the trigger.
MoneyGram, Moneypenny, Alan and FundingSocieties run it in production, and the core is MIT-licensed, so you can read the code behind any tool the agent is allowed to call.
Frequently asked questions
One line each for the first five answers, then four longer ones. Each covers something the body leaves open, and each is worth confirming against Cursor's own pages before you rely on it.
- Free tier: Cursor has a free plan, but its agent usage is limited, so a CI job can exhaust it quickly.
- Offline use: no, the agent calls Cursor's hosted models, so a job without network access will fail.
- Key variable name:
CURSOR_API_KEY, which headless runs read in place of an interactive login. - Stopping runaway spend: set a spend limit in your account dashboard and put a timeout on every scripted call.
- Where limits changed: Cursor's pricing page and docs, not this article.
Those one-liners are the short version, and the questions below need a little more room.
Is Cursor CLI free to use? Installing it costs nothing, but running the agent draws on your Cursor plan's usage.
The free plan is capped, and the caps and prices change, so read the pricing page before wiring the CLI into anything that runs unattended. A loop that looks harmless can burn through an allowance faster than you expect.
Can I call Cursor CLI like an API from my own app?
You can script it, but it's not a model endpoint. Its non-interactive mode runs a whole agent session that reads files, calls tools and edits code, and you pay for that work.
If you need plain completions, use a model provider's API instead. Treat the CLI as a worker you hand a task to, with a timeout and a reviewed result.
Does Cursor CLI work with my own model API key? Don't assume it does. The key the CLI reads authenticates you to Cursor, not to a model provider.
Whether bringing your own provider key is supported depends on Cursor's current docs, so check there before you design around it.
Is Cursor CLI worth it compared with other terminal coding agents? If your team already pays for Cursor, the CLI shares that account and is cheap to try.
If not, run the same task on your own repository with each agent and compare the diffs, the failures and the bill. Demos prove little, and your codebase is the only fair test.
Related reading
References
Running the numbers
See what the same workload costs here.
Free forever plan, and every paid plan self-hosts at no extra cost.
See pricing Talk to sales


