OpenAI SDK for TypeScript 7.10
Last reviewed Sep 6, 2026
Prompt Details
Prompt Composition
4prompts
- JavaScript ES2026102 lines · 3.1K tokens
- Node.js 24101 lines · 5.3K tokens
- TypeScript 746 lines · 1.5K tokens
- OpenAI SDK for TypeScript 7.1096 lines · 4.6K tokens
Total345 lines · 14.5K tokens
CWE Coverage
- 15
- 20
- 22
- 59
- 73
- 78
- 79
- 88
- 89
- 95
- 113
- 117
- 200
- 208
- 209
- 214
- 250
- 252
- 295
- 297
- 306
- 319
- 323
- 330
- 338
- 346
- 347
- 352
- 354
- 362
- 367
- 377
- 426
- 444
- 459
- 471
- 488
- 494
- 502
- 522
- 524
- 532
- 602
- 639
- 653
- 732
- 770
- 772
- 807
- 829
- 838
- 841
- 862
- 863
- 908
- 915
- 916
- 918
- 922
- 942
- 943
- 1004
- 1321
- 1333
- 1426
- 1427
Prompt Preview
Apply the Node.js 24 and TypeScript 7 prompts first. These rules cover the openai 7.10 client, including its credential and endpoint selection, Responses state, 7.10 steering and safety events, tool callbacks, streams, uploads, webhooks, and provider transports.
Client, credential, and destination boundaries
- Treat the SDK as an outbound API client, not an authentication or authorization layer. Authenticate the local caller and enforce tenant, project, resource, model, tool, and spend policy before invoking it.
- Construct
OpenAIonly in trusted server or worker code. Leave browser use disabled;dangerouslyAllowBrowser: trueonly removes the SDK guard and exposes any reusable credential to every browser user, so use a narrowly scoped, short-lived server-minted credential instead. - Select exactly one credential path. Account for environment fallbacks for
OPENAI_API_KEYandOPENAI_ADMIN_KEY; passapiKey: nullor unsetOPENAI_API_KEYwhen selectingworkloadIdentitybecause the constructor rejects a nonempty API key combined with workload identity. - Isolate
adminAPIKeyfrom application request handlers. Putclient.admin.organization.*operations behind a separate administrative service and authorization policy. - Keep
baseURL,dataResidency,provider,defaultHeaders,defaultQuery,fetch,fetchOptions, proxy dispatchers, organization, and project in immutable operator configuration. Never derive a credential-bearing destination, header, query value, or transport hook from request or model data. - Prefer
dataResidencywhen selecting an