Skip to main content
DimiLinks error responses follow the upstream protocol in use:
  • Endpoints under https://dimilinks.com/v1/* (OpenAI-compatible) return the OpenAI-style error wrapper.
  • https://api-direct.dimilinks.com/v1/messages (native Anthropic) returns the native Anthropic format {"type":"error","error":{...}}.
OpenAI style (from dimilinks.com/v1):
{
  "error": {
    "message": "prompt must not be empty",
    "type": "invalid_request_error",
    "code": "invalid_request_error"
  }
}
Anthropic style (from api-direct.dimilinks.com):
{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "messages must not be empty"
  }
}

Common errors

HTTPcodeMeaningRecommended caller action
400invalid_request_error / invalid_reference_imageInvalid parameters, an empty prompt, or an invalid reference imageAsk the user to correct the parameters
401missing_api_key / invalid_api_keyMissing or invalid keyCheck the key configuration
402insufficient_balanceInsufficient balanceAsk the user to add funds or contact an administrator
403model_not_allowedThe current key cannot access the model, or its available groups do not intersect the model’s enable_groupsCheck the model allowlist; see Model groups & pricing to change group or use a different key
404not_foundThe task does not exist or does not belong to the current userStop polling
429rate_limit_rpm / rate_limit_tpmRate limit exceededRetry with backoff and reduce concurrency
500internal_error / billing_errorInternal service errorRecord logs and retry later
502 / 503upstream_error / service_unavailableThe upstream route is temporarily unavailableAllow the user to retry

Handling recommendations

  • For 400, show error.message directly so the user can adjust the input.
  • For 401 / 403, ask the user to check the key or model permissions; do not retry silently.
  • For 429, use exponential backoff and reduce concurrency; do not retry immediately at high frequency.
  • For 5xx / 502 / 503, allow retries, but record logs for upstream troubleshooting.
  • Stop polling immediately when a task endpoint returns 404 to avoid wasting requests.
  • If the same application code calls both domains, add a shared HTTP client abstraction that reads either error.message or error.error.message instead of duplicating compatibility logic in every caller.