Create an AI image generation job
curl --request POST \
--url https://api.adskull.io/v1/image-generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"prompt": "<string>",
"quality": "1K",
"ratio": "9:16",
"reference_image_url": "<string>",
"reference_image_urls": [
"<string>"
],
"count": 1,
"negative_prompt": "<string>"
}
'import requests
url = "https://api.adskull.io/v1/image-generations"
payload = {
"prompt": "<string>",
"quality": "1K",
"ratio": "9:16",
"reference_image_url": "<string>",
"reference_image_urls": ["<string>"],
"count": 1,
"negative_prompt": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
prompt: '<string>',
quality: '1K',
ratio: '9:16',
reference_image_url: '<string>',
reference_image_urls: ['<string>'],
count: 1,
negative_prompt: '<string>'
})
};
fetch('https://api.adskull.io/v1/image-generations', 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.adskull.io/v1/image-generations",
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>',
'quality' => '1K',
'ratio' => '9:16',
'reference_image_url' => '<string>',
'reference_image_urls' => [
'<string>'
],
'count' => 1,
'negative_prompt' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.adskull.io/v1/image-generations"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"quality\": \"1K\",\n \"ratio\": \"9:16\",\n \"reference_image_url\": \"<string>\",\n \"reference_image_urls\": [\n \"<string>\"\n ],\n \"count\": 1,\n \"negative_prompt\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.adskull.io/v1/image-generations")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"quality\": \"1K\",\n \"ratio\": \"9:16\",\n \"reference_image_url\": \"<string>\",\n \"reference_image_urls\": [\n \"<string>\"\n ],\n \"count\": 1,\n \"negative_prompt\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.adskull.io/v1/image-generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"quality\": \"1K\",\n \"ratio\": \"9:16\",\n \"reference_image_url\": \"<string>\",\n \"reference_image_urls\": [\n \"<string>\"\n ],\n \"count\": 1,\n \"negative_prompt\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "image_generation_job",
"status": "queued",
"credits_reserved": 123,
"assets": [
{
"id": "<string>",
"object": "asset",
"type": "image",
"url": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"duration_seconds": 123,
"width": 123,
"height": 123,
"expires_at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"progress_percent": 50,
"credits_used": 123,
"credits_refunded": 0,
"request": {},
"failure_code": "<string>",
"failure_message": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"failed_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Unique key for safe retries of job creation requests.
8 - 128Body
Image generation request. Each model has its own accepted set of
quality and ratio values — see GET /v1/models/{model_id} for
the authoritative matrix.
Orientation cheatsheet: • 9:16 → vertical / portrait (TikTok, Reels, Shorts, Stories) • 16:9 → horizontal / landscape (YouTube, web hero) • 1:1 → square (Instagram feed)
Text prompt describing the image.
1 - 4096Image model. Per-model qualities: • nano-banana-pro / nano-banana-2 → 1K | 2K | 4K • flux-2-pro / flux-2 → 1K | 2K • ideogram-v3 → TURBO | BALANCED | QUALITY • grok-imagine → STANDARD | QUALITY • seedream-5-lite → basic | high • gpt-image-2 → 1K | 2K | 4K • gpt-image-1-5 → medium | high • nano-banana-2-lite, seedream-4-5, wan-2-7-pro, wan-2-7, qwen2, z-image → default
nano-banana-pro, nano-banana-2, nano-banana-2-lite, flux-2-pro, flux-2, seedream-4-5, seedream-5-lite, wan-2-7-pro, wan-2-7, ideogram-v3, grok-imagine, qwen2, gpt-image-2, gpt-image-1-5, z-image Model-specific quality. See model_id description for accepted values.
"1K"
Aspect ratio, validated PER MODEL: any ratio the model advertises in GET /v1/models/{model_id} is accepted (e.g. 4:5 on the nano-banana models). Unsupported ratios return 400 with the accepted list in the error message. Omit to use the model's default ratio.
1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9 "9:16"
One hosted reference image URL. SSRF-checked. Upload local files via POST /v1/assets first.
Compatibility alias for reference_image_url. The backend uses
only the FIRST URL in the array. Prefer the singular form.
Number of images to generate. grok-imagine ignores this and always returns 2–6 images per run.
1 <= x <= 4Optional content to avoid.
1024Response
Image generation accepted.
image_generation_job, video_generation_job, talking_avatar_job queued, processing, completed, failed, canceled Show child attributes
Show child attributes
0 <= x <= 100curl --request POST \
--url https://api.adskull.io/v1/image-generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"prompt": "<string>",
"quality": "1K",
"ratio": "9:16",
"reference_image_url": "<string>",
"reference_image_urls": [
"<string>"
],
"count": 1,
"negative_prompt": "<string>"
}
'import requests
url = "https://api.adskull.io/v1/image-generations"
payload = {
"prompt": "<string>",
"quality": "1K",
"ratio": "9:16",
"reference_image_url": "<string>",
"reference_image_urls": ["<string>"],
"count": 1,
"negative_prompt": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
prompt: '<string>',
quality: '1K',
ratio: '9:16',
reference_image_url: '<string>',
reference_image_urls: ['<string>'],
count: 1,
negative_prompt: '<string>'
})
};
fetch('https://api.adskull.io/v1/image-generations', 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.adskull.io/v1/image-generations",
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>',
'quality' => '1K',
'ratio' => '9:16',
'reference_image_url' => '<string>',
'reference_image_urls' => [
'<string>'
],
'count' => 1,
'negative_prompt' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.adskull.io/v1/image-generations"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"quality\": \"1K\",\n \"ratio\": \"9:16\",\n \"reference_image_url\": \"<string>\",\n \"reference_image_urls\": [\n \"<string>\"\n ],\n \"count\": 1,\n \"negative_prompt\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.adskull.io/v1/image-generations")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"quality\": \"1K\",\n \"ratio\": \"9:16\",\n \"reference_image_url\": \"<string>\",\n \"reference_image_urls\": [\n \"<string>\"\n ],\n \"count\": 1,\n \"negative_prompt\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.adskull.io/v1/image-generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"quality\": \"1K\",\n \"ratio\": \"9:16\",\n \"reference_image_url\": \"<string>\",\n \"reference_image_urls\": [\n \"<string>\"\n ],\n \"count\": 1,\n \"negative_prompt\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "image_generation_job",
"status": "queued",
"credits_reserved": 123,
"assets": [
{
"id": "<string>",
"object": "asset",
"type": "image",
"url": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"duration_seconds": 123,
"width": 123,
"height": 123,
"expires_at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"progress_percent": 50,
"credits_used": 123,
"credits_refunded": 0,
"request": {},
"failure_code": "<string>",
"failure_message": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"failed_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"details": {}
}
}
