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_... >> .env

That key is named "Coding agent" and has the console's Full access. A code works once; a used or expired one fails with 410.

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

ScopeLets the key
userscreate, read, update and suspend users, and mint sessions
credentials:requestcreate and delete connections, send connect links, import credentials
credentials:uselist and verify connections and run integration operations through them
credentials:tokenread a connection's OAuth access token
toolsget toolkit definitions and run tool calls
humansask, approve and notify people
agentscreate, change and message agents
channelsopen and use channels
inboxcreate and read inboxes, and reply
phonebuy phone numbers, route them and place calls
aicall AI models; talking to an agent as a model takes agents
sandboxesstart and use sandboxes
operationslist operations, count them, and read an agent turn's tool calls
usageread spend and the activity logs
policyread and set policy
brandread and set your brand
webhooksmanage webhook endpoints and read events
webhooks:revealread a webhook's signing secret; a key with * doesn't have it unless it's named too
mcp_serverscreate and manage hosted MCP servers
storagecreate buckets, read and write their files, and mint signed links
volumescreate volumes, and read and write their files
dictscreate dicts, and read and write their keys
queuescreate queues, and send, receive and settle messages
secretscreate secrets and set their values, which no key can read back
workflowsrun workflows and give them endpoints
appscreate and deploy apps, and set their bindings, secrets, schedules and app services
reposcreate repos, commit, and mint clone links
databasescreate and query databases, migrate, restore and branch them
domainssearch, connect and manage domains
domains:buybuy and renew domains, which charges your account
browsersstart browsers and manage browser profiles

Scopes for cards

ScopeLets the key
cardscreate and manage cards and read their transactions
cards:revealhand 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 three that read secrets, credentials:token, cards:reveal and webhooks:reveal; 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, and webhooks:reveal only to the receiver that verifies deliveries.

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.

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 429 and noclick.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 with 403 and noclick.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.

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.