Skip to main content
Hostlinku billing is based on a prepaid credit balance in USD. Each completed chat request is deducted from the balance based on the tokens actually used; there are no mandatory monthly subscriptions and no hidden fees.

Account Balance

Balances are managed as a single credit account per user with the following fields: This value is displayed in the console → Credits/Balance menu, and is available via the GET /api/wallet/account session API (used by the console). For your application, the real-time reference remains hostlinku.cost in every response and in the log history.

Top Up Balance

  1. Go to console.hostlinku.com → Billing → Payments.
  2. Select a Credit package or enter another amount (automatic bonus for certain packages).
  3. Select a payment method:
Methods that have not been enabled by the admin are still displayed with the label Not active. 4. You will be redirected to a checkout page containing a QR code, a virtual account number, or a crypto payment link. It is safe to refresh this page, and you can access it again from Pending Payment. 5. Complete the payment. The credit will be automatically credited once the provider’s webhook is validated, without Manual confirmation. From the API perspective, the process is as follows:
method = qris, va (add "channel": "bca", etc.), or crypto. The response contains the topupId along with the QR code / VA number / payment URL; the status can be checked via GET /api/wallet/topup/{topupId}. Server validation rejects amounts outside the top-up policy (min/max set by the admin, technical maximum of $10,000 per transaction) with a 400 BAD_REQUEST error, and rejects unconfigured providers with a 402 PAYMENT_REQUIRED error.

Basis for Cost Calculation

The cost of each request is calculated per token based on the pricing of the customer model being used:
  • The cache token is part of the input token, not an external addition to it. Tokens served from Caches are charged at their respective cache rates, and the remaining input tokens are charged at the input rate—so the same token is never counted twice.
  • The price per model (input/output, including cache price if applicable) is listed in the catalog. See Model and the Model menu in the console. The number in the GET /v1/models response is the price per 1M tokens in (1 = $1) for the Service Mode API key being used—not per token or per 1,000 tokens.
  • The token is calculated based on the usage value in the response; if usage is not available, Hostlinku uses a conservative estimate, and that is what is billed (which rarely happens).
  • The cache here refers to the provider’s prompt cache reported in usage (prompt_tokens_details.cached_tokens / cache_write_tokens). Hostlinku does not store copies of responses and does not mix caches across providers. Instructions on how to enable it and examples of real-world savings can be found in Save Money with Prompt Caching.
  • For streaming, the cost is calculated after the stream is complete; the value in the hostlinku.cost block remains accurate.
  • Calculations are performed in micro-USD units to avoid floating-point rounding errors, then formatted as an 8-digit decimal number.

When does a 402 PAYMENT_REQUIRED error occur?

Code 402 always means credit required, but the message specifies the source:

Transaction History

All balance changes are recorded in the ledger and can be viewed in the console → Transactions (top-ups, usage, refunds), along with the status, amount, method, and reference. Via the API endpoint: GET /api/wallet/transactions (supports pagination by keyset and transaction details).