Janvia

API reference

Errors

HTTP status codes, the error body, and when a retry helps.

Errors use real HTTP status codes and this body:

{
  "error": {
    "code": "insufficient_balance",
    "message": "Insufficient balance. Please top up your account.",
    "type": "invalid_request_error"
  }
}

type is server_error for 5xx errors and invalid_request_error otherwise.

  • Errors at submit time (4xx): no task is created and nothing is charged.
  • Failures while running: the task's status becomes failed, its error has the same code and message, and the charge is refunded in full.
HTTPcodeMeaning
400invalid_requestThe request body or a parameter is invalid; the message says which.
400route_not_offeredThe requested route does not offer this model.
400no_route_selectedYour route settings leave no route for this model.
400price_above_maxEvery selected route costs more than your maximum price.
400unsupported_parametersNo selected route supports this combination of parameters.
400content_policy_violationContent moderation refused the request.
401unauthorizedThe API key is missing or invalid.
402insufficient_balanceYour balance is too low. Top up and try again.
402key_quota_exceededThis API key reached its spending limit.
403forbiddenThis key may not use this model, or not from this IP address.
403account_blockedAPI access for this account is suspended.
404model_not_foundNo such model is on sale.
404task_not_foundNo such task in your account.
404file_not_foundNo such uploaded file, or it expired.
409idempotency_conflictThis Idempotency-Key was used with a different request.
429rate_limitedToo many requests. Slow down.
429too_many_tasksToo many tasks are waiting. Retry later.
502generation_failedGeneration failed. You were not charged.
503no_available_routeNo route can serve this model right now. You were not charged.
504timeoutGeneration timed out. You were not charged.
500internal_errorSomething went wrong on our side.

When to retry

  • 429: wait a moment, then send fewer requests.
  • 502, 503, 504: submit a new task. The failed one was refunded.
  • 400, 402, 403, 404: fix the request, top up or change the key's settings first; retrying as is won't help.