You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -417,6 +417,24 @@ Error codes are as followed:
417
417
| >=500 |`InternalServerError`|
418
418
| N/A |`APIConnectionError`|
419
419
420
+
## Request IDs
421
+
422
+
> For more information on debugging requests, see [these docs](https://platform.openai.com/docs/api-reference/debugging-requests)
423
+
424
+
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.
425
+
426
+
```python
427
+
completion =await client.chat.completions.create(
428
+
messages=[{"role": "user", "content": "Say this is a test"}], model="gpt-4"
429
+
)
430
+
print(completion._request_id) # req_123
431
+
```
432
+
433
+
Note that unlike other properties that use an `_` prefix, the `_request_id` property
434
+
*is* public. Unless documented otherwise, *all* other `_` prefix properties,
435
+
methods and modules are *private*.
436
+
437
+
420
438
### Retries
421
439
422
440
Certain errors are automatically retried 2 times by default, with a short exponential backoff.
0 commit comments