Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.xhuoapi.ai/llms.txt

Use this file to discover all available pages before exploring further.

How do Credits convert to USD?

  • The console shows prices in USD for reference
  • Actual deductions are in Credits
  • Each package has its own Credits ↔ USD ratio set at purchase time
General formula: USD=Credits×package.pricepackage.amount\text{USD} = \text{Credits} \times \frac{\text{package.price}}{\text{package.amount}} Mainstream packages currently convert at roughly $0.095215 / Credit.

When is billing applied?

Call typeWhen billed
Synchronous API (Chat, Embedding, …)At response time, by token / character / count
Async task (image / video / audio)When the task reaches success
Task final state failedGenerally not billed (per service detail page)
Gateway 5xx / upstream timeoutNot billed
4xx auth / param errorsNot billed
Content moderation rejection (forbidden / 403)Not billed

Instance balance vs general balance — which is used first?

  • Instance balance (Dedicated) is tied to an application created under a specific service; usable only for that service
  • General balance is shared across all services
  • Calls draw from the instance balance first. If the instance application has “Allow Use General Balance” enabled, the call falls back to the general balance when the instance balance is exhausted.

What does the API return when balance is exhausted?

{
  "error": {
    "code": "used_up",
    "message": "Your balance is not sufficient for current request, please buy more in XHuoAPI https://api.xhuoapi.ai"
  },
  "trace_id": "..."
}
The HTTP status code is 403 (not 402). Top up in the console before retrying.

Are failed requests billed?

Not billed:
  • Gateway 4xx (bad_request, invalid_token, used_up, …)
  • Upstream 5xx
  • Gateway / upstream timeouts
  • Content moderation rejections (forbidden)
  • Async tasks ending in failed
Billed:
  • Tasks finishing as success
  • Successful synchronous responses

How do refunds work?

Pay-as-you-go packages generally do not support refunding consumed credit. Specific terms follow the package you purchased and any console announcements. For exceptional situations (e.g. extended service unavailability), email [email protected] with:
  • Credential ID (do not send the full Token)
  • Affected time window
  • trace_ids of the affected requests

How do I view usage?

The console Usage page lets you slice by service, time window, and credential. Each row carries a trace_id for pinpointing specific calls.

Can I share a Token across teammates / environments?

Not recommended. Reasons:
  • You can’t tell which consumer caused an issue
  • A leak forces you to revoke the entire Token
  • Usage is aggregated by Token — no per-consumer accounting
Issue a separate credential per consumer / environment.

Pricing overview

The pay-as-you-go model

Response format

All error codes and statuses