Submit a job
curl --request POST \
--url https://api.blon.ai/v1/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": {},
"webhook_url": "<string>",
"metadata": {},
"workspace_id": "<string>"
}
'import requests
url = "https://api.blon.ai/v1/jobs"
payload = {
"model": "<string>",
"input": {},
"webhook_url": "<string>",
"metadata": {},
"workspace_id": "<string>"
}
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({
model: '<string>',
input: {},
webhook_url: '<string>',
metadata: {},
workspace_id: '<string>'
})
};
fetch('https://api.blon.ai/v1/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.blon.ai/v1/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' => '<string>',
'input' => [
],
'webhook_url' => '<string>',
'metadata' => [
],
'workspace_id' => '<string>'
]),
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.blon.ai/v1/jobs"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": {},\n \"webhook_url\": \"<string>\",\n \"metadata\": {},\n \"workspace_id\": \"<string>\"\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.blon.ai/v1/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": {},\n \"webhook_url\": \"<string>\",\n \"metadata\": {},\n \"workspace_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blon.ai/v1/jobs")
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 \"model\": \"<string>\",\n \"input\": {},\n \"webhook_url\": \"<string>\",\n \"metadata\": {},\n \"workspace_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "job",
"model": "<string>",
"status": "queued",
"provider_status": "<string>",
"queue_position": 123,
"cancelable": true,
"next_poll_after_seconds": 123,
"urls": {
"get": "<string>",
"cancel": "<string>"
},
"input": {},
"metadata": {},
"cost": {
"currency": "CREDITS",
"estimated": "<string>",
"charged": "<string>",
"refunded": "<string>"
},
"usage": [
{
"meter": "output_seconds",
"units": 123
}
],
"artifacts": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"url": "<string>",
"url_expires_at": "<string>",
"content_type": "<string>",
"size_bytes": 123,
"width": 123,
"height": 123,
"duration_ms": 123
}
],
"expires_at": "<string>",
"error": {
"code": "content_policy",
"message": "<string>",
"retryable": true
},
"webhook": {
"url": "<string>",
"status": "pending",
"attempts": 123
},
"idempotency_hit": true,
"request_id": "<string>",
"created_at": "<string>",
"started_at": "<string>",
"completed_at": "<string>",
"updated_at": "<string>"
}{
"id": "<string>",
"object": "job",
"model": "<string>",
"status": "queued",
"provider_status": "<string>",
"queue_position": 123,
"cancelable": true,
"next_poll_after_seconds": 123,
"urls": {
"get": "<string>",
"cancel": "<string>"
},
"input": {},
"metadata": {},
"cost": {
"currency": "CREDITS",
"estimated": "<string>",
"charged": "<string>",
"refunded": "<string>"
},
"usage": [
{
"meter": "output_seconds",
"units": 123
}
],
"artifacts": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"url": "<string>",
"url_expires_at": "<string>",
"content_type": "<string>",
"size_bytes": 123,
"width": 123,
"height": 123,
"duration_ms": 123
}
],
"expires_at": "<string>",
"error": {
"code": "content_policy",
"message": "<string>",
"retryable": true
},
"webhook": {
"url": "<string>",
"status": "pending",
"attempts": 123
},
"idempotency_hit": true,
"request_id": "<string>",
"created_at": "<string>",
"started_at": "<string>",
"completed_at": "<string>",
"updated_at": "<string>"
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}API Reference
Submit a job
POST
/
jobs
Submit a job
curl --request POST \
--url https://api.blon.ai/v1/jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": {},
"webhook_url": "<string>",
"metadata": {},
"workspace_id": "<string>"
}
'import requests
url = "https://api.blon.ai/v1/jobs"
payload = {
"model": "<string>",
"input": {},
"webhook_url": "<string>",
"metadata": {},
"workspace_id": "<string>"
}
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({
model: '<string>',
input: {},
webhook_url: '<string>',
metadata: {},
workspace_id: '<string>'
})
};
fetch('https://api.blon.ai/v1/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.blon.ai/v1/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' => '<string>',
'input' => [
],
'webhook_url' => '<string>',
'metadata' => [
],
'workspace_id' => '<string>'
]),
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.blon.ai/v1/jobs"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"input\": {},\n \"webhook_url\": \"<string>\",\n \"metadata\": {},\n \"workspace_id\": \"<string>\"\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.blon.ai/v1/jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"input\": {},\n \"webhook_url\": \"<string>\",\n \"metadata\": {},\n \"workspace_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.blon.ai/v1/jobs")
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 \"model\": \"<string>\",\n \"input\": {},\n \"webhook_url\": \"<string>\",\n \"metadata\": {},\n \"workspace_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "job",
"model": "<string>",
"status": "queued",
"provider_status": "<string>",
"queue_position": 123,
"cancelable": true,
"next_poll_after_seconds": 123,
"urls": {
"get": "<string>",
"cancel": "<string>"
},
"input": {},
"metadata": {},
"cost": {
"currency": "CREDITS",
"estimated": "<string>",
"charged": "<string>",
"refunded": "<string>"
},
"usage": [
{
"meter": "output_seconds",
"units": 123
}
],
"artifacts": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"url": "<string>",
"url_expires_at": "<string>",
"content_type": "<string>",
"size_bytes": 123,
"width": 123,
"height": 123,
"duration_ms": 123
}
],
"expires_at": "<string>",
"error": {
"code": "content_policy",
"message": "<string>",
"retryable": true
},
"webhook": {
"url": "<string>",
"status": "pending",
"attempts": 123
},
"idempotency_hit": true,
"request_id": "<string>",
"created_at": "<string>",
"started_at": "<string>",
"completed_at": "<string>",
"updated_at": "<string>"
}{
"id": "<string>",
"object": "job",
"model": "<string>",
"status": "queued",
"provider_status": "<string>",
"queue_position": 123,
"cancelable": true,
"next_poll_after_seconds": 123,
"urls": {
"get": "<string>",
"cancel": "<string>"
},
"input": {},
"metadata": {},
"cost": {
"currency": "CREDITS",
"estimated": "<string>",
"charged": "<string>",
"refunded": "<string>"
},
"usage": [
{
"meter": "output_seconds",
"units": 123
}
],
"artifacts": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"url": "<string>",
"url_expires_at": "<string>",
"content_type": "<string>",
"size_bytes": 123,
"width": 123,
"height": 123,
"duration_ms": 123
}
],
"expires_at": "<string>",
"error": {
"code": "content_policy",
"message": "<string>",
"retryable": true
},
"webhook": {
"url": "<string>",
"status": "pending",
"attempts": 123
},
"idempotency_hit": true,
"request_id": "<string>",
"created_at": "<string>",
"started_at": "<string>",
"completed_at": "<string>",
"updated_at": "<string>"
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"request_id": "<string>",
"retryable": true,
"retry_after_seconds": 123,
"details": "<unknown>"
}
}授權
bearerapiKey
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
標頭
The same key with the same body returns the original job; a different body is 409 idempotency_conflict.
Required string length:
1 - 255主體
application/json
回應
An idempotent replay, or a job that finished within the request.
Allowed value:
"job"可用選項:
queued, processing, completed, failed, canceled The upstream provider's own status, verbatim.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes