BeLive Token Hub
Service information

Error Codes

API gateway response formats, common HTTP status codes, and the values of the type and code fields in error responses.

Error responses from the API gateway follow the OpenAI-compatible format: the HTTP status code expresses the broad category, while error.type and error.code in the response body provide machine-actionable details.

Error response format

Inference endpoints (chat, image, video, audio, etc.) return a non-200 HTTP status code with this body:

{
  "error": {
    "message": "Invalid API key provided",
    "type": "authentication_error",
    "code": "invalid_api_key",
    "param": ""
  }
}
FieldTypeDescription
messagestringHuman-readable description; may be translated based on request language
typestringBroad category derived from the HTTP status code; see type values
codestringSpecific error code; see code values; may be an empty string for some errors
paramstringRelated request parameter name; usually empty

Management endpoints (console APIs under /api/) behave differently: business errors usually still return HTTP 200, distinguished by the success field:

{
  "success": false,
  "message": "error description",
  "data": null
}

The Seedance asset library uses a ResponseMetadata.Error envelope; see Seedance Asset Library.

HTTP status codes

StatusMeaningCommon causes
200SuccessRequest completed; management endpoints also return 200 for business errors
400Bad requestBody is not valid JSON, missing required parameters, invalid parameter values
401UnauthenticatedAPI key missing, invalid, or disabled
403ForbiddenKey has no access to the model/group, IP not in the token allowlist, user banned, or insufficient quota
404Not foundRequest path does not exist, or the async task ID does not exist
408Request timeoutUpstream processing timed out
413Payload too largeExceeds the 256 MB request-body limit; error code request_too_large
429Rate limitedGlobal rate limit or model RPM/TPM limit hit; slow down and retry
500Internal errorGateway internal error
501Not implementedThe gateway does not support this endpoint path; error code api_not_implemented
502 / 503Upstream errorThe upstream model provider returned an error or is unavailable
504Upstream timeoutThe upstream model provider timed out

type values

error.type is derived from the HTTP status code and is a stable category:

typeStatus codesDescription
authentication_error401Authentication failed; check that the API key is correct and enabled
permission_error403No access permission or insufficient quota
rate_limit_error429Rate limit triggered
timeout_error408, 504Request or upstream response timed out
not_implemented_error501Endpoint not implemented
invalid_request_errorOther 4xxRequest parameter error
server_error5xxGateway or upstream service error
upstream_error—Fallback when an upstream error carries no type

code values

error.code is a more specific, machine-readable error code. Common values are listed below.

Authentication and permission

codeDescription
invalid_api_keyAPI key missing, invalid, or deleted (default code for 401)
access_deniedNo access to the requested resource, group, or agent domain

Request parameters

codeDescription
invalid_requestRequest parameter error (default code for 400)
invalid_jsonRequest body is not valid JSON
invalid_typeField type error
missing_parameterA required parameter is missing
bad_request_bodyRequest body does not meet endpoint requirements
read_request_body_failedFailed to read the request body
convert_request_failedFailed to convert the request format
request_too_largeRequest body exceeds the 256 MB limit (HTTP 413)
remote_fetch_failedFailed to fetch a remote file in the request (e.g. an image URL)
unsupported_response_formatUnsupported response format parameter

Models and channels

codeDescription
model_not_foundThe requested model does not exist or is not available to this token
prompt_blockedPrompt blocked by the upstream safety policy
sensitive_words_detectedContent triggered sensitive-word detection
channel:no_available_keyChannel has no available key
channel:invalid_keyChannel key is invalid
channel:model_mapped_errorModel mapping configuration error
channel:param_override_invalidChannel parameter-override configuration is invalid
channel:header_override_invalidChannel header-override configuration is invalid
channel:aws_client_errorAWS channel client error
channel:response_time_exceededChannel response time exceeded the limit

channel:* errors mean a specific upstream channel failed. The gateway usually retries on another channel automatically; clients only see these errors when every available channel has failed.

Upstream responses

codeDescription
bad_response_status_codeUpstream returned an unexpected status code
bad_responseUpstream response could not be processed
bad_response_bodyFailed to parse the upstream response body
read_response_body_failedFailed to read the upstream response
empty_responseUpstream returned an empty response
aws_invoke_errorAWS model invocation failed

Billing and quota

codeDescription
insufficient_user_quotaAccount quota is insufficient; top up and retry (HTTP 403)
pre_consume_token_quota_failedPre-consumption failed, usually because quota cannot cover the estimated cost of this request (HTTP 403)

Internal system

codeDescription
unknown_errorUncategorized error
count_token_failedToken counting failed
model_price_errorModel pricing configuration error
invalid_api_typeInternal API type error
json_marshal_failedInternal serialization failed
do_request_failedFailed to send the request to the upstream
get_channel_failedFailed to obtain an available channel
gen_relay_info_failedFailed to generate relay information
query_data_errorData query failed
update_data_errorData update failed

Async task errors

Async task endpoints (e.g. Seedance and Kling video generation) can return the errors above when a task is created. Once a task is created, a processing failure does not change the HTTP status of the task query endpoint; it is reported in the error field of the task result instead:

{
  "id": "task-id",
  "status": "failed",
  "error": {
    "code": "upstream error code",
    "message": "failure reason"
  }
}

When polling a task, rely on the status field and read error when it becomes failed.

Troubleshooting

  • 401: confirm the Authorization: Bearer <key> header is correct and the key has not been deleted or disabled.
  • 403: check model access, token group, IP allowlist, and account quota in order.
  • 429: reduce concurrency and request rate; retry with exponential backoff.
  • 5xx: the gateway already retries retryable errors on other channels; if failures persist, contact the platform with the message content.
  • Error messages may be translated based on request language. For programmatic handling, match on type and code, never on the message text.

On this page