The rate limit has a very peculiar formula, and the reset-tokens is seemingly when the memory state is back to the same as if you had made no requests. No OpenAI documentation lays out how to write code based on the values in headers or their meanings.
Remaining tokens seems as if you’ve been hitting the rate limit, perhaps even getting errors instead of fulfillment, so that may make the refill rate (that one would think is simply 5M tokens per minute) take longer to again be memoryless.
How that formula works: impossible proprietary mystery.