openai-node
AGENTS.md11k starsChanged 3 months agoApache-2.0View on GitHub
Most SDK source is generated from the OpenAI API schema. Follow .github/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. - For externally observable bug or behavior fixes, reproduce the reported issue against the current repository and public SDK entrypoint before proposing a fix. Check existing issues and pull requests; inspect the API schema and generated/upstream ownership only when relevant. Do not…
- Reads credentials
- Installs packages
Trending
More talk lately.about the whole repository
Who's talking about openai/openai-node
- vercel/ai“Support for Automated Function Calls”GitHub · Dec 29, 2023 · 7 reactions
- Nutlope/aicommits“feat: Custom OPENAI API Host”GitHub · Apr 30, 2023 · 7 reactions
- Azure/azure-sdk-for-net“[FEATURE REQ] DALL-E 3 Model ImageGeneration”GitHub · Nov 17, 2023 · 6 reactions
- openai/openai-python“Consider using a class constructor for configuration, not module globals”GitHub · Aug 4, 2023 · 6 reactions
- openai/openai-openapi“Moderations endpoint missing from OpenAPI Specification”GitHub · Jul 11, 2022 · 5 reactions
The biggest 5 of 32 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 32
Talked about on GitHub, Bluesky and Hacker News (32 times).
On GitHub · 25
- Dec 29, 2023Support for Automated Function Calls — vercel/ai7 reactions · 2 comments
- Apr 30, 2023feat: Custom OPENAI API Host — Nutlope/aicommits7 reactions · 2 comments
- Nov 17, 2023[FEATURE REQ] DALL-E 3 Model ImageGeneration — Azure/azure-sdk-for-net6 reactions · 3 comments
- Aug 4, 2023Consider using a class constructor for configuration, not module globals — openai/openai-python6 reactions · 2 comments
- Jul 11, 2022Moderations endpoint missing from OpenAPI Specification — openai/openai-openapi5 reactions · 5 comments
20 more on GitHub
- Aug 29, 2023Ability to abort streaming completion — mudler/LocalAI4 reactions · 2 comments
- Dec 12, 2022Switch to the official openai module — RomanHotsiy/commitgpt4 reactions · 1 comment
- Feb 27, 2026deps(deps): bump the runtime-core group across 1 directory with 4 updates — Ilenburg1993/chatgpt-docker-puppeteer3 reactions · 2 comments
- Jan 12, 2026deps(deps): Bump openai from 6.15.0 to 6.16.0 — NeXify-Chat-it-Automate-it/OpenCarBox3 reactions · 3 comments
- Jun 23, 2025Deno language server crashes all the time — denoland/vscode_deno3 reactions · 3 comments
- Feb 23, 2025Add support for Azure OpenAI — clusterzx/paperless-ai3 reactions · 1 comment
- Aug 9, 2024Zod to JSONSchema conversion doesn't use openai custom logic for openai — langchain-ai/langchainjs3 reactions · 10 comments
- Mar 28, 2024[@azure/openai-assistants] run thread with streaming — Azure/azure-sdk-for-js3 reactions · 4 comments
- Jun 28, 2023Try new `openai` package with built-in edge support? — dan-kwiat/openai-edge3 reactions · 2 comments
- Oct 5, 2026deps(deps): bump the security-updates group with 13 updates — koushik369mondal/WanderLust2 reactions · 4 comments
- Oct 5, 2026chore(deps): bump openai from 7.23.0 to 7.27.0 in /integration-tests/esbuild in the test-versions group across 1 directory — DataDog/dd-trace-js2 reactions · 2 comments
- Oct 3, 2026Bump the dev-tooling group with 8 updates — qwts/overlook2 reactions
- Sep 28, 2026chore(deps): bump openai from 7.20.0 to 7.23.0 in /integration-tests/esbuild in the test-versions group across 1 directory — DataDog/dd-trace-js2 reactions · 3 comments
- Sep 23, 2026chore(deps): bump openai from 7.19.0 to 7.20.0 in /packages/dd-trace/test/plugins/versions in the ai-and-llm group across 1 directory — DataDog/dd-trace-js2 reactions · 3 comments
- Sep 23, 2026chore(deps): bump openai from 7.19.0 to 7.20.0 in /integration-tests/esbuild in the test-versions group across 1 directory — DataDog/dd-trace-js2 reactions · 3 comments
- Sep 21, 2026chore(deps): bump openai from 7.15.0 to 7.18.0 in /integration-tests/esbuild in the test-versions group across 1 directory — DataDog/dd-trace-js2 reactions · 3 comments
- Apr 13, 2026build(deps): bump openai from 4.104.0 to 6.34.0 — thanhan92-f1/hitechclaw2 reactions · 1 comment
- Apr 6, 2026chore(deps)(deps): bump openai from 6.18.0 to 6.35.0 — masilo-dev/alphaclone-nextjs2 reactions · 4 comments
- Mar 2, 2026chore(deps)(deps): update openai requirement from ^6.22.0 to ^6.25.0 — involvex/super-agent-cli2 reactions · 2 comments
- Feb 27, 2026Bump openai from 4.78.1 to 6.25.0 — canstralian/CodeFlux-AI-Kit2 reactions · 1 comment
On Bluesky · 6
- Aug 11, 2025📦 openai / openai-node ⭐ 9,687 (+94) 🗒 TypeScript Official JavaScript / TypeScript library for the OpenAI API — @github-trending-js.bsky.social2 likes and reposts
- Aug 10, 2025OpenAIのAPIをNode.jsやDenoなどから簡単に利用できるTypeScript/JavaScriptライブラリ。ストリーミング対応やファイルアップロード、Webhook検証などの機能があり、開発効率を高められそう。 yug1224 starred… — @yug1224.com2 likes and reposts
- Nov 7, 2023📦 openai / openai-node ⭐ 5,260 (+50) 🗒 TypeScript The official Node.js / Typescript library for the OpenAI API — @github-trending-js.bsky.social2 likes and reposts
- Aug 18, 2023Node.jsというかTypeScriptを書いてるのはこうやって、作られるライブラリが出てくるのが複数言語の中では圧倒的に多いし、比較的早い段階で出てくるのがめちゃくちゃアドバンテージあるかなと思ってる。このOpenAIだとPythonも確かにって思うけど、他の言語はっていうと… — @chimame.bsky.social2 likes and reposts
- Aug 10, 2025📦 openai / openai-node ⭐ 9,617 (+12) 🗒 TypeScript Official JavaScript / TypeScript library for the OpenAI API — @github-trending.bsky.social1 likes and repost
1 more on Bluesky
- Nov 18, 2024Concernant ce que je vais faire ici, ça va être une app très simple qui se connecte ici et poste Probablement en combinant genre… — @dremixam.com0 likes and reposts · 1 reply
On Hacker News · 1
- Aug 16, 2023openai-node v4.0.04 points
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
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
19 rules. About 2 are common, 10 are distinctive, and 7 are very specific to this project.
≈2
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 14
Check existing issues and pull requests.
- Distinctive: line 34
If successive edge cases keep appearing, reconsider the invariant and ownership rather than adding another special case.
- Distinctive: line 37
Keep required public snapshot fields accurate before exposing them, or type fields unavailable until later truthfully.
- Distinctive: line 42
Keep handwritten production and test files cohesive.
- Distinctive: line 46
Avoid hand-maintained model, endpoint, capability, or schema lists unless the contract requires them.
- Distinctive: line 60
Do not replace presence or nullish checks with truthiness checks.
- Distinctive: line 64
Verify affected CJS/ESM entrypoints, the exact minimum supported Node version, affected policy-defined Node lines, supported TypeScript …
- Common: line 68
Keep optional integrations isolated from the core SDK.
- Distinctive: line 72
Update affected canonical docs, executable examples, or meaningful public JSDoc when the public contract changes.
- Very specific: line 78
Follow the custom-code guidance.
- Very specific: line 88
Never commit API keys, tokens, private keys, .env files, customer data, or other secrets.
- Very specific: line 91
Never place secret API keys in browser bundles or enable dangerouslyAllowBrowser without explicit security review.
- Distinctive: line 98
Treat provider endpoints, headers, filenames, schemas, and object properties as untrusted.
- Distinctive: line 106
When validation and dispatch must agree, snapshot only the security-critical values or serialized representation, within bounded memory, …
- Common: line 111
Keep workflow tokens, permissions, and secrets at the narrowest required scope.
- Very specific: line 124
Treat large payloads as a normal API contract, not evidence of malformed or hostile input.
- Very specific: line 146
Follow .github/CONTRIBUTING.md and the tool versions pinned by .nvmrc and package.json.
- Very specific: line 158
Run the focused regression first, then the checks appropriate to the change: pnpm lint, pnpm exec tsc, pnpm build, and ./scripts/test.
- Very specific: line 172
Keep Node.js policy changes focused and keep the consumer runtime floor separate from repository tooling requirements.
≈ “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 .github/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.
Start with the actual problem
- For externally observable bug or behavior fixes, reproduce the reported issue against the current repository and public SDK entrypoint before proposing a fix. Check existing issues and pull requests; inspect the API schema and generated/upstream ownership only when relevant. Do not duplicate existing work, "fix" intended API behavior, or patch a generated symptom that belongs in the schema or generator.
- For those behavior fixes, include a focused regression that fails before the change and passes afterward. Type errors need a compile-time reproduction; stream, transport, and packaging bugs need coverage at the actual affected boundary, not merely a passing internal mock.
- For docs-only, dependency-only, generated, formatting, workflow, or policy changes without an observable bug, use the smallest artifact-appropriate validation, such as link, render, configuration, installation, or build checks.
Keep changes small and coherent
- Solve the narrow problem with the simplest implementation. Avoid unrelated refactors, reformatting, dependency or lockfile churn, generated-file edits, speculative abstractions, compatibility shims, and capabilities not requested.
- Establish an invariant once at its owning boundary instead of compensating in every caller. Reuse existing parsers, registries, helpers, and compiler/runtime facilities instead of creating parallel infrastructure or a hand-written parser. If successive edge cases keep appearing, reconsider the invariant and ownership rather than adding another special case.
- Model incomplete API/SSE wire shapes separately from enriched public SDK types.
Keep required public snapshot fields accurate before exposing them, or type
fields unavailable until later truthfully. Normalize incomplete items at their
owning boundary instead of patching downstream consumers. Prefer TypeScript
narrowing and inference over broad
any, assertions,@ts-ignore, or casts that disguise an unproven contract. - Keep handwritten production and test files cohesive. Extract a well-defined owner only when the current change materially grows a file and reveals a coherent, distinct responsibility. Keep unrelated cleanup separate, and do not inflate fixtures or suites to justify an overly complicated implementation.
- Avoid hand-maintained model, endpoint, capability, or schema lists unless the contract requires them. Prefer the documented API/schema and server-side validation over brittle client-side guesses.
Preserve SDK contracts and compatibility
- Compare behavior with the base revision across existing public exports and import subpaths, provider and legacy clients, stable and beta surfaces, and equivalent streaming/non-streaming paths. Preserve published TypeScript declarations, overloads, optional fields, discriminators, object identity, protected hooks, request-option/header precedence, client cloning, and documented defaults unless the task explicitly authorizes a breaking change.
- Preserve meaningful
0,false, and empty-string values, and distinguish explicitnullfrom an omitted orundefinedvalue where the contract does. Do not replace presence or nullish checks with truthiness checks. - For schema helpers, check supported Zod v3/v4 and Standard Schema integrations, inferred output types, escaped JSON Pointer references, and the actual serialized schema rather than trusting an idealized intermediate TypeScript shape.
- Verify affected CJS/ESM entrypoints, the exact minimum supported Node version, affected policy-defined Node lines, supported TypeScript versions, and relevant browser, worker, Bun, Deno, bundler, or serverless integrations. The newest CI version passing does not prove compatibility with the minimum supported version.
- Keep optional integrations isolated from the core SDK. Do not make a provider's optional dependency, environment, credential, or runtime requirement mandatory for unrelated clients; test both installed and absent optional dependencies when the import boundary changes.
- Update affected canonical docs, executable examples, or meaningful public JSDoc when the public contract changes. Preserve existing documentation URLs and import paths, and make examples runnable with the documented environment and dependencies.
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 and lifecycle correctness
- Never commit API keys, tokens, private keys,
.envfiles, customer data, or other secrets. ReadOPENAI_API_KEYfrom the environment and keep examples, fixtures, recordings, and snapshots synthetic. - Never place secret API keys in browser bundles or enable
dangerouslyAllowBrowserwithout explicit security review. Always redact credentials, authorization headers, cookies, and webhook secrets. Keep real customer-sensitive request or response data out of default or uncontrolled logs, errors, test output, snapshots, and CI artifacts. Preserve documented opt-inOPENAI_LOG=debugorlogLevel: 'debug'logging andAPIError.errordiagnostics with clear sensitive-data warnings; redact them before forwarding to untrusted sinks. - Treat provider endpoints, headers, filenames, schemas, and object properties as untrusted. At JSON object-record boundaries, validate the own properties and values actually emitted, accounting for serialization hooks and omitted values; reject or safely preserve dangerous prototype keys. Preserve supported inherited protocols and validate the final request, including normalized host/origin, redirects, protected hooks, custom fetch transports, and both current and legacy entrypoints. Never leak bearer tokens, API keys, certificates, request bodies, or other credentials across trust boundaries.
- When validation and dispatch must agree, snapshot only the security-critical values or serialized representation, within bounded memory, before irreversible network or request-body side effects. Preserve request-options object identity and protected-hook mutations; never validate one mutable representation and serialize another.
- Keep workflow tokens, permissions, and secrets at the narrowest required scope. Bind privileged checkout, release, and publication operations to the validated, immutable commit; do not trust floating refs, mutable tags, optional checks, or assumptions about repository settings and app permissions.
- Pin third-party GitHub Actions to full, immutable commit SHAs. Publish npm packages only through protected GitHub Actions OIDC trusted publishing; never add token-based release paths. Expose GitHub App private keys, OIDC credentials, and permissions only to trusted release jobs; never expose them to unreviewed scripts or untrusted code.
- For streaming, uploads, authentication, retries, timeouts, and cancellation, exercise the complete request/response lifetime: headers, JSON/error/binary/SSE bodies, raw responses, async iterators, redirect handling, abort reasons, retry budgets, concurrent refresh, cleanup, and reader/listener/lock ownership as applicable. Avoid new retained state and accidental quadratic hot paths.
- 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/jsonbodies, streaming events, and WebSocket messages. Do not introduce arbitrary fixed limits on bodies, frames, 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 deterministic public-entrypoint tests that construct large synthetic payloads in memory; do not commit large captures or require slow live image generation. - Give every cache an explicit owner, complete identity key, lifetime, and invalidation policy. Do not trust caller-mutable snapshots, conflate changed transport/certificate identities, or leak request/client-specific state or credentials across clients, transports, retries, or authentication contexts.
- Require focused security review and relevant regression tests for authentication,
network destinations or headers, browser credentials, files and uploads, webhook
signatures, parsing, serialization, dependencies, and release automation. Report
suspected vulnerabilities privately via
.github/SECURITY.md; never disclose them in public issues or pull requests.
Tooling, dependencies, and verification
- Follow
.github/CONTRIBUTING.mdand the tool versions pinned by.nvmrcandpackage.json. Keep./scripts/test,./scripts/lint, and./scripts/formatas the canonical script entrypoints, with package-manager aliases and CI routing through them; preserve both generated and handwritten suite coverage. - For dependency changes, update only the requested package and its dependency
closure. Check
pnpm install --frozen-lockfile, module format, supported runtime and TypeScript floors, minimum-release-age/trust policy, and audited lifecycle build permissions; do not hide unrelated transitive upgrades in the lockfile. - Make changed files pass the actual pinned formatter and linter. Do not disguise code or weaken a fixture to evade a lint rule. When an intentional public type, compatibility requirement, or regression fixture genuinely conflicts with a rule, use the narrowest documented exception; avoid unnecessary suppressions.
- Run the focused regression first, then the checks appropriate to the change:
pnpm lint,pnpm exec tsc,pnpm build, and./scripts/test. Exercise generated tests, packed-package/export checks, supported runtime versions, ecosystem integrations, benchmarks, or workflows when their boundaries change. Report exactly what ran and distinguish verified results from infrastructure failures or checks that could not be run.
Node.js version policy
NODE_VERSION_POLICY.md is the sole authority for lifecycle, deprecation,
exception, and release rules. Read and apply it rather than copying its rules
into agent instructions. package.json#engines.node, .nvmrc, and the README
are enforcement projections; CI derives its runtime matrix from the policy.
Keep Node.js policy changes focused and keep the consumer runtime floor separate from repository tooling requirements. After changing a policy projection, run:
node --experimental-strip-types scripts/check-node-version-policy.tsDoes 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.

