Skip to main content

APIs

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.

Where should I start with apis?

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.

What belongs in an API request?

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.

Illustrative response — not a live request
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.

What should happen when the provider rejects the call?

  1. 1Check the HTTP status before interpreting the body as success.
  2. 2Show a useful failure state without exposing credentials or private response data.
  3. 3For a 429, follow the provider's retry guidance and avoid duplicate submissions while a request is pending.
  4. 4For a state-changing action, check the provider's idempotency support before retrying; a timeout does not prove nothing happened.

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.

Read the apis guides

8 min readUpdated October 21, 2026

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.

9 min readUpdated September 22, 2026

How APIs work in AI-built applications

Requests, responses, headers and status codes — explained through the calls an AI-generated app actually makes, and where those calls tend to go wrong.

6 min readUpdated September 22, 2026

401 vs 403 vs 404 vs 429 vs 500

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.