Comment

Comment by fanieldanara

Bearer indicates the type of credential being supplied in the Authorization header. Bearer tokens are a type of credential, introduced in RFC6750 [0]. Essentially the OpenAI api key you’re using is a form of bearer token, and that’s why the Bearer type should be included there.

Other authentication methods (like username/password or “Basic”) use the Authorization header too, but specify “Authorization: Basic <base64 encoded credentials>”.

[0] https://www.rfc-editor.org/rfc/rfc6750

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton