~/docs/getting_started/authentication.md
2,542 bytesยทedit on github โ†’

#Authentication

The GPT-GOB API uses bearer token authentication. Every request must include your API key in the Authorization header.

http
Authorization: Bearer gob-live-x4f9k3m2nQ8wHvL7pYrJ5tA1cBdE6fG2sK9oXz0aPq

##API key formats

Keys come in two flavors. Both are 50โ€“60 characters long after the prefix.

PrefixEnvironmentNotes
gob-live-ProductionReal billing, real rate limits
gob-test-Test modeFree, capped at 100 RPM, no billing

##Creating a key

  1. 01.Sign in to the Console
  2. 02.Open Settings โ†’ API Keys
  3. 03.Click Create new key
  4. 04.Optionally restrict it to specific scopes (chat.read, chat.write, grs.score, embeddings)
  5. 05.Copy it immediately โ€” you won't see it again

##Rotating keys

Keys can be rotated at any time without downtime. Old keys remain valid for 24 hours after rotation, giving you a window to roll out the new one.

bash
curl -X POST https://api.gpt-gob.ai/v1/keys/rotate \
-H "Authorization: Bearer $GOB_API_KEY"

##Scopes

ScopeAllows
chat.readRead chat history (Cave Memory)
chat.writeCreate chat completions
embeddingsGenerate embeddings
grs.scoreScore arbitrary text against the Goblin Reward Signal
models.listEnumerate available models
usage.readQuery usage and billing endpoints
*All of the above (default for new keys)

##Errors

If authentication fails, you'll get a 401 with one of these error codes:

json
{
  "error": {
    "type": "authentication_error",
    "code": "invalid_api_key",
    "message": "the cave doesn't recognize that key. check your spelling, tall one."
  }
}
CodeMeaning
invalid_api_keyKey is malformed or doesn't exist
expired_api_keyKey was rotated > 24h ago
revoked_api_keyKey was manually revoked
scope_requiredKey lacks the required scope
wrong_password_to_caveAuth header missing or malformed

##Best practices

  • โ–ธNever expose keys client-side. Always proxy through your own backend.
  • โ–ธUse scoped keys. Don't use a * key when chat.write is enough.
  • โ–ธSet up an allowlist. In Console โ†’ Settings, restrict keys to specific IPs.
  • โ–ธRotate quarterly. Even if nothing leaked, rotate at least every 90 days.
  • โ–ธUse `gob-test-` keys in CI. They're free and don't count against quota.