chinaapi_estimate_cost
Estimate 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.
Показать схему аргументов
{
"type": "object",
"required": [
"model"
],
"properties": {
"model": {
"type": "string",
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$",
"maxLength": 128,
"minLength": 1,
"description": "Exact, case-sensitive model ID as returned by chinaapi_list_models."
},
"images": {
"type": "integer",
"maximum": 100000000,
"minimum": 0,
"description": "Quantity in images for the image_n meter."
},
"requests": {
"type": "integer",
"maximum": 100000000,
"minimum": 0,
"description": "Quantity in requests for the per_call meter."
},
"characters": {
"type": "integer",
"maximum": 10000000000,
"minimum": 0,
"description": "Quantity in characters for the input meter (models billed in characters)."
},
"input_tokens": {
"type": "integer",
"maximum": 1000000000000,
"minimum": 0,
"description": "Quantity in tokens for the input meter (models billed in tokens)."
},
"audio_seconds": {
"type": "integer",
"maximum": 100000000,
"minimum": 0,
"description": "Quantity in audio seconds for the input meter (models billed in audio_duration)."
},
"output_tokens": {
"type": "integer",
"maximum": 1000000000000,
"minimum": 0,
"description": "Quantity in tokens for the output meter (models billed in tokens)."
},
"video_seconds": {
"type": "integer",
"maximum": 100000000,
"minimum": 0,
"description": "Quantity in seconds for the video_second meter."
},
"context_tokens": {
"type": "integer",
"maximum": 1000000000000,
"minimum": 0,
"description": "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": {
"type": "integer",
"maximum": 1000000000000,
"minimum": 0,
"description": "Quantity in tokens for the cache_read meter (models billed in tokens)."
},
"audio_input_tokens": {
"type": "integer",
"maximum": 1000000000000,
"minimum": 0,
"description": "Quantity in tokens for the audio_input meter (models billed in tokens)."
},
"cache_write_tokens": {
"type": "integer",
"maximum": 1000000000000,
"minimum": 0,
"description": "Quantity in tokens for the cache_write meter (models billed in tokens)."
},
"image_input_tokens": {
"type": "integer",
"maximum": 1000000000000,
"minimum": 0,
"description": "Quantity in tokens for the image_input meter (models billed in tokens)."
},
"audio_output_tokens": {
"type": "integer",
"maximum": 1000000000000,
"minimum": 0,
"description": "Quantity in tokens for the audio_output meter (models billed in tokens)."
},
"image_output_tokens": {
"type": "integer",
"maximum": 1000000000000,
"minimum": 0,
"description": "Quantity in tokens for the image_output meter (models billed in tokens)."
},
"cache_write_1h_tokens": {
"type": "integer",
"maximum": 1000000000000,
"minimum": 0,
"description": "Quantity in tokens for the cache_write_1h meter (models billed in tokens)."
}
},
"additionalProperties": false
}