SeaLinkSeaLink
/
← Docs

Images

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; first probes should use n=1 and a base size.

POST /v1/images/generations

AI 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, production probes are most reliable with data:image/...;base64,... inputs. If you pass a plain URL, it must be directly downloadable by the upstream provider, and both image dimensions must be greater than 10 px.

Parameters

ParameterTypeRequiredDescription
modelstringYesgpt-image-2
promptstringYes*Image description; *no if using template_id
template_idstringNoPrompt template ID
variablesobjectNoPrompt template variables; values must be strings
nintegerNo1 - 10 (default 1)
sizestringNo256x256, 512x512, 768x768, 1024x1024, 1328x1328, 1472x1104, 1104x1472, 1664x928, 928x1664, 1792x1024, 1024x1792
response_formatstringNourl, b64_json (default url)
qualitystringNostandard, hd
stylestringNovivid, natural
image / image_urlstringNoSingle reference image URL or base64 for models that support reference input
images / image_urls / reference_imagesstring[]NoReference image array for models that support multiple references; use images: [url] when the selected model supports it
reference_url / reference_urlsstring / string[]NoReference image aliases; use only when supported by the selected model
cURL
curl https://test.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"
}'
Python
import os
from openai import OpenAI
client = OpenAI(
base_url="https://test.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)
Node.js
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://test.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);
cURL - reference image
# Reference-image generation uses /v1/images/generations with images[]
IMG_B64="$(base64 -w0 photo.png)"
curl https://test.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/edits

Image 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, production probes are most reliable with data:image/...;base64,... inputs. If you pass a plain URL, it must be directly downloadable by the upstream provider, and both image dimensions must be greater than 10 px.

Parameters

ParameterTypeRequiredDescription
modelstringYes<image-edit-model-from-/v1/models>
promptstringYesEdit instruction
image / image_urlstringYesSource image base64 or URL; multipart mode uses image file field
mask / mask_urlstringNoMask base64 or URL
nintegerNo1 - 10
sizestringNo256x256, 512x512, 1024x1024
response_formatstringNourl, b64_json
cURL
# JSON mode — use a data URL for private or hard-to-fetch images
IMG_B64="$(base64 -w0 photo.png)"
curl https://test.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"
}'
Python
import os
from openai import OpenAI
client = OpenAI(
base_url="https://test.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)
Node.js
import OpenAI from "openai";
import fs from "fs";
const client = new OpenAI({
baseURL: "https://test.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/variations

Image variations. Generate variations of an input image with similar style but different content. Multipart/form-data only.

Parameters

ParameterTypeRequiredDescription
imagefileYesPNG image file, max 10MB, square
modelstringNo<image-edit-model-from-/v1/models>
nintegerNo1 - 10
sizestringNo256x256, 512x512, 1024x1024
cURL
# Multipart mode — upload local image
curl https://test.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"
Python
import os
from openai import OpenAI
client = OpenAI(
base_url="https://test.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)
Node.js
import OpenAI from "openai";
import fs from "fs";
const client = new OpenAI({
baseURL: "https://test.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/upscale

Image upscaling. Enlarge low-resolution images by 2x or 4x with enhanced clarity and detail.

Parameters

ParameterTypeRequiredDescription
modelstringYes<image-upscale-model-from-/v1/models>
imagestringYesSource image base64 or URL
scaleintegerNo2 or 4
response_formatstringNourl, b64_json
cURL
curl https://test.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"
}'
Python
import os
import requests
res = requests.post(
"https://test.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"])
Node.js
const res = await fetch("https://test.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-transfer

Style transfer. Apply the artistic style of one image to the content of another.

Parameters

ParameterTypeRequiredDescription
modelstringYes<image-style-transfer-model-from-/v1/models>
imagestringYesContent image base64 or URL
style_referencestringYesStyle reference image base64 or URL
strengthnumberNo0 - 1
response_formatstringNourl, b64_json
cURL
curl https://test.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"
}'
Python
import os
import requests
res = requests.post(
"https://test.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"])
Node.js
const res = await fetch("https://test.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-remove

Background removal. Automatically detect and remove image backgrounds, returning a transparent PNG.

Parameters

ParameterTypeRequiredDescription
modelstringYes<image-background-remove-model-from-/v1/models>
imagestringYesSource image base64 or URL
response_formatstringNourl, b64_json
cURL
curl https://test.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"
}'
Python
import os
import requests
res = requests.post(
"https://test.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"])
Node.js
const res = await fetch("https://test.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);