Spot API limits IP based or API based?

Hey, I’m implementing the way to handle API request limits to respect current limits and found quite strange behavior. As stated in docs:

  • The limits on the API are based on the IPs, not the API keys.
  • Every request will contain X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter) in the response headers which has the current used weight for the IP for all request rate limiters defined.

Let’s do 4 request using 2 different proxy.

Proxy #1
X-Mbx-Used-Weight:[10] X-Mbx-Used-Weight-1m:[10]

Proxy #2
X-Mbx-Used-Weight:[20] X-Mbx-Used-Weight-1m:[20]

Proxy #2
X-Mbx-Used-Weight:[30] X-Mbx-Used-Weight-1m:[30]

Proxy #1
X-Mbx-Used-Weight:[40] X-Mbx-Used-Weight-1m:[40]

All requests made to /api/v3/account using same api key.

Is it intended way or is docs misleading?

P.S. Proxy is working and code tested to use proxy properly. Proxy do not share any X-forward-from headers

Later I tried 2 different accounts on exchange and repeat the experiment. And the X-Mbx-Used-Weight header definitely send data per API key base. As a result for 4 request looks like:

Proxy #1 Api Key #1
X-Mbx-Used-Weight [10]

Proxy #2 Api Key #2
X-Mbx-Used-Weight [10]

Proxy #2 Api Key #1
X-Mbx-Used-Weight [20]

Proxy #1 Api Key #2
X-Mbx-Used-Weight [20]

request limit is IP based.

If it is true why 2 different IP have combined stats for X-Mbx-Used-Weight? Does not make any sense. I tested it and not just asking.

if you wish to do a real test, test it from 2 different servers, and see if the rate usage can accumulate or not.

I tried the other way. Using my local machine and server to start requesting same api key at same time. The X-Mbx-Used-Weight grow together. Something misleading in API docs or broken.