Authentication
Authenticate API calls with an API key or an OAuth access token, see what each auth error means, and read the rate limit headers of every response.
Every request to https://promptgale.com/v1 needs an API key or an OAuth access token.
API keys
Create a key in the dashboard under API keys. Keys start with pk_live_. We store only a hash, so a lost key cannot be recovered: revoke it and create a new one.
Send the key in either header. They are equivalent; send one.
Authorization: Bearer pk_live_...X-API-Key: pk_live_...The samples in these docs read the key from the PROMPTGALE_API_KEY environment variable.
What an auth failure looks like
| Situation | Status | Code |
|---|---|---|
| No key in the request | 401 | MISSING_API_KEY |
| Unknown or revoked key | 401 | INVALID_API_KEY |
| Read-only token on a route that creates or cancels work | 403 | FORBIDDEN |
Every 401 carries WWW-Authenticate: Bearer realm="promptgale".
OAuth access tokens
Apps that act for a user can use OAuth instead of a key: Authorization: Bearer pgo_at_....
- Flow: authorization code with PKCE, asking for
resource=https://promptgale.com/v1. - Discovery:
/.well-known/oauth-protected-resource/v1. - Scope
mcp:readreads. Scopemcpalso creates and cancels tasks, grids and batches.
API keys have full access. Browsers may call the API directly (CORS, no cookies).
Rate limits
Each API key may send a set number of requests per minute (600 by default). Every response carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset. Over the limit you get 429 RATE_LIMITED with Retry-After in seconds.
Last updated