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
@@ -375,6 +375,24 @@ Error codes are as followed:
375
375
| >=500 |`InternalServerError`|
376
376
| N/A |`APIConnectionError`|
377
377
378
+
## Request IDs
379
+
380
+
> For more information on debugging requests, see [these docs](https://platform.openai.com/docs/api-reference/debugging-requests)
381
+
382
+
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.
383
+
384
+
```python
385
+
completion =await client.chat.completions.create(
386
+
messages=[{"role": "user", "content": "Say this is a test"}], model="gpt-4"
387
+
)
388
+
print(completion._request_id) # req_123
389
+
```
390
+
391
+
Note that unlike other properties that use an `_` prefix, the `_request_id` property
392
+
*is* public. Unless documented otherwise, *all* other `_` prefix properties,
393
+
methods and modules are *private*.
394
+
395
+
378
396
### Retries
379
397
380
398
Certain errors are automatically retried 2 times by default, with a short exponential backoff.
0 commit comments