The rate limit headers like x-ratelimit-remaining-tokens
and x-ratelimit-remaining-tokens
are no longer present in the HTTP api as they are documented to be here.
$> curl https://api.openai.com/v1/chat/completions \
-D - -H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-4",
"messages": [{"role": "user", "content": "Say this is a test!"}],
"temperature": 0.7
}'
HTTP/2 200
date: Tue, 10 Sep 2024 23:58:08 GMT
content-type: application/json
access-control-expose-headers: X-Request-ID
openai-organization: studiosity
openai-processing-ms: 1032
openai-version: 2020-10-01
strict-transport-security: max-age=15552000; includeSubDomains; preload
x-request-id: req_deaa3616cbd15d33b4db96b3ba74d2b4
cf-cache-status: DYNAMIC
set-cookie: __cf_bm=hYY77LPW86IHCxlt4Ckj5AOaCVUtpjnWSTeqBMAc6dY-1726012688-1.0.1.1-xKRPB4N9yUcQZWhNtNFsM_MRYxNYrxURn92ocgRONgdPcsRREoF.2HAFjD1kntn0bA.CW7rbzxXJqRZ7NSYkPw; path=/; expires=Wed, 11-Sep-24 00:28:08 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
x-content-type-options: nosniff
set-cookie: _cfuvid=BWY.Nq8rNtNHMCHMBH0D.4vGEpR8jzpu.fS6z6IeXm0-1726012688465-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None
server: cloudflare
cf-ray: 8c135d3eeec4a97a-SYD
alt-svc: h3=":443"; ma=86400
{
"id": "chatcmpl-A652Fhuqsr1kskKe5B63M0eiw3842",
"object": "chat.completion",
"created": 1726012687,
"model": "gpt-4-0613",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is a test!",
"refusal": null
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 13,
"completion_tokens": 5,
"total_tokens": 18
},
"system_fingerprint": null
}
Is there a parameter you need to add to get the rate limit info?