Authentication
Account API keys, full versus custom access, and where to create one.
Every call to CPI carries an API key. There is no separate client id, no OAuth handshake, no signature to compute, one key, sent with the request.
Creating a key
Keys live in the dashboard, under the account menu's Developers screen, on its API keys
tab. A project has its own API tab that creates the same kind of key already scoped to that
project, so you never type an app_id in by hand. The interactive API reference
sandbox can also create one for you on the spot, so you can try a method before wiring anything
into your own code.
Creating an API key requires identity verification, the same level 2 check Xuda asks for before handing out a phone number, a mailbox or a portable IP. An account with nothing verified sees a prompt to verify before the key form opens.
Scope: what account the key acts as
A key is minted with one of three scopes, and always acts on the account or app it was minted against:
- Account: acts on your account directly, the way you would from a signed-in dashboard session. Reaches every method a plain account key can reach.
- App: minted from a project's own API tab, pinned to that project's
app_id. - Full Stack VPS: auto-issued when you provision a Full Stack VPS, scoped to the capability groups chosen at create time. See Full Stack VPS for what that covers.
Access: full or custom
Every key also picks how much of the public surface it can reach:
- Full access: everything the account can do over the API, including methods added after the
key was created. Private methods stay excluded no matter what:
private: trueis a hard wall, checked on every call, not a default that full access overrides. - Custom access: an explicit allowlist you build by ticking methods in the key form, grouped
by microservice with each method's fields shown inline. A method added later is not included
until you come back and allow it. A method whose
clearanceispublicis always reachable, even by a custom key with nothing ticked, since a public method needs no session and no allowlist entry.
The methods that create, update and list API keys (create_account_api_key,
get_app_api_keys, and the rest of api_module) are never reachable with an API key, by design:
a credential cannot mint or edit credentials for the account it authenticates. Manage keys from
the dashboard or from a signed-in session.
Sending the key
Over plain REST, the key is one more request parameter, named api_key: a field in the JSON body
on POST, a query string parameter on GET. See
Calling a method for both forms.
Over MCP the same key goes in an Authorization: Bearer header instead, there is no api_key
field. See MCP.
An API key is a bearer credential: whoever holds it acts as your account. Never ship one in client-side code, commit it, or paste it into a shared screenshot. Replace a key at once if it ever turns up in one of those places, replacing keeps the name and access mode and revokes the old value in the same step.