# Tokens and Metering

### How tokens are tracked

Every API call is metered at the token level and attributed to a specific Unit, Lot, and trade. The system always draws from the Lot closest to expiration first (FIFO). This metering chain connects your real-time usage back to the market transaction that funded it, giving both developers and suppliers an auditable record of what was delivered, by whom, and at what cost.<br>

* For every call, the platform counts input and output tokens using metering components that are specific to categories of models.
* It subtracts the tokens from the oldest Lot (i.e. the lot that is closest to expiration) in your Consumption Account.
* It records the mapping between the call, the Lot and the Unit to consume from, the trade that funded it, and the Supplier that served it.

You can read more about our metering system [here](https://thegrid.ai/docs/introduction/consumption-delivery-and-metering).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://thegrid.ai/docs/introduction/core-concepts/tokens-and-metering.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
