Create a product job
curl --request POST \
--url https://api.beeble.ai/v1/products/{product}/jobs \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"model_id": "<string>",
"idempotency_key": "<string>",
"inputs": {},
"billing_unit": "credits",
"max_credits": 1,
"callback_url": "<string>"
}
'import requests
url = "https://api.beeble.ai/v1/products/{product}/jobs"
payload = {
"model_id": "<string>",
"idempotency_key": "<string>",
"inputs": {},
"billing_unit": "credits",
"max_credits": 1,
"callback_url": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model_id: '<string>',
idempotency_key: '<string>',
inputs: {},
billing_unit: 'credits',
max_credits: 1,
callback_url: '<string>'
})
};
fetch('https://api.beeble.ai/v1/products/{product}/jobs', 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.beeble.ai/v1/products/{product}/jobs",
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([
'model_id' => '<string>',
'idempotency_key' => '<string>',
'inputs' => [
],
'billing_unit' => 'credits',
'max_credits' => 1,
'callback_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.beeble.ai/v1/products/{product}/jobs"
payload := strings.NewReader("{\n \"model_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"inputs\": {},\n \"billing_unit\": \"credits\",\n \"max_credits\": 1,\n \"callback_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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.beeble.ai/v1/products/{product}/jobs")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"inputs\": {},\n \"billing_unit\": \"credits\",\n \"max_credits\": 1,\n \"callback_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beeble.ai/v1/products/{product}/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"inputs\": {},\n \"billing_unit\": \"credits\",\n \"max_credits\": 1,\n \"callback_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"product": "<string>",
"model_id": "<string>",
"organization_id": "<string>",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"team_id": "<string>",
"billing_unit": "credits",
"progress": 123,
"credits_charged": 123,
"refunded": true,
"outputs": {},
"error": {}
}Products
Create a product job
Organization credits by default. Reuse the same idempotency key on an uncertain response.
switchx_finish creates a higher-resolution child of a completed SwitchX 2.0 Standard product job. Supply model_id=switchx-2.0, inputs.parent_job_id (the public dap_ ID), and inputs.target_resolution (1080 or 2160). Poll the returned child through /product-jobs/.
POST
/
v1
/
products
/
{product}
/
jobs
Create a product job
curl --request POST \
--url https://api.beeble.ai/v1/products/{product}/jobs \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"model_id": "<string>",
"idempotency_key": "<string>",
"inputs": {},
"billing_unit": "credits",
"max_credits": 1,
"callback_url": "<string>"
}
'import requests
url = "https://api.beeble.ai/v1/products/{product}/jobs"
payload = {
"model_id": "<string>",
"idempotency_key": "<string>",
"inputs": {},
"billing_unit": "credits",
"max_credits": 1,
"callback_url": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model_id: '<string>',
idempotency_key: '<string>',
inputs: {},
billing_unit: 'credits',
max_credits: 1,
callback_url: '<string>'
})
};
fetch('https://api.beeble.ai/v1/products/{product}/jobs', 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.beeble.ai/v1/products/{product}/jobs",
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([
'model_id' => '<string>',
'idempotency_key' => '<string>',
'inputs' => [
],
'billing_unit' => 'credits',
'max_credits' => 1,
'callback_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.beeble.ai/v1/products/{product}/jobs"
payload := strings.NewReader("{\n \"model_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"inputs\": {},\n \"billing_unit\": \"credits\",\n \"max_credits\": 1,\n \"callback_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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.beeble.ai/v1/products/{product}/jobs")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"inputs\": {},\n \"billing_unit\": \"credits\",\n \"max_credits\": 1,\n \"callback_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beeble.ai/v1/products/{product}/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"inputs\": {},\n \"billing_unit\": \"credits\",\n \"max_credits\": 1,\n \"callback_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"product": "<string>",
"model_id": "<string>",
"organization_id": "<string>",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"team_id": "<string>",
"billing_unit": "credits",
"progress": 123,
"credits_charged": 123,
"refunded": true,
"outputs": {},
"error": {}
}Authorizations
Your Developer API key.
Path Parameters
Body
application/json
Required string length:
1 - 256Required string length:
1 - 256These product endpoints bill organization credits.
Available options:
usd, credits Required range:
x >= 0Maximum string length:
2048Response
202 - application/json
Successful Response
Allowed value:
"credits"