Dry-run cost estimate for a workflow definition (no execution)
curl --request POST \
--url https://api.infery.ai/v1/workflows/estimate \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": {},
"pipeline_id": "<string>",
"pipeline_version": 123,
"input": {}
}
'import requests
url = "https://api.infery.ai/v1/workflows/estimate"
payload = {
"definition": {},
"pipeline_id": "<string>",
"pipeline_version": 123,
"input": {}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({definition: {}, pipeline_id: '<string>', pipeline_version: 123, input: {}})
};
fetch('https://api.infery.ai/v1/workflows/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.infery.ai/v1/workflows/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([
'definition' => [
],
'pipeline_id' => '<string>',
'pipeline_version' => 123,
'input' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.infery.ai/v1/workflows/estimate"
payload := strings.NewReader("{\n \"definition\": {},\n \"pipeline_id\": \"<string>\",\n \"pipeline_version\": 123,\n \"input\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.infery.ai/v1/workflows/estimate")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"definition\": {},\n \"pipeline_id\": \"<string>\",\n \"pipeline_version\": 123,\n \"input\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.infery.ai/v1/workflows/estimate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"definition\": {},\n \"pipeline_id\": \"<string>\",\n \"pipeline_version\": 123,\n \"input\": {}\n}"
response = http.request(request)
puts response.read_body{
"min_credits": 2.14,
"max_credits": 9.63,
"currency": "credits",
"breakdown": [
{
"step_id": "summarise",
"type": "model",
"min_credits": 0.42,
"max_credits": 1.87,
"note": "params_unknown",
"model": "gpt-4o",
"input_tokens": 1240,
"max_output_tokens": 1024,
"capability_id": "image.resize",
"branches": "<array>",
"child_pipeline_id": "b0e9f2a4-2b1a-4c7d-9a3e-1f5c8d2e4b60",
"child_pipeline_version": 2,
"child_breakdown": "<array>",
"max_iterations": 100,
"items_known": false,
"items_count": 4,
"body_steps": "<array>",
"inner_step": "<unknown>"
}
]
}{
"error": {
"message": "Model not found",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model",
"job_id": "job_1hR9xTPZqK4mVLc2nJ7fY5wB"
}
}{
"error": {
"message": "Model not found",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model",
"job_id": "job_1hR9xTPZqK4mVLc2nJ7fY5wB"
}
}{
"error": {
"message": "Model not found",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model",
"job_id": "job_1hR9xTPZqK4mVLc2nJ7fY5wB"
}
}{
"error": {
"message": "Model not found",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model",
"job_id": "job_1hR9xTPZqK4mVLc2nJ7fY5wB"
}
}Workflows
Estimate a run
POST /v1/workflows/estimate
POST
/
v1
/
workflows
/
estimate
Dry-run cost estimate for a workflow definition (no execution)
curl --request POST \
--url https://api.infery.ai/v1/workflows/estimate \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"definition": {},
"pipeline_id": "<string>",
"pipeline_version": 123,
"input": {}
}
'import requests
url = "https://api.infery.ai/v1/workflows/estimate"
payload = {
"definition": {},
"pipeline_id": "<string>",
"pipeline_version": 123,
"input": {}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({definition: {}, pipeline_id: '<string>', pipeline_version: 123, input: {}})
};
fetch('https://api.infery.ai/v1/workflows/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.infery.ai/v1/workflows/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([
'definition' => [
],
'pipeline_id' => '<string>',
'pipeline_version' => 123,
'input' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.infery.ai/v1/workflows/estimate"
payload := strings.NewReader("{\n \"definition\": {},\n \"pipeline_id\": \"<string>\",\n \"pipeline_version\": 123,\n \"input\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.infery.ai/v1/workflows/estimate")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"definition\": {},\n \"pipeline_id\": \"<string>\",\n \"pipeline_version\": 123,\n \"input\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.infery.ai/v1/workflows/estimate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"definition\": {},\n \"pipeline_id\": \"<string>\",\n \"pipeline_version\": 123,\n \"input\": {}\n}"
response = http.request(request)
puts response.read_body{
"min_credits": 2.14,
"max_credits": 9.63,
"currency": "credits",
"breakdown": [
{
"step_id": "summarise",
"type": "model",
"min_credits": 0.42,
"max_credits": 1.87,
"note": "params_unknown",
"model": "gpt-4o",
"input_tokens": 1240,
"max_output_tokens": 1024,
"capability_id": "image.resize",
"branches": "<array>",
"child_pipeline_id": "b0e9f2a4-2b1a-4c7d-9a3e-1f5c8d2e4b60",
"child_pipeline_version": 2,
"child_breakdown": "<array>",
"max_iterations": 100,
"items_known": false,
"items_count": 4,
"body_steps": "<array>",
"inner_step": "<unknown>"
}
]
}{
"error": {
"message": "Model not found",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model",
"job_id": "job_1hR9xTPZqK4mVLc2nJ7fY5wB"
}
}{
"error": {
"message": "Model not found",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model",
"job_id": "job_1hR9xTPZqK4mVLc2nJ7fY5wB"
}
}{
"error": {
"message": "Model not found",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model",
"job_id": "job_1hR9xTPZqK4mVLc2nJ7fY5wB"
}
}{
"error": {
"message": "Model not found",
"type": "invalid_request_error",
"code": "model_not_found",
"param": "model",
"job_id": "job_1hR9xTPZqK4mVLc2nJ7fY5wB"
}
}A dry run for cost. Nothing executes and nothing is charged.
An estimate is not a reservation. Prices and routing can change between the estimate and the run, and the estimate cannot know how many tokens a model will actually emit. Treat it as an order of magnitude.
Authorizations
API key in format: Bearer inf_***
Body
application/json
Response
The quote, with a per-step breakdown.
Sum of the steps' min_credits. The low end of the quote, not a floor on what a run will cost.
Example:
2.14
Sum of the steps' max_credits. NOT a cap on billing: a run settles per step against actual usage, and any step whose row carries a "could not be priced" note contributed 0 to this total.
Example:
9.63
Always credits (1 credit = $0.01). Never dollars.
Available options:
credits Example:
"credits"
Per-step rows, in definition order. Container steps carry their own nested breakdowns, so the array is a tree rather than a flat list.
Show child attributes
Show child attributes