Skip to main content
Glama

Estimate a ChinaAPI cost

chinaapi_estimate_cost
Read-onlyIdempotent

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesExact, case-sensitive model ID as returned by chinaapi_list_models.
imagesNoQuantity in images for the image_n meter.
requestsNoQuantity in requests for the per_call meter.
charactersNoQuantity in characters for the input meter (models billed in characters).
input_tokensNoQuantity in tokens for the input meter (models billed in tokens).
audio_secondsNoQuantity in audio seconds for the input meter (models billed in audio_duration).
output_tokensNoQuantity in tokens for the output meter (models billed in tokens).
video_secondsNoQuantity in seconds for the video_second meter.
context_tokensNoInput 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_tokensNoQuantity in tokens for the cache_read meter (models billed in tokens).
audio_input_tokensNoQuantity in tokens for the audio_input meter (models billed in tokens).
cache_write_tokensNoQuantity in tokens for the cache_write meter (models billed in tokens).
image_input_tokensNoQuantity in tokens for the image_input meter (models billed in tokens).
audio_output_tokensNoQuantity in tokens for the audio_output meter (models billed in tokens).
image_output_tokensNoQuantity in tokens for the image_output meter (models billed in tokens).
cache_write_1h_tokensNoQuantity in tokens for the cache_write_1h meter (models billed in tokens).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only cover the safety profile (readOnly, idempotent, closed-world), so the description carries the interesting burden and does: it discloses the tier selection rule (Standard, plus Paid where lower), tier-by-tier estimation for tiered models, the refusal behaviour for quantities a model does not price, and the estimate-vs-quote caveat. That is real behavioural context an agent could not derive from the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and basis are front-loaded, and every clause carries information (units, refusal, tiering, disclaimer) with no filler. The one weak spot is the compressed clause 'Standard, and Paid where it is lower', whose meaning is not fully unpacked.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 16-parameter, no-output-schema computation tool the description covers the hard parts: units, tiering, refusal and the estimate caveat. It never describes the shape of the returned estimate (a single figure versus a per-meter breakdown), which is the remaining gap given there is no output schema to fall back on.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the per-parameter descriptions already define each meter, and the baseline would be 3. The description adds a genuine layer on top by mapping meters to model categories ('tokens for text models, characters for speech synthesis, audio seconds for transcription, requests, images or video seconds'), which tells the agent which parameters belong together for a given model.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ('Estimate the USD cost of a workload on one model') and frames the basis of the estimate ('from its published per-meter prices'), which cleanly separates it from the sibling read tools chinaapi_get_model, chinaapi_list_models and chinaapi_get_recipe.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives concrete invocation context: quantities must be passed in the model's own units, with the unit mapping spelled out per modality, and unpriceable quantities are refused. It stops short of naming the sibling alternatives (e.g. list_models to obtain the model ID) or stating explicit when-not conditions, so it is clear context rather than full routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources