Realtime: documented noise_reduction: null is rejected by TypeScript
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
- Domain
- api, backend-api-design
Research direction
Start with src/resources/realtime/realtime.ts, where the issue identifies RealtimeAudioConfigInput.noise_reduction and its JSDoc, then trace the schema or generation projection mentioned in the report. Add a compile-time regression for RealtimeSessionCreateRequest using noise_reduction: null; done means the public request type accepts null while omission and the near_field and far_field values still compile.
Written by the indexing model from the issue text.
Description
Confirm this is a Node library issue and not an underlying OpenAI API issue
- This is an issue with the Node library.
Describe the bug
The documented way to disable Realtime input noise reduction does not type-check with strict null checking:
audio: { input: { noise_reduction: null } }
This prevents a typed client.realtime.clientSecrets.create() call from expressing the documented off setting without a cast, suppression, or weakening null checking. Omitting the property, selecting near_field, and selecting far_field all compile in otherwise equivalent controls.
The mismatch is present in the published [email protected] artifact and in a fresh build of main at 93f5f1ca7420fe711ed559eca6405044199f5c50. This is a compile-time SDK contract report, not a claim about a new server failure or a runtime regression introduced by the latest documentation change.
To Reproduce
-
In an empty directory, run:
npm init -y npm install [email protected] npm install --save-dev [email protected] @types/[email protected] -
Save the code below as
repro.ctsand this configuration astsconfig.json:{ "compilerOptions": { "target": "ES2022", "module": "Node16", "moduleResolution": "Node16", "strict": true, "noEmit": true, "skipLibCheck": true, "types": [] }, "files": ["repro.cts"] } -
Run
npx tsc --project tsconfig.json. Compilation fails onnoise_reduction: null:error TS2322: Type 'null' is not assignable to type 'NoiseReduction | undefined'.
The same result occurs with TypeScript 6.0.3 and when the file is .mts. skipLibCheck only skips dependency declaration checking; the failing assignment in this consumer remains checked under strict: true. The compatible Node declaration dependency isolates this SDK check from newer Node declarations that older TypeScript cannot parse.
Code snippets
import OpenAI from 'openai';
import type { RealtimeSessionCreateRequest } from 'openai/resources/realtime/realtime';
declare const client: OpenAI;
const session: RealtimeSessionCreateRequest = {
type: 'realtime',
audio: { input: { noise_reduction: null } },
};
client.realtime.clientSecrets.create({ session });
This example is compile-only; it needs no API key and should not be executed as JavaScript.
Expected and actual behavior / root cause
- Expected: the documented
nulloff setting is representable by the public Realtime request type, while omission and valid object configurations remain supported. - Actual: generated
RealtimeAudioConfigInput.noise_reductionisnoise_reduction?: RealtimeAudioConfigInput.NoiseReduction, with no| null. - The JSDoc immediately above that member explicitly describes
nullas the off setting, both in 7.64.0 and after the clarification in #3192. That merged PR changes documentation, not the nullable type, so it does not resolve this compilation failure. The open release PR #3191 likewise contains the documentation changes rather than a nullable-type fix.
Please reconcile the schema/generation projection with the documented contract and add a compile-time regression for the public request. I have not hand-edited generated resources or proposed a runtime validation change.
Validation
| Target | TypeScript | .cts / .mts with null |
Omitted / near-field / far-field controls |
|---|---|---|---|
| Actual npm 7.64.0 | 4.9.5 | TS2322 | Pass |
| Actual npm 7.64.0 | 6.0.3 | TS2322 | Pass |
Main 93f5f1ca build |
4.9.5 | TS2322 | Pass |
Main 93f5f1ca build |
6.0.3 | TS2322 | Pass |
The released tarball was checked against its registry SHA512 integrity. Synthetic fetch checks on Node 22.0.0 and 24.19.0 preserve the explicit JSON null through the public client-secret endpoint; these checks do not establish live server acceptance or account access. No real API calls or sensitive data were used.
OS
Windows x64.
Node version
Node 24.19.0 for compiler/build validation; additional synthetic runtime checks on Node 22.0.0.
Library version
openai 7.64.0; also reproduced on main 93f5f1ca7420fe711ed559eca6405044199f5c50.
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 1.6k
- Avg merge
- 19h 41m
- Merged PRs (30d)
- 110
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/openai-node
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
openai/openai-node#3232 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
openai/openai-node#2962 · 2 comments ·
Maintainers usually reply within 1 day
All issues in openai/openai-node
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Techiebutler/freeframe#687 ·
Maintainers usually reply within 1 day
-
enhancement from-app needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
nightly-labs/openbot#23050 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OHDSI/Data2Evidence#3846 ·
Maintainers usually reply within 3 days
-
frontend: EditorDialog: Save & Apply on an empty or comment-only document reports success and applies nothingPossibly taken @shubhamrai9122-creator claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
kubernetes-sigs/headlamp#9086 ·
Maintainers usually reply within 1 day
-
bug rust SDK & CLI & REST API
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
boxlite-ai/boxlite#3292 ·
Maintainers usually reply within 1 day