Skip to main content

Billing & usage

Usage is metered by tokens and cost. This page explains how usage is calculated, where you can see it, and how it connects to your balance.
Most usage is deducted from your prepaid wallet in real time. If you subscribe to a Coding Plan, requests against your plan’s included GLM models consume your request quota instead — your wallet is only charged for usage outside the plan (non-plan models, fine-tuning, embeddings). See Deposit funds and Balance and deductions.

How usage is calculated

WorkloadHow it’s meteredUnit
Inference (/v1/chat/completions)Input + output tokens per requesttokens
Embeddings (/v1/embeddings)Input tokens per request (only RedPill embedding models, e.g. qwen/qwen3-embedding-8b)tokens
Fine-tuning (/api/training)Billed per GPU hour while the job runs (not while queued)GPU hours
Agent (/api/agent/v1/...)Per request / per step, metered like inference (input + output tokens)tokens
Rates are per model or per category; the platform applies its pricing and optional markup. The exact per-token rate isn’t always exposed in the API, but the dashboard and usage endpoints show aggregate cost and token counts.

Token accounting

Inference and Agent responses report a usage object (OpenAI-compatible):
{
  "usage": {
    "prompt_tokens": 12,
    "completion_tokens": 8,
    "total_tokens": 20
  }
}
FieldWhat it counts
prompt_tokens (input)Tokens in the prompt or message list.
completion_tokens (output)Tokens in the generated completion.
total_tokensInput + output.
Cache read/writeWhen supported and reported by the model; may be priced separately.
ReasoningWhen supported (e.g. chain-of-thought); may be reported separately.
This usage object is what is metered and deducted from your balance.

Where you see usage

  • Dashboard — The Usage or Billing section shows token counts, cost over time, and breakdowns by model or endpoint. Go to Account & settings → Usage in the dashboard (wallet balance and token usage over the last 30 days).
  • API — Query usage programmatically:
curl https://api.llmtune.io/api/usage/summary \
  -H "Authorization: Bearer sk_YOUR_API_KEY"
Returns your balanceUsd and daily token counts (tokens30d). To check Coding Plan quota usage specifically, see GET /api/subscriptions/current.
A sudden cost spike usually means a loop, a runaway batch, or a misconfigured max_tokens. Filter usage by model/endpoint in the dashboard, then check audit logs to trace the source.

How usage connects to balance

  1. You top up your wallet via the dashboard — see Deposit funds.
  2. Each successful request outside your Coding Plan quota — inference on non-plan models, embeddings, fine-tuning, or the Agent — deducts from your wallet based on the usage above. Requests against your plan’s included models consume quota instead.
  3. If your wallet can’t cover a non-quota request, the API returns 402 Payment Required. Add funds and retry.
Failed requests are not charged. If a request errors (4xx/5xx), no tokens are billed — only successful completions are deducted. See Balance and deductions for the full 402 response shape and how to handle it in code.

Next