openai-go icon indicating copy to clipboard operation
openai-go copied to clipboard

Missing rate limit headers in response API

Open obitech opened this issue 8 months ago • 1 comments

Hey there! I'm missing the rate limit headers from the new Responses API, they used to be returned from the request with the Completions API.

Here is what I call:

	var respInfo *http.Response
	chatCompletion, err :=client.Responses.New(
		ctx,
		req,
		option.WithResponseInto(&respInfo),
		option.WithRequestTimeout(1*time.Minute),
	)

Logging respInfo.Header only gives me:

{
    "headers": {
        "Alt-Svc": [...],
        "Cf-Cache-Status": [...],
        "Cf-Ray": [...],
        "Content-Type": [...],
        "Date": [...],
        "Openai-Organization": [...],
        "Openai-Processing-Ms": [...],
        "Openai-Version": [...],
        "Server": [...],
        "Set-Cookie": [...],
        "Strict-Transport-Security": [...],
        "X-Content-Type-Options": [...],
        "X-Request-Id": [... ]
    }
}

Is this a limitation of the new Responses API, or an issue with the library?

obitech avatar Mar 27 '25 11:03 obitech

Thanks for the report, this is almost definitely an API issue. I've forwarded this to the team.

RobertCraigie avatar Mar 27 '25 11:03 RobertCraigie