Skip to main content
Geek Hub uses API keys with the ghub_sk_ prefix sent in the Authorization: Bearer header.

Key format

TypePrefixUse
Productionghub_sk_live_Real calls, consume balance
Sandbox (coming soon)ghub_sk_test_Testing without balance
Each key is 45 characters total. The ghub_sk_live_ prefix (13 chars) + 32 random chars.

Generate an API key

  1. Go to the dashboard
  2. Click New API key
  3. Give it a descriptive name (prod-web, ci-bot, staging)
  4. We show the key only once — save it before closing
If you lose the key, we cannot recover it. You have to revoke the current one and generate a new one.

Use your API key

Pass it in the Authorization header:
curl https://api.geekhub.mx/v1/models \
  -H "Authorization: Bearer ghub_sk_live_xxxxx"
Or with SDKs:
from openai import OpenAI

client = OpenAI(
    base_url="https://api.geekhub.mx/v1",
    api_key="ghub_sk_live_xxxxx",  # ideally from env var
)

Best practices

Use environment variables (process.env.GEEKHUB_API_KEY) or secrets services (AWS Secrets Manager, Vault, etc).
Create separate keys for production, staging, CI, etc. If one is compromised, you only revoke that one.
In the dashboard, unused keys appear marked. Revoke them to reduce attack surface.
Every 90 days: generate new, deploy, revoke the old one.

Common authentication errors

HTTP codeMessageCause
401missing_api_keyYou didn’t send the Authorization header
401invalid_api_keyKey doesn’t exist or is revoked
402insufficient_balanceYour balance is ≤ $0 MXN, top up
See Errors for the full catalog.