callBackUrl to your application's publicly reachable HTTPS endpoint. Do not use localhost, a private-network address, or a URL containing credentials. Without a public endpoint, query the task instead.{
"model": "gpt-image-2-5-flare-text-to-image",
"input": {"prompt": "An orange cat", "resolution": "1K", "aspect_ratio": "1:1"},
"callBackUrl": "https://your-app.example.com/callback"
}application/json POST when the task succeeds or fails. Store the platform task ID from the creation response; the callback uses the same ID in data.taskId. Result fields vary by model. This example shows an image task:{
"code": 200,
"msg": "success",
"data": {
"taskId": "task_example",
"state": "success",
"resultJson": "{\"resultUrls\":[\"https://example.com/result.png\"]}"
}
}{
"code": 501,
"msg": "Task failed",
"data": {"taskId": "task_example", "state": "fail", "failMsg": "Task failed"}
}resultJson is a JSON string. Other models may return output in response or other fields; use the task query result for the model's actual shape. Replace the example URLs and IDs.data.taskId belongs to a task your application created and recorded. Do not update business state for an unknown task.BASE_URL, MAXROUTERAI_API_KEY, and the creation response's TASK_ID before running the example. Use an account and token authorized to access the task. Some synchronous operations return a result directly and do not issue an asynchronous callback.