A tablet showing charts and graphs next to a coffee cup, banner image on the APIs for builders: keys, errors, retries and limits page

HiringsAI blog

APIs for builders: keys, errors, retries and limits

The builder-facing facts about calling an API, straight from OpenAI, Anthropic, Stripe and GitHub documentation.

your codekey stays server-sideThe vendor's APIOpenAI, Anthropic,Stripe or GitHubrequest: URL, verb,key, bodyanswer: status, data,rate-limit headersThe docs tell you exactly how each callis keyed, metered and answeredThe vendors' documentation of OpenAI, Anthropic, Stripe and GitHub
01

The short answer

An API is a contract your code signs with somebody else's computer: you send a request in a documented shape, to a documented address, with proof of who you are, and you get back a documented answer or a documented error. That is the whole idea, and the four documentation sets reviewed for this article, OpenAI's API overview and rate limit guide, Anthropic's API overview and rate limit page, Stripe's API reference and key management guide, and GitHub's REST quickstart and rate limit page, all describe the same machine from the same four angles: how you prove identity, what a call looks like, what the answer means, and how fast you are allowed to go.

When your builder asks for an API keyWhen your builder asks for an API key, you should know which keys are safe to paste where.
When your app breaks at 2 AMWhen your app breaks at 2 AM, you should know the difference between a 401 (whoever is calling has no valid key), a 429 (you are calling too fast, or you hit a spend cap), and a 500 (their side, not yours).
When a vendor pageWhen a vendor page, When a vendor page says "rate limits," you should know that three of the four vendors reviewed here, OpenAI, Anthropic and GitHub, document returning the current state of your limit in the response headers of each answer, with different header names per vendor, while Stripe's vendor documentation document the 429 and the backoff, not a meter you can read.
This article walks throughThis article walks through those four angles using only what the vendors' documentation actually say, and flags the places where the pages deliberately stay silent.

The short answer

An API is a contract your code signs with somebody else's computer: you send a request in a documented shape, to a documented address, with proof of who you are, and you get back a documented answer or a documented error. That is the whole idea, and the four documentation sets reviewed for this article, OpenAI's API overview and rate limit guide, Anthropic's API overview and rate limit page, Stripe's API reference and key management guide, and GitHub's REST quickstart and rate limit page, all describe the same machine from the same four angles: how you prove identity, what a call looks like, what the answer means, and how fast you are allowed to go.

If you are building with AI tools rather than writing every line yourself, you do not need to memorize any of this. You need to recognize it. When your builder asks for an API key, you should know which keys are safe to paste where. When your app breaks at 2 AM, you should know the difference between a 401 (whoever is calling has no valid key), a 429 (you are calling too fast, or you hit a spend cap), and a 500 (their side, not yours). When a vendor page says "rate limits," you should know that three of the four vendors reviewed here, OpenAI, Anthropic and GitHub, document returning the current state of your limit in the response headers of each answer, with different header names per vendor, while Stripe's vendor documentation document the 429 and the backoff, not a meter you can read. This article walks through those four angles using only what the vendors' documentation actually say, and flags the places where the pages deliberately stay silent.

02

What an API is, per four docs that assume you already know

None of the four vendors opens with a definition, so their introductions are worth reading for what they treat as given. Stripe says its API "is organized around REST," with predictable resource-oriented URLs, form-encoded request bodies, JSON-encoded responses, and standard HTTP response codes, authentication and verbs. Anthropic calls its API "a RESTful API at https://api.anthropic.com" and immediately lists the surfaces it covers: Messages for conversational calls, Message Batches for asynchronous bulk work at a documented 50 percent cost reduction, Token Counting for pre-flight cost checks, Models, Files, Skills, and, in beta, Agents, Sessions and Environments for its managed agent infrastructure. OpenAI's overview starts with a routing decision instead: pick your surface first, Responses for direct model requests and stateful interactions, Realtime for low-latency voice sessions over WebRTC, WebSocket or SIP, Administration for organization workflows like users, projects, API keys and audit logs, then create credentials, install an official client library or call HTTP directly, and review errors, rate limits and request-ID logging before production. GitHub's quickstart does not describe the API at all; it shows you three ways to touch it within a page, the GitHub CLI, Octokit.js from JavaScript, or curl, and spends the rest of its length on the part that actually hurts beginners: authentication.

The shared skeleton underneath all fourThe shared skeleton underneath all four is this article's synthesis of the vendors' documentation: an API is a set of URLs that behave like nouns, HTTP verbs that behave like actions on those nouns, headers that carry identity and metadata, a body that carries your input, and a response that carries a status code, data, and housekeeping information about your account's limits.
Every vendor dresses that skeleton differentlyEvery vendor dresses that skeleton differently, but nobody replaces it. the URL names the thing /v1/messages, /v1/charges, /repos/{owner}/{repo}/issues The verb names the action GET reads, POST creates, one object per request at Stripe headers carry identity Authorization: Bearer... or The key as Basic-auth username The body carries the input JSON at OpenAI and Anthropic, form-encoded at Stripe The response answers all of it status code + data + headers that report your rate-limit state Two details in that skeleton are easy to miss and cheap to learn now.
Second, the body format differs by vendor and it is documentedNot guessed: Anthropic requires a content-type of application/json, while Stripe's reference says it accepts form-encoded request bodies.
Your AI builderYour AI builder will get this right if the right page is in front of it, and will guess if it is not, which is one reason this article links every claim to the page it came from.

What an API is, per four docs that assume you already know

None of the four vendors opens with a definition, so their introductions are worth reading for what they treat as given. Stripe says its API "is organized around REST," with predictable resource-oriented URLs, form-encoded request bodies, JSON-encoded responses, and standard HTTP response codes, authentication and verbs. Anthropic calls its API "a RESTful API at https://api.anthropic.com" and immediately lists the surfaces it covers: Messages for conversational calls, Message Batches for asynchronous bulk work at a documented 50 percent cost reduction, Token Counting for pre-flight cost checks, Models, Files, Skills, and, in beta, Agents, Sessions and Environments for its managed agent infrastructure. OpenAI's overview starts with a routing decision instead: pick your surface first, Responses for direct model requests and stateful interactions, Realtime for low-latency voice sessions over WebRTC, WebSocket or SIP, Administration for organization workflows like users, projects, API keys and audit logs, then create credentials, install an official client library or call HTTP directly, and review errors, rate limits and request-ID logging before production. GitHub's quickstart does not describe the API at all; it shows you three ways to touch it within a page, the GitHub CLI, Octokit.js from JavaScript, or curl, and spends the rest of its length on the part that actually hurts beginners: authentication.

The shared skeleton underneath all four is this article's synthesis of the vendors' documentation: an API is a set of URLs that behave like nouns, HTTP verbs that behave like actions on those nouns, headers that carry identity and metadata, a body that carries your input, and a response that carries a status code, data, and housekeeping information about your account's limits. Every vendor dresses that skeleton differently, but nobody replaces it.

the URL names the thing/v1/messages, /v1/charges,/repos/{owner}/{repo}/issuesThe verb names the actionGET reads, POST creates,one object per request at Stripeheaders carry identityAuthorization: Bearer ... orThe key as Basic-auth usernameThe body carries the inputJSON at OpenAI and Anthropic,form-encoded at StripeThe response answers all of itstatus code + data + headers thatreport your rate-limit state

Two details in that skeleton are easy to miss and cheap to learn now. First, Stripe states plainly that its API does not support bulk updates: you work on one object per request. Loops are your job, not the API's. Second, the body format differs by vendor and it is documented, not guessed: Anthropic requires a content-type of application/json, while Stripe's reference says it accepts form-encoded request bodies. Your AI builder will get this right if the right page is in front of it, and will guess if it is not, which is one reason this article links every claim to the page it came from.

03

Who is calling: keys, tokens and the one key that is safe to show

Every vendor page agrees on the mechanics of proving identity: your request carries a credential in a header, over HTTPS, and the vendor's server decides what that credential may do. They agree on something else too, and they say it in nearly the same words. OpenAI: your API key is a secret, do not expose it in client-side code such as browsers or apps, load it from an environment variable or a key management service on the server. Stripe: do not embed secret or restricted keys in source code or client-side applications; use your server platform's secrets vault, or environment variables if no vault exists. GitHub: treat your access token like a password, and never include an OAuth app's client secret in client-side code or code that runs on a user's device. Anthropic's overview routes key creation through its Console, where you choose each key's type and expiration at creation time, and its SDKs then send the authentication headers for you. Four vendors, one rule: the credential lives on the server, and anything shipped to a browser, a phone or a repository is a leak.

The header itself differs by vendorThe header itself differs by vendor, and the differences are documented down to the punctuation.
OpenAI uses HTTP Bearer authenticationOpenAI uses HTTP Bearer authentication, an Authorization header whose value is the word Bearer, a space, and your API key or a short-lived access token from workload identity federation.
Anthropic accepts the same Bearer shapeAnthropic accepts the same Bearer shape, or the legacy x-api-key header, and additionally requires an anthropic-version header on every request, with a date such as 2026-10-21, plus an anthropic-workspace-id header when your key is not scoped to a single workspace.
Stripe uses HTTP Basic Auth insteadStripe uses HTTP Basic Auth instead, the API key goes in as the username, with no password at all, and its docs note the trailing colon in the curl example is what stops curl from prompting for one.
GitHub accepts either Authorization, Bearer or AuthorizationToken for most tokens, but requires Bearer specifically when the credential is a JSON web token.

Who is calling: keys, tokens and the one key that is safe to show

Every vendor page agrees on the mechanics of proving identity: your request carries a credential in a header, over HTTPS, and the vendor's server decides what that credential may do. They agree on something else too, and they say it in nearly the same words. OpenAI: your API key is a secret, do not expose it in client-side code such as browsers or apps, load it from an environment variable or a key management service on the server. Stripe: do not embed secret or restricted keys in source code or client-side applications; use your server platform's secrets vault, or environment variables if no vault exists. GitHub: treat your access token like a password, and never include an OAuth app's client secret in client-side code or code that runs on a user's device. Anthropic's overview routes key creation through its Console, where you choose each key's type and expiration at creation time, and its SDKs then send the authentication headers for you. Four vendors, one rule: the credential lives on the server, and anything shipped to a browser, a phone or a repository is a leak.

The header itself differs by vendor, and the differences are documented down to the punctuation. OpenAI uses HTTP Bearer authentication: an Authorization header whose value is the word Bearer, a space, and your API key or a short-lived access token from workload identity federation. Anthropic accepts the same Bearer shape, or the legacy x-api-key header, and additionally requires an anthropic-version header on every request, with a date such as 2026-10-21, plus an anthropic-workspace-id header when your key is not scoped to a single workspace. Stripe uses HTTP Basic Auth instead: the API key goes in as the username, with no password at all, and its docs note the trailing colon in the curl example is what stops curl from prompting for one. GitHub accepts either Authorization: Bearer or Authorization: token for most tokens, but requires Bearer specifically when the credential is a JSON web token. None of this is interchangeable, and all of it is on the cited pages.

The exception that names itself: publishable keys

On the vendors' documentation, exactly one vendor documents a key type designed to be exposed, and it is worth being precise about what that means. Stripe's publishable keys, which start with pk_, are for Stripe.js, Elements and the mobile SDKs: they can identify your account and create tokens or PaymentMethods from payment details, but they cannot perform sensitive operations such as creating charges or reading account data. A publishable key is best understood as an identifier with a narrow capability, not a secret credential. Stripe's other key types are explicitly not safe to expose: restricted keys (rk_) carry permissions you configure and exist to limit the damage a leaked key can do, secret keys (sk_) are unrestricted, and Stripe says it does not recommend secret keys for new use cases at all, recommending migration to restricted keys for existing ones.

publishable (pk_): safe to exposeidentifies your account; tokenizes payment details;cannot charge, cannot read account datarestricted (rk_): server-side onlypermissions you configure; make as many as you need;Stripe's recommended defaultsecret (sk_): server-side onlyunrestricted; not recommended for new use cases;migrate existing usage to restricted keys

Stripe adds one more key distinction that builders mix up constantly: the same key types exist twice, once for sandboxes and once for live mode. Sandbox keys start with sk_test_, rk_test_ or pk_test_; live keys start with sk_live_, rk_live_ or pk_live_. The key you send decides which world the request runs in, and objects do not cross the boundary: a sandbox product cannot be part of a live payment. Sandboxes never touch banking networks, so the entire build-and-test phase can happen with simulated objects, and Stripe recommends a separate general sandbox for new integrations so test settings and data stay isolated.

Tokens that expire on purpose

The vendor documentation also document a second credential philosophy: instead of a long-lived key, exchange something short-lived. All four vendors describe a version of it. OpenAI and Anthropic both support workload identity federation, where your service trades a short-lived identity token from its cloud provider for API access; Anthropic's flow mints the token from POST /v1/oauth/token, and Stripe's equivalent access token expires after one hour. GitHub's Actions workflows get a built-in GITHUB_TOKEN so you do not create a token at all, and GitHub App installation access tokens expire after 60 minutes by design. The pattern, this article's synthesis of the four pages, is that the industry is moving credentials from things you store to things that expire: a token that lives for an hour is a smaller prize than a key that lives forever in an environment variable.

When the caller is an agent

One vendor page goes further than key hygiene and addresses the reader of this blog directly. Stripe documents agent-tagged restricted keys: when you create a restricted key, you can tag it as belonging to an autonomous agent. The tag changes nothing about authentication or permissions; what it adds is governance. Agent-tagged keys are automatically subject to approval rules, which require a designated reviewer to approve sensitive actions before they take effect, and Stripe provides default rules covering high-risk actions such as payouts, refunds and account configuration changes when you create your first agent-tagged key. Stripe calls this the recommended way to give autonomous agents access to your Stripe account, and describes the approval rules as a safeguard against agent mistakes, unexpected behavior and hallucinations. On the vendors' documentation, no other vendor documents an equivalent agent-specific credential feature; that is a statement about these pages, not about what any vendor's wider documentation set may contain.

04

GitHub's credential zoo, and why the docs keep pushing you to an App

GitHub's vendor documentation document a whole zoo of credential types, and the distinctions are not academic because the rate limits attach to the credential, not to you. A personal access token acts as you and spends from your personal 5,000 requests per hour. A GitHub App acting on your behalf spends from the same personal budget, unless the app is owned by a GitHub Enterprise Cloud organization, in which case on-behalf requests get 15,000 per hour. An App authenticating as an installation, acting as itself rather than on your behalf, gets its own budget: 5,000 per hour minimum, 15,000 on Enterprise Cloud organizations, and otherwise a formula that adds 50 requests per hour for every repository past 20 and every organization user past 20, capped at 12,500. An OAuth app acting on your behalf again spends from your personal budget, while an OAuth app fetching public data with its own client ID and client secret gets a separate 5,000 per hour per app. And inside GitHub Actions, the built-in GITHUB_TOKEN gets 1,000 requests per hour per repository, 15,000 against Enterprise Cloud resources.

Two documented consequences fall out of that zoo
First, budgets interact in the direction you would not guessGitHub's own example shows that when a 15,000-per-hour app makes 10,000 requests on your behalf, your personal 5,000 budget is exhausted even though the app has 5,000 of its own remaining.
Second, the page's explicit advice for organizationsSecond, the page's explicit advice for organizations is to replace personal access tokens in automation with a GitHub App, partly because installation tokens expire after 60 minutes instead of living forever, and partly because the installation budget scales with the size of the organization instead of being pinned to one person's account.
One specialist corner of GitHub's limits is worth a paragraph because it breaks the requests-per-hour pattern: Git LFS
Uploading or downloading large-fileUploading or downloading large-file storage content counts against a separate bucket, 300 requests per minute unauthenticated and 3,000 per minute authenticated, and because the LFS batch API moves 100 objects per request by default, those translate to 30,000 and 300,000 objects per minute.

GitHub's credential zoo, and why the docs keep pushing you to an App

GitHub's vendor documentation document a whole zoo of credential types, and the distinctions are not academic because the rate limits attach to the credential, not to you. A personal access token acts as you and spends from your personal 5,000 requests per hour. A GitHub App acting on your behalf spends from the same personal budget, unless the app is owned by a GitHub Enterprise Cloud organization, in which case on-behalf requests get 15,000 per hour. An App authenticating as an installation, acting as itself rather than on your behalf, gets its own budget: 5,000 per hour minimum, 15,000 on Enterprise Cloud organizations, and otherwise a formula that adds 50 requests per hour for every repository past 20 and every organization user past 20, capped at 12,500. An OAuth app acting on your behalf again spends from your personal budget, while an OAuth app fetching public data with its own client ID and client secret gets a separate 5,000 per hour per app. And inside GitHub Actions, the built-in GITHUB_TOKEN gets 1,000 requests per hour per repository, 15,000 against Enterprise Cloud resources.

Two documented consequences fall out of that zoo. First, budgets interact in the direction you would not guess: GitHub's own example shows that when a 15,000-per-hour app makes 10,000 requests on your behalf, your personal 5,000 budget is exhausted even though the app has 5,000 of its own remaining. Second, the page's explicit advice for organizations is to replace personal access tokens in automation with a GitHub App, partly because installation tokens expire after 60 minutes instead of living forever, and partly because the installation budget scales with the size of the organization instead of being pinned to one person's account. If your builder wired your company's automation to a founder's personal token, the vendor's documentation is the citation for changing it.

One specialist corner of GitHub's limits is worth a paragraph because it breaks the requests-per-hour pattern: Git LFS. Uploading or downloading large-file storage content counts against a separate bucket, 300 requests per minute unauthenticated and 3,000 per minute authenticated, and because the LFS batch API moves 100 objects per request by default, those translate to 30,000 and 300,000 objects per minute. The lesson generalizes within the reviewed set: when a vendor documents a separate bucket, the headline limit is not the whole story, and the only safe place to learn your real ceiling is the limits page for the specific thing you are doing.

05

Keeping keys alive: vaults, rotation and tripwires

Creating a key is the beginning of its lifecycle, and Stripe's key management page is the most operational of the reviewed sources on what comes after. Store sensitive keys in a secrets vault or in environment variables, never in source code or configuration files checked into version control, and never shared over email or chat. Rotate keys when team members who had access leave. And when you rotate, do it the way the page describes to avoid downtime: a rotation in the Dashboard keeps both the old and the new key working for up to 7 days, which gives you a grace period to migrate gradually; roll the new key out to a small subset of servers first, watch the logs, and expire the old key only after its request volume has sat at zero for hours or days. If 7 days is not enough, create a new key manually, migrate, then expire the old one.

Two more Stripe lifecycle facts are worth knowing before they surprise you
In live mode, a key you createIn live mode, a key you create, In live mode, a key you create is displayed once and cannot be revealed again; if you lose it, you rotate or delete it and create another, because Stripe cannot recover it for you.
OpenAI's vendor page adds the other end of the lifecycleRevoking an API key takes effect within a few seconds, while most other authentication-affecting updates propagate within 15 minutes and can take longer, which matters when you are standing in an incident wondering whether the kill switch worked. create scoped restricted, not secret store in a vault or environment variables rotate with grace old + new work up to 7 days expire the old key after traffic sits at zero The lifecycle as Stripe documents it; revocation timing from OpenAI's page Stripe also documents a tripwire most builders have never heard of: access policies.
You can attachYou can attach a policy to a live key that restricts where requests may come from, either an explicit list of IPv4 addresses or CIDR ranges, or an advanced policy mixing allowed ASNs, allowed countries, and blocked source categories such as anonymous VPNs, public proxies, residential proxies and Tor exit nodes, with multiple rules combined by AND logic.
A request from somewhere the policyA request from somewhere the policy does not allow is blocked and you get notified, which turns a leaked key into an alert.

Keeping keys alive: vaults, rotation and tripwires

Creating a key is the beginning of its lifecycle, and Stripe's key management page is the most operational of the reviewed sources on what comes after. Store sensitive keys in a secrets vault or in environment variables, never in source code or configuration files checked into version control, and never shared over email or chat. Rotate keys when team members who had access leave. And when you rotate, do it the way the page describes to avoid downtime: a rotation in the Dashboard keeps both the old and the new key working for up to 7 days, which gives you a grace period to migrate gradually; roll the new key out to a small subset of servers first, watch the logs, and expire the old key only after its request volume has sat at zero for hours or days. If 7 days is not enough, create a new key manually, migrate, then expire the old one.

Two more Stripe lifecycle facts are worth knowing before they surprise you. In live mode, a key you create is displayed once and cannot be revealed again; if you lose it, you rotate or delete it and create another, because Stripe cannot recover it for you. And a key that has not created transfers, payouts or payout destinations in over 180 days gets its access limited for those specific actions until you restore it from the API keys page. OpenAI's vendor page adds the other end of the lifecycle: revoking an API key takes effect within a few seconds, while most other authentication-affecting updates propagate within 15 minutes and can take longer, which matters when you are standing in an incident wondering whether the kill switch worked.

create scopedrestricted, not secretstore in a vaultor environment variablesrotate with graceold + new work up to 7 daysexpire the old keyafter traffic sits at zeroThe lifecycle as Stripe documents it; revocation timing from OpenAI's page

Stripe also documents a tripwire most builders have never heard of: access policies. You can attach a policy to a live key that restricts where requests may come from, either an explicit list of IPv4 addresses or CIDR ranges, or an advanced policy mixing allowed ASNs, allowed countries, and blocked source categories such as anonymous VPNs, public proxies, residential proxies and Tor exit nodes, with multiple rules combined by AND logic. A request from somewhere the policy does not allow is blocked and you get notified, which turns a leaked key into an alert. Stripe recommends access policies on all live mode keys for exactly that reason.

06

The answer you get back: status codes and error vocabularies

Stripe's reference states the convention all four vendors rely on: 2xx codes mean success, 4xx codes mean the request failed given the information provided, and 5xx codes mean a problem on the vendor's side, which Stripe notes are rare and, in its error-type table, "extremely uncommon." The 4xx family is where builders live. Stripe's own status table includes 400 for an unacceptable request, 401 for no valid API key, 402 for a request whose parameters were valid but that failed anyway, the classic declined-card shape, 403 for a key without the required permission, 404 for a missing resource, 409 for a conflicting request such as a re-used idempotency key, 424 for a failed external dependency, and 429 for too many requests, with a recommendation of exponential backoff.

Below the status code, each vendor publishes an error vocabularyBelow the status code, each vendor publishes an error vocabulary, And they are not the same vocabulary.
Stripe's errors carry a type, one of api_error, card_errorIdempotency_error or invalid_request_error, plus fields like a machine-readable code, an issuer decline_code for card failures, a human message that Stripe says can be shown to your users for card errors, and the offending param when the error is parameter-specific.
Anthropic's 429 responses carry error type rate_limit_errorAnthropic's 429 responses carry error type rate_limit_error, But its spend-cap response is a special case: the same rate_limit_error type with an error_code of enforced_spend_limit_reached in the details, and, critically, no retry-after header, because retrying cannot fix a monthly cap.
OpenAI's pages drawOpenAI's pages draw the same kind of line between 429 with a slow_down code, meaning your traffic ramped too fast, and 503 with server_is_overloaded, meaning the model itself is temporarily overloaded, and warns that other errors share those HTTP statuses, so you inspect the error body before choosing a recovery.
GitHub's rate-limited responses can arrive as either 403 or 429GitHub's rate-limited responses can arrive as either 403 or 429, Which surprises people who learned the 2xx/4xx/5xx rule as "4xx is your fault": a 403 from GitHub might mean your key lacks permission, or it might mean you are simply out of requests for the hour.

The answer you get back: status codes and error vocabularies

Stripe's reference states the convention all four vendors rely on: 2xx codes mean success, 4xx codes mean the request failed given the information provided, and 5xx codes mean a problem on the vendor's side, which Stripe notes are rare and, in its error-type table, "extremely uncommon." The 4xx family is where builders live. Stripe's own status table includes 400 for an unacceptable request, 401 for no valid API key, 402 for a request whose parameters were valid but that failed anyway, the classic declined-card shape, 403 for a key without the required permission, 404 for a missing resource, 409 for a conflicting request such as a re-used idempotency key, 424 for a failed external dependency, and 429 for too many requests, with a recommendation of exponential backoff.

Below the status code, each vendor publishes an error vocabulary, and they are not the same vocabulary. Stripe's errors carry a type, one of api_error, card_error, idempotency_error or invalid_request_error, plus fields like a machine-readable code, an issuer decline_code for card failures, a human message that Stripe says can be shown to your users for card errors, and the offending param when the error is parameter-specific. Anthropic's 429 responses carry error type rate_limit_error, but its spend-cap response is a special case: the same rate_limit_error type with an error_code of enforced_spend_limit_reached in the details, and, critically, no retry-after header, because retrying cannot fix a monthly cap. Anthropic's docs tell you to use that error_code to tell a spend cap apart from a rate limit. OpenAI's pages draw the same kind of line between 429 with a slow_down code, meaning your traffic ramped too fast, and 503 with server_is_overloaded, meaning the model itself is temporarily overloaded, and warns that other errors share those HTTP statuses, so you inspect the error body before choosing a recovery. GitHub's rate-limited responses can arrive as either 403 or 429, which surprises people who learned the 2xx/4xx/5xx rule as "4xx is your fault": a 403 from GitHub might mean your key lacks permission, or it might mean you are simply out of requests for the hour.

2xx: it workedread the data, then read the rate-limit headers4xx: the request failed as given401 no valid key | 402 valid but failed (the declined card)403 no permission, or a GitHub rate limit | 404 not found409 conflict, such as a re-used idempotency key | 424 external dependency429 too fast, or a spend cap: read the body before you retryAnthropic's spend-cap 429 has no retry-after; OpenAI's slow_down means ramp, not quota5xx: the vendor's siderare per Stripe; OpenAI's 503 server_is_overloaded means try again laterstatus meanings per the reviewed Stripe, OpenAI, Anthropic and GitHub pages
07

The speed limit: how rate limits actually work

OpenAI's rate limit guide gives the most direct statement of the idea: rate limits restrict how many times a user or client can access the service within a period, and they exist to protect against abuse, to keep access fair, and to manage aggregate load on shared infrastructure. Anthropic's page adds the framing every builder should internalize: the limits it publishes are maximum allowed usage, not guaranteed minimums. GitHub's page adds a third honest note: its secondary rate limits can change without notice and can be hit for undisclosed reasons. The speed limit is real, it is not a promise of capacity, and some of its sensors are deliberately opaque.

What is being counted The four vendors count different thingsWhat is being counted The four vendors count different things, And the units are the first thing to check on any limits page.
OpenAI measures RPM (requests per minute)RPD (requests per day), TPM (tokens per minute), TPD (tokens per day), IPM (images per minute) and audio minutes for some streaming models, and whichever limit you hit first is the one that stops you: 20 tiny requests can exhaust a 20 RPM limit while your 150,000 TPM sits almost untouched.
Anthropic measures RPMAnthropic measures RPM, input tokens per minute and output tokens per minute per model class, with a twist worth reading twice: its default input-token limits count only uncached input tokens.
Tokens read from prompt cache do not countTokens read from prompt cache do not count, so Anthropic's own example shows a 2,000,000 input-token-per-minute limit with an 80 percent cache hit rate effectively processing 10,000,000 total input tokens per minute.
Output limits count tokens as they are actually generatedOutput limits count tokens as they are actually generated, In real time, and the max_tokens parameter does not factor in, so there is no rate-limit penalty for setting it high.

The speed limit: how rate limits actually work

OpenAI's rate limit guide gives the most direct statement of the idea: rate limits restrict how many times a user or client can access the service within a period, and they exist to protect against abuse, to keep access fair, and to manage aggregate load on shared infrastructure. Anthropic's page adds the framing every builder should internalize: the limits it publishes are maximum allowed usage, not guaranteed minimums. GitHub's page adds a third honest note: its secondary rate limits can change without notice and can be hit for undisclosed reasons. The speed limit is real, it is not a promise of capacity, and some of its sensors are deliberately opaque.

What is being counted

The four vendors count different things, and the units are the first thing to check on any limits page. OpenAI measures RPM (requests per minute), RPD (requests per day), TPM (tokens per minute), TPD (tokens per day), IPM (images per minute) and audio minutes for some streaming models, and whichever limit you hit first is the one that stops you: 20 tiny requests can exhaust a 20 RPM limit while your 150,000 TPM sits almost untouched. Anthropic measures RPM, input tokens per minute and output tokens per minute per model class, with a twist worth reading twice: its default input-token limits count only uncached input tokens. Tokens read from prompt cache do not count, so Anthropic's own example shows a 2,000,000 input-token-per-minute limit with an 80 percent cache hit rate effectively processing 10,000,000 total input tokens per minute. Output limits count tokens as they are actually generated, in real time, and the max_tokens parameter does not factor in, so there is no rate-limit penalty for setting it high. GitHub counts requests per hour, and the number depends on who is asking: 60 per hour unauthenticated, tied to your IP address; 5,000 per hour authenticated; 15,000 per hour when a GitHub App or OAuth app owned by a GitHub Enterprise Cloud organization acts on your behalf. Stripe's vendor documentation publish no numeric rate limits at all; they say only that 429 means too many requests hit the API too quickly and recommend exponential backoff. This article does not invent numbers to fill that silence.

GitHub also documents a second layer that trips people who think they are under the limit: secondary rate limits. No more than 100 concurrent requests across REST and GraphQL combined. No more than 900 points per minute against REST endpoints, where most GET, HEAD and OPTIONS requests cost 1 point and most POST, PATCH, PUT and DELETE requests cost 5. No more than 90 seconds of CPU time per 60 seconds of real time. Content creation is limited separately, roughly 80 content-generating requests per minute and 500 per hour, and actions taken on the GitHub web interface count toward those numbers too, a detail documented on the vendor's documentation and found, within this reviewed set, only there. There is no way to check your secondary rate limit status; the first sign is the error.

Tiers: the limit is a function of your history

Both model vendors tie limits to usage tiers that rise automatically. OpenAI's tiers are Free (open to users in allowed geographies), then Build, Launch and Grow, qualified by total credit purchases of $5, $100 and $500, carrying monthly usage limits of $100, $500, $5,000 and $200,000 respectively. Anthropic's tiers are Start, Build, Scale and Custom, with monthly spend caps of $500, $1,000, $200,000 and none, and its page warns that new organizations may begin in an Evaluation tier with limits below the published standard ones while account history is established, a fraud-prevention measure that lifts automatically. GitHub's ladder is about authentication method and organization type rather than spend: the same person gets 60 requests per hour anonymous, 5,000 authenticated, and 15,000 through an Enterprise Cloud app, and GitHub App installations outside Enterprise Cloud scale from 5,000 per hour upward by 50 per hour per repository past 20 and per organization user past 20, capped at 12,500. The shared lesson, this article's synthesis: your rate limit is not a property of the API, it is a property of your relationship with the vendor, and the cheapest upgrade is usually authenticating at all.

OpenAI usage tiersqualify by total credit purchasesFree: allowed geography$100 / month usageBuild: $5 purchased$500 / monthLaunch: $100 purchased$5,000 / monthGrow: $500 purchased$200,000 / monthAnthropic usage tiersmonthly spend caps; Evaluation tier may precedeStart$500 / month capBuild$1,000 / month capScale$200,000 / month capCustomno cap; arranged with account teamtier tables from each vendor's rate limit page;tiers describe limits, not model access

Anthropic's tier numbers come with a second subtlety its page states plainly: limits are maximums, and 60 RPM might be enforced as one request per second, so a short burst can trip a limit you are "under." Anthropic uses a token bucket algorithm, meaning capacity replenishes continuously rather than resetting at fixed intervals. Both model vendors also document ramp limits, a cap on how fast your usage may grow. Anthropic's ramp limit is your recent peak per-minute usage on a model plus a step, rising as your successful usage grows and falling after quiet periods; exceed it and you get a 429 with error_code ramp_limit_exceeded even while you are under your published RPM and token limits. OpenAI's version returns slow_down and offers a rule of thumb: once traffic reaches 1 million input tokens per minute, increase it by no more than 50 percent every 15 minutes. The practical reading for a builder: launching a marketing campaign that 10x-es your app's traffic in an hour is itself a way to get throttled, even on a paid tier, even under your nominal limits.

The headers are the speedometer

Here is the fact this article most wants you to keep: on the vendors' documentation, three of the four vendors, OpenAI, Anthropic and GitHub, document returning your current rate-limit state in response headers. Stripe's vendor documentation document the 429 and the backoff discipline, not a meter you can read between errors. OpenAI sends x-ratelimit-limit-requests, x-ratelimit-remaining-requests, x-ratelimit-reset-requests and the token equivalents, plus project-scoped variants when a project limit applies, and may add Retry-After to 429 and 503 responses. Anthropic sends an anthropic-ratelimit-* family with limit, remaining and reset values for requests, tokens, input tokens and output tokens, reset expressed as RFC 3339 timestamps, and the headers reflect the most restrictive limit currently in effect, including workspace-level ones. GitHub sends x-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-used, x-ratelimit-reset in UTC epoch seconds, and x-ratelimit-resource to say which bucket the request counted against, and its page notes the headers are authoritative when they disagree with the GET /rate_limit endpoint because requests are processed in multiple regions. You do not have to guess when to slow down; the answer you just received tells you. GitHub adds the matching design rule: use the headers to pace yourself, but do not write logic that depends on an exact remaining count.

OpenAI: x-ratelimit-*limit / remaining / reset for requests and tokens,plus project-token variants; Retry-After on 429 and 503Anthropic: anthropic-ratelimit-*requests, tokens, input and output; resets as RFC 3339;shows the most restrictive limit in effect, workspaces includedGitHub: x-ratelimit-*limit, remaining, used, reset (epoch seconds), resource;headers outrank the /rate_limit endpoint when they disagree
08

When the limit bites: 429, Retry-After and the discipline of backing off

Every vendor page converges on the same playbook for the moment you hit the wall, and the details matter more than the headline. If the response carries a Retry-After or retry-after header, treat it as a minimum: wait at least that long, and add a small random delay so a fleet of clients does not retry in lockstep. If there is no such header, fall back to exponential backoff with jitter, waiting briefly, then doubling, and cap both the number of attempts and the total time spent. OpenAI notes that its official SDKs already retry eligible 429 and 503 responses subject to their own settings, and that if the server's requested delay exceeds the SDK's supported maximum, you should defer the request rather than retry sooner; it also warns that unsuccessful requests still count toward your per-minute limit, so hammering the API makes the problem worse, not better. Anthropic's guidance for ramp limits is behavioral: hold traffic where requests succeed, increase by at most one step per minute, and start bulk jobs low and spread them out.

A primary-limit failure arrivesA primary-limit failure arrives as 403 or 429 with x-ratelimit-remaining at 0; do not retry until the time in x-ratelimit-reset.
A secondary-limit failure arrivesA secondary-limit failure arrives as 403 or 429 with a message saying so; honor retry-after if present, otherwise wait at least one minute, then back off exponentially.
429 (or 403 at GitHub)429 (or 403 at GitHub) read the error body before reacting retryable slowdown Retry-After is a minimum; add jitter; else exponential backoff, capped not retryable spend caps, quota and billing errors: fix the account, not the timing failed attempts still count toward your per-minute limit (OpenAI); continuing while limited can get an integration banned (GitHub) The vendor documentation also document the escape hatches for work that does not fit inside a per-minute world.
OpenAI's Batch APIOpenAI's Batch API and Anthropic's Message Batches API both exist for large volumes that do not need immediate answers; Anthropic's batches carry a documented 50 percent cost reduction and their own, separate rate limits, 1,000 to 4,000 requests per minute and 200,000 to 500,000 batch requests in the processing queue depending on tier, and Anthropic's batches are exempt from ramp limits.
OpenAI's batch and backgroundOpenAI's batch and background requests draw on a separate cap on queued input tokens, counted at submission and released when the job completes.

When the limit bites: 429, Retry-After and the discipline of backing off

Every vendor page converges on the same playbook for the moment you hit the wall, and the details matter more than the headline. If the response carries a Retry-After or retry-after header, treat it as a minimum: wait at least that long, and add a small random delay so a fleet of clients does not retry in lockstep. If there is no such header, fall back to exponential backoff with jitter, waiting briefly, then doubling, and cap both the number of attempts and the total time spent. OpenAI notes that its official SDKs already retry eligible 429 and 503 responses subject to their own settings, and that if the server's requested delay exceeds the SDK's supported maximum, you should defer the request rather than retry sooner; it also warns that unsuccessful requests still count toward your per-minute limit, so hammering the API makes the problem worse, not better. Anthropic's guidance for ramp limits is behavioral: hold traffic where requests succeed, increase by at most one step per minute, and start bulk jobs low and spread them out.

GitHub's page adds the sharpest consequence in the reviewed set: continuing to make requests while you are rate limited may result in your integration being banned. Its rules are precise. A primary-limit failure arrives as 403 or 429 with x-ratelimit-remaining at 0; do not retry until the time in x-ratelimit-reset. A secondary-limit failure arrives as 403 or 429 with a message saying so; honor retry-after if present, otherwise wait at least one minute, then back off exponentially. And both OpenAI and Anthropic warn against retrying errors that retries cannot fix: quota and billing errors at OpenAI, and at Anthropic the spend-cap 429, where the documented response has no retry-after at all and nothing succeeds until access resumes at 00:00 UTC on the first of the next month or a higher tier is approved.

429 (or 403 at GitHub)read the error body before reactingretryable slowdownRetry-After is a minimum; add jitter;else exponential backoff, cappednot retryablespend caps, quota and billing errors:fix the account, not the timingfailed attempts still count toward your per-minute limit (OpenAI);continuing while limited can get an integration banned (GitHub)

The vendor documentation also document the escape hatches for work that does not fit inside a per-minute world. OpenAI's Batch API and Anthropic's Message Batches API both exist for large volumes that do not need immediate answers; Anthropic's batches carry a documented 50 percent cost reduction and their own, separate rate limits, 1,000 to 4,000 requests per minute and 200,000 to 500,000 batch requests in the processing queue depending on tier, and Anthropic's batches are exempt from ramp limits. OpenAI's batch and background requests draw on a separate cap on queued input tokens, counted at submission and released when the job completes. And for the opposite problem, hitting a requests-per-minute ceiling while your token budget has headroom, OpenAI documents the old-fashioned fix: batch multiple tasks into each request.

09

Pagination and versioning: the boring parts that bite

List endpoints never return everything. Anthropic's overview documents the modern cursor pattern: a limit parameter for page size, a page parameter that takes the opaque next_page cursor from the previous response, and a data array alongside the cursors. Two traps are documented in the same breath: a page cursor is only valid with the sort order it was created with, and backward pagination exists only on GET /v1/sessions, where a prev_page cursor appears; other list endpoints omit the field entirely rather than returning null. The SDKs will auto-paginate for you, but forward only. And the scheme is not universal even inside one vendor: the Message Batches API, the Models API and several Admin endpoints use after_id and before_id with has_more, first_id and last_id instead. The generic skill is to read the pagination section of any API before writing the loop, because the cursor's name and rules are a per-vendor, sometimes per-endpoint, decision.

On versioning, OpenAI's overview makes the promise builders want to hear and then qualifies it honestly
It avoids breaking changesIt avoids breaking changes in major API versions whenever reasonably possible, across the REST API (currently v1), its first-party client libraries under semantic versioning, and model families, and it lists what counts as a backwards-compatible change: new resources, new optional parameters, new response properties, reordered JSON properties, changed lengths of opaque IDs, new streaming event types.
Anthropic pins behavior a different wayAnthropic pins behavior a different way, through the required anthropic-version header you send on every request.

Pagination and versioning: the boring parts that bite

List endpoints never return everything. Anthropic's overview documents the modern cursor pattern: a limit parameter for page size, a page parameter that takes the opaque next_page cursor from the previous response, and a data array alongside the cursors. Two traps are documented in the same breath: a page cursor is only valid with the sort order it was created with, and backward pagination exists only on GET /v1/sessions, where a prev_page cursor appears; other list endpoints omit the field entirely rather than returning null. The SDKs will auto-paginate for you, but forward only. And the scheme is not universal even inside one vendor: the Message Batches API, the Models API and several Admin endpoints use after_id and before_id with has_more, first_id and last_id instead. The generic skill is to read the pagination section of any API before writing the loop, because the cursor's name and rules are a per-vendor, sometimes per-endpoint, decision.

On versioning, OpenAI's overview makes the promise builders want to hear and then qualifies it honestly. It avoids breaking changes in major API versions whenever reasonably possible, across the REST API (currently v1), its first-party client libraries under semantic versioning, and model families, and it lists what counts as a backwards-compatible change: new resources, new optional parameters, new response properties, reordered JSON properties, changed lengths of opaque IDs, new streaming event types. But model prompting behavior between snapshots is explicitly subject to change, because model outputs are variable by nature; the documented defense is pinned model versions plus evals for your application, and a deprecations page for shutdown dates and replacements. Anthropic pins behavior a different way, through the required anthropic-version header you send on every request. Your code will outlive several model generations; the docs are telling you to decide, on purpose, which one it is talking to.

10

Two different brakes: rate limits and spend limits

The model vendors document two distinct braking systems, and conflating them causes real operational confusion. Rate limits govern speed: how many requests or tokens per minute you may use right now. Spend limits govern money: how much your organization may pay per month. Anthropic's page defines the pair explicitly, and the failure modes are different. Hit a rate limit and you get a 429 with a retry-after header; wait, and you are back. Hit Anthropic's tier spend cap and you get a 429 with no retry-after header, an error_code of enforced_spend_limit_reached, and a message stating the date access resumes, 00:00 UTC on the first day of the next month, unless you move to a higher tier sooner. Retrying is not just useless against a spend cap; the docs engineer the header away so your retry loop has nothing to chew on.

Both vendors also let you set your own brakes below theirsBoth vendors also let you set your own brakes below theirs, And the failure shape changes again.
OpenAI documents two controls, a spend alertOpenAI documents two controls, a spend alert, Which notifies you and lets traffic continue, and a hard spend limit, which starts returning 429 at your configured amount.
Anthropic lets you setAnthropic lets you set a monthly spend limit below your tier's cap, and reaching a limit you set yourself returns not a 429 but an HTTP 400 with type invalid_request_error and a message starting "You have reached your specified API usage limits," resuming at the stated time or when you raise the limit.
The builder's takeaway, this article's synthesisDecide before launch which brake you want to hit first, and make sure your error handling can tell the 429s apart, because "back off and retry" is the right answer to exactly one of these brakes. rate limit: speed 429, usually with retry-after wait, then you are back token bucket refills continuously spend limit: money tier cap: 429, no retry-after, back at 00:00 UTC on the 1st self-set limit at Anthropic: HTTP 400 your error handling must tell these apart: retry fixes exactly one of them documented on the OpenAI and Anthropic rate limit pages

Two different brakes: rate limits and spend limits

The model vendors document two distinct braking systems, and conflating them causes real operational confusion. Rate limits govern speed: how many requests or tokens per minute you may use right now. Spend limits govern money: how much your organization may pay per month. Anthropic's page defines the pair explicitly, and the failure modes are different. Hit a rate limit and you get a 429 with a retry-after header; wait, and you are back. Hit Anthropic's tier spend cap and you get a 429 with no retry-after header, an error_code of enforced_spend_limit_reached, and a message stating the date access resumes, 00:00 UTC on the first day of the next month, unless you move to a higher tier sooner. Retrying is not just useless against a spend cap; the docs engineer the header away so your retry loop has nothing to chew on.

Both vendors also let you set your own brakes below theirs, and the failure shape changes again. OpenAI documents two controls: a spend alert, which notifies you and lets traffic continue, and a hard spend limit, which starts returning 429 at your configured amount. Anthropic lets you set a monthly spend limit below your tier's cap, and reaching a limit you set yourself returns not a 429 but an HTTP 400 with type invalid_request_error and a message starting "You have reached your specified API usage limits," resuming at the stated time or when you raise the limit. Anthropic also lets an organization push limits down to individual workspaces, so one runaway project cannot starve the others, with the caveat documented on the page that Console playground and managed agent usage in the default workspace may not count against a workspace limit, only the organization one. The builder's takeaway, this article's synthesis: decide before launch which brake you want to hit first, and make sure your error handling can tell the 429s apart, because "back off and retry" is the right answer to exactly one of these brakes.

rate limit: speed429, usually with retry-afterwait, then you are backtoken bucket refills continuouslyspend limit: moneytier cap: 429, no retry-after,back at 00:00 UTC on the 1stself-set limit at Anthropic: HTTP 400your error handling must tell these apart:retry fixes exactly one of themdocumented on the OpenAI and Anthropic rate limit pages
11

How you touch it: CLIs, SDKs, curl and somebody else's cloud

The same API can be reached several ways, and the vendors' documentation are unusually candid about which one they prefer. GitHub's quickstart recommends the GitHub CLI for the command line, because gh auth login handles authentication once and gh api then speaks the REST API with no header plumbing; its curl section opens by telling you the CLI version of the same article exists for a reason. For JavaScript, GitHub points at Octokit.js, and all three of its examples end up in the same place when automation gets serious: a GitHub Actions workflow, where the built-in GITHUB_TOKEN is the recommended credential, stored for you, no personal token to leak. OpenAI's overview offers the same fork, an official client library from its libraries page or direct HTTP from any environment, and notes its libraries expose the x-request-id as a property on response objects so you do not parse headers by hand. Anthropic's page lists official SDKs for Python, TypeScript, C#, Go, Java, PHP and Ruby, and sells them on four behaviors you would otherwise hand-roll: automatic header management including the version header, type-safe requests, built-in retry logic, and streaming support.

Anthropic's overview documents oneAnthropic's overview documents one more routing decision that surprises people who thought "the AI assistant API" was one thing: you can also reach the AI assistant through cloud platforms.
The first-party APIThe first-party API gives you the newest models and features with Anthropic billing; the cloud options, the AI assistant Platform on the cloud provider, the AI assistant Models on Google Cloud in Anthropic-managed and Google-managed variants, Amazon Bedrock, and the cloud flow tool Foundry, integrate with the cloud provider's billing and IAM, and feature availability varies by platform.
The rate limit pageThe rate limit page notes that on the AI assistant Platform on the cloud provider, billing runs through the cloud provider Marketplace invoices rather than Anthropic credit purchases, per-workspace rate limit configuration and fast mode are unavailable, and the Console's limits page shows Custom tier for every organization regardless of its real tier.
Request size caps differ too32 MB messages on the Anthropic-operated platforms, 20 MB on Bedrock, 30 MB on the Google-managed option.
GitHub, three doorsOne API gh CLI (recommended for the terminal) | Octokit.js | curl in Actions, the built-in GITHUB_TOKEN is the recommended credential OpenAI: official client libraries or direct HTTP libraries surface x-request-id as a property on responses Anthropic: first-party API or cloud platforms the AI assistant Platform on the cloud provider | Google Cloud (Anthropic- or Google-managed) Amazon Bedrock | the cloud flow tool Foundry billing, IAM, feature availability and request size caps differ per platform entry paths as documented on the reviewed quickstart and overview pages The generic skill across all four, this article's synthesis: the vendor's official client or CLI is not a convenience layer, it is where the vendor puts the housekeeping you will otherwise forget, authentication headers, version headers, retries, pagination, request IDs.

How you touch it: CLIs, SDKs, curl and somebody else's cloud

The same API can be reached several ways, and the vendors' documentation are unusually candid about which one they prefer. GitHub's quickstart recommends the GitHub CLI for the command line, because gh auth login handles authentication once and gh api then speaks the REST API with no header plumbing; its curl section opens by telling you the CLI version of the same article exists for a reason. For JavaScript, GitHub points at Octokit.js, and all three of its examples end up in the same place when automation gets serious: a GitHub Actions workflow, where the built-in GITHUB_TOKEN is the recommended credential, stored for you, no personal token to leak. OpenAI's overview offers the same fork, an official client library from its libraries page or direct HTTP from any environment, and notes its libraries expose the x-request-id as a property on response objects so you do not parse headers by hand. Anthropic's page lists official SDKs for Python, TypeScript, C#, Go, Java, PHP and Ruby, and sells them on four behaviors you would otherwise hand-roll: automatic header management including the version header, type-safe requests, built-in retry logic, and streaming support.

Anthropic's overview documents one more routing decision that surprises people who thought "the AI assistant API" was one thing: you can also reach the AI assistant through cloud platforms. The first-party API gives you the newest models and features with Anthropic billing; the cloud options, the AI assistant Platform on the cloud provider, the AI assistant Models on Google Cloud in Anthropic-managed and Google-managed variants, Amazon Bedrock, and the cloud flow tool Foundry, integrate with the cloud provider's billing and IAM, and feature availability varies by platform. The difference is not cosmetic. The rate limit page notes that on the AI assistant Platform on the cloud provider, billing runs through the cloud provider Marketplace invoices rather than Anthropic credit purchases, per-workspace rate limit configuration and fast mode are unavailable, and the Console's limits page shows Custom tier for every organization regardless of its real tier. Request size caps differ too: 32 MB messages on the Anthropic-operated platforms, 20 MB on Bedrock, 30 MB on the Google-managed option. If your company already buys everything through a cloud marketplace, the vendors' documentation say you can keep doing that, but you inherit a slightly different API, and you should read the platform-specific page, not assume the first-party numbers apply.

GitHub: three doors, one APIgh CLI (recommended for the terminal) | Octokit.js | curlin Actions, the built-in GITHUB_TOKEN is the recommended credentialOpenAI: official client libraries or direct HTTPlibraries surface x-request-id as a property on responsesAnthropic: first-party API or cloud platformsthe AI assistant Platform on the cloud provider | Google Cloud (Anthropic- or Google-managed)Amazon Bedrock | the cloud flow tool Foundrybilling, IAM, feature availability and request size caps differ per platformentry paths as documented on the reviewed quickstart and overview pages

The generic skill across all four, this article's synthesis: the vendor's official client or CLI is not a convenience layer, it is where the vendor puts the housekeeping you will otherwise forget, authentication headers, version headers, retries, pagination, request IDs. Writing raw HTTP is a legitimate choice, shown in curl across the reviewed set and pinned down to the exact headers in Anthropic's overview, but it means you have volunteered to re-implement that housekeeping correctly, starting with the backoff discipline from the previous section.

12

The bottom line

An API stops being mysterious the moment you see the four questions every vendor's docs answer: how do you prove who is calling (a credential in a header, kept server-side, scoped as narrowly as the vendor allows), what does a call look like (a URL, a verb, a body whose format the vendor specifies), what does the answer mean (a status code plus a documented error vocabulary that differs per vendor), and how fast may you go (limits that live in tiers, count different units per vendor, and report their own state in response headers on every answer). The vendor documentation even agree on the meta-lesson: the housekeeping is documented, down to grace periods on key rotation, cache-aware token accounting, spend caps that refuse to give you a retry-after, and secondary limits that will not tell you their numbers. Whoever reads the page, you or your AI builder, the answers are there; the failures come from guessing across vendors. Read the page for the vendor you are calling, keep the narrow credential in the vault, watch the headers, and respect the retry-after you are given.

One last habitOne last habit costs nothing and pays out the first time something breaks: when a vendor's documentation and your memory disagree, the documentation is right, because these vendors version their APIs by date, rotate their tier tables, and retire models on published schedules.
Anthropic's vendor documentation alreadyAnthropic's vendor documentation already carry deprecation notes for the AI assistant Opus 4.5 and Sonnet 4.5 on the AI assistant API, and OpenAI's overview keeps a deprecations page for shutdown dates and recommended replacements.
Bookmark the five or six pages behind this article's claimsThey are the contract your app actually signed.

The bottom line

An API stops being mysterious the moment you see the four questions every vendor's docs answer: how do you prove who is calling (a credential in a header, kept server-side, scoped as narrowly as the vendor allows), what does a call look like (a URL, a verb, a body whose format the vendor specifies), what does the answer mean (a status code plus a documented error vocabulary that differs per vendor), and how fast may you go (limits that live in tiers, count different units per vendor, and report their own state in response headers on every answer). The vendor documentation even agree on the meta-lesson: the housekeeping is documented, down to grace periods on key rotation, cache-aware token accounting, spend caps that refuse to give you a retry-after, and secondary limits that will not tell you their numbers. Whoever reads the page, you or your AI builder, the answers are there; the failures come from guessing across vendors. Read the page for the vendor you are calling, keep the narrow credential in the vault, watch the headers, and respect the retry-after you are given.

One last habit costs nothing and pays out the first time something breaks: when a vendor's documentation and your memory disagree, the documentation is right, because these vendors version their APIs by date, rotate their tier tables, and retire models on published schedules. Anthropic's vendor documentation already carry deprecation notes for the AI assistant Opus 4.5 and Sonnet 4.5 on the AI assistant API, and OpenAI's overview keeps a deprecations page for shutdown dates and recommended replacements. Bookmark the five or six pages behind this article's claims; they are the contract your app actually signed.

13

Sources

Comparisons across vendors are labeled as this article's synthesis where they appear.

OpenAI API overview (vendor documentation)OpenAI API overview (vendor documentation), bearer authentication and workload identity federation, key handling and revocation timing, the 64 KiB header budget, response headers including openai-version and x-request-id, the caller-supplied X-Client-Request-Id and its 512-character ASCII rule, and the backwards-compatibility policy with its pinned-model advice.
OpenAI rate limits (vendor documentation)OpenAI rate limits (vendor documentation), the limit metrics and first-hit-wins behavior, the Free/Build/Launch/Grow tier table and monthly usage limits, spend alerts versus hard spend limits, the rate-limit response headers, slow_down versus server_is_overloaded, the 50 percent per 15 minutes ramp rule of thumb, batch and background token caps, and the retry guidance including the note that failed attempts still count.
The AI assistant API overview(platform.claude.com): the API surface list including Message Batches at a documented 50 percent cost reduction and the Token Counting API, the required anthropic-version header and workspace header behavior, request size limits per endpoint family, response headers including request-id and anthropic-workspace-id, the pagination schemes and SDK auto-pagination, the cloud platform options with their differing limits, and the official SDK list
The AI assistant API rate limits(platform.claude.com): spend limits versus rate limits, the Start/Build/Scale/Custom tier spend caps, the Evaluation tier, the token bucket algorithm, cache-aware ITPM accounting with its worked example, ramp limits and their error code, the spend-cap 429 with no retry-after and the self-set-limit 400, batch rate limits, workspace limits, and the anthropic-ratelimit-* header family
Stripe API reference (docs.stripe.com)Stripe API reference (docs.stripe.com), the REST organization and one-object-per-request rule, sandbox versus live mode, Basic auth with the key as username, HTTPS-only and authenticated-only requests, workload identity federation with one-hour tokens, and the full error taxonomy with its HTTP status summary.

Sources

Comparisons across vendors are labeled as this article's synthesis where they appear.

1. OpenAI API overview (vendor documentation): bearer authentication and workload identity federation, key handling and revocation timing, the 64 KiB header budget, response headers including openai-version and x-request-id, the caller-supplied X-Client-Request-Id and its 512-character ASCII rule, and the backwards-compatibility policy with its pinned-model advice.

2. OpenAI rate limits (vendor documentation): the limit metrics and first-hit-wins behavior, the Free/Build/Launch/Grow tier table and monthly usage limits, spend alerts versus hard spend limits, the rate-limit response headers, slow_down versus server_is_overloaded, the 50 percent per 15 minutes ramp rule of thumb, batch and background token caps, and the retry guidance including the note that failed attempts still count.

3. the AI assistant API overview (platform.claude.com): the API surface list including Message Batches at a documented 50 percent cost reduction and the Token Counting API, the required anthropic-version header and workspace header behavior, request size limits per endpoint family, response headers including request-id and anthropic-workspace-id, the pagination schemes and SDK auto-pagination, the cloud platform options with their differing limits, and the official SDK list.

4. the AI assistant API rate limits (platform.claude.com): spend limits versus rate limits, the Start/Build/Scale/Custom tier spend caps, the Evaluation tier, the token bucket algorithm, cache-aware ITPM accounting with its worked example, ramp limits and their error code, the spend-cap 429 with no retry-after and the self-set-limit 400, batch rate limits, workspace limits, and the anthropic-ratelimit-* header family.

5. Stripe API reference (docs.stripe.com): the REST organization and one-object-per-request rule, sandbox versus live mode, Basic auth with the key as username, HTTPS-only and authenticated-only requests, workload identity federation with one-hour tokens, and the full error taxonomy with its HTTP status summary.

6. Stripe API keys (docs.stripe.com): the publishable, restricted, secret and organization key types and which are safe to expose, agent-tagged keys and their approval rules, key storage and handling rules, the 7-day rotation grace period and gradual-rollout advice, one-time key display in live mode, the 180-day limited-access rule, and access policies with their IP, ASN, country and threat-category rules.

7. Quickstart for GitHub REST API (docs.github.com): the GitHub CLI, Octokit.js and curl entry paths, token handling warnings, GITHUB_TOKEN in Actions, and GitHub App installation tokens expiring after 60 minutes.

8. GitHub REST API rate limits (docs.github.com): the 60 / 5,000 / 15,000 requests-per-hour ladders and the installation scaling formula, the secondary rate limits including concurrency, points, CPU time and content-generation counts that include web UI actions, the x-ratelimit-* headers and their authority over the /rate_limit endpoint, the 403-or-429 failure shapes, the retry rules, and the ban warning for continuing while limited.

A wooden desk with glasses, a coffee cup, a plant and the edge of a laptop, banner image on the APIs for builders: keys, errors, retries and limits page

Keep reading, or try a tool.

Long-form guides on building, automating and AI computing.