Pricing API
Get a model’s base price and effective discount, or estimate the price of a specific inference request from its input parameters.
API Information
| Item | Description |
|---|---|
| API Path | /api/v3/model/price |
| HTTP Method | POST |
| Content-Type | application/json |
| Authentication | Bearer Token via Authorization header |
Request
curl --fail-with-body --connect-timeout 10 --max-time 60 \
-X POST "https://api.wavespeed.ai/api/v3/model/price" \
-H "Authorization: Bearer $WAVESPEED_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model_id": "pixverse/pixverse-v5.5/image-to-video",
"inputs": {
"aspect_ratio": "16:9",
"duration": 5,
"image": "https://example.com/image.jpg",
"prompt": "A stylish model, fashion show",
"sound": true
}
}'
Parameters
Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Access Key in format: Bearer {access_key} |
| Content-Type | string | Yes | application/json |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model_id | string | Yes | The model ID to get pricing for |
| inputs | object | No | Omit this field to return the configured base price and effective discount. Send an object, including {}, to evaluate the model’s dynamic pricing formula. |
inputs Semantics
The presence of inputs changes what price means:
- When
inputsis omitted,priceis the model’s configured base price. The response still includes the effective discount for the authenticated account. - When
inputsis an object, including an empty object,priceis calculated using that object and the model’s schema defaults. Models without a pricing formula return their base price. If calculation fails, the API returns an error instead of falling back to the base price. An empty object does not request base-price mode.
To query only the base price and effective discount:
{
"model_id": "pixverse/pixverse-v5.5/image-to-video"
}Response
| Field | Type | Description | Example |
|---|---|---|---|
| code | integer | Application response code: 200 on success; errors may use a business code distinct from the HTTP status | 200 |
| message | string | Status message | "success" |
| data.model_id | string | Model identifier | "pixverse/pixverse-v5.5/image-to-video" |
| data.price | number | Original price in USD before the effective discount | 0.45 |
| data.discounted_price | number | Amount payable in USD after the effective discount | 0.0 |
| data.discount_rate | number | Payable percentage. 100 means no discount; 0 means free | 0 |
| data.currency | string | Currency code | "USD" |
Response Example
{
"code": 200,
"message": "success",
"data": {
"model_id": "pixverse/pixverse-v5.5/image-to-video",
"price": 0.45,
"discounted_price": 0.0,
"discount_rate": 0,
"currency": "USD"
}
}Pricing Errors
A failed calculation returns HTTP 400 with an application error code:
| Code | Meaning | Action |
|---|---|---|
4005 | The model price could not be calculated | Check the model’s required pricing inputs. If valid inputs still fail, contact support. |
4006 | The duration of provided media could not be measured | Check that the media is accessible and readable. |
4007 | The dimensions of a provided image could not be read | Check that the JPEG or PNG image is accessible and valid. |
{
"code": 4005,
"message": "Failed to retrieve model pricing."
}Check both the HTTP status and the response code. A failed request does not
provide a usable price. For a UI preview, you may make a separate request without
inputs to display the base price, but that value is not a quote for the failed
input-specific calculation.
Submitting an inference request calculates its price again. If pricing fails, the server rejects the submission before creating the task or charging it.
Notes
- Pricing can depend on input parameters such as duration, aspect ratio, and sound.
priceis the original price;discounted_priceis the amount payable by the authenticated account.- Price queries may reuse successful media-duration and image-size measurements for up to two minutes. The pricing formula is evaluated for each query.
- An inference submission measures media duration and image size again when required by the pricing formula, and recalculates its price; it does not reuse the preview metadata cache. The server enforces the final charge.