# List upstream request attempts

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

List the upstream attempts and results for one model call.

```text
GET https://billing.moi.matrixorigin.cn/api/v1/taas/usage-logs/{id}/provider-requests
```

## Before you begin

1. Prepare a personal access token. For creation and management, see [Manage personal access tokens](../../../../../guides/billing/credentials.md#personal-access-token).
2. Select a call from [List request logs](list-request-logs.md).

Results are scoped to data accessible to the current user.

## Request example

Replace `$MOI_PERSONAL_ACCESS_TOKEN` and `$USAGE_LOG_ID` with your personal access token and the selected request log’s ID.

```bash
curl --get "https://billing.moi.matrixorigin.cn/api/v1/taas/usage-logs/$USAGE_LOG_ID/provider-requests" \
  -H "X-API-Key: $MOI_PERSONAL_ACCESS_TOKEN"
```

## Path parameters

::::{div} mo-api-parameter-table

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The selected request log’s ID, from `items[].id` in the request log list. |

::::

## Successful response

Returns HTTP `200` with the upstream request attempts for the selected call.

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
[
  {
    "id": "attempt_example",
    "usage_log_id": "usage_example",
    "model_id": "model_example",
    "model_name": "example-chat-model",
    "attempt_number": 1,
    "status": "success",
    "http_status_code": 200,
    "called_at": 1788710400,
    "input_tokens": 12,
    "output_tokens": 8,
    "cache_read_tokens": 0,
    "cache_creation_tokens": 0,
    "latency_ms": 120,
    "created_at": 1788710400
  }
]
```

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `[].id` | string | Upstream request log ID. |
| `[].usage_log_id` | string | Parent usage log ID. |
| `[].model_id` | string | Catalog model object ID. |
| `[].model_name` | string | Actual model name. |
| `[].attempt_number` | integer | Attempt number within the call. |
| `[].status` | string | Attempt result status. |
| `[].http_status_code` | integer | Upstream HTTP status, when available. |
| `[].retryable` | boolean | Whether the failure is retryable; may be omitted when `false`. |
| `[].called_at` | integer | Call time, Unix seconds. |
| `[].input_tokens` | integer | Input tokens. |
| `[].output_tokens` | integer | Output tokens. |
| `[].cache_read_tokens` | integer | Cache-read tokens. |
| `[].cache_creation_tokens` | integer | Cache-creation tokens. |
| `[].error_type` | string | Call error category, when present. |
| `[].error_message` | string | Call error description, when present. |
| `[].latency_ms` | integer | Call `latency` in milliseconds. |
| `[].created_at` | integer | Log creation time, Unix seconds. |

In field paths, `[]` denotes each array item.

:::::
::::::
:::::::
