> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siray.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Error Codes

> Machine-readable failure codes returned in the fail_code field when a request or generation task fails.

## Overview

When a generation task fails (`status` is `FAILURE`) or a submit/query request is rejected, the response may include a `fail_code` field. Use this code for programmatic handling; `fail_reason` provides the human-readable message.

Names that include `<Parameter>` are templates. The actual code substitutes the parameter name, for example `MissingParameter.Prompt`.

## Codes

| fail\_code                                              | HTTP          | Description                                                                                   |
| ------------------------------------------------------- | ------------- | --------------------------------------------------------------------------------------------- |
| `MissingParameter`                                      | 400           | Missing a required parameter                                                                  |
| `MissingParameter.<Parameter>`                          | 400           | Missing the specified parameter                                                               |
| `InvalidParameter`                                      | 400           | Invalid request parameter; also commonly returned when content moderation rejects the request |
| `InvalidParameter.<Parameter>`                          | 400           | Invalid value for the specified parameter                                                     |
| `InvalidImageURL.EmptyURL`                              | 400           | Image URL is empty                                                                            |
| `InvalidImageURL.InvalidFormat`                         | 400           | Image URL, Base64 data, or format could not be parsed                                         |
| `InputImageSensitiveContentDetected`                    | 400           | Input image contains sensitive content                                                        |
| `InputImageSensitiveContentDetected.PolicyViolation`    | 400           | Input image may involve copyright restrictions                                                |
| `InputImageSensitiveContentDetected.PrivacyInformation` | 400           | Input image may contain a real person                                                         |
| `OutputImageSensitiveContentDetected`                   | 400           | Output image contains sensitive content                                                       |
| `OutputImageSensitiveContentDetected.DeepFake`          | 400           | Output image may contain a forged ID or credential                                            |
| `OutputVideoSensitiveContentDetected`                   | 400           | Output video contains sensitive content                                                       |
| `OutofContextError`                                     | 400           | Image and text tokens exceed the context length limit                                         |
| `AuthenticationError`                                   | 401           | API key or AK/SK is missing, invalid, or expired                                              |
| `AccessDenied`                                          | 403           | No permission to access the target resource                                                   |
| `OperationDenied.ServiceNotOpen`                        | 403           | Model service is not enabled                                                                  |
| `AccountOverdueError`                                   | 403           | Account has an overdue balance                                                                |
| `InsufficientBalance`                                   | 403           | Insufficient balance                                                                          |
| `EmailNotVerified`                                      | 403           | Email is not verified                                                                         |
| `KeyDenied`                                             | 403           | API key is disabled                                                                           |
| `InvalidEndpointOrModel.NotFound`                       | 404           | Model or endpoint does not exist or is not accessible                                         |
| `ModelNotOpen`                                          | 404           | Account has not enabled this model                                                            |
| `UnsupportedModel`                                      | 404           | Model does not support the requested feature                                                  |
| `ServerOverloaded`                                      | 429           | Service is overloaded                                                                         |
| `InternalServiceError`                                  | 500           | Internal service error                                                                        |
| `TaskSubmitFailed`                                      | Other non-200 | Submission failed but the upstream code could not be parsed                                   |
| `MissingParameter.Prompt`                               | 400           | Prompt is missing or empty                                                                    |
| `MissingParameter.Model`                                | 400           | Model name is empty                                                                           |
| `InvalidParameter.Prompt`                               | 400           | Prompt type could not be parsed                                                               |
| `InvalidParameter.Model`                                | 400           | Model type could not be parsed                                                                |
| `InvalidParameter.Request`                              | 400           | JSON / request structure / multipart parsing failed                                           |
| `InvalidParameter.TaskTypeConstraint`                   | 400           | Parameter is incompatible with the task type                                                  |
| `InvalidParameter.TaskTypeMismatch`                     | 400           | Specified task type does not match the detected result                                        |
| `InvalidEndpoint.ClosedEndpoint`                        | 400           | Endpoint is closed or unavailable                                                             |
| `InvalidArgumentError`                                  | 400           | Invalid protocol parameter                                                                    |
| `InvalidArgumentError.UnknownRole`                      | 400           | Unsupported role                                                                              |
| `InvalidArgumentError.InvalidImageDetail`               | 400           | Image detail only supports auto/high/low                                                      |
| `InvalidArgumentError.InvalidPixelLimit`                | 400           | Invalid custom image pixel upper/lower bound                                                  |
| `SensitiveContentDetected`                              | 400           | Input text may contain sensitive information                                                  |
| `InputTextSensitiveContentDetected`                     | 400           | Input text triggered content safety filtering                                                 |
| `ContentPolicyViolation`                                | 400           | Blocked by local content safety policy                                                        |
| `InvalidAccountStatus`                                  | 401           | Account status is abnormal                                                                    |
