Estimate a Relay cost
estimate_costEstimates the USD cost of an AI model call before you run it. Pass the model and usage fields to get a per-call price estimate from the price list, not an invoice.
Instructions
Estimates the USD cost of a call from the price list (with a credential your account's view: its tier and grants; public otherwise): an estimate, not an invoice (the bill uses provider-reported usage and any custom pricing on your account). Pass only the usage fields the model's billing_type (see get_model or get_pricing) reads: per_token: input_tokens, output_tokens, cached_input_tokens; per_image: image_count, resolution_tier; per_second_video: duration_seconds, quality_mode, sound; per_second_audio: duration_seconds; per_character: character_count; per_media_token: media_input_tokens, media_output_tokens. Add store_output / retention / file_count for storage fees.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"model": "<model>",
"usage": "<usage>"
},
"name": "estimate_cost"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Exact model name, e.g. KlingTeam/v3-T2V. | |
| usage | Yes | What the call uses; only the fields of the model's billing type matter. |