Skip to main content

API keys and authentication

Choose the right credential and keep it secure.

Personal model API key

Sign in to the API keys page and complete any required contact verification. Create a personal PAYG key with models:chat permission. Its plaintext is shown once; save it in your secret manager.

API Credits and membership balances are separate. A key alone does not make a model available or fund a request. Check the catalog, then follow the console’s funding instructions.

sh
# Set this securely in your terminal; never commit it.
export ACOSMI_API_KEY="YOUR_PERSONAL_PAYG_KEY"

Model HTTP requests use:

text
Authorization: Bearer YOUR_PERSONAL_PAYG_KEY
Content-Type: application/json

x-api-key has a separate compatibility gate. Use Bearer authentication unless that alternative is confirmed; do not assume every endpoint accepts every credential header.

Credential types

CredentialPurposeBoundary
Personal PAYG keyPersonal metered model requestsAPI Credits and the required scopes
Membership delegated keyExplicitly enabled membership callsSeparate availability and entitlements
Membership OAuth / Acosmi SDKAuthorized Agent and compliance featuresSeparate tutorial
Browser sessionConsole management and personal recordsNot a model API key

Store, rotate and revoke

Store keys in server-side environment variables or a secret manager, never browser JavaScript, URLs, screenshots or logs. The console playground keeps a pasted key only in current page memory; refresh or account changes require it again.

Rotation prevents the old key from authorizing new requests. Clearing an input does not revoke a key. Historical requests and costs remain available in personal records. Revoke lost or exposed keys from the key management page.

For 401/403 errors, check validity, expiration and scope before sending another paid POST. See error handling.