> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ariacompute.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reroute Captured Router Request API

> Replay a captured Aria Compute ROUTER request against the current routing configuration to compare decisions and responses.

Use the Reroute endpoint to replay a previously captured request against the current router configuration. This is useful for regression testing: compare the new routing decision and provider response with the original to validate config changes.

The request is re-executed against the live downstream provider unless you are in a restricted environment.

## Endpoint

```http theme={null}
POST /v1/router/replay/{id}/reroute
```

## Authentication

Authenticate with a session cookie or pass `Authorization: Bearer <api-key>`.

## Path Parameters

<ParamField path="id" type="string" required>
  Unique replay identifier from the list replay response.
</ParamField>

## Response

<ResponseField name="new_id" type="string">
  Identifier assigned to the new replayed request.
</ResponseField>

<ResponseField name="decision" type="object">
  Routing decision produced by the current configuration.

  <Expandable title="properties">
    <ResponseField name="provider" type="string">
      Selected provider name.
    </ResponseField>

    <ResponseField name="model" type="string">
      Resolved model name.
    </ResponseField>

    <ResponseField name="recipe" type="string">
      Matched recipe identifier.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="response" type="object">
  Downstream provider response from the replayed request.

  <Expandable title="properties">
    <ResponseField name="id" type="string">
      Completion identifier.
    </ResponseField>

    <ResponseField name="choices" type="array">
      Generated choices.
    </ResponseField>

    <ResponseField name="usage" type="object">
      Token usage summary.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://router.example.com/v1/router/replay/req_9f3a2b/reroute" \
    -H "Authorization: Bearer <api-key>"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "new_id": "req_7a4e1f",
    "decision": {
      "provider": "anthropic",
      "model": "claude-3-5-sonnet-20241022",
      "recipe": "semantic-router"
    },
    "response": {
      "id": "msg_01example",
      "choices": [
        {
          "index": 0,
          "message": {"role": "assistant", "content": "Hello again!"},
          "finish_reason": "stop"
        }
      ],
      "usage": {
        "prompt_tokens": 10,
        "completion_tokens": 8,
        "total_tokens": 18
      }
    }
  }
  ```
</ResponseExample>


## Related topics

- [List Replayable Router Requests API](/api-reference/router/replay/list.md)
- [List All Training Checkpoints - PIN API](/api-reference/pin/checkpoints/list.md)
- [aria-router runtime and FFI](/sdks/router-runtime.md)
- [Router Management Chat and Route Test API](/api-reference/router/management/chat.md)
- [Router Configuration Get and Update API](/api-reference/router/management/config.md)
