秋田预测市场 · Discord 审计

Kalshi API v2迁移引发429限流与端点困惑

2026-06-11 · Kalshi · 19 条相关讨论

R.R. 2026-06-10 22:01:41

Hi - Getting 50% 429s on order placement despite being well under documented rate limits Tier: Basic (confirmed via GET /account/limits — write refill=100/s, capacity=100) I'm placing IOC limit orders via POST /portfolio/orders on api.elections.kalshi.com at ~2 orders/sec (hardcoded 0.5s throttle). That's 20 tokens/sec against a 100 tokens/sec budget. No retries, no other write endpoints, no batch calls. Single script, single API key. Roughly 50% of orders return 429 too_many_requests. The failures come in sustained bursts (e.g. 17 consecutive 429s at ~1/sec) while other orders in the same window succeed. Example window: 2026-06-10 10:35:00–10:45:00 UTC, ticker KXBTC15M-26JUN100645-45. 104 order attempts, 54 filled, 50 returned 429. Is there an additional rate limit beyond the token bucket (per-market, per-endpoint, gateway-level)? Or something else that could be draining my write bucket? Happy to share my key ID via DM if that helps look up the bucket history.

Hi - Getting 50% 429s on order placement despite being well under documented rate limits Tier: Basic (confirmed via GET /account/limits — write refill=100/s, capacity=100) I'm placing IOC limit orders via POST /portfolio/orders on api.elections.kalshi.com at ~2 orders/sec (hardcoded 0.5s throttle). That's 20 tokens/sec against a 100 tokens/sec budget. No retries, no other write endpoints, no batch calls. Single script, single API key. Roughly 50% of orders return 429 too_many_requests. The failures come in sustained bursts (e.g. 17 consecutive 429s at ~1/sec) while other orders in the same window succeed. Example window: 2026-06-10 10:35:00–10:45:00 UTC, ticker KXBTC15M-26JUN100645-45. 104 order attempts, 54 filled, 50 returned 429. Is there an additional rate limit beyond the token bucket (per-market, per-endpoint, gateway-level)? Or something else that could be draining my write bucket? Happy to share my key ID via DM if that helps look up the bucket history.

kikopashka 2026-06-10 22:13:47

U must change the endpoints Probably (I’m 100% sure) u use v1 and the cost for v1 has been increased to force to use v2

U must change the endpoints Probably (I’m 100% sure) u use v1 and the cost for v1 has been increased to force to use v2

R.R. 2026-06-10 22:18:05

Got it. Also, my code points to https://api.elections.kalshi.com/trade-api/v2/portfolio/orders Is that the correct endpoint or is there a newer one?

Got it. Also, my code points to https://api.elections.kalshi.com/trade-api/v2/portfolio/orders Is that the correct endpoint or is there a newer one?

kikopashka 2026-06-10 22:19:57

The right one has something like portfolio/events/orders I just remember there is extra “events” in the endpoint Take a look at it in the change logs in documentation

The right one has something like portfolio/events/orders I just remember there is extra “events” in the endpoint Take a look at it in the change logs in documentation

kikopashka 2026-06-10 22:21:19

So yours is wrong, it’s v1 Although it has “v2” in the url it’s just bad choose for naming from kalshi

So yours is wrong, it’s v1 Although it has “v2” in the url it’s just bad choose for naming from kalshi

R.R. 2026-06-10 22:22:27

You are officially smarter than Claude who could not debug this despite 2 hours of debugging. Thank you!

You are officially smarter than Claude who could not debug this despite 2 hours of debugging. Thank you!

kikopashka 2026-06-10 22:23:30

Well just ask Claude to get through a change log page and point it towards the logs where v2 concept is described, should work like that

Well just ask Claude to get through a change log page and point it towards the logs where v2 concept is described, should work like that

Byron 2026-06-10 23:03:21

can we get some kind of notification in the future when these kinds of breaking changes happen? i feel like they keep doing this, just silently push a change and then wait for everyone's code to blow up, I knew nothing about the "v2" order endpoint change until I started getting rate limited while using the old endpoint

can we get some kind of notification in the future when these kinds of breaking changes happen? i feel like they keep doing this, just silently push a change and then wait for everyone's code to blow up, I knew nothing about the "v2" order endpoint change until I started getting rate limited while using the old endpoint

Beans 2026-06-10 23:09:34

“You can subscribe to the RSS changelog at /changelog/rss.xml if you’d like to stay ahead of breaking changes.”

“You can subscribe to the RSS changelog at /changelog/rss.xml if you’d like to stay ahead of breaking changes.”

Byron 2026-06-10 23:31:29

maybe an email? i spent like 2 hours trying to debug the rate limiting because I thought I had introduced a bug somewhere.

maybe an email? i spent like 2 hours trying to debug the rate limiting because I thought I had introduced a bug somewhere.

Byron 2026-06-10 23:35:15

also, is the get endpoint now failing when you create an order with the new endpoint? I'm getting a 404. e.g. I post with the new create order endpoint, and then try GET /portfolio/orders/{order_id} and GET /portfolio/orders?status=resting and see nothing

also, is the get endpoint now failing when you create an order with the new endpoint? I'm getting a 404. e.g. I post with the new create order endpoint, and then try GET /portfolio/orders/{order_id} and GET /portfolio/orders?status=resting and see nothing

betaclone 2026-06-10 23:38:52

This stuff has been in the changelog for months

This stuff has been in the changelog for months

betaclone 2026-06-10 23:39:01

And the docs

And the docs

Byron 2026-06-10 23:41:12

My code just runs automatically, should I be checking the docs all the time for updates? seems like a simple email isn't crazy

My code just runs automatically, should I be checking the docs all the time for updates? seems like a simple email isn't crazy

kikopashka 2026-06-10 23:43:59

For me rate limit was a great notification, since it’s wasnt increased just x10 in one day, it was slowly which gave understanding of changes

For me rate limit was a great notification, since it’s wasnt increased just x10 in one day, it was slowly which gave understanding of changes

betaclone 2026-06-10 23:44:00

You should be keeping up with the changelog, yes

You should be keeping up with the changelog, yes

betaclone 2026-06-10 23:44:30

Even if it's once a month. These breaking changes always come with warning

Even if it's once a month. These breaking changes always come with warning

betaclone 2026-06-10 23:45:18

You can't expect the API to stand still and I personally don't want an email every time there's any change as a good deal of them don't affect me anyway

You can't expect the API to stand still and I personally don't want an email every time there's any change as a good deal of them don't affect me anyway

Melon 2026-06-11 18:39:41

https://docs.kalshi.com/changelog > June 11, 2026 > New endpoint: GET /trade-api/v2/account/api_usage_level/volume_progress reports your trailing 30d volume and the earn/keep volume goals for each volume-based API usage tier.

https://docs.kalshi.com/changelog > June 11, 2026 > New endpoint: GET /trade-api/v2/account/api_usage_level/volume_progress reports your trailing 30d volume and the earn/keep volume goals for each volume-based API usage tier.