---
title: "Edge network"
description: "A pirouter request enters the cloud CDN edge nearest to you and goes straight to the provider from there, never through pirouter's servers; pirouter only records token usage on a side path as the response returns; failed deployments are replaced automatically, and some providers in mainland China are reached through a dedicated relay in Japan East."
canonical: "https://pirouter.ai/docs/guides/edge-network"
last-updated: "2026-10-19"
lang: "en"
source: "content/docs/en/guides/edge-network.mdx"
---

# Edge network

A pirouter request enters the cloud CDN edge nearest to you and goes straight to the provider from there, never through pirouter's servers; pirouter only records token usage on a side path as the response returns; failed deployments are replaced automatically, and some providers in mainland China are reached through a dedicated relay in Japan East.

Wherever you are, your request starts at an edge close to you and takes the shortest path to the provider.

![Wherever you are, in Tokyo, Frankfurt or São Paulo, your request enters the nearest cloud CDN edge and goes from there straight to the provider, with no detour through a central region.](https://pirouter.ai/docs/diagrams/edge-network.en.svg)

## Nearest edge in, usage on the side

- **Nearest edge**: Your request enters the cloud CDN edge closest to you.
- **Straight to the provider**: A provider is chosen for the model and your routing settings, and the request goes straight to it.
- **Usage on the side**: As the response returns, pirouter records token usage on a side path.

## Straight to the provider, with automatic failover

From the CDN edge the request goes directly to the chosen provider. Each model is served by more than one deployment where possible. When the chosen deployment fails before the first byte of the response, the request moves to the next deployment of the same model, then to the next model in the request's `models`.

A failure moves on when the provider returns `429`, `500`, `502` or `503`, when the connection fails, and when the provider refuses pirouter's own credentials (`401`, `403`). A `504` or any other `4xx` does not. The full rules are in [Provider routing](https://pirouter.ai/docs/guides/routing.md#failover).

A request is tried at most 5 times, counted across all models.

You pay only for the attempt that returned the response; a failed attempt that the next one replaced is not billed. See [Requests that fail](https://pirouter.ai/docs/guides/billing.md#requests-that-fail).

## Providers in mainland China

Some providers in mainland China are reached through a dedicated relay in Japan East. The relay forwards the encrypted traffic by the host name in the TLS handshake and never decrypts it.

Median time to first byte for large-context requests (about 80,000 input tokens, cache hit, streaming):

| Time window (UTC+8) | Via the relay | Direct |
| ------------------- | ------------- | ------ |
| Night, off-peak     | **2.68 s**    | 3.76 s |
| Evening             | **3.20 s**    | 5.25 s |
| Evening peak        | **3.26 s**    | 5.69 s |

Small requests (80 input tokens, at night): **1.25 s** via the relay, 1.43 s direct.

Measured on 2026-10-10 and 10-11 against the one provider that goes through the relay. The figures cover the outbound leg from the CDN edge to the provider, not the full round trip from your client.

## No content on disk

Prompts and completions pass through in memory only and are never written to disk. For the metadata pirouter does record, see [Data policy & ZDR](https://pirouter.ai/docs/guides/data-policy.md).

## Next steps

- [Data policy & ZDR](https://pirouter.ai/docs/guides/data-policy.md): What pirouter stores, each provider's data policy, and what you control.
- [Provider routing](https://pirouter.ai/docs/guides/routing.md): Control which providers serve your requests.
- [Model fallbacks](https://pirouter.ai/docs/guides/fallbacks.md): Switch to another model automatically when the one you asked for is unavailable.
