Skip to main content
POST
/
cost
Estimate the cost of a request
curl --request POST \
  --url https://api.budgetpixel.com/v1/cost \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "length_seconds": 5,
  "model": "seedance-2.0",
  "resolution": "1080p"
}
'
import requests

url = "https://api.budgetpixel.com/v1/cost"

payload = {
"length_seconds": 5,
"model": "seedance-2.0",
"resolution": "1080p"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({length_seconds: 5, model: 'seedance-2.0', resolution: '1080p'})
};

fetch('https://api.budgetpixel.com/v1/cost', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.budgetpixel.com/v1/cost",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'length_seconds' => 5,
'model' => 'seedance-2.0',
'resolution' => '1080p'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.budgetpixel.com/v1/cost"

payload := strings.NewReader("{\n \"length_seconds\": 5,\n \"model\": \"seedance-2.0\",\n \"resolution\": \"1080p\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.budgetpixel.com/v1/cost")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"length_seconds\": 5,\n \"model\": \"seedance-2.0\",\n \"resolution\": \"1080p\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.budgetpixel.com/v1/cost")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"length_seconds\": 5,\n \"model\": \"seedance-2.0\",\n \"resolution\": \"1080p\"\n}"

response = http.request(request)
puts response.read_body
{
  "credits": 2750,
  "exact": true,
  "model": "seedance-2.0"
}
{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}
{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}
{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}
{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}
{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}

Authorizations

Authorization
string
header
required

API key as a bearer token: Authorization: Bearer bpx_live_xxx

Body

application/json
model
string
required

The model slug (image or video), e.g. seedance-2.0.

Response

The estimated cost.

The credit cost of a request. The real charge is always ≤ credits (failures cost nothing; sequential image jobs may use fewer images).

credits
integer
required

Credits the request will cost — the maximum, for non-deterministic cases.

Example:

2750

exact
boolean
required

True when the cost is exact; false when credits is an upper bound (e.g. seedream sequential, where the model picks the image count).

model
string
required
Example:

"seedance-2.0"

type
enum<string>
required
Available options:
image,
video