Estimate Image Generation Cost
curl --request POST \
--url https://api.example.com/image/generate/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"output": {
"format": "webp",
"quality": 80
},
"model": "black-forest-labs/flux.2-pro",
"count": 1,
"destination": "<string>",
"inputs": [
"<string>"
],
"magic_prompt": "<unknown>",
"metadata": {},
"negative_prompt": "<string>",
"rating": {
"mode": "custom",
"levels": [
{
"value": "<13",
"description": "Safe for Children"
},
{
"value": "<18",
"description": "Safe for Teens"
},
{
"value": "18+",
"description": "Adults Only"
}
]
},
"size": {
"type": "<unknown>",
"scale": "base"
},
"webhook": {
"custom": [
{
"url": "<string>"
}
],
"dashboard": "<unknown>"
}
}
'import requests
url = "https://api.example.com/image/generate/estimate"
payload = {
"prompt": "<string>",
"output": {
"format": "webp",
"quality": 80
},
"model": "black-forest-labs/flux.2-pro",
"count": 1,
"destination": "<string>",
"inputs": ["<string>"],
"magic_prompt": "<unknown>",
"metadata": {},
"negative_prompt": "<string>",
"rating": {
"mode": "custom",
"levels": [
{
"value": "<13",
"description": "Safe for Children"
},
{
"value": "<18",
"description": "Safe for Teens"
},
{
"value": "18+",
"description": "Adults Only"
}
]
},
"size": {
"type": "<unknown>",
"scale": "base"
},
"webhook": {
"custom": [{ "url": "<string>" }],
"dashboard": "<unknown>"
}
}
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({
prompt: '<string>',
output: {format: 'webp', quality: 80},
model: 'black-forest-labs/flux.2-pro',
count: 1,
destination: '<string>',
inputs: ['<string>'],
magic_prompt: '<unknown>',
metadata: {},
negative_prompt: '<string>',
rating: {
mode: 'custom',
levels: [
{value: '<13', description: 'Safe for Children'},
{value: '<18', description: 'Safe for Teens'},
{value: '18+', description: 'Adults Only'}
]
},
size: {type: '<unknown>', scale: 'base'},
webhook: {custom: [{url: '<string>'}], dashboard: '<unknown>'}
})
};
fetch('https://api.example.com/image/generate/estimate', 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.example.com/image/generate/estimate",
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([
'prompt' => '<string>',
'output' => [
'format' => 'webp',
'quality' => 80
],
'model' => 'black-forest-labs/flux.2-pro',
'count' => 1,
'destination' => '<string>',
'inputs' => [
'<string>'
],
'magic_prompt' => '<unknown>',
'metadata' => [
],
'negative_prompt' => '<string>',
'rating' => [
'mode' => 'custom',
'levels' => [
[
'value' => '<13',
'description' => 'Safe for Children'
],
[
'value' => '<18',
'description' => 'Safe for Teens'
],
[
'value' => '18+',
'description' => 'Adults Only'
]
]
],
'size' => [
'type' => '<unknown>',
'scale' => 'base'
],
'webhook' => [
'custom' => [
[
'url' => '<string>'
]
],
'dashboard' => '<unknown>'
]
]),
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.example.com/image/generate/estimate"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"output\": {\n \"format\": \"webp\",\n \"quality\": 80\n },\n \"model\": \"black-forest-labs/flux.2-pro\",\n \"count\": 1,\n \"destination\": \"<string>\",\n \"inputs\": [\n \"<string>\"\n ],\n \"magic_prompt\": \"<unknown>\",\n \"metadata\": {},\n \"negative_prompt\": \"<string>\",\n \"rating\": {\n \"mode\": \"custom\",\n \"levels\": [\n {\n \"value\": \"<13\",\n \"description\": \"Safe for Children\"\n },\n {\n \"value\": \"<18\",\n \"description\": \"Safe for Teens\"\n },\n {\n \"value\": \"18+\",\n \"description\": \"Adults Only\"\n }\n ]\n },\n \"size\": {\n \"type\": \"<unknown>\",\n \"scale\": \"base\"\n },\n \"webhook\": {\n \"custom\": [\n {\n \"url\": \"<string>\"\n }\n ],\n \"dashboard\": \"<unknown>\"\n }\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.example.com/image/generate/estimate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"output\": {\n \"format\": \"webp\",\n \"quality\": 80\n },\n \"model\": \"black-forest-labs/flux.2-pro\",\n \"count\": 1,\n \"destination\": \"<string>\",\n \"inputs\": [\n \"<string>\"\n ],\n \"magic_prompt\": \"<unknown>\",\n \"metadata\": {},\n \"negative_prompt\": \"<string>\",\n \"rating\": {\n \"mode\": \"custom\",\n \"levels\": [\n {\n \"value\": \"<13\",\n \"description\": \"Safe for Children\"\n },\n {\n \"value\": \"<18\",\n \"description\": \"Safe for Teens\"\n },\n {\n \"value\": \"18+\",\n \"description\": \"Adults Only\"\n }\n ]\n },\n \"size\": {\n \"type\": \"<unknown>\",\n \"scale\": \"base\"\n },\n \"webhook\": {\n \"custom\": [\n {\n \"url\": \"<string>\"\n }\n ],\n \"dashboard\": \"<unknown>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/image/generate/estimate")
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 \"prompt\": \"<string>\",\n \"output\": {\n \"format\": \"webp\",\n \"quality\": 80\n },\n \"model\": \"black-forest-labs/flux.2-pro\",\n \"count\": 1,\n \"destination\": \"<string>\",\n \"inputs\": [\n \"<string>\"\n ],\n \"magic_prompt\": \"<unknown>\",\n \"metadata\": {},\n \"negative_prompt\": \"<string>\",\n \"rating\": {\n \"mode\": \"custom\",\n \"levels\": [\n {\n \"value\": \"<13\",\n \"description\": \"Safe for Children\"\n },\n {\n \"value\": \"<18\",\n \"description\": \"Safe for Teens\"\n },\n {\n \"value\": \"18+\",\n \"description\": \"Adults Only\"\n }\n ]\n },\n \"size\": {\n \"type\": \"<unknown>\",\n \"scale\": \"base\"\n },\n \"webhook\": {\n \"custom\": [\n {\n \"url\": \"<string>\"\n }\n ],\n \"dashboard\": \"<unknown>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"currency": "<unknown>",
"estimateKind": "<unknown>",
"estimatedCost": "<string>"
}
}Image
Estimate Image Generation Cost
POST
/
image
/
generate
/
estimate
Estimate Image Generation Cost
curl --request POST \
--url https://api.example.com/image/generate/estimate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"output": {
"format": "webp",
"quality": 80
},
"model": "black-forest-labs/flux.2-pro",
"count": 1,
"destination": "<string>",
"inputs": [
"<string>"
],
"magic_prompt": "<unknown>",
"metadata": {},
"negative_prompt": "<string>",
"rating": {
"mode": "custom",
"levels": [
{
"value": "<13",
"description": "Safe for Children"
},
{
"value": "<18",
"description": "Safe for Teens"
},
{
"value": "18+",
"description": "Adults Only"
}
]
},
"size": {
"type": "<unknown>",
"scale": "base"
},
"webhook": {
"custom": [
{
"url": "<string>"
}
],
"dashboard": "<unknown>"
}
}
'import requests
url = "https://api.example.com/image/generate/estimate"
payload = {
"prompt": "<string>",
"output": {
"format": "webp",
"quality": 80
},
"model": "black-forest-labs/flux.2-pro",
"count": 1,
"destination": "<string>",
"inputs": ["<string>"],
"magic_prompt": "<unknown>",
"metadata": {},
"negative_prompt": "<string>",
"rating": {
"mode": "custom",
"levels": [
{
"value": "<13",
"description": "Safe for Children"
},
{
"value": "<18",
"description": "Safe for Teens"
},
{
"value": "18+",
"description": "Adults Only"
}
]
},
"size": {
"type": "<unknown>",
"scale": "base"
},
"webhook": {
"custom": [{ "url": "<string>" }],
"dashboard": "<unknown>"
}
}
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({
prompt: '<string>',
output: {format: 'webp', quality: 80},
model: 'black-forest-labs/flux.2-pro',
count: 1,
destination: '<string>',
inputs: ['<string>'],
magic_prompt: '<unknown>',
metadata: {},
negative_prompt: '<string>',
rating: {
mode: 'custom',
levels: [
{value: '<13', description: 'Safe for Children'},
{value: '<18', description: 'Safe for Teens'},
{value: '18+', description: 'Adults Only'}
]
},
size: {type: '<unknown>', scale: 'base'},
webhook: {custom: [{url: '<string>'}], dashboard: '<unknown>'}
})
};
fetch('https://api.example.com/image/generate/estimate', 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.example.com/image/generate/estimate",
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([
'prompt' => '<string>',
'output' => [
'format' => 'webp',
'quality' => 80
],
'model' => 'black-forest-labs/flux.2-pro',
'count' => 1,
'destination' => '<string>',
'inputs' => [
'<string>'
],
'magic_prompt' => '<unknown>',
'metadata' => [
],
'negative_prompt' => '<string>',
'rating' => [
'mode' => 'custom',
'levels' => [
[
'value' => '<13',
'description' => 'Safe for Children'
],
[
'value' => '<18',
'description' => 'Safe for Teens'
],
[
'value' => '18+',
'description' => 'Adults Only'
]
]
],
'size' => [
'type' => '<unknown>',
'scale' => 'base'
],
'webhook' => [
'custom' => [
[
'url' => '<string>'
]
],
'dashboard' => '<unknown>'
]
]),
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.example.com/image/generate/estimate"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"output\": {\n \"format\": \"webp\",\n \"quality\": 80\n },\n \"model\": \"black-forest-labs/flux.2-pro\",\n \"count\": 1,\n \"destination\": \"<string>\",\n \"inputs\": [\n \"<string>\"\n ],\n \"magic_prompt\": \"<unknown>\",\n \"metadata\": {},\n \"negative_prompt\": \"<string>\",\n \"rating\": {\n \"mode\": \"custom\",\n \"levels\": [\n {\n \"value\": \"<13\",\n \"description\": \"Safe for Children\"\n },\n {\n \"value\": \"<18\",\n \"description\": \"Safe for Teens\"\n },\n {\n \"value\": \"18+\",\n \"description\": \"Adults Only\"\n }\n ]\n },\n \"size\": {\n \"type\": \"<unknown>\",\n \"scale\": \"base\"\n },\n \"webhook\": {\n \"custom\": [\n {\n \"url\": \"<string>\"\n }\n ],\n \"dashboard\": \"<unknown>\"\n }\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.example.com/image/generate/estimate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"output\": {\n \"format\": \"webp\",\n \"quality\": 80\n },\n \"model\": \"black-forest-labs/flux.2-pro\",\n \"count\": 1,\n \"destination\": \"<string>\",\n \"inputs\": [\n \"<string>\"\n ],\n \"magic_prompt\": \"<unknown>\",\n \"metadata\": {},\n \"negative_prompt\": \"<string>\",\n \"rating\": {\n \"mode\": \"custom\",\n \"levels\": [\n {\n \"value\": \"<13\",\n \"description\": \"Safe for Children\"\n },\n {\n \"value\": \"<18\",\n \"description\": \"Safe for Teens\"\n },\n {\n \"value\": \"18+\",\n \"description\": \"Adults Only\"\n }\n ]\n },\n \"size\": {\n \"type\": \"<unknown>\",\n \"scale\": \"base\"\n },\n \"webhook\": {\n \"custom\": [\n {\n \"url\": \"<string>\"\n }\n ],\n \"dashboard\": \"<unknown>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/image/generate/estimate")
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 \"prompt\": \"<string>\",\n \"output\": {\n \"format\": \"webp\",\n \"quality\": 80\n },\n \"model\": \"black-forest-labs/flux.2-pro\",\n \"count\": 1,\n \"destination\": \"<string>\",\n \"inputs\": [\n \"<string>\"\n ],\n \"magic_prompt\": \"<unknown>\",\n \"metadata\": {},\n \"negative_prompt\": \"<string>\",\n \"rating\": {\n \"mode\": \"custom\",\n \"levels\": [\n {\n \"value\": \"<13\",\n \"description\": \"Safe for Children\"\n },\n {\n \"value\": \"<18\",\n \"description\": \"Safe for Teens\"\n },\n {\n \"value\": \"18+\",\n \"description\": \"Adults Only\"\n }\n ]\n },\n \"size\": {\n \"type\": \"<unknown>\",\n \"scale\": \"base\"\n },\n \"webhook\": {\n \"custom\": [\n {\n \"url\": \"<string>\"\n }\n ],\n \"dashboard\": \"<unknown>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"currency": "<unknown>",
"estimateKind": "<unknown>",
"estimatedCost": "<string>"
}
}Authorizations
apiKeyAuthoauthAuth
Mynth API key sent as Authorization: Bearer <api-key>.
Body
application/json
Positive prompt.
Maximum string length:
8192Example:
"Cute Cat"
Show child attributes
Show child attributes
model
Option 1 · anyOption 2 · anyAuto model selection · anyOption 4 · anyOption 5 · anyOption 6 · anyOption 7 · anyOption 8 · anyOption 9 · anyOption 10 · anyOption 11 · anyOption 12 · anyOption 13 · anyOption 14 · anyOption 15 · anyOption 16 · anyOption 17 · anyOption 18 · anyOption 19 · anyOption 20 · anyOption 21 · anyOption 22 · anyOption 23 · anyOption 24 · anyOption 25 · anyOption 26 · anyOption 27 · anyOption 28 · anyOption 29 · anyOption 30 · anyOption 31 · anyOption 32 · anyOption 33 · anyOption 34 · anyOption 35 · anyOption 36 · anyOption 37 · anyOption 38 · anyOption 39 · any
default:auto
Example:
"black-forest-labs/flux.2-pro"
Required range:
1 <= x <= 20Controls whether the create-task response should include a short-lived Public Access Token.
That token can be passed to browser or client-side code for polling task status and task images without exposing your API key.
Show child attributes
Show child attributes
Required string length:
1 - 64Example:
"bunny-prod"
Maximum array length:
20Required string length:
1 - 2048Maximum string length:
8192Content rating
Show child attributes
Show child attributes
Example:
{
"mode": "custom",
"levels": [
{
"value": "<13",
"description": "Safe for Children"
},
{
"value": "<18",
"description": "Safe for Teens"
},
{
"value": "18+",
"description": "Adults Only"
}
]
}
size
Option 1 · objectOption 2 · objectOption 3 · anyOption 4 · anyOption 5 · anyOption 6 · anyOption 7 · anyOption 8 · anyOption 9 · anyOption 10 · anyOption 11 · anyOption 12 · anyOption 13 · anyOption 14 · anyOption 15 · anyOption 16 · anyOption 17 · anyOption 18 · anyOption 19 · anyOption 20 · anyOption 21 · anyOption 22 · anyOption 23 · anyOption 24 · anyOption 25 · anyOption 26 · anyOption 27 · anyOption 28 · anyOption 29 · anyOption 30 · anyOption 31 · anyOption 32 · any
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
200 - application/json
Image generation request validated and cost estimated
Show child attributes
Show child attributes
⌘I