ChartnautDocs

API keys

An API key lets the CLI, a coding agent or your own code call Chartnaut as you. You create and revoke keys on the Developers page, in the menu under your name.

A key acts as you. It can read, save and run anything your account can, within the scopes you give it, and it uses your plan's limits exactly as the app does. Treat it like a password.

On Free

Keys work on every plan, Free included, at your plan's API limits. A call past one of your plan's caps, such as an eleventh definition on Free, gets 403 plan_limit. Plans and limits lists what each plan includes.

Create a key

  1. Open the menu under your name and choose Developers.

  2. Under API keys, click Create API key.

  3. Type a Name you will recognise later, such as Laptop CLI.

  4. Untick any Scopes the key does not need. At least one must stay ticked.

  5. Pick when it Expires: Never, 30 days, 90 days or 1 year. The default is 90 days.

  6. Click Create API key.

  7. Copy the key. Chartnaut shows it once, and closing the dialog loses it for good.

Create API key form
The Create API key form with all three scopes ticked.

The next screen shows the key, and under it the line that signs the CLI in with it:

chartnaut login --token cn_live_XXXX

A third line adds Chartnaut to Claude Code over MCP with the same key. Claude, ChatGPT and Cursor can also connect with a browser sign-in and no key: Connect Chartnaut to an AI app. For your own code, send the key as a bearer token; API overview shows how.

API key created
The new key, shown once, with the CLI sign-in line under it.

Most CLI users never open this dialog. Approving chartnaut login in the browser makes a key named CLI on followed by your computer's name, with every scope. It expires after 90 days unless you chose 7 or 30 with chartnaut login --expires, and the approval page lets you shorten it. A key from this dialog keeps the expiry you pick here. Sign in covers it.

Scopes

A scope narrows what a key can do. It never adds anything your account cannot already do.

Scope

Lets the key

scripts:read

Every read: your scripts, versions, a definition's events, runs and results, instruments, timeframes, the docs and your usage. Also validating a script without saving it

scripts:write

Create scripts, save new versions, change a name, description or visibility, and delete

runs:write

Start and cancel runs, and run a definition over history

A key for a dashboard that only reads results needs scripts:read alone. A key for a coding agent that writes and tests scripts needs all three. A call outside the key's scopes gets 403 forbidden_scope.

The keys list

Each key shows its name, its first characters (cn_live_ and four more), its scopes, when it was created, when it was last used and when it expires.

API keys list
Two API keys with their scopes, last use and expiry.

An expired key stays in the list marked Expired until you revoke it, and it stops working the moment it expires: every call gets 401 unauthorized with the message API token expired. Keys made by chartnaut login before CLI sign-in keys had an expiry now expire 90 days after that change shipped; the list shows the date. Run chartnaut login again for a fresh key.

You can have 20 keys at once, not counting expired ones. Make one per machine or per tool, so revoking one never breaks the others.

Revoke a key

  1. Click Revoke on the key.

  2. Click Revoke again in the confirm dialog.

Anything using the key stops working straight away, and it cannot be undone.

Revoke API key dialog
The Revoke API key confirm dialog.

chartnaut logout revokes the key the CLI is signed in with, including one you gave it with --token. Your own code can do the same with Revoke the current key. Revoke a key at once if it ends up in a commit, a log or a chat.