Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.foxapi.cc/llms.txt

Use this file to discover all available pages before exploring further.

HTTP Status Codes

Status CodeDescriptionCommon Causes
200SuccessRequest processed successfully
400Bad RequestInvalid JSON format, incorrect Content-Type
401UnauthorizedAPI Key is invalid, expired, or missing
402Payment RequiredInsufficient account balance, please top up and retry
404Not FoundTask ID does not exist
422Unprocessable EntityMissing required fields, invalid parameter values, model does not exist
429Too Many RequestsRate limit exceeded, please retry later
500Internal Server ErrorServer-side unknown error, please retry later
503Service UnavailableNo available channels for the current model or upstream service error, please retry later

Error Response Format

All error responses follow this format:
{
  "error": {
    "message": "Error description",
    "type": "error_type"
  }
}
When a task fails, the error field in the task query response includes an additional code field:
{
  "error": {
    "code": "specific_error_code",
    "message": "Error description",
    "type": "task_error"
  }
}

Error Types

Error TypeStatus CodeDescription
invalid_request_error400, 422Invalid request format or parameter validation failed
authentication_error401API Key is invalid, expired, or missing
insufficient_quota402Insufficient account balance
not_found404The requested resource does not exist
rate_limit_error429Rate limit exceeded
server_error500Internal server error
service_unavailable_error422Model temporarily unavailable (no available channels)

Submission Stage Error Codes

When submitting a task, if parameter validation passes but channel matching fails, a 422 status code is returned with the following error codes in the error.code field:
Error CodeDescriptionRecommended Action
unsupported_advanced_optionsNo available channels currently support the advanced parameters in the requestRefer to the unsupported_advanced_options field in the response (each item contains the parameter name and default value); remove these parameters and retry
param_constraints_unsatisfiableParameter values exceed the range supported by currently available channelsCheck whether parameter values are within the valid options documented in the API reference
no_compatible_channelNo available channels for this model at the momentRetry later
invalid_file_typeThe actual content of the media file does not match the expected typeCheck whether the file is corrupted or the extension does not match the content

File Type Mismatch (invalid_file_type)

When submitting a task, the system performs content detection on media file URLs in the request (image_url, audio_url, video_url, etc.). If the actual format of the file does not match the expected type for the field (e.g., audio_url points to a file that is actually an archive), a 422 status code and invalid_file_type error code are returned. The response includes the following additional fields to help locate the issue:
FieldDescription
fieldThe parameter name that triggered the validation failure (e.g., audio_url)
detected_typeThe actual MIME type detected (e.g., application/x-tar)
expected_typeThe expected media category (image / audio / video)
Example response:
{
  "error": {
    "message": "The file '002543212992.mp3' is detected as tar archive file (application/x-tar), not a valid audio file. Please verify the file content matches the expected format.",
    "type": "invalid_request_error",
    "code": "invalid_file_type",
    "field": "audio_url",
    "detected_type": "application/x-tar",
    "expected_type": "audio"
  }
}
File type detection is based on magic bytes in the file header, not the file extension or HTTP Content-Type header. If the file format is correct but cannot be recognized (e.g., uncommon encoding formats), the system will silently pass it through without blocking the request.

Advanced Options Not Supported (unsupported_advanced_options)

Some parameters are advanced options that are not supported by all channels. When the advanced parameters in the request are not supported by any available channel for the current model, a 422 status code and unsupported_advanced_options error code are returned. The response includes the following structured fields for programmatic parsing:
FieldDescription
modelThe model ID that triggered the error
unsupported_advanced_optionsList of unsupported advanced parameters, each containing param (parameter name) and default_value (the default value for the parameter in the request schema; the system uses this value when the parameter is omitted)
Example response:
{
  "error": {
    "message": "The advanced options [enhance_prompt, seed] are not supported by any available channel for model 'veo-3.1'. Remove the unsupported options to proceed.",
    "type": "invalid_request_error",
    "code": "unsupported_advanced_options",
    "model": "veo-3.1",
    "unsupported_advanced_options": [
      {"param": "enhance_prompt", "default_value": false},
      {"param": "seed", "default_value": null}
    ]
  }
}
  • Advanced parameters are marked with x-advanced in each model’s API documentation. Removing unsupported advanced parameters does not affect core functionality, and generation results will still be normal.
  • default_value comes from the field’s default value in the request schema (null means the parameter is optional and the system will not apply any value when it is omitted).
When querying task status, tasks with a failed status will include the following error codes in the error.code field:
Error CodeDescriptionRecommended Action
task_failedTask execution failed (general)Resubmit the request
content_policy_violationInput content violates content policiesModify the prompt and retry
invalid_image_urlThe provided image/video URL is inaccessibleCheck whether the URL is publicly accessible
file_too_largeThe uploaded file exceeds size limitsReduce the file size
unsupported_formatUnsupported file formatUse a supported format

Rate Limits

  • Rate limits are applied per API Key
  • When rate limited, a 429 status code is returned; please wait and retry
  • Contact support if you need higher rate limits

Best Practices

  1. Always check the HTTP status code before parsing the response body
  2. Implement exponential backoff for retries on 429 and 5xx errors
  3. Log error responses for debugging and troubleshooting
  4. Poll task status at reasonable intervals recommended 3-5 seconds, avoid polling too frequently
  5. Handle async tasks gracefully generation time varies by model; refer to the estimated time in each model’s documentation