API Atlas — OpenAI + Anthropic (conventions for humans and agents)
Exhaustive, experimentally verified documentation of the public API surface of OpenAI and Anthropic.
Machine-readable first: every important fact in docs/ must also exist in generated/ (JSON/CSV).
Security (non-negotiable)
- Keys live ONLY in
.env(mode 600, gitignored). Never print, log, commit or paste them. Never put a key in a file underdocs/,examples/,tests/,sources/,generated/,reports/. - Use
source scripts/lib.sh(bash/zsh) →oai METHOD PATH [curl args],ant METHOD PATH [curl args](auth injected, never printed), orpython3 scripts/live.pyhelpers. Both masksk-…patterns and auth headers in anything saved. - Raw live responses go to
tmp-live/(gitignored). Sanitized excerpts may be copied into docs. - Never run destructive Admin actions (delete users/keys/projects, rotate secrets). GET/LIST only.
- Minimal payloads:
"Reply with OK.",max_tokens/max_output_tokens≤ 32, cheapest model of the family (OpenAI:gpt-5.4-nano/gpt-4.1-nano, Anthropic:claude-haiku-4-5-20251001) unless the feature requires another model. Log every live call withlog_request(bash) orlive.py(auto) →reports/live-requests.jsonl(ts, provider, method, path, status, est_cost_usd, note).
Status vocabulary (use exactly these strings)
DOCUMENTED (in current official docs, not tested) · LIVE_DISCOVERED (seen via API, weak/absent docs) · LIVE_VERIFIED (called successfully with our key) · BETA · PREVIEW · LEGACY · DEPRECATED · RETIRED · ACCOUNT_RESTRICTED (documented; our key got 401/403/permission error) · UNVERIFIED · FAILED_VERIFICATION (tried; unexpected failure — record the reason).
A record may carry several statuses (e.g. ["DOCUMENTED","BETA","LIVE_VERIFIED"]). A 403/404 with our key NEVER means "does not exist".
Providers (4)
openai · anthropic · xai (Grok, https://api.x.ai, OpenAI-compatible surface + xAI-specific endpoints; Management API at https://management-api.x.ai needs a separate key we do NOT have) · gemini (Google Gemini Developer API, https://generativelanguage.googleapis.com/v1beta, key via x-goog-api-key header — never put the key in a URL). Helpers: xai/gemini in scripts/lib.sh, xai_request/gemini_request in scripts/live.py, pytest fixtures xai/gemini; cheap models: xAI grok-4.3 (note: every Grok call bills reasoning tokens; keep prompts tiny), Gemini gemini-3.5-flash-lite (2.5 models are "no longer available to new users" on this key). SDKs installed: .venv has xai-sdk 1.19 and google-genai 2.24; node_modules has @google/genai 2.23 (no official xAI Node SDK — use openai client with baseURL or raw fetch).
Sources of truth (already downloaded, offline, grep them — do not re-fetch unless a page is missing)
- xAI docs:
sources/xai/pages/**(182 pages split from the officialllms-full.txt: developers/** incl. rest-api-reference/, grpc-api-reference/, tools/, models/, pricing, rate-limits, release-notes; build/, grok/, grok-bot/, console/), manifestsources/xai/pages-manifest.json; official OpenAPI specsources/xai/openapi/openapi.json(38 paths; op listopenapi-ops.json); SDK:sources/xai/openapi/python-sdk-readme.md. Live:sources/xai/models-api-raw.json(12 ids),language-models-raw.json,image-generation-models-raw.json. Citehttps://docs.x.ai/<path>. - Gemini docs:
sources/gemini/pages/gemini-api/docs/**(guides) andsources/gemini/pages/api/**(REST reference pages, e.g.api/generate-content.md), manifestsources/gemini/pages-manifest.json; Google API discovery documentssources/gemini/openapi/discovery-v1beta.json(revision 20260918, 86 methods, full request/response schemas underschemas) +discovery-v1.json; extracted method listdiscovery-v1beta-methods.json; SDK typessources/gemini/openapi/python-genai-types.py(authoritative field names), READMEs. Live:sources/gemini/models-api-raw.json(58 models). Citehttps://ai.google.dev/gemini-api/docs/<slug>orhttps://ai.google.dev/api/<slug>(drop the.md.txt). - OpenAI docs pages (Markdown twins):
sources/openai/pages/api/docs/**(guides, models/.md, pricing, changelog, deprecations), reference:sources/openai/pages/api/reference/**; manifestsources/openai/pages-manifest.json. Combined exportsources/openai/llms-full.txt(7.5 MB). Official OpenAPI spec:sources/openai/openapi/openapi-master.yaml(352 operations, extracted listopenapi-master-ops.json). SDK surfaces:sources/openai/openapi/{python,node}-sdk-api.md. - Anthropic docs pages:
sources/anthropic/pages/**(api/, build-with-claude/, agents-and-tools/, managed-agents/, models/, about-claude/, release-notes/**), manifestsources/anthropic/pages-manifest.json, combinedsources/anthropic/llms-full.txt(35 MB, frontmattertitle/url/descriptionper page). SDK surfaces:sources/anthropic/openapi/{python,node}-sdk-api.md. - Live discovery:
sources/openai/models-api-raw.json(136 ids),sources/anthropic/models-api-raw.json(11 ids). - Cite the canonical public URL (not the .md twin): OpenAI
https://developers.openai.com/api/docs/.../https://developers.openai.com/api/reference/...; Anthropichttps://platform.claude.com/docs/en/.... Every record hassources: [{url, retrieved_at}].
Repository layout
docs/ human docs (Markdown). docs/openai/*, docs/anthropic/*, docs/models/*, docs/tools/*, docs/endpoints/*, docs/errors/*, docs/comparisons/*, docs/architecture/*, docs/security/*
generated/ merged machine-readable outputs (built by scripts/build_generated.py from generated/fragments/**)
generated/fragments/<domain>/*.json ← agents write HERE only (never edit merged files by hand)
examples/<provider>/<area>/ runnable examples: *.sh (curl), *.py, *.ts — each header comment states STATUS and how verified
tests/<provider>/test_*.py pytest smoke tests; expensive ones gated by RUN_*_TESTS env flags (see .env.example)
scripts/ crawl_docs.py, discover_models.py, live.py, lib.sh, build_generated.py, verify_links.py, update_atlas.py
sources/ downloaded official material (immutable inputs) + sanitized live discovery
reports/ live-requests.jsonl, changes.md, final-report.md, coverage
schemas/ JSON Schemas for every generated record type — validate fragments against them Record schemas (see schemas/*.schema.json; summary)
- model: provider, id, display_name, aliases[], snapshots[], family, status[], release_date, knowledge_cutoff, context_window, max_output, modalities{input[],output[]}, capabilities{…booleans or "unknown"}, endpoints[], tools[], pricing{…}, rate_limits, beta_headers[], restrictions, availability{account, regions/clouds}, last_verified, verification{}, sources[]
- endpoint: provider, api_family, method, path, name, description, status[], auth, beta_header, request{content_type, body_ref}, response{}, streaming{supported, events_ref}, pagination, idempotency, sdk{python, node}, verification{}, sources[]
- parameter: provider, endpoint (e.g.
POST /v1/messages), parameter (dotted path), location (body|query|path|header), type, required, default, minimum, maximum, enum[], description, compatible_models[], beta_header, status[], source - tool: provider, name, type (exact JSON
typestring, versioned), category (client|server|hosted|programmatic|mcp), description, compatible_models[], compatible_endpoints[], parameters_schema, tool_choice_support, parallel, streaming_events[], result_shape, billing, limitations, security, beta_header, status[], examples{curl,python,typescript}, verification{}, sources[] - streaming_event: provider, api, direction (server→client|client→server), event, description, schema, example, source
- error: provider, http_status, type, code, message_semantics, retryable, recommended_action, source
- header: provider, name, direction (request|response), required, description, example, source
- price: provider, model_or_service, dimension (input|cached_input|output|…), price, currency (USD), unit (per 1M tokens | per image | per minute | per call | …), tier (standard|batch|priority|flex|fast), effective_notes, source, retrieved_at
- example: provider, area, file, language, status (LIVE_VERIFIED|FAILED_VERIFICATION|UNVERIFIED), verified_at, notes
- verification: {method: live_api|docs_only|sdk_types, verified_at, result: success|failure|restricted, http_status, request_note}
Writing rules
- French or English is fine in prose; identifiers, JSON keys and status strings are English.
- Tables over prose for matrices. Every doc page starts with a status line + "Sources" list + "Last verified" date (2026-09-18 for this run).
- Do not claim tested unless it ran. Record failures verbatim (sanitized).
- Do not invent account-specific rate limits; separate "documented limits" from "observed headers".