estimate_inference_cost
Estimate the USDC cost of an inference call before making it, using model and billing units (tokens, characters, or audio seconds), to inform gating decisions.
Instructions
Estimate the USDC cost of a Floe Inference call for a given model and usage vector, WITHOUT making the call or touching balance. Returns the cheapest priceable source: { rail, provider, margin_bps, upstream_cost_usdc, cost_usdc, cost_raw }. Provide only the units the model bills: text models use input_tokens/output_tokens (+cached_input_tokens); TTS uses characters; STT uses audio_seconds; realtime voice uses audio_input_tokens/audio_output_tokens. Use BEFORE inference to decide gating. Requires any Floe API key (agent floe_... or developer floe_live_...).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Model id from list_models, e.g. "openai/gpt-4o" or "elevenlabs/eleven-turbo-v2.5". | |
| characters | No | Characters of input text (TTS models). | |
| input_tokens | No | Prompt tokens (text models). | |
| audio_seconds | No | Seconds of audio, fractional allowed (STT models). | |
| output_tokens | No | Completion tokens (text models). | |
| audio_input_tokens | No | Input audio tokens (realtime voice). | |
| audio_output_tokens | No | Output audio tokens (realtime voice). | |
| cached_input_tokens | No | Cached prompt tokens billed at the cached rate (text models). |