# Finalize application inference run

```http
POST /internal/application-agui-inference/runs/{runId}/finalize
```

Record the terminal status of a private application AG-UI inference run.

## Parameters

| Name    | In   | Required | Description |
| ------- | ---- | -------- | ----------- |
| `runId` | path | Yes      |             |

## Request body

| Field            | Type   | Required | Description |
| ---------------- | ------ | -------- | ----------- |
| `status`         | string | Yes      |             |
| `errorCode`      | string |          |             |
| `inferenceToken` | string | Yes      |             |

## Responses

| Status | Description                                               |
| ------ | --------------------------------------------------------- |
| 200    | Application inference run finalized                       |
| 400    | Redacted application inference refusal                    |
| 401    | Missing or invalid internal host Basic credentials        |
| 402    | Redacted application inference refusal                    |
| 403    | Redacted application inference refusal                    |
| 404    | Redacted application inference refusal                    |
| 409    | Redacted application inference conflict                   |
| 413    | Request body exceeds the maximum allowed size             |
| 429    | Redacted application inference refusal                    |
| 500    | Redacted application inference refusal                    |
| 503    | Redacted application inference refusal or shutdown notice |
