RunbaseDocs

Command Palette

Search for a command to run...

Error Codes

API error codes, causes, and how to handle them.

Known API errors return a JSON body with this structure:

{
  "error": {
    "message": "Human-readable description",
    "code": "error_code"
  }
}

Error reference

400 Bad Request

CodeCauseFix
invalid_jsonRequest body is not valid JSONCheck your JSON syntax
missing_modelmodel field missing or not a stringInclude "model": "provider/name" in your request body
missing_inputinput field missing or not an objectInclude "input": {...} in your request body
invalid_inputInput doesn't match the model's schemaCheck the model's API reference for required fields and valid values
model_not_foundThe model ID doesn't match any available modelSee the models page for valid model IDs

401 Unauthorized

CodeCauseFix
missing_api_keyNo Authorization header or wrong formatInclude Authorization: Bearer sk-... in your request
invalid_api_keyKey is invalid, disabled, or expiredCreate a new key or re-enable the existing one in Settings → API Keys

402 Payment Required

CodeCauseFix
insufficient_balanceYour balance is too low for this runTop up your balance in Settings → Credits

403 Forbidden

CodeCauseFix
api_key_spend_limit_exceededThe key's lifetime spend limit has been reachedRaise the spend limit in Settings → API Keys
ip_not_allowedYour IP is not in the key's whitelistAdd your IP to the key's allowed list, or remove the whitelist

429 Too Many Requests

CodeCauseFix
RATE_LIMITEDToo many requests in a short windowWait and retry. See rate limits
USAGE_EXCEEDEDThe key's usage quota is exhaustedContact support or create a new key

404 Not Found

CodeCauseFix
run_not_foundNo run with this ID for your accountCheck the run ID is correct and was created with this API key

500 Internal Server Error

An unexpected error on our side. If this persists, contact support@runbase.net.

Handling errors in code

response=$(curl -s -w "\n%{http_code}" https://runbase.net/api/v1/runs \
  -H "Authorization: Bearer $RUNBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "google/nano-banana-2", "input": {"prompt": "test"}}')
 
http_code=$(echo "$response" | tail -1)
body=$(echo "$response" | head -1)
 
if [ "$http_code" -ne 201 ]; then
  echo "Error $http_code: $(echo $body | jq -r '.error.message')"
fi

For 429 errors, implement exponential backoff — wait 1s, then 2s, then 4s before retrying.