API Keys
Lit Chipotle uses two distinct types of API keys, each with a different scope and purpose.Account Key
Your account key is created once, at account creation time. It is the master credential for your account — treat it like a password.- Created: Automatically generated when you create a new account. Displayed once in a one-time success message; copy and store it immediately.
- Purpose: Full administrative access to your account — creating and deleting usage keys, managing groups, registering actions, and creating PKPs.
- Authentication: Pass it in the
X-Api-Key(orAuthorization: Bearer) header to authenticate as the account owner. - Security: Because this key is your master credential, it should never be embedded in client-side code, shared with users, or rotated casually. If it is compromised, your entire account is at risk. Store it in a secrets manager or equivalent secure store.
Usage Keys
Usage keys are scoped, rotatable keys intended for day-to-day operations — for use in dApps, servers, cron jobs, or anywhere you need to run lit-actions without exposing your master credential.- Created: From the Usage API Keys section of the dashboard, or via the API. Like the account key, each usage key is shown once on creation.
- Purpose: Running lit-actions and interacting with the node on behalf of your account. Scoped execution is enforced through groups. A wildcard execution key can run arbitrary code without a group, while PKP wallet use still requires a matching action-and-wallet group in its own account.
- Authentication: Pass the usage key in the
X-Api-Key(orAuthorization: Bearer) header just as you would the account key. - Security model: Usage keys enforce least-privilege access. By scoping each key to specific groups (and therefore specific IPFS actions and PKPs), you can give a key to a client or service without granting it access to your full account. If a key is compromised or no longer needed, delete it — this has no impact on other keys or your account.
Wildcard execution and wallet access
Setexecute_in_groups: [0] (executeInGroups: [0] in the SDK) to run arbitrary Lit Action code without registering an action or creating a group. Paste this usage key into the Dashboard Action Runner to try code such as console.log("hello"). An account master key is an administrative credential; it does not automatically grant action execution.
Wildcard execution does not grant unrestricted PKP wallet access. PKP private-key, encryption, and decryption operations require a group in the key’s account that permits both the action CID and wallet. A group can explicitly permit all action CIDs, but the key’s execution wildcard alone never bypasses wallet scoping. See Groups.
Key lifecycle
A freshly-created usage key’s group permissions are eventually consistent — the first
/lit_action call right after add_usage_api_key can fail for a beat while the grant propagates. Don’t sleep a fixed amount; poll the real execution path until it succeeds. See Verify the real path before you depend on it.Managing Usage Keys
Usage keys can be managed through the Dashboard or directly via the REST API. Both require your account key to authenticate.Via the Dashboard
In the Usage API Keys section of the Dashboard:- Add — Click Add, optionally set a name and description, then confirm. The new key is displayed once — copy it immediately.
- Delete — Select a key and delete it. This takes effect immediately; any service still using the key will receive authentication errors.
Via the API
All usage key management endpoints are under/core/v1/ and require your account key in the X-Api-Key (or Authorization: Bearer) header.
Create a usage key —
POST /core/v1/add_usage_api_key
Returns the new key once in the response (usage_api_key). Permissions are set at creation time — pass empty arrays to grant no group access initially.
- JavaScript (Core SDK)
- cURL
List usage keys —
GET /core/v1/list_api_keys?page_number=0&page_size=20
Returns a paginated list of usage keys on the account. The key value itself is not returned — only its hash and metadata. Each item includes the full permission set as it exists on-chain.
- JavaScript (Core SDK)
- cURL
Update a usage key’s permissions —
POST /core/v1/update_usage_api_key
Replaces all permissions on an existing usage key. Pass the usage key value (not the account key) in the body. The full permission set must be provided — any fields omitted will be reset to their defaults.
- JavaScript (Core SDK)
- cURL
Update a usage key’s name/description only —
POST /core/v1/update_usage_api_key_metadata
Updates only the name and description without touching permissions.
- JavaScript (Core SDK)
- cURL
Delete a usage key —
POST /core/v1/remove_usage_api_key
Permanently removes a usage key. Pass the key value (not an ID) in the request body. Takes effect immediately.
- JavaScript (Core SDK)
- cURL