Errors, limits and retries
Every common refusal of the Prow API with its meaning and what to do, the rate limits, and how to retry a call safely with an idempotency key.
On this page
The shape of an error
Every refusal is one plain sentence with a stable code. Relay the sentence as it is worded and act on the code.
Over REST the body is:
{ "error": { "code": "invalid_settings", "message": "These settings are not valid: Minimum investment for these settings: 25. Fix them and try again.", "details": { "errors": [ { "code": "order_below_min", "field": "investment", "message": "Minimum investment for these settings: 25" } ] }, "request_id": "req_abc123" } }
Over MCP a refusal of a tool is a tool result with isError: true and HTTP 200, with the same codes as REST. What comes back depends on the protocol version, so read the text when in doubt:
content[0].textalways has the sentence, then onekey: valueline per piece of information that matters, thenrequest_id: <id>last. The lines arecode: <code>,retry_after_s: <seconds>when there is a wait, oneerror: <reason code> (<field>): <sentence>line for each problem of a draft, and the plain values ofdetailssuch asmin_investment: 780.63,min_investment_currency: USDT,fix_url: https://...oropen_in_prow: https://.... A client that reads text alone loses nothing.structuredContentis on every protocol version, whateverMCP-Protocol-Versionheader you send. It is{ "error": { "code", "message", "request_id", "details"?, "retry_after_s"? } }, the same object as the REST body. A successful call has the same object as the text JSON instructuredContent.
A request that is not a valid tool call (an unknown tool, bad framing) is a JSON-RPC error instead. So is every refusal that comes before the tool runs: a wrong key (HTTP 401), a rate limit (HTTP 429 with Retry-After) or a paused API (HTTP 503). Its body is { "jsonrpc": "2.0", "id": ..., "error": { "code": -32000, "message": "...", "data": { "code": "rate_limited", "request_id": "...", "retry_after_s": 12 } } }, the same code as REST. Quote the request_id when you ask Prow for help.
Refusals and what to do
This table is generated from the codes the API itself answers, so it lists every one and cannot fall behind. The status is the HTTP status over REST.
| Code | Status | What it means | What to do |
|---|---|---|---|
ambiguous_key | 400 | Two different keys were sent | Send one |
bad_request | 400 | An argument is missing, unknown or the wrong type | Fix the call. The sentence names the argument |
key_in_query | 400 | The key was sent in the address | Send it in the x-api-key header |
key_revoked | 401 | The key was revoked | Make a new key in Settings |
unauthorized | 401 | The key is missing or wrong | Send it in the x-api-key header, never in the address |
bots_not_available | 403 | Bots are not available on this account | Nothing to change on your side |
consent_outdated | 403 | The key was made before the text it needs existed (building, editing or copying bots) | Make a new key: the sentence says which |
key_expired | 403 | The key has expired | Make a new key in Settings |
key_suspended | 403 | Prow paused the key | Open Prow for the reason |
not_available | 403 | The API or this feature is not available for this account | Nothing to change on your side |
origin_not_allowed | 403 | A browser page called the API | Call it from a script or an assistant, not from a web page |
scope_missing | 403 | The key does not have the permission this tool needs | Make a key with Build, pause and stop your bots |
funding_unavailable | 404 | Funding bots are switched off | list_bot_types shows what is on |
hedge_unavailable | 404 | The spot hedge is switched off | list_bot_types shows what is on |
not_found | 404 | No such bot, draft or market (also for another user's id) | Check the id with list_bots or list_bot_drafts |
type_not_available | 404 | That bot type is switched off in Prow right now | list_bot_types shows what is on |
unknown_market | 404 | No such market on that venue (a spot pair such as @107 needs kind: spot) | Name the market as list_markets names it, or add kind spot and use a pair from list_spot_markets |
unknown_tool | 404 | There is no such tool | tools/list shows the tools |
method_not_allowed | 405 | The route does not accept this method | Use the method the answer names |
account_not_unified | 409 | A Funding bot needs the Hyperliquid account on unified balance | Switch the account to unified balance in Prow |
account_portfolio_margin | 409 | A Funding bot runs on unified balance, not portfolio margin | Use an account on unified balance |
bot_state | 409 | The bot is in a state that does not allow this (for example editing a stopped bot) | Check get_bot. A draft is changed with update_bot_draft |
combo_unavailable | 409 | Ladder bots are switched off | Use grid or dca |
idempotency_conflict | 409 | This idempotency key was used with different arguments | Use a new key for a different request |
idempotency_key_reused | 409 | The key was used for another request, or too long ago | Use a new key |
market_busy | 409 | duplicate_bot was asked to copy a bot that is still running on that market and account (Prow runs one bot per market and account) | Stop the bot first (its position is closed), wait until it is stopped, then copy. A copy to another market or exchange needs no stop |
market_not_available | 409 | Bots are not open on that market, although it is listed (list_markets shows bots: false) | Choose a market with bots true |
not_ready | 409 | The pause is still being applied | Wait a few seconds and try again |
payload_too_large | 413 | The request body is too large | Send less |
unsupported_media_type | 415 | The body is not JSON | Send it as application/json |
account_required | 422 | You have more than one account on that venue | Send account_id with one of the accounts the answer lists |
amount_too_small | 422 | The amount is below what the setting needs | Raise it to the minimum the answer names |
arb_unavailable | 422 | Arbitrage bots are switched off | list_bot_types shows what is on |
edit_not_supported | 422 | Arbitrage and Funding bots keep the settings they were signed with | Stop the bot and make a new one |
idempotency_mismatch | 422 | The former code of idempotency_conflict (renamed; a script that matched it should match idempotency_conflict, 409) | Use idempotency_conflict |
invalid_settings | 422 | The settings did not pass Prow's check | Read details.errors, fix each field, call again. The reasons are listed below |
invalid_value | 422 | A value of edit_bot is outside the allowed range, has the wrong type, or the result would break a rule of the draft (a trailing take profit needs a take profit) | Use a value the sentence allows |
market_unsupported | 422 | The market or kind is not offered (for example Aster spot while it is off) | Choose another market, or use futures |
needs_new_signature | 422 | The setting is signed when a bot starts, so nobody can change it on a running bot | Stop the bot (its position is closed), wait until it is stopped, duplicate_bot, change the copy, start it in Prow |
needs_owner | 422 | A key may only make a running bot safer, and this change would loosen it, remove a protection or set a distance too small | Make the change in Prow: details.open_in_prow links to the bot. details.key_may_change says what a key may do |
needs_trade_key | 422 | Reading this venue's account needs a key that can trade, which Prow does not offer for it | Use Hyperliquid, or read it in Prow |
network_mismatch | 422 | The account is on another network than Prow runs bots on | Use an account on the network Prow runs |
no_account | 422 | No account on that venue is connected | Connect it in Prow |
not_enough_history | 422 | The market is too new to check settings against its past prices | Choose a market that has traded for longer |
not_for_this_bot | 422 | The setting does not apply to this kind of bot (for example a range exit on a DCA bot) | details and the sentence list what a key may change on this bot |
not_paused_by_this_key | 422 | Only the key that paused a bot can resume it | Resume it in Prow |
starts_a_trade | 422 | startDeal opens a position, so a key cannot send it | Start the deal in Prow |
too_few_coins | 422 | This account already holds too many of the coins on spot for a hedge | Pick at least 3 coins it does not hold |
too_many_drafts | 422 | You have 50 unstarted drafts, the most Prow keeps, and a copy never deletes any | Delete drafts you do not need with delete_bot_draft, then try again |
type_change | 422 | A draft keeps the bot type it was made with | Make a new draft of the other type |
unknown_setting | 422 | That is not a setting of a bot | get_bot shows the settings and edit_rules says which a key may change |
venue_mismatch | 422 | The account is on another venue than the one you named | Use an account on the venue you named |
venue_not_served | 422 | That venue is not served right now | Use another venue |
bot_cooldown | 429 | The bot was paused or resumed a moment ago | Wait the seconds the answer names |
rate_limited | 429 | Too many calls this minute, more than 20 bot changes in a minute, the hourly bot builder budget used up, a trailing take profit changed again within 10 minutes, or a wrong key sent too often | Wait retry_after_s seconds (the Retry-After header). The builder budget is in get_key_limits as build_budget. See the limits below |
venue_busy | 429 | Prow's reads from the venue are at their limit | Wait Retry-After seconds |
bot_load_failed | 500 | Prow could not load the bot | Try again; quote the request_id if it repeats |
draft_create_failed | 500 | The draft could not be saved | Try again; quote the request_id if it repeats |
draft_delete_failed | 500 | The draft could not be deleted | Try again; quote the request_id if it repeats |
draft_update_failed | 500 | The draft could not be changed | Try again; quote the request_id if it repeats |
internal | 500 | Something went wrong at Prow | Try again; quote the request_id if it repeats |
output_too_large | 502 | The answer was too large to return | Ask for fewer rows with limit |
venue_unreachable | 502 | The venue could not be reached | Try again in a moment |
api_halted | 503 | The API is paused by Prow | Try again later |
api_misconfigured | 503 | The API is not available right now | Try again later |
audit_unavailable | 503 | Prow's call log is unavailable, so changes are paused (reading still works) | Try again in a minute |
auth_unavailable | 503 | Prow could not check your key right now | Try again in a moment |
busy | 503 | Prow's settings checker is busy | Try again in a few seconds |
data_unavailable | 503 | Prow could not load your data | Try again in a moment |
degraded | 503 | Prow's call counters are recovering, so changes are paused (reading still works) | Try again in a minute |
sync_stale | 503 | Prow could not refresh its list of keys, so changes are paused (reading still works) | Try again in a few minutes |
usage_unavailable | 503 | The list of recent calls is not available | Try again in a minute |
venue_unavailable | 503 | The venue could not be reached | Try again in a moment |
backtest_timeout | 504 | Checking the settings took too long | Try again, or use fewer levels |
Which code to expect from edit_bot
edit_bot changes a running bot only. On a draft it answers bot_state (409): a draft is changed with update_bot_draft. The field codes needs_owner, needs_new_signature, not_for_this_bot and unknown_setting (and starts_a_trade and invalid_value) are answers about the settings of a running bot: they say whether a key may make that change and which way. A paused bot answers needs_owner.
Reasons inside invalid_settings
Each item of details.errors has a code, the field and a sentence. This table is generated from the checks Prow runs, so it lists every code and cannot fall behind.
Errors
These make the settings invalid: the call is refused until you fix them.
| Code | What it means | What to do |
|---|---|---|
invalid | A field has the wrong type or is outside its allowed range, or an unknown field was sent | Fix the field named in the field of the error; the settings reference lists every field and range |
market_closed | The market is not trading | Choose another market |
market_not_available | Bots are not open on this market | Choose another market (list_markets, list_spot_markets) |
combo_unavailable | Ladder bots are off in Prow right now | Use grid or DCA (list_bot_types shows what is on) |
bot_tp_unavailable | A take profit for the whole bot is not available yet | Use takeProfitPct (grid) or tpPct (DCA) |
market_busy | Another bot of yours already runs on this market and account (Prow runs one per market and account) | Stop it first, or use another market or account |
leverage_too_high | Leverage is above the market's maximum or above 5 | Lower leverage |
advanced_top_only | Short and neutral grids, and leverage above 3, run only on the deepest markets | Use a long grid, leverage 3 or less, or one of the deepest markets |
max_loss_too_high | The loss limit is larger than the position | Lower maxLossUsd, or raise investment or leverage |
range | The upper price is not above the lower price | Swap or fix lower and upper |
range_too_narrow | The range is narrower than the minimum (2 percent, 4 for a Ladder) | Widen the range |
too_many_grids | More levels than the venue allows (150 on Hyperliquid, 100 on Aster) | Lower count |
stop_required | The stop loss is missing: slLow for long and neutral, slHigh for short and neutral, slPct for DCA | Add the stop |
stop_inside_range | The stop loss sits inside the range (or inside the trailing limit) | Put slLow below lower and slHigh above upper |
trailing_spot_long | trailingUp is for spot grids | Remove trailingUp on futures |
trailing_spot_only | trailingDown is for spot grids | Remove trailingDown on futures |
trailing_limit | The trailing limit is on the wrong side of the range | Put the up limit above upper and the down limit below lower |
trigger_at_price | The trigger price is the price now | Pick another trigger price or leave it out |
price_beyond_stop | The price now is already past the stop loss | Move the stop or wait for the price |
trailing_tp_needs_tp | A trailing take profit needs a take profit | Set takeProfitPct too |
neutral_side_over_cap | At the top of its range a Neutral grid would hold more on its sell side than on its buy side, more than the investment allows | Use more grids or a narrower range |
grid_levels | Too few levels are left after rounding to the venue's price ticks | Lower count or widen the range |
step_below_fee_floor | The smallest grid step is below what fees and slippage take | Lower count or widen the range |
order_below_min | An order is below the venue's minimum | Raise investment or lower count; the sentence gives the minimum |
profit_per_grid | The profit per grid after fees is not positive | Lower count or widen the range |
liq_before_stop | The liquidation price comes before the stop loss | Lower leverage or move the stop closer |
combo_futures_only | Ladder bots run on futures only | Use a futures market |
combo_direction | A Ladder is long or short | Set direction long or short |
combo_levels | A Ladder has 6 to 40 levels | Set count between 6 and 40 |
combo_trigger | A Ladder starts at the price now: no trigger price | Leave trigger out |
combo_range_exit | A Ladder has no range exit | Leave rangeExit as off |
combo_take_on_cross | A Ladder does not take crossed levels at market | Leave takeOnCross false |
combo_price_outside | A Ladder needs levels on both sides of the price now | Move the range around the price |
qfl_long_only | A QFL start buys a crack under a base: long only | Set direction long |
max_active | More extra orders resting at once than extra orders | Lower maxActiveSafety |
trailing_tp | The trailing take profit is not below the take profit | Set trailingTpPct below tpPct |
tp_targets_trailing | Several take profits do not go with a trailing take profit | Use one of them |
tp_targets_order | Each take profit target must be further than the one before | Order tpTargets by pct, ascending |
tp_targets_share | The target shares do not add up to 100 | Make the shares add up to 100 |
tp_target_below_min | The smallest target's share of the base order is below the venue's minimum order | Raise baseOrder or give the smallest target a bigger share |
breakeven_needs_targets | Breakeven needs two or more take profit targets | Add tpTargets or turn breakeven off |
breakeven_target_close | With breakeven on, the first target must be far enough to cover fees | Raise the first target's pct |
stop_inside_ladder | The DCA stop sits inside the safety order ladder: it must be beyond the last safety order | Raise slPct above stop_loss_must_exceed_pct, or use fewer or closer safety orders |
ladder_too_deep | The extra buys would go below zero | Lower safetyCount, deviationPct or stepScale |
investment_too_small | The investment cannot pay for the base and extra orders | Raise investment, or lower the order sizes or leverage |
Warnings
These come back next to a valid check, in warnings. They do not refuse the call.
| Code | What it means | What to do |
|---|---|---|
negative_return | The scanner reads the return of this coin and strategy after costs as negative right now | Choose a coin the scanner shows with after_costs_pct_a_year above zero (list_arbitrage_opportunities), or expect the bot to wait |
stop_lifted | The orders are so small that the stop loss is placed with a little extra size so the exchange accepts it; it can only reduce the position | Raise the order sizes (investment or baseOrder) if you want the stop to match the position exactly |
max_loss_before_stop | The loss limit would close the bot before its stop loss is reached | Raise maxLossUsd or move the stop closer |
direction_risk | Short and neutral bots lose when the price keeps moving against them | Check the direction is what you want |
price_outside_range | The price is outside your range: the bot buys or sells its whole investment at the start, or waits on one side | Move the range around the price, or set a trigger price |
levels_merged | Some levels merged after rounding to the venue's ticks | Lower count |
small_step | Steps under 0.15 percent: most of each trade goes to fees | Lower count or widen the range |
martingale | Each extra order is bigger than the last: losses grow fast if the price keeps going | Lower volumeScale |
bot_tp_below_fees | The bot-level take profit is below what fees cost | Raise botTpPct |
Rate limits
| Limit | Value |
|---|---|
| Reads | 120 a minute per key and 240 a minute per user across keys |
| Writes | 30 a minute per key and 60 a minute per user |
| Changing bots (edit, pause, stop, drafts) | 20 a minute per key |
| Building bots | 60 points an hour per key (the builder budget, below) |
Every answer carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset. X-RateLimit-Reset is the moment the current one-minute window ends, as Unix time in seconds (UTC, for example 1796122860). Retry-After is different: it is a number of seconds from now. A 429 or 503 carries Retry-After. Wait that long, then retry. Do not retry faster: a key that keeps hitting the limit is slowed down. A wrong key sent again and again from one place is blocked for a few minutes.
The bot builder budget
The tools that check, save, change, copy and delete drafts and hand over links, and edit_bot, share one hourly budget of 60 points per key. What a call costs:
| Call | Points |
|---|---|
validate_bot_config, validate_two_leg_bot_config, edit_bot | 1 |
check_bot_config, create_bot_draft, update_bot_draft, duplicate_bot, create_two_leg_bot_link | 2 |
list_bot_drafts, delete_bot_draft | a quarter |
| Any of the above that is refused (bad settings, a draft that is not there, a busy limit) | a quarter, whatever its price |
| A call repeated with the same idempotency key | nothing |
A refused call costs almost nothing, so a wrong guess is cheap, but a loop of refused calls still runs out. The hour starts at the first call and the budget is back to full when it ends.
You can always see it. get_key_limits returns build_budget with limit_points_per_hour, remaining_points and resets_at. Every answer of a builder tool carries the headers X-Build-Budget-Limit, X-Build-Budget-Remaining and X-Build-Budget-Reset (Unix seconds). When it is used up the answer is rate_limited (429) with retry_after_s, a Retry-After header and details.limit_points_per_hour, details.remaining_points and details.resets_at.
How fast a key starts and stops working
A new key is known to the API within seconds: the first call with a key the API has not seen yet makes it look again at once. Allow up to a minute. A revoked or expired key, and an owner's kill switch, stop working at the latest when the API's list of keys is next refreshed: normally within 30 seconds, never later than 60 seconds. This is deliberate: the list is read from the core database every 10 seconds at most, through a shared cache, so many instances share one read.
Retry safely with an idempotency key
Every tool that changes something takes an idempotency key: idempotency_key over MCP, the Idempotency-Key header over REST. It is 8 to 80 characters, letters, digits, - and _. Make a new one for every action you mean to do once, and send the same one again when you retry the same action after a timeout or an error you could not read.
- The same key with the same arguments returns the first answer again, marked
replayed: true, and does nothing a second time. - The same key with different arguments is refused with
idempotency_conflict(409). Over REST the key is theIdempotency-Keyheader: 8 to 80 characters, letters, digits,-and_(a bad one is refused with a sentence that names the header). This code replacesidempotency_mismatch(422), which Prow used before: a script that matched the old code or status should match the new one. For a pause, stop, resume or edit this holds on every server instance, because Prow keeps a fingerprint of the arguments with the command. - A key is remembered for 10 minutes.
A pause, resume, stop or edit is a request: it returns 202 and Prow applies it within seconds. Confirm with get_bot. Do not send it again until you have looked.
Last updated