Skip to main content
Every call to https://api.abstract.inc/v1 carries an API key as a Bearer token:
The same header authenticates the WebSocket handshake at /v1/responses. GET /v1/models needs the key too.

Get a key

The abstract CLI signs you in and saves a key on your machine.
abstract login prints a link and a code. Open the link in a browser and confirm the code. The CLI then creates a key on your account and saves it in ~/.config/abstract/credentials.json, readable by you alone. A machine that is already signed in keeps its key. The account needs a payment method or credit before the CLI can create a key. Set one up at abstract.inc/start?setup=billing.

Use the key

abstract token prints the saved key and nothing else. Pass it inside a command as $(abstract token):
For a program, set the key in that program’s environment only:
The program reads ABSTRACT_API_KEY and sends it as the Bearer token.
Never print the key, echo it, commit it, or write it into a log or a chat. Treat anything that prints abstract token output as a secret.

Check the key

abstract status shows the saved key’s safe prefix and calls GET /v1/models with it.

Handle 401

The API answers HTTP 401 when the key is missing, wrong, or revoked. Do not retry a 401 with the same key.

Revoke a key

See the CLI reference for every command.