Credits and billing
Prepaid USD credits, buying them through Efespay with the platform fee on top, receipts, automatic top-up, promo codes, low-balance alerts, refunds and payment disputes, plans, how the cost of a request is calculated and reserved, and what is never billed.
MarkdownOn this page
Lykia is pay-as-you-go. Your company buys credits in advance, and each request's cost is deducted from that balance at the model's list price. There is no subscription and nothing is added to the price of a request paid with credits: Lykia's fee is taken when you buy credits.
All amounts are in USD. There are no other currencies and no conversion.
Topping up
Buy credits on the Credits page of the dashboard. You need to be the company owner or have the accountant role. Enter an amount in USD with at most two decimal places; the dashboard shows the smallest and largest amount you can buy at once. You pay on Efespay's secure payment page, which opens in a new tab; there you can also save the card for later. When the payment is done, the tab tells you it can be closed and the Credits page updates on its own.
The credits are added to the balance when Efespay confirms the payment. Closing the payment page without paying changes nothing. Every project in the company spends from the same balance.
Your company's first top-up also moves it from the Free plan to Standard, which unlocks paid models (see Plans).
Platform fee
A platform fee is added on top of every purchase. It is the amount of credits multiplied by your plan's fee rate, rounded to the nearest cent:
platform fee = credit amount × plan fee rate
total charged = credit amount + platform fee
added to balance = credit amountThe whole credit amount lands in your balance and the fee is paid on top. The payment page shows the credits and the platform fee as separate lines. The fee rate that applies is the one your plan has when you start the payment. Prices do not include tax.
Receipts
When a payment goes through, the owner and the accountants get a notification in the dashboard and a receipt by email (each person can choose their notification channels). The receipt has a number of the form LY-YYYY-NNNNNN, the date, the company, the credit amount, the platform fee and its rate, and the total.
Saved cards and automatic top-up
Cards are saved on the payment page, by ticking Save card when you buy credits; there is no separate way to add a card. Saved cards are stored by Efespay; Lykia never sees the card details. You can remove a saved card on the Credits page at any time.
With a saved card you can turn on automatic top-up: choose a threshold and an amount. When a request leaves the balance below the threshold, Lykia charges the amount (plus the platform fee) to the card without you being present, and the credits arrive when Efespay confirms the payment. Only one automatic top-up runs at a time, and Lykia caps how many it attempts per day.
If the card is declined or the bank asks for authentication that cannot happen without you, automatic top-up is switched off and the owner and accountants are notified; top up by hand or choose another card, then turn it back on. They are also notified if the daily cap is reached. Removing the card that automatic top-up uses switches it off.
Low-balance alerts
Set a low-balance threshold on the Credits page (5 USD unless you change it; 0 turns the alert off). Each time the balance drops below it, the owner and accountants get one notification in the dashboard and by email. The alert is armed again once the balance is back at or above the threshold, for example after a top-up.
Promo codes
If you have a promo code, redeem it on the Credits page. Its amount is added to the balance straight away; no platform fee is charged on it. Each code can be redeemed once per company and once per person: if you have already redeemed a code for one company, you cannot redeem it again for another. An unknown, expired, used-up or already redeemed code returns the same error.
Refunds and payment disputes
Top-ups are refunded through Lykia. When a refund goes through, the refunded credits are removed from the balance. If some of those credits have already been spent, the balance can go below zero, and paid requests stop until it is topped up again. If a refund fails or is cancelled after its credits were removed, the credits are added back.
If the cardholder disputes a payment with their bank, the disputed credits are removed from the balance as soon as Lykia records the dispute, and here too the balance can go below zero. Automatic top-up is switched off at the same time, and the owner and accountants are notified; you can turn automatic top-up back on in the dashboard. If the dispute is decided in your favour, the credits are added back; if it is lost, they stay removed.
Plans
Your company is on one of four plans: Free, Standard, Business or Enterprise. A plan sets whether paid models are available, the platform fee rate, how many active projects you can have, the daily request limit for free models, and the monthly BYOK allowance and the fee above it. The current figures for each plan are on the pricing page.
- Free: new companies start here. Your own provider keys work, and so do models Lykia has marked free, if any; paid models need a top-up.
- Standard: the company moves here automatically with its first top-up. Paid models become available and the daily limit for free models goes up.
- Business: for companies that need more projects. The owner can switch between Standard and Business on the dashboard. Moving from Business back to Standard is possible once a minimum period on Business has passed; the dashboard shows when.
- Enterprise: fees and limits are set by contract, and Lykia sets the plan up for you. Contact us to arrange it.
A new fee rate applies to purchases started after the change.
What a request costs
The cost comes from the model's unit prices (see Models) and the token counts the provider reports:
cost = input tokens × prompt price
+ output tokens × completion price
+ cache-read tokens × input_cache_read price
+ cache-write tokens × input_cache_write price
+ input images × image price
+ per-request price (request)Tokens read from or written to the cache are subtracted from the input token count, so no token is charged twice. If the model has no cache price, those tokens are charged at its prompt price. Each image part in the messages is charged at the model's image price when the catalog lists one. Reasoning tokens are part of the output tokens and are charged at the completion price, unless the catalog lists a separate reasoning price for the model. Other units that have no price for the model are not charged. The result is rounded to the nearest micro-dollar (0.000001 USD), with exact halves rounded up.
Prices are kept per provider connection in Lykia's catalog. When a model is offered by more than one provider, a request is charged at the price of the provider that served it; GET /models shows the lowest price available to your project for each model.
Example: take openai/gpt-4o-mini at 0.00000015 USD per input token and 0.0000006 per output token. A request that uses 17 input and 27 output tokens costs:
17 × 0.00000015 = 0.00000255
27 × 0.0000006 = 0.0000162
total = 0.00001875 → 0.000019 USDThat figure comes back in the response as usage.cost, and if you pay with credits it is exactly what leaves your balance. usage.cost_details breaks it down: upstream_cost is the request at list price, platform_fee is the BYOK fee for the request (0 on credits) and is_byok says which kind of request it was. Cache writes with a one-hour lifetime are charged at the model's one-hour write price, or 1.6 times the five-minute write price when the catalog has none (Prompt caching). The token counts that are charged never exceed what the request could use: input up to the amount reserved for the prompt and output up to the output limit sent to the provider (see Reservations). You can fetch the same request's details later with GET /generation.
What is not billed
- Failed attempts: Lykia may try a request with several providers in turn. Attempts that fail, or that Lykia moves on from, are free; only the attempt that produced the response is billed.
- Requests that never got a response: a request rejected before it reached a provider, or one that every provider failed, costs nothing.
- BYOK requests: when a request goes out with your own provider key, the provider bills you for inference directly and Lykia takes no inference charge from your credits. Once the company's BYOK usage in a month passes your plan's allowance, a fee is charged on the excess; see BYOK.
Reservations
Before Lykia sends a request to a provider, it reserves the most the request can cost: its prompt and its output limit at the model's prices. The reservation is held against the company balance, and also against the key's spending limit and the project's budget when they are set. Reserved amounts count as spent for any other request until the request finishes; then the actual cost is deducted and the rest of the reservation is released. The amount deducted is never more than the reservation.
When the amount still available cannot cover the model's full output, Lykia lowers the output limit (max_tokens or max_completion_tokens) to what it can cover. If you did not send a limit, Lykia sets one: the model's maximum output, or less when that is all the available amount covers. The response then carries the applied limit in the X-Max-Tokens-Applied header. An answer that reaches the limit ends with finish_reason: "length".
When the available amount cannot cover even the prompt plus a minimal completion (16 tokens, or fewer if you asked for fewer), the request is rejected with 402 before it reaches a provider, even if the balance is not yet zero:
{
"error": {
"message": "Insufficient credits: your available balance cannot cover this request's prompt and a minimal completion. Top up, or shorten the prompt or max_tokens.",
"type": "invalid_request_error",
"code": "insufficient_credits",
"status": 402,
"metadata": {
"reason": "insufficient_credits"
}
}
}Shortening the prompt or lowering max_tokens can let such a request through; otherwise top up. Requests to free models do not reserve anything. Requests sent with your own provider keys reserve nothing from the balance, only from a key limit or project budget that counts BYOK spending.
How the balance goes down
The cost is deducted when a request finishes, from the reservation made for it. Because of the reservation, usage never takes the balance below zero, however many requests run at once. The balance can go below zero only through a refund or payment dispute for credits that were already spent, or through BYOK fees. BYOK fees are deducted once a day, in one entry per project for the previous day. While the balance is at or below zero, new requests to paid models return 402 (requests to free models are not affected; for requests with your own provider keys, see BYOK):
{
"error": {
"message": "Insufficient credits. Add credits to your balance, or add your own provider key (BYOK) to this project.",
"type": "invalid_request_error",
"code": "insufficient_credits",
"status": 402,
"metadata": {
"reason": "insufficient_credits"
}
}
}You can read the balance, what is reserved for requests in flight and what is available for new requests from the API too:
curl https://api.getlykia.com/v1/credits \
-H "Authorization: Bearer $LYKIA_API_KEY"import os
import requests
response = requests.get(
"https://api.getlykia.com/v1/credits",
headers={"Authorization": f"Bearer {os.environ['LYKIA_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
credits = response.json()["data"]
print("balance (USD):", credits["balance"])
print("total usage (USD):", credits["total_usage"])
print("reserved (USD):", credits["reserved"])
print("available (USD):", credits["available"])const response = await fetch("https://api.getlykia.com/v1/credits", {
headers: { Authorization: `Bearer ${process.env.LYKIA_API_KEY}` },
});
if (!response.ok) {
throw new Error(`Lykia returned ${response.status}: ${await response.text()}`);
}
const { data } = await response.json();
console.log("balance (USD):", data.balance);
console.log("total usage (USD):", data.total_usage);
console.log("reserved (USD):", data.reserved);
console.log("available (USD):", data.available);{
"data": {
"balance": 99.996675,
"total_usage": 0.003325,
"reserved": 0.16414,
"available": 99.832535,
"billing_mode": "prepaid"
}
}Field descriptions: GET /credits.
Related
- Limits: cap spending with key limits and project budgets.
- Bring your own key (BYOK)
- Models: price units.