Billing & Usage

1. Billing dimensions

ApiSet.ai Gateway charges based on actual usage, mainly measured by:

  • Prompt tokens (prompt_tokens)
  • Completion tokens (completion_tokens)
  • Total tokens (total_tokens)

The gateway prefers to use the upstream model’s usage field as the basis for billing.

2. Pricing model

  • Pricing is defined per 1K tokens (different models have different prices; see the console or the pricing page for details).
  • A typical formula looks like:
amount = prompt_tokens * price_prompt + completion_tokens * price_completion
  • Internally, the system uses the smallest currency unit (for example cents) and integer arithmetic to avoid floating‑point rounding errors.

3. Usage for streaming vs non‑streaming

  • Non‑streaming (stream=false)
    When the upstream response contains a usage field, the gateway directly uses those token counts.

  • Streaming (stream=true)

    • The upstream returns multiple data: {...} SSE frames.
    • The final frame usually contains a usage field.
    • The gateway parses this usage information separately (without affecting the streaming output) for billing and analytics.

4. Viewing usage and bills

In the ApiSet.ai console’s Usage section you can view:

  • Call counts and total token usage per API key.
  • Usage statistics broken down by model.
  • Per‑call billing details, and remaining balance / quota (if quota or prepaid modes are enabled).

The console UI may change over time, but core metrics such as call count, token usage and cost will remain available.

5. FAQ

Q: Are streaming calls more expensive than non‑streaming calls?
A: No. Both are billed based on the final usage.total_tokens returned by the upstream model. Splitting the response into multiple frames does not increase cost.

Q: Do all models have the same price?
A: No. Prices vary by provider and by model. Please refer to the console or public pricing documentation.

Q: What happens when my balance is insufficient or I exceed my quota?
A: The gateway will reject new requests and return an error such as insufficient_quota. Whether overdraft is allowed depends on your console configuration.

Q: Do you support monthly plans or bundled packages?
A: Yes. For monthly or custom packages, please contact sales/operations; plans can be tailored to your estimated usage.