Node.js
import GetimgAI from "getimg-ai";
const client = new GetimgAI();
const result = await client.images.generate({
model: "seedream-5-lite",
prompt: "A cinematic portrait of a cat astronaut",
aspect_ratio: "1:1",
resolution: "2K",
output_format: "jpeg",
});from getimg import GetimgAI
client = GetimgAI()
result = client.images.generate(
model="seedream-5-lite",
prompt="A cinematic portrait of a cat astronaut",
aspect_ratio="1:1",
resolution="2K",
output_format="jpeg",
)
curl --request POST \
--url https://api.getimg.ai/v2/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "seedream-5-lite",
"prompt": "A cinematic portrait of a cat astronaut",
"aspect_ratio": "1:1",
"resolution": "2K",
"output_format": "jpeg"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getimg.ai/v2/images/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([
'model' => 'seedream-5-lite',
'prompt' => 'A cinematic portrait of a cat astronaut',
'aspect_ratio' => '1:1',
'resolution' => '2K',
'output_format' => 'jpeg'
]),
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.getimg.ai/v2/images/generations"
payload := strings.NewReader("{\n \"model\": \"seedream-5-lite\",\n \"prompt\": \"A cinematic portrait of a cat astronaut\",\n \"aspect_ratio\": \"1:1\",\n \"resolution\": \"2K\",\n \"output_format\": \"jpeg\"\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.getimg.ai/v2/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"seedream-5-lite\",\n \"prompt\": \"A cinematic portrait of a cat astronaut\",\n \"aspect_ratio\": \"1:1\",\n \"resolution\": \"2K\",\n \"output_format\": \"jpeg\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getimg.ai/v2/images/generations")
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\": \"seedream-5-lite\",\n \"prompt\": \"A cinematic portrait of a cat astronaut\",\n \"aspect_ratio\": \"1:1\",\n \"resolution\": \"2K\",\n \"output_format\": \"jpeg\"\n}"
response = http.request(request)
puts response.read_body{
"id": "req-01HXYZABCD1234",
"status": "completed",
"model": "seedream-5-lite",
"data": [
{
"url": "https://api.getimg.ai/v2/downloads/req-01HXYZABCD1234/0?exp=1760000000&sig=1d9c2f6f4f7f6c03e5c58a4e6fd8b5b8e2d0c2f5f9e1a4cfe8c0e9d9a8b7c6d5",
"width": 1024,
"height": 1024,
"mime_type": "image/png",
"deletes_at": "2026-05-02T12:30:00.000Z"
}
],
"usage": {
"total_cost": 0.04,
"billable_unit": "image",
"unit_price": 0.04,
"quantity": 1
}
}Images
Generate an image
Generate an image and return the completed result.
POST
/
v2
/
images
/
generations
Node.js
import GetimgAI from "getimg-ai";
const client = new GetimgAI();
const result = await client.images.generate({
model: "seedream-5-lite",
prompt: "A cinematic portrait of a cat astronaut",
aspect_ratio: "1:1",
resolution: "2K",
output_format: "jpeg",
});from getimg import GetimgAI
client = GetimgAI()
result = client.images.generate(
model="seedream-5-lite",
prompt="A cinematic portrait of a cat astronaut",
aspect_ratio="1:1",
resolution="2K",
output_format="jpeg",
)
curl --request POST \
--url https://api.getimg.ai/v2/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "seedream-5-lite",
"prompt": "A cinematic portrait of a cat astronaut",
"aspect_ratio": "1:1",
"resolution": "2K",
"output_format": "jpeg"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getimg.ai/v2/images/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([
'model' => 'seedream-5-lite',
'prompt' => 'A cinematic portrait of a cat astronaut',
'aspect_ratio' => '1:1',
'resolution' => '2K',
'output_format' => 'jpeg'
]),
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.getimg.ai/v2/images/generations"
payload := strings.NewReader("{\n \"model\": \"seedream-5-lite\",\n \"prompt\": \"A cinematic portrait of a cat astronaut\",\n \"aspect_ratio\": \"1:1\",\n \"resolution\": \"2K\",\n \"output_format\": \"jpeg\"\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.getimg.ai/v2/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"seedream-5-lite\",\n \"prompt\": \"A cinematic portrait of a cat astronaut\",\n \"aspect_ratio\": \"1:1\",\n \"resolution\": \"2K\",\n \"output_format\": \"jpeg\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getimg.ai/v2/images/generations")
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\": \"seedream-5-lite\",\n \"prompt\": \"A cinematic portrait of a cat astronaut\",\n \"aspect_ratio\": \"1:1\",\n \"resolution\": \"2K\",\n \"output_format\": \"jpeg\"\n}"
response = http.request(request)
puts response.read_body{
"id": "req-01HXYZABCD1234",
"status": "completed",
"model": "seedream-5-lite",
"data": [
{
"url": "https://api.getimg.ai/v2/downloads/req-01HXYZABCD1234/0?exp=1760000000&sig=1d9c2f6f4f7f6c03e5c58a4e6fd8b5b8e2d0c2f5f9e1a4cfe8c0e9d9a8b7c6d5",
"width": 1024,
"height": 1024,
"mime_type": "image/png",
"deletes_at": "2026-05-02T12:30:00.000Z"
}
],
"usage": {
"total_cost": 0.04,
"billable_unit": "image",
"unit_price": 0.04,
"quantity": 1
}
}Authorizations
Send your API key as a bearer token:
Authorization: Bearer sk_<secret>.
Body
application/json
AI model ID. See supported models.
Description of the image to generate or an editing instruction.
Required string length:
1 - 4096Maximum array length:
8Show child attributes
Show child attributes
Optional output aspect ratio. See supported values by model.
Optional output resolution. See supported values by model.
Output image format.
Available options:
png, jpeg, webp Response
Image generation completed.
⌘I