Bridge by Wekoya / Docs / Reference

Errors

Updated

Every error carries a machine-readable type, so your code can branch on the reason rather than on the message.

Images, music and long Gemini transcriptions can take longer than 20 seconds. Their reply then starts at once, with status 200 and a few leading spaces, to keep the connection open, so an error that comes after that arrives as {"error": {…}} in a 200 body. Check for error as well as the status.

StatusTypeWhat it means
400invalid_requestThe body or query is malformed. The message names the field.
400end_user_requiredYour account requires every request to name an end user, and this one did not.
400context_length_exceededThe request is too long for the model. For decisions, shorten the state or ask fewer questions.
400cache_too_smallA context cache needs at least 1,024 tokens (more on some models). Short prompts are cached automatically.
400cache_model_mismatchA cache works only with the model it was made for. Send that model, or "auto".
401unauthorizedThe key is wrong, revoked or expired.
401guest_key_revokedThe key that made this guest key was revoked, so the guest key stopped too. Make a new one.
403guest_key_not_allowedA guest key asked for something outside its uses. Make that call from your server, or allow it in uses.
403origin_not_allowedA guest key made for certain websites was used from somewhere else.
429guest_key_used_upA guest key has made all of its max_requests. Get a new one from your server.
402insufficient_fundsYour balance cannot cover the request. The reply names the amount needed. Top up to continue.
402key_limit_exceededThis key has reached the spending cap set on it (a guest key's max_spend, or a key's monthly limit, which resets on the 1st).
402app_budget_exceededThis app has reached the monthly budget its account set for it (an app is a key's app_id, or X-Bridge-App). An admin raises it under App budgets; it resets on the 1st.
403not_a_memberX-Wekoya-Org-Strict was sent and you are not in that company, or it is suspended or deleted. Nothing was done or charged.
403key_owner_removedThe person who made this company key has left the company. Make a new key, or have an admin make one the company owns.
402end_user_budget_exhaustedThat end user's budget is spent. Top them up, or wait for their period to reset. Your balance is untouched.
403insufficient_scopeThe key does not carry the scope for this route.
403model_not_allowedThe key or the end user is restricted to other models. The reply lists what is allowed.
403end_user_suspendedThat end user is suspended. Resume them to allow requests.
400invalid_provider_keyThe provider rejected the key you tried to save, so it was not stored.
503byok_key_rejectedYour own provider key was rejected (wrong, expired or revoked). Replace it. Wekoya charged nothing.
503byok_provider_out_of_creditYour provider account is out of credit or over its spend limit. Fix it with the provider; your Wekoya balance was not used.
503byok_model_unavailableYour provider account cannot run this model (not enabled, or not in the key's region). Enable it with the provider, or route the model elsewhere. Wekoya charged nothing.
503byok_rate_limitedYour provider rate-limited your key. Wait, or raise the limit with them.
503byok_key_unreadableA stored key could not be decrypted. Save it again. Nothing was charged.
402byok_budget_exhaustedEvery key that could serve this model has reached its monthly budget, and wallet fallback is off. Raise a budget, add a key, or allow the wallet.
402byok_credits_exhaustedThe only key left is set to use promotional credit only, and that credit is spent or expired.
400media_not_supportedThe model cannot read the audio, video or PDF you sent. The message names models that can.
400unsupported_mediaThat kind of attachment is not accepted: send base64 data or a YouTube link, as a PDF, image, audio or video.
400content_policyThe model declined the request under its safety rules. Rephrase it.
400invalid_audioThe audio could not be read: empty, damaged, or not an audio file. Nothing was charged.
400unsupported_languageThe transcription language is not available. Use an ISO code such as "en", or "multi" for mixed languages.
400invalid_voiceThere is no voice by that name. List them with GET /v1/audio/voices.
413audio_too_longThe recording is over 60 minutes. Split it into parts. Nothing was charged.
413request_too_largeToo large for one request: an audio file over 25 MB, speech text over 2,000 characters, or a decision request over 512 KB.
409no_own_keyThe request (X-Bridge-Billing: own-keys) or a routing rule allows only your own keys, and none can serve this model.
409ambiguous_provider_keyYou have more than one key for that provider. Name one as provider:label or by its id.
409key_limitYou already store the most provider keys allowed (10 per provider, 20 in all). Remove one first.
404model_not_foundNo such model. Read the catalogue for the current list.
404end_user_not_foundNo end user with that id. Create them first, or turn on auto-create.
429end_user_rate_limitedThat end user passed their requests-per-minute cap. Retry after a short wait.
429rate_limitedToo many requests. Back off and retry, ideally with jitter.
409workload_deployedA workload or configuration is serving a deployment. Deploy something else or delete the deployment first.
409batch_not_finishedThe batch is still running. Results are ready once its status is completed, failed, cancelled or expired.
410cache_expiredThe cache expired or was deleted. Make a new one.
400budget_too_lowA run's budget cannot cover the work it must do to report. The message gives the minimum.
429too_many_runsTwo evaluations or adaptations are already running on this account.
429too_many_batchesFive batches are already running on this account. Wait for one to end.
503model_unavailableThat model is not available right now. Retry, or fall back to another model.