API keys
API keys are the recommended way to authenticate. They start with thecgk_
prefix and are passed in the Authorization header.
Creating an API key
You can create API keys from the dashboard or via the API itself (requiresadmin scope):
raw_key field. Store it
securely — it cannot be retrieved again.
Key security
- Keys are stored as SHA-256 hashes. ChatGrid never stores your raw key.
- Revoked or expired keys are rejected immediately.
- Each key’s
last_used_atis tracked for auditing.
Scopes
Each API key has one or more scopes that control what it can access:
If a request requires a scope your key does not have, you receive a
403 Forbidden:
Scope requirements by endpoint
JWT authentication
The ChatGrid web app authenticates with Supabase JWTs. If you are building a frontend integration, you can pass the user’s Supabase access token:read, write, and admin
scopes. Rate limits differ from API key limits (200 req/min for JWTs).