OpenRouter Made Crystal Clear · chapter 2: The Mental Model: One Key, Many Endpoints

The big schema

2026-09-18

Client code, the API surface, the routing decision, the chosen provider, and the billed response, one path this book zooms into repeatedly.

Below: the paragraph from the book that builds this idea, then the diagram itself (Figure 2.2), and a recap. About a minute of reading.

Trace one request through the whole system and the pieces click into place. Your code sends a request to OpenRouter's API surface, naming a model slug and, optionally, routing preferences. OpenRouter's routing layer evaluates the candidate endpoints for that slug, applies whatever filters and sort preferences you set (or the price-based default if you set none), and picks one. The chosen provider actually runs the model and returns a response. OpenRouter passes that response back to you and records what it cost, against the provider's own pricing, on your credit balance.

Figure 2.2: The big schema. Client code, the API surface, the routing decision, the chosen provider, and the billed response, one path this book zooms into repeatedly.
Figure 2.2: The big schema. Client code, the API surface, the routing decision, the chosen provider, and the billed response, one path this book zooms into repeatedly.

Recap

  • The idea: Client code, the API surface, the routing decision, the chosen provider, and the billed response, one path this book zooms into repeatedly.
  • The picture: Figure 2.2, from chapter 2 ("The Mental Model: One Key, Many Endpoints") of OpenRouter Made Crystal Clear.
  • Go deeper: the chapter builds this step by step, with recipes and sources at the end.

This diagram is one of many in OpenRouter Made Crystal Clear.

Every chapter opens with the gist, draws the hard ideas, and ends with recipes and sources.

Get the book

All diagrams