AI image generation, editing, variations, upscaling, style transfer, and background removal. Use SeaLink /v1/images/* and choose model capabilities and parameters from the model detail page; for your first test, use n=1 and a base size.
POST /v1/images/generationsAI image generation. The example model comes from the current public callable catalog; use /v1/models and the model detail page for available models, sizes, and reference-image support.
For image editing and reference-image models, data:image/...;base64,... inputs are the most reliable. If you pass a plain URL, it must be publicly accessible without sign-in, and both image dimensions must be greater than 10 px.
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | gpt-image-2 |
| prompt | string | Yes* | Image description; *no if using template_id |
| template_id | string | No | Prompt template ID |
| variables | object | No | Prompt template variables; values must be strings |
| n | integer | No | 1 - 10 (default 1) |
| size | string | No | 256x256, 512x512, 768x768, 1024x1024, 1328x1328, 1472x1104, 1104x1472, 1664x928, 928x1664, 1792x1024, 1024x1792, 1920x1920, 4096x4096. Seedream 4.0 accepts 1K, 2K, 4K, and WIDTHxHEIGHT from 921,600 to 16,777,216 total pixels; 2048x2048 is the default. Seedream 4.5 accepts 2K, 4K, and WIDTHxHEIGHT from 2560x1440 to 4096x4096 total pixels. Seedream 5.0 Lite accepts 2K, 3K, 4K, and WIDTHxHEIGHT from 2560x1440 to 4096x4096 total pixels. Dola Seedream 5.0 Pro accepts 1K, 2K, and WIDTHxHEIGHT from 921,600 to 4,624,220 total pixels; 2K is the default. For Gemini image models, use top-level aspect_ratio and image_size; delivered pixels follow the ratios and sizes supported by the selected model. See the model detail page for current pricing. |
| aspect_ratio | string | No | Model-specific. Gemini 3.1 Flash Image / Nano Banana 2 support 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; 2.5 Flash Image, 3.1 Flash Lite Image, and 3 Pro Image support the common ratios and do not support 1:4, 1:8, 4:1, or 8:1. For Gemini image models, send this field at the top level, not inside response_format |
| image_size | string | No | Model-specific. Gemini 3.1 Flash Image / Nano Banana 2 support 512, 1K, 2K, 4K; 3 Pro Image / Nano Banana Pro support 1K, 2K, 4K; 3.1 Flash Lite Image / Nano Banana 2 Lite supports only 1K; 2.5 Flash Image uses a fixed 1K output tier and does not accept image_size |
| response_format | string | No | url, b64_json (default url). This only controls whether SeaLink returns a URL or base64; use top-level aspect_ratio and image_size for Gemini image models |
| quality | string | No | standard, hd |
| style | string | No | vivid, natural |
| quality | string | No | standard, hd |
| style | string | No | vivid, natural |
| image / image_url | string | No | Single reference image URL or base64 for models that support reference input; Seedream 4.0, 4.5, and 5.0 Lite accept up to 10 reference images, and reference images plus generated images must not exceed 15; one Seedream reference image can generate up to 14 images, and text-only image sets can generate up to 15 images; Dola Seedream 5.0 Pro accepts up to 10 reference images, the first reference image is free, and each additional reference image is billed; 2.5 Flash Image accepts up to 3 input/reference images total |
| images / image_urls / reference_images | string[] | No | Reference image array for models that support multiple references; use images: [url] when the selected model supports it; Seedream 4.0, 4.5, and 5.0 Lite accept up to 10 reference images, and reference images plus generated images must not exceed 15; one Seedream reference image can generate up to 14 images, and text-only image sets can generate up to 15 images; Dola Seedream 5.0 Pro accepts up to 10 reference images, the first reference image is free, and each additional reference image is billed; 2.5 Flash Image accepts up to 3 input/reference images total |
| reference_url / reference_urls | string / string[] | No | Reference image aliases; use only when supported by the selected model |
| source_lang / target_lang | string | No | Source and target language hints for image-translation models; supported values come from model details |
| domain_hint | string | No | Domain hint for image-translation OCR or layout work, such as general, doc, ecommerce, or comic |
| image_segment | boolean | No | Request segmentation assistance on supported image-translation models |
curl https://api.sealink.io/v1/images/generations \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "gpt-image-2","prompt": "A serene Japanese garden with cherry blossoms, soft morning light","n": 1,"size": "1024x1024","response_format": "url"}'
import osfrom openai import OpenAIclient = OpenAI(base_url="https://api.sealink.io/v1",api_key=os.environ["SEALINK_API_KEY"],)response = client.images.generate(model="gpt-image-2",prompt="A serene Japanese garden with cherry blossoms, soft morning light",n=1,size="1024x1024",)print(response.data[0].url)
import OpenAI from "openai";const client = new OpenAI({baseURL: "https://api.sealink.io/v1",apiKey: process.env.SEALINK_API_KEY || "",});const response = await client.images.generate({model: "gpt-image-2",prompt: "A serene Japanese garden with cherry blossoms, soft morning light",n: 1,size: "1024x1024",});console.log(response.data[0].url);
# Reference-image generation uses /v1/images/generations with images[]IMG_B64="$(base64 -w0 photo.png)"curl https://api.sealink.io/v1/images/generations \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<image-reference-model-from-/v1/models>","prompt": "Turn this product photo into a clean catalog render","images": ["data:image/png;base64,'"$IMG_B64"'"],"n": 1,"size": "1024x1024"}'
POST /v1/images/editsImage editing. Choose a model whose detail page lists image editing support, then send it to /v1/images/edits. JSON and multipart/form-data are both supported; multipart files are limited to 10 MB.
For image editing and reference-image models, data:image/...;base64,... inputs are the most reliable. If you pass a plain URL, it must be publicly accessible without sign-in, and both image dimensions must be greater than 10 px.
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | <image-edit-model-from-/v1/models> |
| prompt | string | Yes | Edit instruction |
| image / image_url | string | Yes | Source image base64 or URL; multipart mode uses image file field |
| mask / mask_url | string | No | Mask base64 or URL |
| n | integer | No | 1 - 10 |
| size | string | No | 256x256, 512x512, 1024x1024 |
| response_format | string | No | url, b64_json |
# JSON mode — use a data URL for private or hard-to-fetch imagesIMG_B64="$(base64 -w0 photo.png)"curl https://api.sealink.io/v1/images/edits \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<image-edit-model-from-/v1/models>","image_url": "data:image/png;base64,'"$IMG_B64"'","prompt": "Add a rainbow in the sky","n": 1,"size": "1024x1024"}'
import osfrom openai import OpenAIclient = OpenAI(base_url="https://api.sealink.io/v1",api_key=os.environ["SEALINK_API_KEY"],)response = client.images.edit(model="<image-edit-model-from-/v1/models>",image=open("photo.png", "rb"),prompt="Add a rainbow in the sky",n=1,size="1024x1024",)print(response.data[0].url)
import OpenAI from "openai";import fs from "fs";const client = new OpenAI({baseURL: "https://api.sealink.io/v1",apiKey: process.env.SEALINK_API_KEY || "",});const response = await client.images.edit({model: "<image-edit-model-from-/v1/models>",image: fs.createReadStream("photo.png"),prompt: "Add a rainbow in the sky",n: 1,size: "1024x1024",});console.log(response.data[0].url);
POST /v1/images/variationsImage variations. Generate variations of an input image with similar style but different content. Multipart/form-data only.
| Parameter | Type | Required | Description |
|---|---|---|---|
| image | file | Yes | PNG image file, max 10MB, square |
| model | string | No | <image-edit-model-from-/v1/models> |
| n | integer | No | 1 - 10 |
| size | string | No | 256x256, 512x512, 1024x1024 |
# Multipart mode — upload local imagecurl https://api.sealink.io/v1/images/variations \-H "Authorization: Bearer $SEALINK_API_KEY" \-F "image=@photo.png" \-F "model=<image-edit-model-from-/v1/models>" \-F "n=1" \-F "size=1024x1024"
import osfrom openai import OpenAIclient = OpenAI(base_url="https://api.sealink.io/v1",api_key=os.environ["SEALINK_API_KEY"],)response = client.images.create_variation(model="<image-edit-model-from-/v1/models>",image=open("photo.png", "rb"),n=1,size="1024x1024",)print(response.data[0].url)
import OpenAI from "openai";import fs from "fs";const client = new OpenAI({baseURL: "https://api.sealink.io/v1",apiKey: process.env.SEALINK_API_KEY || "",});const response = await client.images.createVariation({model: "<image-edit-model-from-/v1/models>",image: fs.createReadStream("photo.png"),n: 1,size: "1024x1024",});console.log(response.data[0].url);
POST /v1/images/upscaleImage upscaling. Enlarge low-resolution images by 2x or 4x with enhanced clarity and detail.
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | <image-upscale-model-from-/v1/models> |
| image | string | Yes | Source image base64 or URL |
| scale | integer | No | 2 or 4 |
| size | string | No | Optional output size or resolution label for metering on models that support it |
| quality | string | No | Optional quality tier for metering on models that support it |
| response_format | string | No | url, b64_json |
curl https://api.sealink.io/v1/images/upscale \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<image-upscale-model-from-/v1/models>","image": "https://example.com/low-res.jpg","scale": 4,"response_format": "url"}'
import osimport requestsres = requests.post("https://api.sealink.io/v1/images/upscale",headers={"Authorization": f"Bearer {os.environ['SEALINK_API_KEY']}"},json={"model": "<image-upscale-model-from-/v1/models>","image": "https://example.com/low-res.jpg","scale": 4,"response_format": "url",},)print(res.json()["data"][0]["url"])
const res = await fetch("https://api.sealink.io/v1/images/upscale", {method: "POST",headers: {Authorization: `Bearer ${process.env.SEALINK_API_KEY || ""}`,"Content-Type": "application/json",},body: JSON.stringify({model: "<image-upscale-model-from-/v1/models>",image: "https://example.com/low-res.jpg",scale: 4,response_format: "url",}),});const data = await res.json();console.log(data.data[0].url);
POST /v1/images/style-transferStyle transfer. Apply the artistic style of one image to the content of another.
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | <image-style-transfer-model-from-/v1/models> |
| image | string | Yes | Content image base64 or URL |
| style_reference | string | Yes | Style reference image base64 or URL |
| strength | number | No | 0 - 1 |
| size | string | No | Optional output size or resolution label for metering on models that support it |
| quality | string | No | Optional quality tier for metering on models that support it |
| response_format | string | No | url, b64_json |
curl https://api.sealink.io/v1/images/style-transfer \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<image-style-transfer-model-from-/v1/models>","image": "https://example.com/content.jpg","style_reference": "https://example.com/style.jpg","strength": 0.7,"response_format": "url"}'
import osimport requestsres = requests.post("https://api.sealink.io/v1/images/style-transfer",headers={"Authorization": f"Bearer {os.environ['SEALINK_API_KEY']}"},json={"model": "<image-style-transfer-model-from-/v1/models>","image": "https://example.com/content.jpg","style_reference": "https://example.com/style.jpg","strength": 0.7,"response_format": "url",},)print(res.json()["data"][0]["url"])
const res = await fetch("https://api.sealink.io/v1/images/style-transfer", {method: "POST",headers: {Authorization: `Bearer ${process.env.SEALINK_API_KEY || ""}`,"Content-Type": "application/json",},body: JSON.stringify({model: "<image-style-transfer-model-from-/v1/models>",image: "https://example.com/content.jpg",style_reference: "https://example.com/style.jpg",strength: 0.7,response_format: "url",}),});const data = await res.json();console.log(data.data[0].url);
POST /v1/images/background-removeBackground removal. Automatically detect and remove image backgrounds, returning a transparent PNG.
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | <image-background-remove-model-from-/v1/models> |
| image | string | Yes | Source image base64 or URL |
| size | string | No | Optional output size or resolution label for metering on models that support it |
| quality | string | No | Optional quality tier for metering on models that support it |
| response_format | string | No | url, b64_json |
curl https://api.sealink.io/v1/images/background-remove \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<image-background-remove-model-from-/v1/models>","image": "https://example.com/product.jpg","response_format": "url"}'
import osimport requestsres = requests.post("https://api.sealink.io/v1/images/background-remove",headers={"Authorization": f"Bearer {os.environ['SEALINK_API_KEY']}"},json={"model": "<image-background-remove-model-from-/v1/models>","image": "https://example.com/product.jpg","response_format": "url",},)print(res.json()["data"][0]["url"])
const res = await fetch("https://api.sealink.io/v1/images/background-remove", {method: "POST",headers: {Authorization: `Bearer ${process.env.SEALINK_API_KEY || ""}`,"Content-Type": "application/json",},body: JSON.stringify({model: "<image-background-remove-model-from-/v1/models>",image: "https://example.com/product.jpg",response_format: "url",}),});const data = await res.json();console.log(data.data[0].url);