Get startedAuthentication

Authentication

The GPUs.io API authenticates with a bearer token. Send your secret API key in the Authorization header on every request.

curl -G https://api.gpus.io/v1/prices \
  -H "Authorization: Bearer $GPUS_API_KEY"
Keep your key secret. Your key grants access to the API. Never commit it to source control or expose it in client-side code — call the API from your backend and inject the key from an environment variable such as GPUS_API_KEY. Keys are opaque secrets; treat the whole string as sensitive.

Authentication errors

A missing or malformed Authorization header returns 401 with an UNAUTHORIZED error and a WWW-Authenticate response header:

401 Unauthorized
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Missing or malformed Authorization header. Use: Authorization: Bearer <api-key>"
  }
}

An unknown or revoked key also returns 401, with the message Invalid API key. There is no separate status for an inactive key — any key the server can't accept is a 401.

© 2026 GPUs.io · API v1