API keys and scopes
Create keys with only the access they need, pin them to a user, and cap what they spend.
A platform API key lets your server act for your account. Create keys in the developer console under API keys. Each key has a name, the scopes it may use, and optionally a monthly spend cap, an expiry and a user it's pinned to. Creating one accepts the Developer Terms and the Acceptable Use Policy.
The console's Quickstart gives a coding agent a key without showing it the key: its prompt carries a one-time setup code (30 minutes), and the agent's one command trades it for a key that goes from the response straight into the project's .env:
curl -fsS -X POST https://api.noclick.com/v1/setup -d code=nc_setup_... >> .envThat key is named for the task the prompt hands the agent ("Coding agent: build an agent") and has the console's Full access. A code works once; a used or expired one fails with 410. The prompt tells the agent to skip that step when the project already has NOCLICK_API_KEY, so copying another prompt for the same project makes no second key: its code expires unused. Key.setup_code(name=) names the key the same way from your own code. An agent with no account at all can sign itself up and hand the account to you to claim.
A key starts with nk_live_ and is shown once, when you create it. After that the console shows only its prefix, like nk_live_ab12, which is also how you filter activity by key.
Scopes
| Scope | Lets the key |
|---|---|
users | create, read, update and suspend users, and mint sessions |
credentials:request | create and delete connections, send connect links, import credentials |
credentials:use | list and verify connections and run integration operations through them |
credentials:token | read a connection's OAuth access token |
tools | get toolkit definitions and run tool calls |
humans | ask, approve and notify people |
approvals:answer | approve or decline a call NoClick holds for your account's owner's yes, as long as the key didn't make it and could make it itself; a key with * doesn't have it unless it's named too |
approvals:policy | switch what NoClick holds for a person, for the whole account, or loosen them for one key or connected app (never itself; tightening one takes no scope); a loosening it makes waits a 10-minute undo window and tells the owner; a key with * doesn't have it unless it's named too |
keys:create | make secret keys no wider than itself, which never outlive it; a key with * doesn't have it unless it's named too |
agents | create, change and message agents |
agents:terminal | take over a coding agent's terminal, which shows its sandbox's keys and tokens; a key with * doesn't have it unless it's named too |
account:phones | link phone numbers to your account and unlink them; a linked number signs in to your account, so a key with * doesn't have it unless it's named too |
workflows:variables | read a workflow's variables' values, of a workflow you own or can edit, which no other read of it carries; they hold what its steps are given as secrets, so a key with * doesn't have it unless it's named too |
channels | open and use channels |
inbox | create and read inboxes, and reply |
phone | buy phone numbers, route them and place calls |
ai | call AI models; talking to an agent as a model takes agents |
render | draw a picture or a PDF for a reply from a composition, kept as one of your files; a page of a repo in it takes repos too |
sandboxes | start and use sandboxes |
operations | list operations, count them, and read an agent turn's tool calls |
usage | read spend and the activity logs |
policy | read and set policy |
brand | read and set your brand |
webhooks | manage webhook endpoints and read events |
webhooks:reveal | read a webhook's signing secret; a key with * doesn't have it unless it's named too |
mcp_servers | create and manage hosted MCP servers |
storage | create buckets, read and write their files, and mint signed links |
volumes | create volumes, and read and write their files |
dicts | create dicts, and read and write their keys |
queues | create queues, and send, receive and settle messages |
secrets | create secrets and set their values, which no key can read back |
workflows | run workflows and give them endpoints |
apps | create and deploy apps, and set their bindings, secrets, schedules and app services |
repos | create repos, commit, and mint clone links |
databases | create and query databases, migrate, restore and branch them |
domains | search, connect and manage domains |
domains:buy | buy and renew domains, which charges your account |
browsers | start browsers and manage browser profiles |
machines | rent and run machines |
machines:vetting | ask for machines for your company from your server, saying who accepted the machines usage policy and when; a key with * doesn't have it unless it's named too |
projects:publish | make an app's code public from your server: anyone can then clone it; a key with * doesn't have it unless it's named too |
Scopes for cards
| Scope | Lets the key |
|---|---|
cards | create and manage cards and read their transactions |
cards:reveal | hand out a card's number: a reveal page or a purchase's number |
The console offers sets of these: Full access is every scope except the five that read secrets, credentials:token, cards:reveal, webhooks:reveal, agents:terminal and workflows:variables, approvals:answer, which says yes for your account's owner, approvals:policy, which switches what waits for them, machines:vetting, which accepts the machines usage policy for your company, keys:create, which makes keys, projects:publish, which makes an app's code public, and account:phones, which links a phone that signs in to your account (each of those it offers on its own, beside Full access); GET /v1/account lists Full access in meta.scopes, and the scopes it leaves out, each held by naming it, in meta.explicit_scopes (a key with * also holds credentials:token); Read-only is usage and operations; or pick your own. Only grant credentials:token to code that must call providers directly, since it can read your users' access tokens, cards:reveal only to code that hands a card's number to a person or announces purchases, webhooks:reveal only to the receiver that verifies deliveries, agents:terminal only to the server that opens a terminal for the person who'll drive it, workflows:variables only to code that must read a variable's value itself, for the workflows you own or edit, approvals:answer only to the code that decides on your behalf, on a key of its own, approvals:policy only to the code that sets your approval switches, machines:vetting only to the sign-up flow that records who accepted the machines usage policy, keys:create only to the code that hands its workers keys of their own, projects:publish only to the code that publishes your apps' code, and account:phones only to the code a person links their own phone through.
A call a key's scopes don't cover fails with noclick.PermissionDenied. Reading, waiting on and cancelling one operation by its id needs no scope.
Let your code make keys
One of your account's own secret keys that names keys:create makes keys from your server, so code that runs a fleet of workers hands each its own key without you minting them in the console:
worker = noclick.Key.create("queue worker 7", ["queues", "agents"], spend_cap_usd_per_month=20)
os.environ["WORKER_KEY"] = worker.secret # shown this onceOver HTTP it's POST /v1/keys. A key it makes is never wider than the key making it, and each way it would be is refused with noclick.PermissionDenied naming the field:
- Scopes: only scopes the key holds itself;
*only from a key holding*, and a scope a key holds only when it's named (keys:createamong them) only from one that names it. - Cap: when the key has a monthly spend cap, the new key needs one too, at most that.
- Expiry: when the key expires, the new key does too, no later.
- Approval settings: the new key starts with the approval settings the key set for itself.
- Lifetime: the new key names the key that made it (
minted_by), and revoking a key revokes every key it made, and theirs.
It makes secret keys only (a publishable key is yours to make, signed in), and only a key acting for your whole account makes any: a key pinned to a user, a session, an app's code, an MCP connection or an agent's turn is refused.
Pin a key to a user
A key pinned to a user always acts for that user, without as_user, and can't act for any other: naming another user fails with noclick.PermissionDenied. Use one for a service that only ever works for one customer.
For code in a browser, don't use a pinned key: mint a session, which expires.
Cap a key's spend
A key's monthly spend cap limits everything done with that key. Once it's reached, calls with the key fail with noclick.SpendCapExceeded until the next month or until you raise the cap. You can change a key's name and cap at any time in the console.
Publishable keys
A web page can't hold a secret key: anyone can read it from the page. A publishable key starts with nk_pub_ and is safe to ship in a page, because it can call only the endpoints you've made public and listed on it, such as a shared agent's chat or a workflow's public endpoint. It reads nothing else, and spends only through those endpoints.
Create one in the console under API keys, choosing Publishable as the key type. For each one you pick:
- Endpoints: the public endpoints it may call. A key with none calls nothing.
- Per-visitor limit: how many calls one visitor (by IP address) may make a minute; more fail with
429andnoclick.RateLimited. The default is 20. - Allowed origins: the sites that may use it from a browser, like
https://acmebooking.com. A call from any other origin, or with none, fails with403andnoclick.PermissionDenied; with none listed, any site may.
A publishable key is shown in full at any time, since it isn't a secret, and it still has a monthly spend cap: the turns and runs its visitors start count against it, as well as against your other caps. Change its endpoints, limit and origins from its row's menu; calls to an endpoint you take off it, or one that stops being public (an agent whose page you turn off), are refused at once.
A visitor never learns about your account's money or rules: a call a cap, your balance or your policy stops answers 409 with not_available, and the reason shows in your activity instead. A call for a user whose spending you paused answers 402 spending_paused with only what you wrote for that user: its user_message, action and since. Any other route refuses a publishable key with 403. To act as one of your users in the browser, with their own agents and connections, mint a session instead.
Keys NoClick gives your apps
An app you deploy on NoClick whose repository asks for a key to your account is given one by NoClick once you agree to what it can do. It's listed here with your other keys, naming its app (project_id in GET /v1/keys), and you cap, rename and revoke it the same way. It has no value to show: its app's production release holds a bearer of its own, starting nk_app_, that works only while that release serves. It never holds *, keys:create, approvals:answer or approvals:policy.
Revoke a key
Revoking a key stops it at once, along with every session it minted. To rotate a key, create the new one, deploy it, then revoke the old one.