Predict Cost
predict_costEstimate token cost and latency for executing code by analyzing historical samples of similar call patterns.
Instructions
Predict the token cost and latency of executing code based on historical samples for similar call patterns.
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": {
"code": "<code>"
},
"name": "predict_cost"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The code whose cost you want to estimate. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| estimatedInputTokens | Yes | ||
| estimatedOutputTokens | Yes | ||
| estimatedLatencyMs | Yes | ||
| basedOn | Yes | ||
| available | Yes |