Python 88.3%
TypeScript 7.6%
Shell 4.1%
1# API Atlas — OpenAI + Anthropic (conventions for humans and agents)23Exhaustive, experimentally verified documentation of the public API surface of OpenAI and Anthropic.4Machine-readable first: every important fact in `docs/` must also exist in `generated/` (JSON/CSV).56## Security (non-negotiable)7- Keys live ONLY in `.env` (mode 600, gitignored). Never print, log, commit or paste them. Never put a key in a file under `docs/`, `examples/`, `tests/`, `sources/`, `generated/`, `reports/`.8- Use `source scripts/lib.sh` (bash/zsh) → `oai METHOD PATH [curl args]`, `ant METHOD PATH [curl args]` (auth injected, never printed), or `python3 scripts/live.py` helpers. Both mask `sk-…` patterns and auth headers in anything saved.9- Raw live responses go to `tmp-live/` (gitignored). Sanitized excerpts may be copied into docs.10- Never run destructive Admin actions (delete users/keys/projects, rotate secrets). GET/LIST only.11- 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 with `log_request` (bash) or `live.py` (auto) → `reports/live-requests.jsonl` (ts, provider, method, path, status, est_cost_usd, note).1213## Status vocabulary (use exactly these strings)14`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).15A record may carry several statuses (e.g. `["DOCUMENTED","BETA","LIVE_VERIFIED"]`). A 403/404 with our key NEVER means "does not exist".1617## Providers (4)18`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).1920## Sources of truth (already downloaded, offline, grep them — do not re-fetch unless a page is missing)21- xAI docs: `sources/xai/pages/**` (182 pages split from the official `llms-full.txt`: developers/** incl. rest-api-reference/**, grpc-api-reference/**, tools/**, models/**, pricing, rate-limits, release-notes; build/**, grok/**, grok-bot/**, console/**), manifest `sources/xai/pages-manifest.json`; official OpenAPI spec `sources/xai/openapi/openapi.json` (38 paths; op list `openapi-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`. Cite `https://docs.x.ai/<path>`.22- Gemini docs: `sources/gemini/pages/gemini-api/docs/**` (guides) and `sources/gemini/pages/api/**` (REST reference pages, e.g. `api/generate-content.md`), manifest `sources/gemini/pages-manifest.json`; Google API discovery documents `sources/gemini/openapi/discovery-v1beta.json` (revision 20260918, 86 methods, full request/response schemas under `schemas`) + `discovery-v1.json`; extracted method list `discovery-v1beta-methods.json`; SDK types `sources/gemini/openapi/python-genai-types.py` (authoritative field names), READMEs. Live: `sources/gemini/models-api-raw.json` (58 models). Cite `https://ai.google.dev/gemini-api/docs/<slug>` or `https://ai.google.dev/api/<slug>` (drop the `.md.txt`).23- OpenAI docs pages (Markdown twins): `sources/openai/pages/api/docs/**` (guides, models/<id>.md, pricing, changelog, deprecations), reference: `sources/openai/pages/api/reference/**`; manifest `sources/openai/pages-manifest.json`. Combined export `sources/openai/llms-full.txt` (7.5 MB). Official OpenAPI spec: `sources/openai/openapi/openapi-master.yaml` (352 operations, extracted list `openapi-master-ops.json`). SDK surfaces: `sources/openai/openapi/{python,node}-sdk-api.md`.24- Anthropic docs pages: `sources/anthropic/pages/**` (api/**, build-with-claude/**, agents-and-tools/**, managed-agents/**, models/**, about-claude/**, release-notes/**), manifest `sources/anthropic/pages-manifest.json`, combined `sources/anthropic/llms-full.txt` (35 MB, frontmatter `title/url/description` per page). SDK surfaces: `sources/anthropic/openapi/{python,node}-sdk-api.md`.25- Live discovery: `sources/openai/models-api-raw.json` (136 ids), `sources/anthropic/models-api-raw.json` (11 ids).26- Cite the canonical public URL (not the .md twin): OpenAI `https://developers.openai.com/api/docs/...` / `https://developers.openai.com/api/reference/...`; Anthropic `https://platform.claude.com/docs/en/...`. Every record has `sources: [{url, retrieved_at}]`.2728## Repository layout29```30docs/ human docs (Markdown). docs/openai/*, docs/anthropic/*, docs/models/*, docs/tools/*, docs/endpoints/*, docs/errors/*, docs/comparisons/*, docs/architecture/*, docs/security/*31generated/ merged machine-readable outputs (built by scripts/build_generated.py from generated/fragments/**)32generated/fragments/<domain>/*.json ← agents write HERE only (never edit merged files by hand)33examples/<provider>/<area>/ runnable examples: *.sh (curl), *.py, *.ts — each header comment states STATUS and how verified34tests/<provider>/test_*.py pytest smoke tests; expensive ones gated by RUN_*_TESTS env flags (see .env.example)35scripts/ crawl_docs.py, discover_models.py, live.py, lib.sh, build_generated.py, verify_links.py, update_atlas.py36sources/ downloaded official material (immutable inputs) + sanitized live discovery37reports/ live-requests.jsonl, changes.md, final-report.md, coverage38schemas/ JSON Schemas for every generated record type — validate fragments against them39```4041## Record schemas (see `schemas/*.schema.json`; summary)42- **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[]43- **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[]44- **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[], source45- **tool**: provider, name, type (exact JSON `type` string, 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[]46- **streaming_event**: provider, api, direction (server→client|client→server), event, description, schema, example, source47- **error**: provider, http_status, type, code, message_semantics, retryable, recommended_action, source48- **header**: provider, name, direction (request|response), required, description, example, source49- **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_at50- **example**: provider, area, file, language, status (LIVE_VERIFIED|FAILED_VERIFICATION|UNVERIFIED), verified_at, notes51- **verification**: {method: live_api|docs_only|sdk_types, verified_at, result: success|failure|restricted, http_status, request_note}5253## Writing rules54- French or English is fine in prose; identifiers, JSON keys and status strings are English.55- Tables over prose for matrices. Every doc page starts with a status line + "Sources" list + "Last verified" date (2026-09-18 for this run).56- Do not claim tested unless it ran. Record failures verbatim (sanitized).57- Do not invent account-specific rate limits; separate "documented limits" from "observed headers".58