API keys explained
What an API key is, what it proves, why some keys are safe in a browser and others are not, and how to handle one without leaking it.
An API is a program's interface for requests and responses. Learn about keys, headers and status codes, then inspect calls made by an AI-built app.
Start with the guide that matches your question or the error you can see. Each guide below names the problem, gives checks you can run, and links to related reading.
Inspect the method, destination, headers and body separately. GET usually retrieves data; POST commonly submits an action. The provider defines the actual contract. A correct URL with the wrong authorization header can still fail, and a JSON response is not necessarily a successful response.
HTTP 401
{"error":"missing_credentials"}This example points to missing identity. Check whether the credential was attached where the provider expects it. Do not paste a secret into browser code to make the request work: a server-held credential needs a server-side handler that validates the caller and restricts the permitted action.
Read API keys explained for public-versus-secret handling, the API workflow guide for browser-to-server traffic, and the status-code guide when a specific request is failing. Share a redacted error and the request shape, not a working credential.
What an API key is, what it proves, why some keys are safe in a browser and others are not, and how to handle one without leaking it.
Requests, responses, headers and status codes — explained through the calls an AI-generated app actually makes, and where those calls tend to go wrong.
Five status codes that cover most failures in an AI-built app, what each one is really saying, and who has to fix it.
Looking for something else? Browse every topic.