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",
"type": "image"
}{
"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"
}
}Models
Estimate the cost of a request
Returns the credit cost of a generation request without running it. Send the same
body you’d send to the generate endpoint, plus model.
The cost is computed by the same logic that bills you, so it can’t disagree with the
invoice. exact is true for deterministic pricing. For seedream’s sequential mode
(the model chooses how many images, up to max_images) credits is the ceiling we
reserve and exact is false — the real charge is always ≤ it. Failed jobs cost
nothing, so you’re never charged more than credits.
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",
"type": "image"
}{
"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
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).