Steps
Register Modellix
Log in to the Modellix console.
Get API Key
In the Modellix console, go to βAPI Keyβ and create an API Key.
The API Key is only displayed once after creation, so be sure to save it first.
Use the API
Find the model you want to use in Model API, and call the API using your API Key. For example:Since model calls are asynchronous tasks, after a successful call, you will first receive a
task_id as shown below:Get the Result
You can query the task result later using the After a successful query, you will get the generated result. For example:You can find the generated image URL in the
task_id. For example:The modelβs generated results will all be placed in the
result object.result. For example:Error Handling
All error responses follow a unified JSON format:code(integer) β equals the HTTP status code (0on success)message(string) β formatted as"<Category>: <detail>"
Error Codes
| HTTP Status | Description | Common Scenarios | Retryable |
|---|---|---|---|
| 400 | Bad Request | Missing required parameters, invalid format, invalid values | No β fix parameters first |
| 401 | Unauthorized | Invalid API key, missing API key, expired API key | No β provide a valid key |
| 402 | Payment Required | Insufficient balance, account in arrears | No β recharge your account |
| 404 | Not Found | Task ID not found, model not found, provider not found | No β check resource ID |
| 429 | Too Many Requests | Rate limit exceeded, concurrent limit exceeded | Yes β use exponential backoff |
| 500 | Internal Server Error | Internal processing error, unexpected error | Yes β retry up to 3 times |
| 503 | Service Unavailable | Service temporarily unavailable, circuit breaker open | Yes β retry with backoff |