Credits and usage
Billable services are settled in account credits. Amounts are given in millicredits (millicredits); 1000 millicredits equal 1 credit. Amounts you send in requests must be integers; amounts in balances and records may carry one decimal place (0.1 millicredit). credit_precision in responses is 4, meaning at most 4 decimal places once converted to credits.
Check the balance
Section titled “Check the balance”GET /api/v1/billing/credits/balancecurl https://omnidoc.top/api/v1/billing/credits/balance \ -H "X-API-Key: $OMNIDOC_API_KEY"Key fields:
| Field | Meaning |
|---|---|
available | Millicredits available now, after debt; negative when in debt |
debt | Debt in millicredits: the part of completed jobs’ actual cost that exceeded the balance. Credits that arrive later (top-ups, daily grants, redeem codes, refunds and so on) pay off the debt first |
spent | Total millicredits settled |
expired | Millicredits that expired or were withdrawn |
today_charged | Millicredits settled today |
lots | Credit lots currently valid and their expiry |
Credit packs
Section titled “Credit packs”GET /api/v1/billing/credits/plansA public endpoint that needs no sign-in and returns the packs on sale (purchase_plans, keyed by plan code). On sale now:
| Plan code | Credits | Price | Bonus |
|---|---|---|---|
credits_3000_v4 | 3,000 | ¥9.90 | — |
credits_10000_v4 | 10,000 | ¥29.90 | — |
credits_25000_v4 | 25,000 | ¥69 | 8% |
credits_50000_v4 (recommended) | 50,000 | ¥129 | 16% |
credits_125000_v4 | 125,000 | ¥299 | 25% |
credits_450000_v4 | 450,000 | ¥999 | 35% |
- “Bonus” is computed against the price of 10,000 credits for ¥29.90 and is the
bonus_percentfield; the recommended pack hasrecommended: true. Neither field appears when it is not set. price_fen(in fen, 1/100 yuan) is authoritative for the price, andtotal_millicredits(millicredits) for the credits. Purchased credits do not expire; packs can be bought again and arrive in one go each time.
Charging lifecycle
Section titled “Charging lifecycle”- The balance is checked against a threshold before a job starts: the balance (after debt) must be above the job’s threshold, for example “pages × 2 credits” for PDF translation, the length of the source text for other files (at least 2 credits), and for audio, video and speech the cost computed from the duration or characters the server measured (prices in audio, video and voices). With an API key that has a budget, the key’s remaining budget must also be above the threshold. Otherwise the response is
402(a file translation job ends as failed withquota_exceeded=true, a media job ends witherror_code=insufficient_credits) and nothing is charged. Starting a job does not change the balance. - Actual usage is charged when it finishes: file translation (including images), batched rich text, document operations, audio, video and speech are charged in full for actual usage on completion. An API key’s budget only takes part in the check before the start and never reduces the charge for a completed job; if that pushes the key’s used budget past its limit, the key cannot start new jobs until the limit is raised. Failed or cancelled jobs are not charged.
- The balance can go negative: the part of the actual cost that exceeds the balance is recorded as debt and the balance shows as negative; credits that arrive later pay off the debt first. New jobs cannot start while the balance is negative; top up.
Clients never submit “how much should be charged”; the server computes the settled amount from what was delivered.
Operations and records
Section titled “Operations and records”GET /api/v1/billing/credits/operations?limit=20GET /api/v1/billing/credits/operations/{operation_id}GET /api/v1/billing/credits/jobs/{job_id}A record contains the operation ID, status, billing basis, and the amounts charged and refunded. Listed with an API key, operations include only those started by that key.
GET /api/v1/usage?limit=50GET /api/v1/usage/summaryThe usage endpoints return the account’s file count, characters, tokens and processing time.
Queries are free
Section titled “Queries are free”Checking the balance, job status, usage, settlement records, result lists and download addresses costs no credits.