Pricing & Billing
How Yunxin's credit-based billing works — the credit unit, per-model token pricing, tiers, and cost control.
Credits
Yunxin bills with a single, provider-agnostic unit: credits.
1 credit = $0.001 USD. Balances and costs are tracked as precise decimal credits and drawn down per request.
You fund an account with credits in the Dashboard, and each request deducts credits based on the model used and the tokens consumed. Because everything is denominated in credits, one balance covers every provider and modality.
Per-model token pricing
Each model carries its own prices, stored in credits per 1,000,000 tokens. The full price object is
returned by the Models API under each model's pricing field:
| Field | Applies to |
|---|---|
input | Prompt (input) tokens. |
output | Generated (output) tokens. |
request | Optional flat per-request charge, where a model defines one. |
thinking | Reasoning/thinking tokens, where billed separately. |
cache_read | Input tokens served from a prompt cache (cheaper than input). |
cache_write | Tokens written into a prompt cache. |
# Inspect a model's pricing object
curl https://api.yuhuanstudio.com/v1/models/model-id \
-H "Authorization: Bearer $YUNXIN_API_KEY"Prices are model- and provider-specific and change over time, so Yunxin doesn't publish a static price
table here. Always read live prices from GET /v1/models or the Models page in
the Dashboard.
How a request's cost is computed
For a text request, the cost in credits is approximately:
cost ≈ (input_tokens − cached_tokens) · input
+ cached_tokens · cache_read
+ output_tokens · output
+ reasoning_tokens · output(scaled by the per-1,000,000-token rates above). Other modalities — image, audio, video, music, 3D —
are priced per generated unit; consult the model's pricing and the Dashboard.
Every request's token counts, computed cost, latency, routing, and fallback are recorded in your usage history. See Usage Monitoring Tools to read them back.
Discounts
- Batch API runs at roughly a 50% discount — see Batch API.
- When a request is rerouted, a fallback discount may apply; the amount is reported in the
X-Fallback-Discountresponse header. See Fallback & Routing.
Insufficient balance
If your balance can't cover a request, the API returns 402 with code insufficient_balance:
{
"error": {
"code": "insufficient_balance",
"message": "Your credit balance is too low to complete this request."
},
"timestamp": 1709251200
}Top up in the Dashboard to resume. Monitor your balance proactively via the usage endpoints so you can alert before you hit this. See Error Handling.
Tiers
Your account tier sets your request rate limit, request priority, and which models you can reach.
| Tier | Requests / min | Notes |
|---|---|---|
| Free | 10 | Starter credits; entry-level models. |
| Basic | 50 | Standard models across providers. |
| Fellow | 100 | Curated program — apply from the Fellows page. |
| Pro | 100 | Premium models and higher priority. |
| Enterprise | Custom | Negotiated (unlimited where configured). |
See Rate Limits for how these limits are enforced and the headers that report them.
Request priority
Your tier also determines a request priority level, surfaced in the X-Request-Priority response
header: 1 (low), 2 (normal), 3 (high), 4 (critical). Higher-tier traffic is favored under load.
Model access
Some models require a minimum tier. If your account tier is below a model's requirement, the API
returns 403 with code model_tier_restricted. Upgrade your tier in the Dashboard to gain access, and
check GET /v1/models to see which models your account can use.
Cost optimization
- Right-size the model — use a smaller, cheaper model for simple tasks; reserve capable models for hard reasoning. Compare prices via the Models API.
- Set
max_tokensto cap output length. - Use the Batch API for non-urgent bulk work (~50% off).
- Cache stable prompt prefixes so repeated input bills at the
cache_readrate. - Monitor usage via the Dashboard or Usage Monitoring Tools to spot optimization opportunities.
See Best Practices for the full reliability and cost playbook.
How is this guide?