Estimate cost
estimate_costCalculate the cost of image, video, speech, or music requests before running them, and compare models, check remaining budget, and see if approval is required.
Instructions
Estimate the cost of an image, video, speech or music request before running it, optionally comparing all models; also reports remaining budget and whether approval is needed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Speech: the text to be spoken (length drives cost) | |
| count | No | Number of images/clips/songs (default 1) | |
| model | No | Model ID or alias (default model when omitted) | |
| compare | No | Also estimate the same request on every other active model of this media type | |
| imageSize | No | Images: 512, 1K, 2K or 4K | |
| mediaType | Yes | image, video, speech or music | |
| resolution | No | Video: 720p, 1080p or 4k (Omni also 360p) | |
| inputImages | No | Images: number of reference/source images | |
| generateAudio | No | Video on Vertex AI: false for the cheaper silent rate | |
| durationSeconds | No | Video: clip length (default 8) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | Yes | ||
| model | Yes | ||
| estimate | Yes | ||
| warnings | No | Lifecycle notices (deprecation, shutdown, replacement) and budget problems | |
| alternatives | No | ||
| needsApproval | Yes | True when the call would exceed the confirmation threshold and needs approvedCostUsd | |
| budgetRemaining | No | ||
| wouldExceedBudget | No | True when a budget would refuse this call right now (see warnings) |