Skip to content

API Reference

Errors

Standard error codes, response envelope shape, and how to handle each.

Response envelope

Every response from the LLM Prover API uses the same envelope:

{
  "ok": true,
  "request_id": "a1b2c3d4-...",
  "data": { ... }
}

On error:

{
  "ok": false,
  "request_id": "a1b2c3d4-...",
  "error": "Human-readable message",
  "code": "MACHINE_READABLE_CODE"
}

Always check ok first. Use code for programmatic handling. Use error for displaying to users or logging.


Error codes

HTTPCodeMeaningAction
400VALIDATION_ERRORRequest body failed validationFix the request. Check the error field for which field failed.
400HARD_CAP_EXCEEDEDMonthly spend hard cap reachedTop up or upgrade.
401UNAUTHORIZEDMissing or invalid API keyCheck your key. Revoked or expired keys return this.
402INSUFFICIENT_BALANCEMonthly allowance exhaustedTop up from the account page or upgrade your plan.
403TIER_REQUIREDFeature requires a higher tierUpgrade your plan. The error field names the required tier.
404NOT_FOUNDResource does not exist or does not belong to your accountCheck the ID.
409ASSET_IN_USECannot delete – resource is used by active benchmarksPass confirmed_name to force delete, or remove the dependency first.
429RATE_LIMIT_EXCEEDEDToo many requestsBack off and retry. See Rate limits.
429KEY_LIMIT_REACHEDCannot create more API keys on your planRevoke an existing key or upgrade.
500INTERNAL_ERRORUnexpected server errorRetry once. If it persists, contact support with your request_id.

Handling errors in Python

resp = requests.post(f"{BASE_URL}/compare", headers=HEADERS, json=body)
data = resp.json()

if not data.get("ok"):
    code = data.get("code", "UNKNOWN")
    if code == "INSUFFICIENT_BALANCE":
        # prompt user to top up
    elif code == "RATE_LIMIT_EXCEEDED":
        # back off and retry
    elif code == "TIER_REQUIRED":
        # prompt user to upgrade
    else:
        raise RuntimeError(f"API error {code}: {data.get('error')}")

Provider errors

When a provider call fails inside a job (e.g. a model is temporarily unavailable), the job itself completes successfully but the affected model’s result has an error field set:

{
  "provider": "anthropic",
  "model": "claude-3-5-sonnet-20241022",
  "error": "Provider unavailable. Please try again.",
  "error_type": "unavailable"
}

Other results in the same job are unaffected. Check each result’s error field when processing job output.


What’s next