# GET /api/v1/jobs/recordInfo

> Task status and result. Ask every 3–5 seconds until state becomes success or fail.

## Request

```http
GET https://ai.aimixmedia.site/api/v1/jobs/recordInfo?taskId=<taskId>
Authorization: Bearer <API_KEY>
```

## Parameters

| Parameter | Required | Description |
|---|---|---|
| `taskId` | yes | Task ID from createTask |

## Response

```json
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_nano-banana-2_1790621023886ca4e4d",
    "model": "nano-banana-2",
    "state": "success",
    "param": "{\"model\":\"nano-banana-2\",\"callBackUrl\":\"\",\"input\":{\"prompt\":\"...\"}}",
    "resultJson": "{\"resultUrls\":[\"https://ai.aimixmedia.site/files/7496aef5292507f51b84cb2cb258d001.png\"]}",
    "failCode": "",
    "failMsg": "",
    "costTime": 104016,
    "completeTime": 1790621127902,
    "createTime": 1790621023886,
    "updateTime": 1790621127902,
    "progress": 100,
    "creditsConsumed": 0.02,
    "costUsd": "0.0200",
    "refunded": false,
    "filesExpired": false,
    "callback": null
  }
}
```

| Field | Meaning |
|---|---|
| `state` | Status — see the table below |
| `resultJson` | On `success` — a JSON string with `resultUrls` (file links, kept for 30 days) |
| `failCode`, `failMsg` | Error code and text on `fail` |
| `creditsConsumed` | Charged, USD (0 after a refund) |
| `refunded` | `true` — the money was refunded (task failed) |
| `callback` | Callback delivery status if a `callBackUrl` was set |
| `costTime`, `createTime`, `completeTime` | Duration and timestamps, ms |

## States

| state | Meaning |
|---|---|
| `waiting` | Accepted, waiting in the queue |
| `queuing` | Handed to the model |
| `generating` | Generating |
| `success` | Done ✓ |
| `fail` | Failed, money refunded |

A task that does not finish within 20 minutes becomes `fail`.

## Examples

```bash
curl "https://ai.aimixmedia.site/api/v1/jobs/recordInfo?taskId=task_nano-banana-2_1790621023886ca4e4d" \
  -H "Authorization: Bearer $API_KEY"
```

```python
import os, requests

r = requests.get(
    "https://ai.aimixmedia.site/api/v1/jobs/recordInfo",
    params={"taskId": "task_nano-banana-2_1790621023886ca4e4d"},
    headers={"Authorization": f"Bearer {os.environ['API_KEY']}"},
)
print(r.json())  # data.state, data.resultJson
```

```javascript
const r = await fetch("https://ai.aimixmedia.site/api/v1/jobs/recordInfo?taskId=task_nano-banana-2_1790621023886ca4e4d", {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
console.log(await r.json()); // data.state, data.resultJson
```

## Errors

| code | error | When |
|---|---|---|
| 401 | `unauthorized` | Missing or invalid key |
| 404 | `task_not_found` | No such task in your account |
| 422 | `validation_error` | `taskId` is missing |
