翻篇收录说明
翻篇网页快照

Model Errors - fal

https://fal.ai/docs/documentation/model-apis/errors

最近抓取:2026-12-03 17:44:42(北京时间)

最近内容变化:2026-12-03 17:44:42(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

Validation and content errors returned by models when inputs don't meet requirements.

正文摘录

When a model rejects your input due to validation failures, content policy violations, or format issues, it returns a structured error response with typed error objects. These errors tell you exactly what went wrong with your input and how to fix it. For infrastructure-level errors (timeouts, runner failures), see Request Errors. Some APIs are still being migrated to this error structure. Not all endpoints strictly follow the format documented below yet. Error Response When an API request fails due to client-side input issues (like validation errors) or server-side problems, the API returns a structured error response. This response includes a standard HTTP status code, specific headers, and a JSON body detailing the errors. Error Response Structure The error response consists of: HTTP Status Code: Indicates the general category of the error (e.g., 500 for internal errors, 504 for timeouts). Headers: Includes required headers like X-Fal-Needs-Retry. JSON Body: Contains a detail field which is an array of Error objects. Error Object Structure The detail field is an array where each object represents a specific error. PropertyDescriptionloc[REQUIRED] An array indicating the location of the error (e.g., ["body", "field_name"] for input validation, ["body"] for general errors). The first item in the loc list will be the field where the error occurred, and if the field is a sub-model, subsequent items will be present to indicate the nested location of the error.msg[REQUIRED] A human-readable description of the error. Client code should not parse and rely on the msg field.type[REQUIRED] A unique, machine-readable string identifying the error category (e.g., image_too_large). Use this for conditional logic.url[REQUIRED] A link to documentation about this specific error type (e.g., https://docs.fal.ai/errors#image_too_large). Primarily for developers.ctx[OPTIONAL] An object with additional structured, machine-readable context for the error type (e.g., {"max_height": 1024, "max_width": 1024} for image_too_large).input[OPTIONAL] The input that caused the error.categories[OPTIONAL] Broad moderation labels for a content_policy_violation error, when available. Guidance For Machine Processing: Rely on the type field for conditional logic. Use ctx for specific error details if available. Check the X-Fal-Needs-Retry header for retry decisions. For Human Display: Use the msg field to show error messages to end-users. Client code should not parse and rely on the msg field. For Documentation: Use the url field to link to further documentation about the specific error. This is primarily intended for developers to get more detailed information about error handling and resolution. Error Types This document details the specific error types returned by the API, following the structure defined in the error specification. Each error type has a unique type string, a human-readable msg, and potentially a ctx object with more context. The sections below cover fal’s first-party error types. Standard Pydantic validation errors (e.g., string_type, int_parsing, enum) are passed through with their original type string; treat any type not listed on this page as a non-retryable 422 validation error and rely on msg for the details. internal_server_error This error indicates an unexpected issue occurred on the server that prevented the request from being fulfilled. Status Code: 500 Retryable: Can be true or false. Context (ctx): None [ { "loc": ["body"], "msg": "Internal server error", "type": "internal_server_error", "url": "https://docs.fal.ai/errors#internal_server_error", "input": { "prompt": "a cat" } } ] generation_timeout This error occurs when the requested operation took longer than the allowed time limit to complete. Status Code: 504 Retryable: Can be true or false. Context (ctx): None [ { "loc": ["body"], "msg": "Generation timeout", "type": "generation_timeout", "url": "https://docs.fal.ai/errors#generation_timeout", "input": { "prompt": "a very complex scene taking too long" } } ] downstream_service_error This error signifies a problem when communicating with an external service required to fulfill the request. Status Code: 500 Retryable: Can be true or false. Context (ctx): None [ { "loc": ["body"], "msg": "Downstream service error", "type": "downstream_service_error", "url": "https://docs.fal.ai/errors#downstream_service_error", "input": { "some_input": "value" } } ] downstream_service_unavailable This error indicates that a required third-party service (including partner APIs) is currently unavailable, preventing the request from being fulfilled. Status Code: 500 Retryable: Can be true or false. Context (ctx): None [ { "loc": ["body"], "msg": "Downstream service unavailable", "type": "downstream_service_unavailable", "url": "https://docs.fal.ai/errors#downstream_service_unavailable", "input": { "prompt": "a cat" } } ] content_policy_violation This error indicates that the provided input content (e.g., text prompt, uploaded image) could not be processed because it was flagged by automated safety systems as potentially violating usage policies or responsible AI guidelines. Status Code: 422 Retryable: false. Context (ctx): None These filters are in place to ensure safe, ethical, and legal use of the platform. The content may have been flagged by either fal’s filter or one of our partners’. Sensitivity levels can vary between partner APIs. The optional categories array gives broad moderation labels when they are available. fal’s safety checker can return harassment, hate, illicit, self-harm, sexual, or violence. Some models have their own moderation layer that fal does not control. If that layer rejects a request, model_moderated is appended to the categories array. For an input list, loc can identify each checked item by index. The same category can appear for multiple items checked together. This does not mean that each item independently triggered the block. Violations may include, but are not limited to: Content depicting NSFW content, promoting illegal acts or hate speech. Severely harmful content, such as depictions of extreme violence, gore, or content promoting self-harm. Content intended to promote misinformation, deception, harassment, or discrimination. Generation of content that infringes on third-party intellectual property rights. Content that perpetuates harmful stereotypes. [ { "loc": ["body", "prompt"], "msg": "The content could not be processed because it contained material flagged by a content checker.", "type": "content_policy_violation", "url": "https://docs.fal.ai/errors#content_policy_violation", "input": "a prompt containing forbidden content", "categories": ["sexual"] } ] no_media_generated This error indicates that the generation completed successfully but the model did not produce any media output for the given input. This can happen when the model is unable to generate a valid result from the provided prompt or parameters. Status Code: 422 Retryable: false. Context (ctx): None [ { "loc": ["body"], "msg": "The model did not generate the expected output for this prompt.", "type": "no_media_generated", "url": "https://docs.fal.ai/errors#no_media_generated", "input": { "prompt": "a cat in a garden" } } ] value_error This error indicates that the provided value for an input field failed validation and no more specific error type applies. The offending field is typically identified by loc, and msg describes why the value was rejected. Status Code: 422 Retryable: false. Context (ctx): None by default; may carry additional passthrough context from the validating service. [ { "loc": ["body", "images_data_url"], "msg": "No valid images found in the archive. Expected PNG, JPG, JPEG, or WEBP files.", "type": "value_error", "url": "https://docs.fal.ai/errors#value_error", "input": "https://example.com/images.zip" } ] input_value_error This error indicates that the request as a whole could not be processed, when the failure is not attributable to a single input field (loc is ["body"]). msg describes why the input was rejected. Status Code: 422 Retryable: false. Context (ctx): None [ { "loc": ["body"], "msg": "Validation error from downstream service", "type": "input_value_error", "url": "https://docs.fal.ai/errors#input_value_error", "input": { "prompt": "a cat" } } ] missing This error indicates that a required input field was not provided. The missing field is identified by loc. Status Code: 422 Retryable: false. Context (ctx): None [ { "loc": ["body", "prompt"], "msg": "Field 'prompt' is required but was not provided.", "type": "missing", "url": "https://docs.fal.ai/errors#missing", "input": {} } ] image_too_small This error indicates that the provided image dimensions are smaller than the required minimum. Status Code: 422 Retryable: false. Context (ctx): min_height: The minimum required height in pixels. min_width: The minimum required width in pixels. [ { "loc": ["body", "image_url"], "msg": "Image too small", "type": "image_too_small", "url": "https://docs.fal.ai/errors#image_too_small", "ctx": { "min_height": 512, "min_width": 512 }, "input": "https://example.com/image_100x100.jpg" } ] image_too_large This error indicates that the provided image dimensions exceed the maximum allowed limits. Status Code: 422 Retryable: false. Context (ctx): max_height: The maximum allowed height in pixels. max_width: The maximum allowed width in pixels. [ { "loc": ["body", "input_image"], "msg": "Image too large", "type": "image_too_large", "url": "https://docs.fal.ai/errors#image_too_large", "ctx": { "max_height": 1024, "max_width": 1024 }, "input": "https://example.com/image_2000x2000.jpg" } ] image_load_error This error occurs when the server failed to load or process the provided image, possibly due to corruption or an unsupported format. Status Code: 422 Retryable: false. Context (ctx): None [ { "loc": ["body", "control_image"], "msg": "Image load error", "type": "image_load_error", "url": "https://docs.fal.ai/errors#image_lo