
ChatGPT API: Access, Rate Limits & SDKs 2026
The OpenAI API is a REST API at api.openai.com/v1, built around the Responses API. Rate limits rise with spend, and cache hits get a 90% discount.
ChatGPT API verdict
The OpenAI API is a REST API at api.openai.com/v1.
You authenticate with an Authorization: Bearer key, or a short-lived WIF token, with optional OpenAI-Organization and OpenAI-Project headers. The primary surface is the Responses API, at POST /v1/responses, for tool use and multimodal input.
OpenAI's API is straightforward to adopt: one Bearer header, the Responses API as the main surface, and official client libraries that surface request IDs for support. Budget around three levers. Route non-interactive volume through the Batch API, which sits off the synchronous limit. Cache repeated context, since cache hits are billed at $0.50 per 1M, a 90% discount. Keep max_tokens close to the real response size, because it feeds the rate-limit estimate. Plan tier advancement ahead of launch, since limits rise automatically with cumulative spend from Free through Tier 5. High-volume long-context GPT-5.5 work needs the separate long-context limit checked in the console.
- Model prompting behaviour can change between snapshots even within v1, so pin model versions and run evals for consistent output.
- Rate limits are hit across whichever of RPM, RPD, TPM and TPD comes first. 20 small requests can exhaust a 20-RPM limit long before the token limit.
- Long-context GPT-5.5 requests have a separate rate limit from standard requests, visible only in the developer console.
- Failed requests still count toward the per-minute limit, so naive retry loops make 429s worse. Use exponential backoff with jitter.
- Base URL
- api.openai.com/v1
- Primary endpoint
- POST /v1/responses
- Auth
- Bearer key / WIF
- Usage tiers
- Free to Tier 5
- Cache discount
- 90% ($0.50/1M)
Build with the ChatGPT API
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-5.5",
input="Hello, GPT",
)
print(response.output_text){
"object": "response",
"status": "completed",
"model": "gpt-5.5",
"output": [{ "type": "message", "role": "assistant",
"content": [{ "type": "output_text", "text": "Hello! How can I help?" }] }],
"usage": { "input_tokens": 9, "output_tokens": 8 }
}- Cost levers: Batch API (off the synchronous limit); prompt caching (cache hit $0.50/1M, 90% off); trim max_tokens to response size.
- Handle: 400 (X-Client-Request-Id over 512 chars / non-ASCII), 429 (rate limit, retry with backoff).
Real ChatGPT code from the official docs. The raw cURL hello-world is the code block above; full limits and endpoints are in the tables on this page.
Your first ChatGPT API request
curl https://api.openai.com/v1/responses \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"input": "Hello, GPT"
}'How to authenticate with the ChatGPT API
| Aspect | Detail | Notes |
|---|---|---|
| Base URL | https://api.openai.com/v1 (REST) | REST API, currently v1 |
| Auth | Authorization: Bearer OPENAI_API_KEY | API key or short-lived WIF token |
| Key types | Standard API key, Admin API key, WIF tokens | Admin key for Administration endpoints |
| Org / project headers | OpenAI-Organization, OpenAI-Project | Multi-org or legacy user keys |
| Version header | openai-version (currently 2020-10-01) | Returned on every response |
| Request IDs | x-request-id on every response; X-Client-Request-Id optional | Client id: ASCII, <=512 chars |
| Stability | No breaking changes within a major version | Pin model snapshots for consistent behaviour |
ChatGPT core endpoints
| Surface | Method / path | Purpose |
|---|---|---|
| Responses | POST /v1/responses | Direct model requests: tool use, audio/image/text input, stateful interactions |
| Chat Completions | POST /v1/chat/completions | Legacy chat surface, still supported |
| Realtime | WebRTC / WebSocket / SIP | Low-latency voice or audio sessions |
| Models | GET /v1/models | List models and details |
| Administration | /v1 admin endpoints | Users, invites, projects, API keys, audit logs |
| Embeddings | POST /v1/embeddings | Vector embeddings for search and RAG |
| Fine-tuning | GET /v1/fine_tuning/model_limits | Fine-tuning jobs and per-org limits |
ChatGPT rate limits and tiers
| Limit | Detail | Notes |
|---|---|---|
| Dimensions | RPM, RPD, TPM, TPD (+ IPM, audio-min) | Hit across any, whichever comes first |
| Scope | Per organization and per project | Not per user; varies by model |
| Usage tiers | Free, Tier 1-5; auto-graduated by spend | Tier 1 $5 paid, Tier 5 $1,000 paid |
| Monthly usage cap | Free/Tier1 $100, Tier3 $1,000, Tier5 $200,000 | Spend ceiling per month |
| Long-context limit | Separate rate limit for long-context GPT-5.5 requests | Visible in developer console |
| Shared limits | Some model families share one TPM pool | All calls count to the shared limit |
| Headers | x-ratelimit-limit/remaining/reset for requests and tokens | e.g. limit-tokens 150000, reset-tokens 6m0s |
| Batch queue | Batch API queue limit by total queued input tokens | Off the synchronous limit |
ChatGPT SDKs, error handling and developer fit
| Aspect | Detail | Notes |
|---|---|---|
| Official SDKs | Official client libraries (libraries page) | Released libraries follow semver |
| Backwards compatibility | No breaking changes in a major version; pin snapshots | Model behaviour can shift between snapshots |
| Request tracing | x-request-id auto; X-Client-Request-Id (ASCII, <=512) | SDKs surface the request id on responses |
| Rate-limit errors | Retry with random exponential backoff + jitter | Failed requests still count to the limit |
| Cost levers | Batch API (off sync limit); cache hits at $0.50/1M; trim max_tokens | max_tokens counts toward the limit estimate |
| Processing metadata | openai-processing-ms, openai-organization headers | On every response |
| API pricing (GPT-5.5) | $5/1M in, $30/1M out, cache hit $0.50/1M | Independent cross-reference |
ChatGPT API FAQ
How do I authenticate with the OpenAI API?
Send an Authorization: Bearer header with your API key, or a short-lived token from workload identity federation, to https://api.openai.com/v1. If you belong to more than one organization or use a legacy user key, add OpenAI-Organization and OpenAI-Project headers to attribute usage. Never expose the key in client-side code. Load it from an environment variable or secret manager.
What are the core OpenAI API endpoints?
The primary surface is the Responses API, at POST /v1/responses, for direct model requests with tool use and text, image and audio input. There is also the Realtime API for low-latency voice over WebRTC, WebSocket or SIP, plus Administration endpoints for org workflows. Models at GET /v1/models handles discovery, and the still-supported legacy Chat Completions endpoint sits at POST /v1/chat/completions.
What are the OpenAI API rate limits?
Limits apply per organization and per project across requests per minute and day and tokens per minute and day, enforced on whichever is reached first. Usage tiers raise the ceiling automatically as cumulative spend grows, from Free through Tier 5, which needs $1,000 paid and allows $200,000 per month. Long-context GPT-5.5 requests carry a separate limit, and some model families share one pool. Response headers report live usage through x-ratelimit-limit, remaining and reset.
Which SDKs does OpenAI offer?
OpenAI publishes official client libraries, listed on the libraries page, that follow semantic versioning and surface the x-request-id on top-level response objects for troubleshooting. You can also call the HTTP API directly from any environment that supports HTTP. Pin model snapshots and run evals, because prompting behaviour can shift between snapshots even within the stable v1 surface.
How do I reduce OpenAI API costs and avoid rate-limit errors?
Three levers. Use the Batch API for non-interactive work, since it does not count against your synchronous request limit. Rely on prompt caching, where cache hits are billed at $0.50 per 1M, a 90% discount on GPT-5.5. Trim max_tokens to your real response size, because it feeds the rate-limit estimate. For 429s, retry with random exponential backoff and jitter, and note that failed requests still count toward the per-minute limit.
Sources & verification
| Source | What was checked | Last checked |
|---|---|---|
| Chatgpt Official | Official product page | July 10, 2026 |
| Artificial Analysis | Independent reference | July 10, 2026 |
| OpenAI Guides Rate Limits | API Rate Limits | July 10, 2026 |
| OpenAI Reference Overview | API Overview | July 10, 2026 |
Every fact on this ChatGPT page is tied to a named source and a verification date. Freshness-sensitive figures trace to the sources above; verify against the vendor before relying on them.
Explore ChatGPT
Every page on ChatGPT in one place, you are on api.
