We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
.withResponse()
1 parent 6c25833 commit b6800d4Copy full SHA for b6800d4
README.md
@@ -377,6 +377,18 @@ const completion = await client.chat.completions.create({ messages: [{ role: 'us
377
console.log(completion._request_id) // req_123
378
```
379
380
+You can also access the Request ID using the `.withResponse()` method:
381
+
382
+```ts
383
+const { data: stream, request_id } = await openai.chat.completions
384
+ .create({
385
+ model: 'gpt-4',
386
+ messages: [{ role: 'user', content: 'Say this is a test' }],
387
+ stream: true,
388
+ })
389
+ .withResponse();
390
+```
391
392
## Microsoft Azure OpenAI
393
394
To use this library with [Azure OpenAI](https://learn.microsoft.com/azure/ai-services/openai/overview), use the `AzureOpenAI`
0 commit comments