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
| 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 |
| response_format | string | No | url, b64_json (default url) |
| 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 |
| 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 |
| reference_url / reference_urls | string / string[] | No | Reference image aliases; use only when supported by the selected model |
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"}'
import osfrom openai import OpenAIclient = 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)
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);
# 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
| 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://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"}'
import osfrom openai import OpenAIclient = 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)
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
| 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://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"
import osfrom openai import OpenAIclient = 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)
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
| 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 |
| response_format | string | No | url, b64_json |
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"}'
import osimport requestsres = 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"])
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
| 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 |
| response_format | string | No | url, b64_json |
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"}'
import osimport requestsres = 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"])
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
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | <image-background-remove-model-from-/v1/models> |
| image | string | Yes | Source image base64 or URL |
| response_format | string | No | url, b64_json |
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"}'
import osimport requestsres = 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"])
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);