Skip to content

Commit 01c6cbd

Browse files
committed
docs
1 parent 0bef40a commit 01c6cbd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,17 @@ Error codes are as followed:
361361
| >=500 | `InternalServerError` |
362362
| N/A | `APIConnectionError` |
363363

364+
## Request IDs
365+
366+
> For more information on debugging requests, see [these docs](https://platform.openai.com/docs/api-reference/debugging-requests)
367+
368+
All object responses in the SDK provide a `_request_id` property which is added from the `x-request-id` response header so that you can quickly log failing requests and report them back to OpenAI.
369+
370+
```ts
371+
const completion = await client.chat.completions.create({ messages: [{ role: 'user', content: 'Say this is a test' }], model: 'gpt-4' });
372+
console.log(completion._request_id) // req_123
373+
```
374+
364375
## Microsoft Azure OpenAI
365376

366377
To use this library with [Azure OpenAI](https://learn.microsoft.com/azure/ai-services/openai/overview), use the `AzureOpenAI`

0 commit comments

Comments
 (0)