# list_results

> List your recent jobs

`GET /api/v2/results`

Needs the `results:read` scope.

- Auth: API key (Authorization: Bearer)
- Key scope needed: `results:read`
- Raw spec: https://app.diffusr.ai/api/v2/openapi.json

## Query

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer | no | Default 20. |

## Example

**cURL**

```bash
curl "https://app.diffusr.ai/api/v2/results?limit=10" \
  -H "Authorization: Bearer $DIFFUSR_KEY"
```

**TypeScript**

```ts
import { Diffusr } from "diffusr";

const d = new Diffusr(); // reads DIFFUSR_KEY
const { results } = await d.listResults({ limit: 10 });
console.log(results.map((r) => r.status));
```

**Python**

```python
from diffusr import Diffusr

d = Diffusr()  # reads DIFFUSR_KEY
data = d.list_results(limit=10)
print([r["status"] for r in data["results"]])
```

## Response

### 200 ApiResultList

Your latest jobs, newest first.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `results` | object[] | yes | Newest first. |
| `results[].id` | string | yes |  |
| `results[].status` | "PENDING" \| "RUNNING" \| "SUCCEEDED" \| "FAILED" \| "CANCELED" | yes | PENDING and RUNNING = keep waiting. SUCCEEDED, FAILED and CANCELED are final. |
| `results[].model` | string | yes |  |
| `results[].credits_estimated` | number | no |  |
| `results[].created_at` | string | yes |  |
| `results[].finished_at` | string | no |  |
| `results[].output` | object | no | Present once SUCCEEDED. |
| `results[].output.kind` | "IMAGE" \| "VIDEO" \| "AUDIO" | yes |  |
| `results[].output.url` | string | yes | Public link to the file. |
| `results[].output.thumbnail_url` | string | no |  |
| `results[].output.width` | number | no |  |
| `results[].output.height` | number | no |  |
| `results[].output.duration_sec` | number | no |  |
| `results[].error` | object | no | Present when FAILED. |
| `results[].error.code` | string | yes |  |
| `results[].error.message` | string | yes |  |
| `results[].request_id` | string | no | The X-Request-Id of the request that started the job. |
| `results[].test` | true | no | true when a test key made the call: the price is real, nothing real ran. Absent for live keys. |
| `results[].charge` | object | yes |  |
| `results[].charge.quoted_credits` | number \| null | yes | The most the call could charge (null for a run with no API quote). |
| `results[].charge.charged_credits` | number | yes | What the call has charged so far. Work that was never delivered is not counted. A test run is always 0. |
| `results[].charge.final` | boolean | yes | true once the run is over: the number can no longer change. |
| `results[].price` | object | no |  |
| `results[].price.credits` | number | yes | The most this call costs, in whole credits (1 credit = $0.01). |
| `results[].price.usd` | string | yes | The same price in US dollars, e.g. "0.0336". |
| `results[].price.tariff` | "direct" \| "outcome" | yes | "direct" = your prompt goes to the model as sent; "outcome" = a result we shape (Recast, creator video). |
| `results[].price.tariff_version` | string | yes |  |
| `results[].price.expires_at` | string | yes | The quoted price holds until then (ISO time). |
| `results[].next` | string | no | Present while the job is not finished. |

## Errors

Every error body is `{ error, code, request_id, ... }`. See https://diffusr.ai/docs/errors.

- 401: Missing, wrong, revoked or expired API key (code UNAUTHORIZED, KEY_REVOKED, KEY_EXPIRED).
- 403: The key may not do this (SCOPE_DENIED, MODEL_NOT_ALLOWED, TEST_MODE_UNSUPPORTED, ACCOUNT_BLOCKED, allowance_exceeded).
- 422: The request is not valid (VALIDATION_FAILED, INVALID_JSON, PREFLIGHT_FAILED, CALLBACK_URL_INVALID, REFERENCE_*). `issues` lists each problem. Nothing was charged.
- 429: Too many requests or jobs (RATE_LIMITED, CONCURRENCY_LIMIT, UPLOAD_QUOTA, …). Wait Retry-After seconds, then retry.
- 500: Our fault (INTERNAL_ERROR). Quote request_id to support.
- 503: Paused or busy (API_PAUSED, MODEL_PAUSED, PROVIDER_PAUSED, PROVIDER_BUSY, UNAVAILABLE). Wait Retry-After seconds, then retry.

## Charges

Free. No credits are spent.
