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

# Understand usage and billing

> Understand token usage, estimate text generation costs using current model prices, and compare llm.sg request records with your account billing data.

Check your selected model's current prices, account balance, and applicable limits before making llm.sg requests.

> [!NOTE]
>
> Billing page locations, currencies, payment methods, pricing units, and charging rules still require product confirmation. Use the platform's actual pricing and billing records.

## Read token usage

Tokens measure the input and output processed by a model. They are not equivalent to words or characters.

Compatible responses may include:

| Field | Meaning |
| - | - |
| `usage.prompt_tokens` | Input token count |
| `usage.completion_tokens` | Output token count |
| `usage.total_tokens` | Total token count |

Availability and detailed accounting depend on the model and endpoint. Reasoning, cached content, and multimodal input may have separate rules.

## Estimate text generation cost

For a model priced separately by input and output tokens:

```text theme={null}
Estimated cost = input tokens × input price ÷ pricing unit
               + output tokens × output price ÷ pricing unit
```

If prices are listed per million tokens, use `1,000,000` as the pricing unit. Use current prices in the same currency. This estimate does not replace actual billing records.

## Check your records

If the console provides usage or request history, compare the model ID, timestamp, request ID, token usage, and number of attempts against your application logs. Include the timezone when investigating differences.

Keep costs predictable by evaluating small batches, trimming unnecessary conversation history, and using output limits supported by your model. Set bounded retries and check whether your SDK already retries automatically.

A timeout can occur after the server starts processing. Another request may create additional usage. Failed, canceled, or interrupted request charges depend on the platform's billing policy.


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