Skip to content

PresetAuth

type PresetAuth = "key" | "bearer" | "oauth";

Defined in: core/src/presets.ts:37

How the credential reaches the endpoint.

  • key: the vendor’s native key header (Anthropic reads x-api-key, Gemini x-goog-api-key); the OpenAI shapes have only Bearer, so they never use this.
  • bearer: Authorization: Bearer, the OpenAI shapes’ only mode, and the coding-plan gateways’ mode on the Anthropic wire (measured: Z.ai’s coding endpoint ignores x-api-key and reads Bearer).
  • oauth: same wire as bearer, but the token is a short-lived access token from a sign-in flow (see @providerkit/core/auth). The preset may carry the beta headers that switch the endpoint into OAuth mode.