Estimate a ChinaAPI cost
chinaapi_estimate_costEstimate the USD cost of a workload on one model from its published per-meter prices: Standard, and Paid where it is lower. Pass quantities in the model's own units — tokens for text models, characters for speech synthesis, audio seconds for transcription, requests, images or video seconds for per-call and per-second models; a quantity the model does not price is refused. Tiered models are estimated tier by tier. The result is an estimate, not a quote.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Exact, case-sensitive model ID as returned by chinaapi_list_models. | |
| images | No | Quantity in images for the image_n meter. | |
| requests | No | Quantity in requests for the per_call meter. | |
| characters | No | Quantity in characters for the input meter (models billed in characters). | |
| input_tokens | No | Quantity in tokens for the input meter (models billed in tokens). | |
| audio_seconds | No | Quantity in audio seconds for the input meter (models billed in audio_duration). | |
| output_tokens | No | Quantity in tokens for the output meter (models billed in tokens). | |
| video_seconds | No | Quantity in seconds for the video_second meter. | |
| context_tokens | No | Input context length used to choose a context-length tier. Only for models whose tiers depend on context length; defaults to the input and cache tokens. | |
| cache_read_tokens | No | Quantity in tokens for the cache_read meter (models billed in tokens). | |
| audio_input_tokens | No | Quantity in tokens for the audio_input meter (models billed in tokens). | |
| cache_write_tokens | No | Quantity in tokens for the cache_write meter (models billed in tokens). | |
| image_input_tokens | No | Quantity in tokens for the image_input meter (models billed in tokens). | |
| audio_output_tokens | No | Quantity in tokens for the audio_output meter (models billed in tokens). | |
| image_output_tokens | No | Quantity in tokens for the image_output meter (models billed in tokens). | |
| cache_write_1h_tokens | No | Quantity in tokens for the cache_write_1h meter (models billed in tokens). |