---
title: "Principles"
description: "How pricing, host choice, compatibility and data handling work."
---

# Principles

## Compatibility

The API follows OpenRouter's paths, fields, response shapes and error bodies. Chat completions, completions and Responses follow OpenAI's shapes; Messages follows Anthropic's.

## Pricing

Every token costs the provider's list price, with 0% platform fee. Each model page shows the price.
Every completion reports its own cost in `usage.cost`, and a non-streamed one also in the `X-PG-Cost-USD` header; on a stream, `usage.cost` is in the final usage chunk.

### Your own keys

A provider key you add on [AI providers](https://plaingateway.com/providers) serves your own requests first, for the models it carries.
You pick no models: when you add the key, we ask the provider which models it can use and keep the ones we route. On Azure, that means your deployments.
We charge no fee on such a request, so it needs no credits. Your provider bills you for the tokens.
When your key fails or refuses the request, the gateway falls back to the shared hosts at our normal price, if your credits cover it. `X-PG-Host` names the host that answered, and Logs tags each request your key served with "Your key".

## Host choice

Each model has a pinned host: the gateway sends the model's requests to the same first host every time, which keeps prompt caches warm.
When that host fails, times out or rate limits, the gateway tries the model's next host, unless **Allow fallbacks** is off in your [account settings](../routing/provider-routing.md#account-settings). `X-PG-Host` names the host that answered.

## Data

plaingateway does not train on request data. Each host has its own retention policy; see [Provider logging](../privacy/provider-logging.md).
Service health and host latency are on [/latency](https://plaingateway.com/latency).
