Skip to main content
All OpenPAI APIs require authentication. Auth information is carried in the request headers, not in the URL query.

OpenAI-compatible protocol

Claude Messages protocol

SDKs usually add anthropic-version automatically, so you don’t need to set it manually when using an SDK.

Gemini native protocol

Gemini also supports query-parameter auth (?key=sk-...), but this is not recommended — the URL gets logged by proxies.

Failure examples

How to troubleshoot:
  1. Copy the X-OpenPAI-Request-Id header.
  2. Console → Logs → search for that Request ID to see the detailed failure reason.

Key safekeeping

  • Do not commit keys to Git or paste them into chats / issues.
  • Inject them via environment variables / a secret manager.
  • If you suspect a leak, disable and regenerate immediately in the console.
  • Create separate tokens per app / environment for fine-grained tracking.