APIQIKAPIQIK
Docs
Billing & Support

Usage-Based Billing

Understand input and output token billing and estimate and control costs from actual usage.

APIQIK charges for actual usage. Input and output rates can differ by model; current model-catalog and console prices are the source of truth.

Billing components

ComponentFieldDescription
Input tokensusage.prompt_tokensSystem instructions, message history, user input, tool definitions, and other input.
Output tokensusage.completion_tokensGenerated text, reasoning, or tool-call content according to the model's billing definition.
Total tokensusage.total_tokensUsually combined input and output tokens, used for usage monitoring.

Cost formula

Per-request cost: Input tokens × input rate + output tokens × output rate. Rate units and settlement precision follow the model catalog.

Do not budget from average requests alone. Measure P50 and P95 input/output token counts and daily volume, then reserve capacity for traffic changes, retries, and new features.

Record response usage

response = client.chat.completions.create(
    model="qwen-turbo",
    messages=[{"role": "user", "content": "Summarize this text"}],
)

usage = response.usage
print({
    "prompt_tokens": usage.prompt_tokens,
    "completion_tokens": usage.completion_tokens,
    "total_tokens": usage.total_tokens,
})

Reduce costs

  • Match models to task difficulty rather than using the most expensive model for every request.
  • Remove unrelated history, repeated system instructions, and retrieval noise.
  • Use max_tokens to prevent unnecessarily long answers.
  • Cache stable, repeated results where permitted.
  • Attribute usage by tenant, feature, and environment to detect unusual growth.
  • Apply deterministic filters before generation so models do not handle tasks that require no reasoning.