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

# How TokenChange works

> The core ideas behind TokenChange: models, endpoints, providers, credits, inference keys and API tokens, and what happens to each request you send.

TokenChange connects people who run inference servers with people who want to call models. One person can be both: earn credits by serving requests, then spend them on models someone else hosts.

## Models and endpoints

A **model** is an open-weights model in the catalog, such as a specific release of an open model family. Each model has a slug that you pass as `model` in API requests.

An **endpoint** is one provider's deployment of a model. A popular model can have many endpoints, each with its own prices, context window, quantization, capabilities and capacity. TokenChange doesn't host model weights itself; every endpoint is run by an independent provider.

When you call a model, TokenChange picks one of its endpoints for you. You can also [pin a request](https://docs.tokenchange.io/guides/models-and-endpoints.md#pin-a-request-to-one-endpoint) to a single endpoint.

## Providers

A **provider** is a user who hosts endpoints. Every new endpoint is reviewed by an operator and then validated automatically before it serves traffic. See [Become a provider](https://docs.tokenchange.io/providers/overview.md).

## Credits

Credits are the only currency on TokenChange.

| Unit | Value |
| - | - |
| 1 credit | \$0.01 |
| \$1 | 100 credits |

Using an endpoint spends credits at that endpoint's per-million-token prices. Hosting earns credits: providers receive what customers are charged on their endpoints, minus a 15% platform fee. See [Credits and billing](https://docs.tokenchange.io/guides/credits.md).

## Inference keys and API tokens

TokenChange has two kinds of credential, and neither works in place of the other.

| Credential | Prefix | Used for | Create it in |
| - | - | - | - |
| Inference key | `ask_` | Calling models through the [inference API](https://docs.tokenchange.io/inference/overview.md) | **Inference keys** |
| API token | `tcg_` | Managing your account through the [REST API](https://docs.tokenchange.io/api-reference/introduction.md) | **Account** > **API tokens** |

## What happens to a request

1. You send a streaming request to `inference.tokenchange.io` with an inference key.
2. TokenChange checks the key and that your balance is above zero.
3. It finds the model's endpoints that are serving, that your key allows and that fit any [price options](https://docs.tokenchange.io/guides/routing.md#price-options) you set.
4. It routes the request to one of them. Requests that share a prompt prefix tend to reach the same endpoint, so the provider's prompt cache is reused.
5. If that endpoint fails before sending anything, the request moves to another endpoint. You only see the stream from the endpoint that succeeds.
6. When the stream ends, the request is priced from its token usage and the endpoint's prices, and the credits move from your balance to the provider.

Requests that deliver no output are never billed.

## Next steps

> **[Quickstart](https://docs.tokenchange.io/quickstart.md)**
>
> Make your first request.

> **[Routing and price options](https://docs.tokenchange.io/guides/routing.md)**
>
> How endpoints are chosen and how to steer that choice.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.