---
title: "Estimate cost"
method: POST
path: "/models/pricing/estimate"
tags: ["Models", "Pricing"]
---

# Estimate cost

`POST /models/pricing/estimate`

Computes cost estimates using one of two methods:

**1. Historical API Price** (`historical_api_price`):
- Based on historical pricing per API call from past usage patterns
- Takes `call_quantity` (number of API calls) per endpoint
- Useful for estimating based on actual historical usage patterns
- Example: "How much will 100 calls to flux/dev cost?"

**2. Unit Price** (`unit_price`):
- Based on unit price × expected billing units from pricing service
- Takes `unit_quantity` (number of billing units like images/videos) per endpoint
- Useful when you know the expected output quantity
- Example: "How much will 50 images from flux/dev cost?"

**Authentication:** Required. Users must provide a valid API key.
Custom pricing or discounts may be applied based on account status.

**Common Use Cases:**
- Pre-calculate costs for batch operations
- Display cost estimates in user interfaces
- Budget planning and cost optimization

See [fal.ai pricing](https://fal.ai/pricing) for more details.

## Request body

- union
  - object — Historical API price estimate: Calculates cost based on historical pricing per API call. Useful for estimating costs based on actual usage patterns.
    - `estimate_type` 'historical_api_price', required — Estimate type: historical API pricing based on past usage patterns
    - `endpoints` object, required — Map of endpoint IDs to call quantities
  - object — Unit price estimate: Calculates cost based on unit price × billing units. Useful for estimating costs when you know the expected output quantity.
    - `estimate_type` 'unit_price', required — Estimate type: unit price calculation based on billing units
    - `endpoints` object, required — Map of endpoint IDs to unit quantities

## Response `200`

Cost estimates calculated successfully

- object — Cost estimation response with total cost
  - `estimate_type` 'historical_api_price' | 'unit_price', required — The type of estimate that was performed
  - `total_cost` number, required — Total estimated cost across all endpoints
  - `currency` string, required — Three-letter currency code (ISO 4217, e.g., 'USD')

## Other responses

- `400` — Invalid request parameters
- `401` — Authentication required
- `404` — Resource not found
- `429` — Rate limit exceeded

---

[API](https://skmtc.dev/fal/apis/platform-apis.md) · [All operations](https://skmtc.dev/fal/apis/platform-apis/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/fal/platform-apis/revisions/0c7dabf80b00/schema)
