AI 服务/图像生成
图像任务状态
接口说明:根据 logId 查询异步图像任务的执行状态与结果。
GET
/
api
/
ai
/
image
/
task
/
{logId}
图像任务状态
curl --request GET \
--url https://aitoearn.cn/api/ai/image/task/{logId} \
--header 'X-Api-Key: <api-key>'import requests
url = "https://aitoearn.cn/api/ai/image/task/{logId}"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://aitoearn.cn/api/ai/image/task/{logId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/ai/image/task/{logId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"code": 0,
"message": "请求成功",
"data": {
"logId": "string",
"status": "generating",
"startedAt": "2026-07-02T12:00:00.000Z",
"points": 1,
"request": {},
"createdAt": "2026-07-02T12:00:00.000Z",
"updatedAt": "2026-07-02T12:00:00.000Z",
"duration": 1,
"response": {},
"images": [
{
"url": "string",
"b64_json": "string",
"revised_prompt": "string"
}
],
"errorMessage": "string"
}
}授权
需要从 AiToEarn 获取 API Key。点击前往「API Key 获取教程」。
路径参数
任务日志ID,由异步图像生成编辑接口返回,用于任务状态或生成结果查询。
响应
200 - application/json
请求已被服务处理。业务是否成功以响应体 code === 0 为准。
业务状态码。0 表示成功,非 0 表示业务错误。
响应消息。
Hide child attributes
Hide child attributes
任务日志ID
任务状态
可用选项:
generating, success, failed 开始时间
消耗Credits
请求参数
创建时间
更新时间
持续时间(毫秒)
响应结果
错误信息
请求 ID。
错误响应时间戳,Unix 毫秒。
⌘I
图像任务状态
curl --request GET \
--url https://aitoearn.cn/api/ai/image/task/{logId} \
--header 'X-Api-Key: <api-key>'import requests
url = "https://aitoearn.cn/api/ai/image/task/{logId}"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://aitoearn.cn/api/ai/image/task/{logId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/ai/image/task/{logId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"code": 0,
"message": "请求成功",
"data": {
"logId": "string",
"status": "generating",
"startedAt": "2026-07-02T12:00:00.000Z",
"points": 1,
"request": {},
"createdAt": "2026-07-02T12:00:00.000Z",
"updatedAt": "2026-07-02T12:00:00.000Z",
"duration": 1,
"response": {},
"images": [
{
"url": "string",
"b64_json": "string",
"revised_prompt": "string"
}
],
"errorMessage": "string"
}
}
