Authentication
Every request carries your developer API key in the X-Api-Key header.
The Golden Engine API authenticates with a developer API key sent as the X-Api-Key
header. There is no login step and no token to refresh.
Every endpoint lives under https://backend.goldenengine.ai/v1/. That is the API host
for every environment, and the same one the API reference playground
sends to.
curl "https://backend.goldenengine.ai/v1/me" \
-H "X-Api-Key: <YOUR_API_KEY>"
{
"user_id": "9c4e8d21-6f3a-4b8e-9d21-1f2a3b4c5d6e",
}
GET /v1/me is the cheapest way to check a key: a 200 means the key is live and
has not been revoked.
Create a key
Keys are created in the Golden Engine dashboard, under API. Creating one returns the full secret once — it is stored hashed and cannot be retrieved again. Copy it before you close the dialog; if you lose it, revoke the key and create another.
Each key belongs to one environment, which sets its prefix:
| Prefix | Environment |
|---|---|
sk_live_ | Live |
sk_test_ | Test |
Both are real credentials against the same API. The prefix tells you which key you are looking at in logs and in the dashboard; it does not sandbox anything.
Every request
Send the header on every /v1/ call. Nothing else is required.
- cURL
- Python
- Node.js
curl "https://backend.goldenengine.ai/v1/avatars" \
-H "X-Api-Key: <YOUR_API_KEY>"
import os
import requests
requests.get(
"https://backend.goldenengine.ai/v1/avatars",
headers={"X-Api-Key": os.environ["GOLDENENGINE_API_KEY"]},
)
await fetch("https://backend.goldenengine.ai/v1/avatars", {
headers: { "X-Api-Key": process.env.GOLDENENGINE_API_KEY },
});
When authentication fails
Every error a /v1/ endpoint returns uses the same envelope, so you can branch on
error.code and never parse message text:
{
"error": {
"code": "invalid_api_key",
"message": "Invalid or revoked API key"
}
}
The one exception is a request that never reaches an endpoint: a path that does not
exist, or a method the path does not accept, gets the framework's plain
{"detail": "Not Found"} (404) or {"detail": "Method Not Allowed"} (405). A
404 with no error.code means the URL is wrong, not that a resource is missing.
401 invalid_api_key
The header is missing, the key does not exist, or it has been revoked. A
revoked key fails on its next request — there is no grace period. Check the
header name is exactly X-Api-Key and that you copied the whole secret.
429 rate_limit_exceeded
You have exceeded 100 requests per minute for that key. The window is a fixed
60 seconds that starts at the key's first request, not a rolling one, and only
requests that authenticate count against it. The limit is per key, so splitting
work across keys raises your total throughput. The wait is in the envelope as
error.retry_after_seconds — there is no Retry-After header — so wait that long
before retrying.
404 not_found on a resource you own
Keys are scoped to the account that created them. An avatar or conversation
belonging to a different account reads as missing rather than forbidden, so a
404 here usually means the key belongs to the wrong account.
Rotating a key
Create the new key first, deploy it, then revoke the old one. Revocation is immediate and cannot be undone, so revoking before the new key is live will drop requests in between.