# Billing Tracking

Infron uses a transparent billing system to ensure every call is precisely metered and billed. Pricing differs across models, and the same model may be priced differently across providers.

### Model Prices

Model prices for each provider are listed on the [model detail page](https://infron.ai/models).&#x20;

<figure><img src="https://3822312837-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZ9C9AjT7j46HAcQrOVWw%2Fuploads%2FxgrvVLFXrrCmUGShprJI%2Fimage.png?alt=media&#x26;token=c00bb905-cfbc-4602-814c-0bd2834444f9" alt=""><figcaption></figcaption></figure>

### Billing Items <a href="#billing-items" id="billing-items"></a>

You can enable usage accounting in your requests by including the `usage` parameter:

{% content-ref url="../api-reference/usage-accounting" %}
[usage-accounting](https://infronai.gitbook.io/docs/api-reference/usage-accounting)
{% endcontent-ref %}

{% tabs %}
{% tab title="Python" %}

```python
import requests
import json

response = requests.post(
  url="https://llm.onerouter.pro/v1/chat/completions",
  headers={
    "Authorization": "Bearer <API_Keys>",
    "Content-Type": "application/json"
  },
  data=json.dumps({
    "model": "x-ai/grok-4.1-fast-reasoning", 
    "messages": [
      {
        "role": "user",
        "content": "What is the meaning of life?"
      }
    ],
    "usage": {
      "include": True
    },
    "reasoning": {
        "effort": "none"
    }
  })
)
print(response.json())
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl https://llm.onerouter.pro/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <API_Keys>" \
  -d '{
  "model": "x-ai/grok-4.1-fast-reasoning",
  "messages": [
    {
      "role": "user",
      "content": "What is the meaning of life?"
    }
  ],
  "usage": {
      "include": true
  },
  "reasoning": {
      "effort": "none"
  }
}'
```

{% endtab %}
{% endtabs %}

When usage accounting is enabled, the response will include

* `usage` object with detailed token information
* `cost` object with the total amount charged to your account.
* `cost_details` object with the breakdown of the total cost.

```json
{
  'choices': [{
    'finish_reason': 'stop',
    'index': 0,
    'logprobs': None,
    'message': {
      'content': '42.\n\n(That\'s from Douglas Adams\' *The Hitchhiker\'s Guide to the Galaxy*, where a supercomputer spends 7.5 million years computing the Answer to the Ultimate Question of Life, the Universe, and Everything... only for everyone to realize they don\'t know the actual question.)\n\nIn all seriousness, there\'s no single, objective "meaning" to life—it\'s a question philosophers, scientists, religions, and thinkers have wrestled with for millennia. Here\'s a quick tour of perspectives:\n\n### Biological/Evolutionary View\nLife\'s "purpose" is survival and reproduction. Richard Dawkins calls us "survival machines" for genes. Propagate, adapt, repeat.\n\n### Religious/Spiritual Views\n- **Abrahamic faiths** (Christianity, Islam, Judaism): Worship God, follow divine commandments, achieve salvation or paradise.\n- **Eastern philosophies**: Hinduism/Buddhism—break the cycle of rebirth (samsara) through enlightenment or dharma. Taoism: Flow with the Tao, live in harmony.\n- **Existential twist**: Even atheists like Sartre say God isn\'t filling the void, so *you* define meaning through choices.\n\n### Philosophical Takes\n- **Aristotle**: Eudaimonia—flourishing through virtue, reason, and fulfilling your potential.\n- **Nietzsche**: Become who you are; embrace the will to power, create values beyond "slave morality."\n- **Camus (Absurdism)**: Life is inherently meaningless and absurd, so rebel by living fully anyway—Sisyphus happy with his boulder.\n- **Epicurus**: Seek modest pleasures, avoid pain, cultivate friendships. (Not orgies—simple joys.)\n\n### Modern/Scientific Lens\nFrom xAI\'s vantage (understanding the universe): Life might be about curiosity, discovery, and expanding consciousness. We\'re stardust pondering itself (thanks, Carl Sagan). Build, explore, connect—whether that\'s AI, space, or relationships.\n\nUltimately, **the meaning of *your* life is what you make it**. Pursue what lights you up: love, art, science, helping others, memes. Experiment, reflect, iterate. If it feels empty, pivot.\n\nWhat\'s *your* take? Or what sparked the question? 🚀',
      'role': 'assistant'
    }
  }],
  'cost': 0.000235,
  'cost_details': {
    'audio_cost': 0,
    'byok_cost': 0,
    'completion_cost': 0.000225,
    'discount_rate': 1,
    'image_cost': 0,
    'is_byok': False,
    'native_web_search_cost': 0,
    'plugin_web_search_cost': 0,
    'prompt_cache_read_cost': 7.55e-06,
    'prompt_cache_write_1_h': 0,
    'prompt_cache_write_5_min': 0,
    'prompt_cache_write_cost': 0,
    'prompt_cost': 2.4e-06,
    'reasoning_cost': 0,
    'tools_cost': 0,
    'video_cost': 0
  },
  'created': 1773372917,
  'id': '9ecbdbd4-3a3d-0030-bbd2-e325a04e45cf',
  'model': 'x-ai/grok-4.1-fast-reasoning',
  'object': 'chat.completion',
  'request_id': '2d1bb838663549eb9e004b2a64e4e981',
  'usage': {
    'completion_tokens': 450,
    'completion_tokens_details': {
      'reasoning_tokens': 218
    },
    'input_tokens': 0,
    'output_tokens': 0,
    'prompt_tokens': 163,
    'prompt_tokens_details': {
      'cached_tokens': 151,
      'text_tokens': 163
    },
    'total_tokens': 831,
    'ttft': 0
  }
}
```

#### usage

| Item                                         | Description                                              |
| -------------------------------------------- | -------------------------------------------------------- |
| `prompt_tokens`                              | Total tokens of `input prompts`, include `cached_tokens` |
| `completion_tokens`                          | Total tokens of `output completions`                     |
| `total_tokens`                               |                                                          |
| `prompt_tokens_details`                      | prompt\_tokens breakdowns                                |
| `prompt_tokens_details.cached_tokens`        |                                                          |
| `prompt_tokens_details.cache_write_tokens`   |                                                          |
| `prompt_tokens_details.audio_tokens`         |                                                          |
| `prompt_tokens_details.video_tokens`         |                                                          |
| `completion_tokens_details`                  | completion\_tokens breakdowns                            |
| `completion_tokens_details.reasoning_tokens` |                                                          |
| `completion_tokens_details.image_tokens`     |                                                          |
| `completion_tokens_details.audio_tokens`     |                                                          |

{% hint style="info" %}
`input_tokens` = `prompt_tokens` - `cached_tokens` - `cache_write_tokens`&#x20;

`prompt_cost` = (`input_tokens` \* `input_price`) + (`cached_tokens` \* `cached_price`) + (`cache_write_tokens` \* `cache_write_price`)
{% endhint %}

{% hint style="info" %}
`output_tokens` = `completion_tokens`&#x20;

`completions_tokens_cost` = `completion_tokens` \* `completion_price`
{% endhint %}

{% hint style="info" %}
`total_tokens` = `prompt_tokens` + `completion_tokens`

`total_tokens_cost`  = `prompt_cost` + `completions_tokens_cost`
{% endhint %}

#### cost\_details

| Item                       | Description                                       |
| -------------------------- | ------------------------------------------------- |
| `prompt_cost`              | Cost for processing input prompts                 |
| `completion_cost`          | Cost for model-generated output                   |
| `image_cost`               | Cost for image processing or generation           |
| `video_cost`               | Cost for video processing or generation           |
| `audio_cost`               | Cost for audio processing or generation           |
| `native_web_search_cost`   | Cost for invoking native web search functionality |
| `plugin_web_search_cost`   | Cost for invoking plugin web search functionality |
| `tools_cost`               | Cost for invoking tool callings                   |
| `prompt_cache_read_cost`   | Cost for cache read operations                    |
| `prompt_cache_write_cost`  | Cost for cache write operations                   |
| `prompt_cache_write_5_min` | Cost for 5-minute cache write operations          |
| `prompt_cache_write_1_h`   | Cost for 1-hour cache write operations            |
| `reasoning_cost`           | Cost for internal reasoning computations          |
| `discount_rate`            | Effective discount rate                           |
| `is_byok`                  | Whether is byok                                   |
| `byok_cost`                | Cost for byok                                     |


---

# 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://infronai.gitbook.io/docs/observability/billing-tracking.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.
