openai-php / client

⚡️ OpenAI PHP is a supercharged community-maintained PHP API client that allows you to interact with OpenAI API.
MIT License
4.57k stars 466 forks source link

[Bug]: Rate Limits not being returned #288

Closed s2-ieuan closed 6 months ago

s2-ieuan commented 6 months ago

Description

The response metadata rate limit info is empty, trying to access $response->meta()->requestLimit->limit; returns an error reading limit as requestLimit does not exist. Calling $response->meta()->toArray() also does not show these headers

Steps To Reproduce

Trigger an image generation request, the rate limit stays empty

OpenAI PHP Client Version

0.8.0

PHP Version

8.3.0

Notes

No response

s2-ieuan commented 6 months ago

It appears that this is an issue with the image generation endpoint, rather than the whole API itself. I guess there is no fix for this without OpenAI adding these headers to the relevant endpoints

gehrisandro commented 6 months ago

Hi @s2-ieuan

You are right. OpenAI does not include this information in all of their responses. Therefore there is nothing we can do about it from our side.