Skip to content

Developer Access ​

A developer token is a personal API key for scripts, CI jobs, the CLI and MCP clients. It starts with cbt_live_, acts as you, and can do only what its permissions allow. Each token has an expiry and can optionally be restricted to the networks you list.

This page explains how to create a developer token, how permissions, expiry and network restrictions work, and how to revoke a token. Enterprise API keys are a separate credential; see Enterprise API Keys. For a task-oriented walkthrough, see Restrict API keys.


Create a token in the web app ​

  1. Sign in to chainabit.com.
  2. Open Settings → Developer and select the Developer Tokens tab.
  3. Select Create Token. A side panel opens.
  4. Enter a Label of up to 80 characters, for example GitHub Actions deploy. The label is shown in your token list.
  5. Under Permissions, select what the token can do. Permissions are grouped by area. Each one shows its risk level and whether using it can spend credits. Nothing is selected by default.
  6. Under Expiration, choose a preset. A preset your account cannot use is shown as unavailable, with the reason.
  7. To restrict the token to known networks, turn on Restrict to IP addresses under IP restriction and add addresses or ranges. Leave it off to allow any network.
  8. Select Create token. You may be asked to confirm your identity first.
  9. Copy the token with Copy and store it in a secret manager. It is shown only once and cannot be retrieved later. The token list shows only a short preview.

Permissions ​

A token's permissions (its scopes) decide which routes it can call. The permission catalog is the source of truth for which permissions a developer token can carry. Read it with an interactive access token:

curl https://api.chainabit.com/api/v1/auth/developer-tokens/catalog \
  -H "Authorization: Bearer $TOKEN"

GET /auth/developer-tokens/catalog requires an interactive session. A developer token cannot read the catalog and is refused with 403. The response is never cached (Cache-Control: no-store).

json
{
  "data": {
    "entries": [
      {
        "name": "projects:read",
        "label": "Read projects",
        "description": "List and read projects (Chainies) the account can access",
        "group": "projects",
        "risk": "medium",
        "sensitivity": "medium",
        "billable": false,
        "dependencies": [],
        "delegableTo": ["oauth_access", "developer_token"],
        "allowedTokenTypes": ["oauth_access", "developer_token"],
        "defaultApproval": "self_service",
        "resources": ["productivity.chainies"],
        "auditRequired": false,
        "workspaceScoped": true,
        "operations": [
          { "method": "GET", "path": "/chainies" },
          { "method": "GET", "path": "/chainies/:id" }
        ]
      }
    ],
    "catalogVersion": "<64-character hex digest>",
    "expiryOptions": [
      { "expiry": "none", "days": null, "available": false, "reason": "non_expiring_unavailable" },
      { "expiry": "1d", "days": 1, "available": true, "reason": null },
      { "expiry": "7d", "days": 7, "available": true, "reason": null },
      { "expiry": "30d", "days": 30, "available": true, "reason": null },
      { "expiry": "90d", "days": 90, "available": true, "reason": null },
      { "expiry": "1y", "days": 365, "available": true, "reason": null }
    ]
  }
}

The example shows one entry; the real response lists every permission a developer token can carry, sorted by name.

FieldMeaning
entries[].nameThe permission name to send in scopes, for example bits:read
entries[].label, entries[].descriptionA short name and an explanation for people
entries[].groupThe area the permission belongs to. The web app groups permissions by this value
entries[].risk, entries[].sensitivitylow, medium or high
entries[].billabletrue when using the permission can spend credits
entries[].dependenciesPermissions that must be granted together with this one
entries[].operationsThe exact routes the permission authorizes, as method and path
entries[].workspaceScopedPresent and true when those routes act inside a workspace
entries[].defaultApproval, entries[].auditRequired, entries[].delegableTo, entries[].allowedTokenTypes, entries[].resourcesClassification metadata of the permission
catalogVersionA digest of the entries. Send it back when you create a token to detect a catalog that changed in the meantime
expiryOptionsThe six expiry presets and whether you can choose each one now (see Expiry)

Choose the smallest set of permissions whose operations cover the routes your integration calls.

Examples. At the time of writing, the catalog offers these permissions to developer tokens. Treat this list as an example only; the catalog response is authoritative and may change.

  • execution:run: create AI runs. Using it can spend credits.
  • wallet:read: read the wallet balance.
  • projects:read: list and read Projects (Chainies).
  • bits:read: read Bits, including tree, calendar and Project Gantt views.
  • bits:write: create Bits and update existing Bits, including placing a Bit in a Chain, completing it and assigning people to it. Deleting and executing Bits are not included.

Scopes such as contexts:read or agents:execute belong to Enterprise API Keys and cannot be granted to a developer token.

If a request omits scopes or sends an empty list, the token receives execution:run. Always send the permissions you want explicitly.


Expiry ​

Every token expires. Choose one of these presets in the web app, or send it as expiry in the API:

PresetLifetime
1d1 day
7d7 days
30d30 days (the default when no expiry is sent)
90d90 days
1y365 days
noneNot supported. The catalog reports it as unavailable and the API refuses it
  • A lifetime is counted in elapsed days from the moment the token is created. 1y is 365 days, not a calendar year. Read the exact time from expiresAt in the response.
  • none is not supported. The catalog lists it with "available": false and the reason non_expiring_unavailable, and a create request with "expiry": "none" is refused with 422 and developer_token_non_expiring_unavailable.
  • When you create a token from a session signed in to an Organization, the token cannot outlive that sign-in. In that case expiresAt can be earlier than the preset.
  • The older expiresInDays field (a whole number from 1 to 365) is still accepted. Send either expiry or expiresInDays, not both; sending both is refused with 400 and developer_token_expiry_conflict.

Organization lifetime limit ​

An Organization can set a maximum credential lifetime. A token cannot outlive that limit in that Organization:

  • When you create a token. A preset longer than the limit of the account the token will be bound to is listed in expiryOptions with "available": false and the reason account_limit. A create request for it is refused with 422 and developer_token_lifetime_exceeded; error.details.maxCredentialLifetimeDays gives the limit. Choose a shorter preset.
  • When you use a token. The limit applies to every request that runs in the Organization, including requests made with tokens created before the limit was set. A token whose lifetime is longer than the limit is refused with 403 and developer_token_lifetime_exceeded, with the same error.details.maxCredentialLifetimeDays. The token keeps working in other accounts. Replace it with a token whose lifetime fits the limit.

If the Organization's policy cannot be read at that moment, the request is refused with 503 and SSO_POLICY_UNAVAILABLE. Retry later.


Network restriction ​

A token can be restricted to a list of networks. Requests from any other address are refused, even when the token is otherwise valid. In the API, send the list as allowedNetworks; omit the field (or send null) to allow any network.

  • Send between 1 and 100 entries. An empty list is refused.
  • Each entry is an IPv4 or IPv6 address, or a CIDR range: 198.51.100.7, 203.0.113.0/24, 2001:db8::/48.
  • Entries are normalized before they are stored. A single address becomes /32 (IPv4) or /128 (IPv6). Host bits of a range are cleared, so 203.0.113.99/24 is stored as 203.0.113.0/24. An IPv4-mapped IPv6 entry such as ::ffff:198.51.100.7 is stored as its IPv4 form; a mapped range needs a prefix of /96 or longer. Equivalent entries are stored once. The response returns the normalized list.
  • Host names, URLs, ports, interface suffixes such as %eth0, IPv4 addresses with leading zeros (192.168.01.1) or in shortened or hexadecimal form, and prefixes that are malformed, out of range or have leading zeros are refused. If any entry is invalid, the whole request is refused with 400 and developer_token_networks_invalid, and error.details.errors lists each invalid entry as { "index": <position, from 0>, "code": "<reason>" }. The reasons are network_invalid_address, network_invalid_prefix and network_invalid_mapped_prefix. No token is created.
  • A range that covers every address (0.0.0.0/0 or ::/0) is accepted, but the restriction then has no effect. The response's warnings array contains developer_token_network_broad so that you can catch the mistake.

Which address is checked. Chainabit checks the public address your request arrives from. Forwarding headers that your client sets are never used. If your traffic leaves through a proxy, NAT gateway or VPN, allow the public egress address of that hop, not the private address of the machine. An IPv4 address matches only IPv4 entries and an IPv6 address matches only IPv6 entries, so if your network can reach the API over both, list both. A restricted token is refused when no address can be determined.

Refusal. A request from outside the list is refused with 401 and developer_token_ip_denied. The token itself remains valid: fix the network, or replace the token with one that lists the right networks. The response never reveals the allowed networks. The restriction also applies to the compatibility exchange (POST /auth/developer-tokens/exchange) and to refreshing a session obtained from it.

A token's permissions, expiry and allowed networks cannot be changed after it is created. To change them, create a replacement token and revoke the old one.


Create a token with the API ​

POST /auth/developer-tokens creates a token. It requires an interactive access token, and it can require recent identity verification: a stale session receives 403 and STEP_UP_REQUIRED and no token is issued. A developer token cannot create, list or revoke developer tokens.

curl -X POST https://api.chainabit.com/api/v1/auth/developer-tokens \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "GitHub Actions deploy",
    "scopes": ["wallet:read", "bits:read"],
    "expiry": "90d",
    "allowedNetworks": ["203.0.113.0/24", "198.51.100.7"]
  }'
FieldTypeRequiredDescription
labelstringYes1 to 80 characters, shown in the token list
scopesstring[]NoPermission names from the catalog. Defaults to ["execution:run"]
expirystringNo1d, 7d, 30d, 90d or 1y. Defaults to 30d. none is currently refused
expiresInDaysnumberNoOlder alternative to expiry: 1 to 365. Do not send both
allowedNetworksstring[] | nullNo1 to 100 addresses or CIDR ranges. Omitted or null allows any network
catalogVersionstringNoThe catalogVersion you read from the catalog. If the catalog has changed since, the request is refused with 409 and developer_token_catalog_stale
accountIdstring (UUID)NoBind the token to one account you can access. If you omit it, the token is bound to your default account

A successful request returns 201:

json
{
  "data": {
    "id": "7efb71f0-0b76-40c1-b567-2e1b8df11c5c",
    "label": "GitHub Actions deploy",
    "token": "cbt_live_EXAMPLE...",
    "tokenPreview": "cbt_live_EXA...",
    "scopes": ["bits:read", "wallet:read"],
    "accountId": "1b6cf9aa-6a85-4cdb-aadf-6cdb20d09b7b",
    "tokenKind": "account_bearer",
    "expiresAt": "2027-01-27T10:00:00.000Z",
    "allowedNetworks": ["203.0.113.0/24", "198.51.100.7/32"],
    "catalogVersion": "<64-character hex digest>",
    "warnings": [],
    "createdAt": "2026-10-29T10:00:00.000Z"
  }
}
  • token is the secret. It is returned only in this response; store it immediately. Later responses show only tokenPreview.
  • allowedNetworks is the normalized list, or null when the token works from any network.
  • warnings is empty unless the request needs your attention, for example developer_token_network_broad.
  • Settings are checked before identity verification is requested, so an invalid request never asks you to verify.
  • This request does not use an Idempotency-Key. If a create request fails without a clear outcome, list your tokens before you retry, so that you do not create a second token. A token whose secret you did not receive cannot show it again: revoke it and create a new one.

The error codes of this request are listed in Error codes.


List tokens ​

GET /auth/developer-tokens returns your tokens, newest first. It never returns the secret.

curl https://api.chainabit.com/api/v1/auth/developer-tokens \
  -H "Authorization: Bearer $TOKEN"

Each item contains id, label, tokenPreview, scopes, accountId, tokenKind, status (active or expired), expiresAt, allowedNetworks (null when the token works from any network), createdAt, lastUsedAt and revokedAt. Expired tokens stay in the list; revoked tokens are removed from it. lastUsedAt is approximate: repeated use from the same client updates it at most once every five minutes.


Using a Developer Token ​

Pass the token directly as a Bearer token on supported endpoints. No browser login or session exchange is required on current servers.

javascript
const response = await fetch(`https://api.chainabit.com/api/v1/ai/features/ai.chat.basic/runs`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${DEVELOPER_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    messages: [{ role: 'user', content: 'Run the nightly health check' }],
  }),
});
const { data } = await response.json();
python
import httpx

result = httpx.post(
    f"{BASE_URL}/ai/features/ai.chat.basic/runs",
    json={"messages": [{"role": "user", "content": "Run the nightly health check"}]},
    headers={
        "Authorization": f"Bearer {DEVELOPER_TOKEN}",
        "Content-Type": "application/json",
    },
).json()

Each request is independently authenticated, and the token's expiry, permissions and network restriction are checked on every request. A request to a route outside the token's permissions is refused with 403. The CLI also supports passing the token through CHAINABIT_TOKEN, --token-env, --token-file, or --token-stdin.

Security Recommendations ​

  • Never embed cbt_live_... tokens in frontend code.
  • Never commit tokens to repositories or CI logs.
  • Create a separate token per environment and per system instead of sharing one token across dev, staging, and production.
  • Prefer the narrowest permissions and the shortest expiry that fit the job.
  • Restrict tokens used from fixed infrastructure, such as CI runners or servers, to the networks they run in.
  • Revoke tokens immediately if they appear in shell history, screenshots, build logs, or chat transcripts.

Rate Limits ​

Developer-token requests remain subject to the applicable endpoint and caller limits. A token does not create a separate request allowance. Check the response headers and any Retry-After value rather than assuming one quota for every operation.

Managing tokens has its own limits: 10 creations per 5 minutes, 30 list requests per minute and 20 revocations per 5 minutes.

AI endpoints may also consume credits governed by the entitlements system. See Rate Limiting for full threshold tables.

Revoking a Token ​

From the web app: open Settings → Developer, select the Developer Tokens tab, select Revoke on the token's row and confirm. Revocation is immediate; any subsequent request using that token returns 401.

From the API:

curl -X DELETE https://api.chainabit.com/api/v1/auth/developer-tokens/$DEVELOPER_TOKEN_ID \
  -H "Authorization: Bearer $TOKEN"

The response is { "data": { "revoked": true, "id": "<token id>" } }. Revoking a token that is already revoked succeeds again. An unknown ID, or the ID of another user's token, returns 404.

From the CLI:

bash
chainabit auth keys revoke "$ID"

There is no in-place rotation. To rotate a token, create a replacement, switch your systems to it, then revoke the old token. See Restrict API keys.

Audit ​

Creating and revoking a developer token are recorded in the audit trail of the account the request runs in. The record identifies the token by its ID, label and preview, and includes its permissions, its expiry choice and the number of allowed networks. It never contains the token secret.


Built with purpose. chainabit.com