openai-python
AGENTS.md32k starsChanged 3 months agoApache-2.0View on GitHub
Most SDK source is generated from the OpenAI API schema. Follow CONTRIBUTING.md before changing generated files. Handwritten policy, automation, tests, and examples should remain small and should not alter exported SDK APIs unless the change explicitly requires it. Follow the custom-code guidance. Budget changes belong in a separate PR containing only .castiron-ratchet.json, with an explicit justification in the PR description. Increases require a human approving review before merging. Agents may investigate and draft proposals, but must not approve budget increases…
- Reads credentials
Trending
Quiet since August.about the whole repository
Who's talking about openai/openai-python
- A Hacker News story“ChatML: ChatGPT API expects a structured format, called Chat Markup Language”Hacker News · Mar 1, 2023 · 336 points
- A Hacker News story“Migrating to HTTPX2”Hacker News · Aug 28, 2026 · 209 points
- NousResearch/hermes-agent“openai-codex provider crashes: SDK parse_response fails on null output from Codex backend”GitHub · May 27, 2026 · 25 reactions
- Azure/azure-rest-api-specs“[BUG] Missing support for the parallel_tool_calls parameter in Azure openAI API”GitHub · Jun 21, 2024 · 21 reactions
- alexrudall/ruby-openai“Add Microsoft Azure support”GitHub · Apr 11, 2023 · 19 reactions
The biggest 5 of 28 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 28
Talked about on GitHub, Hacker News and Bluesky (28 times).
On GitHub · 14
- May 27, 2026openai-codex provider crashes: SDK parse_response fails on null output from Codex backend — NousResearch/hermes-agent25 reactions · 17 comments
- Jun 21, 2024[BUG] Missing support for the parallel_tool_calls parameter in Azure openAI API — Azure/azure-rest-api-specs21 reactions · 39 comments
- Apr 11, 2023Add Microsoft Azure support — alexrudall/ruby-openai19 reactions · 9 comments
- Jul 22, 2024Add 'extra_body' Parameter to ChatCompletionOptions in .NET SDK — openai/openai-dotnet17 reactions · 7 comments
- Mar 28, 2023Microsoft Azure support — alexrudall/ruby-openai11 reactions · 7 comments
9 more on GitHub
- Nov 11, 2025Feature: Support openai version 2 — openlit/openlit10 reactions · 9 comments
- Oct 11, 2023support new openai package — microsoft/autogen9 reactions · 1 comment
- Jul 7, 2023HTTPError: 429 Client Error: Too Many Requests for url — TheR1D/shell_gpt9 reactions · 14 comments
- Mar 31, 2023Pipe to custom domain (Azure OpenAI service support) — Helicone/helicone9 reactions · 3 comments
- Mar 18, 2026chore(deps): bump the uv-all group with 2 updates — Ven0m0/gemini-web-wrapper3 reactions · 3 comments
- May 23, 2025[Feat] Use aiohttp transport by default - 97% lower median latency — BerriAI/litellmsays it tested it3 reactions · 1 comment
- Dec 5, 2023Moderation: migrate to new openai api — langchain-ai/langchain3 reactions · 7 comments
- Dec 2, 2023OPENAI: upgrade to openai api v1.0.0 — fastai/lm-hackers3 reactions · 1 comment
- Apr 27, 2026deps: update openai requirement from >=1.3.0 to >=2.32.0 — Joker5514/workflow-failure-copilot2 reactions · 2 comments
On Hacker News · 10
- Mar 1, 2023ChatML: ChatGPT API expects a structured format, called Chat Markup Language336 points · 78 comments
- Aug 28, 2026Migrating to HTTPX2209 points · 95 comments
- Nov 6, 2023OpenAI Python v1 Released3 points
- Feb 23, 2026WebSockets for Responses API2 points
- Nov 6, 2023OpenAI-Python v1.0.02 points
5 more on Hacker News
- Oct 6, 2023OpenAI's Beta Python SDK sees a rewrite using httpx, drops Azure2 points · 1 comment
- Aug 8, 2025Uploading PDF via Files API and using in Streaming gives 400 bad request1 point
- Sep 12, 2024OpenAI adds new o1 models1 point
- Oct 12, 2023OpenAI-Python v1.0.0 Beta1 point
- Oct 6, 2023OpenAI Python Library v1.0 beta introduces breaking changes1 point
On Bluesky · 4
- Mar 14, 2025📦 openai / openai-python ⭐ 25,135 (+40) 🗒 Python The official Python library for the OpenAI API — @github-trending.bsky.social4 likes and reposts
- Nov 8, 2023🔥 Hot Repo! 🔥 (100+ new stars) 📦 openai / openai-python ⭐ 13,628 (+139) 🗒 Python The official Python library for the OpenAI API — @github-trending.bsky.social2 likes and reposts
- Aug 8, 2025📦 openai / openai-python ⭐ 27,671 (+19) 🗒 Python The official Python library for the OpenAI API — @github-trending.bsky.social1 likes and repost
- Dec 1, 2023🔥 Hot Repo! 🔥 (100+ new stars) 📦 openai / openai-python ⭐ 16,030 (+123) 🗒 Python The official Python library for the OpenAI API — @github-trending.bsky.social1 likes and repost · 1 reply
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Follow the custom-code guidance.
- Very specific: line 22
Never commit real API or admin keys, bearer tokens, webhook secrets, cloud credentials, X.509 private keys, release credentials, or .env …
- Very specific: line 55
Keep requires-python, classifiers, dependency markers, README requirements, static-analysis targets, .python-version, and CI synchronized.
- Distinctive: line 57
Do not combine a minimum-Python change with unrelated SDK or dependency upgrades.
- Very specific: line 62
Update pyproject.toml, .python-version, the lock files, README, CONTRIBUTING.md, and PYTHON_VERSION_POLICY.md.
- Distinctive: line 64
Remove dependency branches that only served the retired runtime.
- Distinctive: line 65
Update minimum/current and full-matrix CI coverage.
- Very specific: line 68
Add a ## Release note section to the pull request description naming the new minimum and final compatible SDK release.
- Distinctive: line 91
Never changes the Python floor or merges code automatically.
- Distinctive: line 95
Before publishing a Python-version change, run:
- Very specific: line 114
Treat large payloads as a normal API contract, not evidence of malformed or hostile input.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Repository Guidance
Generated SDK
Most SDK source is generated from the OpenAI API schema. Follow CONTRIBUTING.md before
changing generated files. Handwritten policy, automation, tests, and examples
should remain small and should not alter exported SDK APIs unless the change
explicitly requires it.
Custom-code budget
Follow the custom-code guidance. Budget changes
belong in a separate PR containing only .castiron-ratchet.json, with an explicit justification
in the PR description. Increases require a human approving review before merging.
Agents may investigate and draft proposals, but must not approve budget increases
(including through a human's credentials) or bypass the gate. Do not weaken
counting, broaden exclusions, or alter generation metadata to make a change pass.
The checker and effective budget come from main, not the PR. Keep default CODEOWNERS.
Security requirements for coding agents
- Never commit real API or admin keys, bearer tokens, webhook secrets, cloud
credentials, X.509 private keys, release credentials, or
.envfiles. ReadOPENAI_API_KEY,OPENAI_ADMIN_KEY,OPENAI_WEBHOOK_SECRET, and other credentials from the environment; use clearly fake examples and fixtures. - Redact credentials,
Authorizationandapi-keyheaders, customer data, and sensitive request or response bodies from logs, exceptions, snapshots, and test output. Clearly fake or sanitized fixtures and safeAPIError.bodydiagnostics may remain. Preserve existing sensitive-header filtering, including debug logging. - Review direct and transitive dependency changes in
pyproject.toml, optional extras, dependency groups, anduv.lock. Check package provenance, build backends, and install scripts before accepting or running them. - Pin third-party GitHub Actions to reviewed full commit SHAs. Minimize job-level token permissions and never expose secrets or write-capable tokens to untrusted pull-request code.
- Preserve separate build and publish jobs, protected release credentials, and
PyPI Trusted Publishing. Grant
id-token: writeonly to the trusted, upload-only publishing job; do not introduce long-lived PyPI tokens. - Obtain SDK CODEOWNER review and add focused synchronous and asynchronous security regression tests, as applicable, for changes to authentication, X.509 or webhook verification, HTTP destinations, redirects, proxies, TLS, cloud metadata, file uploads, serialization, dependencies, GitHub Actions, or release workflows.
- Report suspected vulnerabilities privately as described in
SECURITY.md; never disclose them in public issues, pull requests, or logs.
Python version policy
requires-pythoninpyproject.tomlis the authoritative technical minimum.PYTHON_VERSION_POLICY.mdis the human-readable support and release policy.- Support every fully released, non-EOL CPython line. A documented grace period may temporarily add the most recently retired line.
- Keep
requires-python, classifiers, dependency markers, README requirements, static-analysis targets,.python-version, and CI synchronized. - Do not combine a minimum-Python change with unrelated SDK or dependency upgrades.
Changing the minimum Python version
- Update
pyproject.toml,.python-version, the lock files, README,CONTRIBUTING.md, andPYTHON_VERSION_POLICY.md. - Remove dependency branches that only served the retired runtime.
- Update minimum/current and full-matrix CI coverage.
- Build both distributions and validate their
Requires-Pythonmetadata and old-interpreter rejection behavior. - Add a
## Release notesection to the pull request description naming the new minimum and final compatible SDK release. Do not promise security backports for the old release. - Obtain SDK CODEOWNER approval.
The deterministic Python policy check proves repository surfaces agree. It does not decide whether an EOL grace period or floor increase is appropriate.
Automation map
.github/workflows/ci.yml- On pull requests and branch pushes: lint, build, metadata validation, and tests on the minimum and current stable Python releases.
- Nightly and manually: smoke-tests every supported Python release and the allowed-failure prerelease.
.github/workflows/python-version-review.yml- Monthly on the default branch: snapshots official CPython lifecycle data plus the public PyPI Python-minor distribution and asks Codex for a policy review.
- Runs a pinned Codex runtime as an unprivileged user with no command network access and read-only repository permissions.
- Codex cannot edit the repository or call GitHub. A separate job with no OpenAI credential opens or refreshes one issue only when action is needed.
- Never changes the Python floor or merges code automatically.
Validation
Before publishing a Python-version change, run:
uv lock
uv lock --check
./scripts/build
uv run --locked --all-extras python scripts/check-python-version-policy.py
uv run --locked --all-extras python scripts/utils/validate-python-version-wheel.py
python3.9 scripts/utils/validate-python-version-wheel.py --check-python-39
uv run --locked --all-extras python scripts/utils/validate-bedrock-wheel.py
uv run --locked --all-extras python scripts/utils/validate-httpx2-wheel.py
./scripts/lint
./scripts/testAlso run the scheduled compatibility matrix before release.
Large-payload compatibility
Treat large payloads as a normal API contract, not evidence of malformed or
hostile input. Responses, Chat Completions, and other APIs can legitimately
return large application/json bodies and streaming events. Do not introduce
arbitrary fixed limits on bodies, events, or lines as a security or efficiency
fix. Prefer incremental processing, amortized-linear buffering, timely cleanup,
and caller cancellation. Any new rejection limit needs an explicit,
owner-approved API contract and a review of existing supported payloads and
transports.
Protect this behavior with focused, deterministic public-entrypoint tests using large synthetic payloads generated in memory, not committed captures or live image generation. Their high memory use is intentional: do not shrink the payloads or raise client limits to make the tests pass. Keep coverage to the main JSON and streaming categories, and run large cases sequentially to keep peak memory reasonable. The fixture size is a regression probe, not a new API maximum.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

