# Download a request or response body

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

Download the complete archived request or response body for a model call.

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

## 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).
3. Use [Get request log details](get-request-log.md) to confirm that the required body has been archived.

The download may contain user inputs and model outputs. Store it in a controlled location.

## Request example

Replace `$MOI_PERSONAL_ACCESS_TOKEN`, `$USAGE_LOG_ID`, and `$BODY_REF_ID` with your personal access token, the selected log’s ID, and its body archive reference ID.

```bash
curl "https://billing.moi.matrixorigin.cn/api/v1/taas/usage-logs/$USAGE_LOG_ID/bodies/$BODY_REF_ID" \
  -H "X-API-Key: $MOI_PERSONAL_ACCESS_TOKEN" \
  --output body.bin
```

## 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. |
| `body_ref_id` | string | Yes | A body archive reference belonging to the same log, from `request_body_ref_id`, `response_body_ref_id`, or `body_refs[].id` in its details. |

::::

## Successful response

Returns HTTP `200` with the complete body as raw bytes. The example saves these bytes to `body.bin`. The media type is `application/octet-stream`.

The following headers are returned when their values are available.

| Header | Type | Description |
| --- | --- | --- |
| `X-Body-Scope` | string | Request or response stage for the body, when available. |
| `X-Body-SHA256` | string | SHA-256 of the complete body, when available; use it to verify the download. |
| `X-Body-Bytes` | integer | Complete body size in bytes; returned when greater than 0. |
