SeaLinkSeaLink
/
← Docs

API surface

API Reference

Create an API Key and start calling SeaLink. Each capability includes the minimal request, when to use it, and where to read the detailed guide.

Download full OpenAPI 3.1 specDownload Postman collection

API document scope

/api/openapi is the complete SeaLink OpenAPI 3.1 document. OpenAI SDKs work well with compatible paths such as /v1/chat/completions, /v1/responses, /v1/embeddings, and /v1/models; use the examples on this page to call media, task, realtime, account, and billing APIs directly over HTTP or WebSocket.

Call basics

Use https://api.sealink.io as the base URL. Send Authorization: Bearer $SEALINK_API_KEY on authenticated requests. Synchronous APIs return results directly; video and some generation jobs return a task id first, then you poll for status.

Production call flow

  1. Create an API Key in the dashboard and confirm your balance or trial credit is available.
  2. Choose a model ID from /models; match the model to chat, vision, image, video, audio, embedding, or rerank work.
  3. Set Base URL to https://api.sealink.io/v1, or call the SeaLink API paths below directly.
  4. Before launch, verify with minimal requests: one chat message, one image, a short video task, and short text/file audio.
  5. In production, store x-sealink-request-id so you can debug billing, rate limits, and errors.

Media and vision inputs

Image editing, image-to-image, image-to-video, keyframe video, and vision embedding models accept data:image/...;base64,... inputs. You may also send a regular image URL when it is directly downloadable by the model service and both dimensions are greater than 10 px. Video generation returns an async task id; poll /v1/tasks/{task_id}. The video examples below use https://raw.githubusercontent.com/mathiasbynens/small/master/jpeg.jpg as a downloadable image input.

POST/v1/chat/completions

Chat completion (OpenAI-compatible)

OpenAI-compatible chat completion endpoint. Use stream=true for streaming responses.

cURL
curl https://test.sealink.io/v1/chat/completions \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-pro",
"messages": [{"role":"user","content":"Hello"}]
}'
POST/v1/chat/completions

Vision chat (image input)

Use the chat endpoint with OpenAI-compatible image_url content. Choose a vision model from /v1/models; pass image_url.url as a public HTTPS URL or data URL, and use a real image larger than 10 px on both dimensions.

cURL
curl https://test.sealink.io/v1/chat/completions \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.6-plus",
"messages": [{
"role": "user",
"content": [
{ "type": "text", "text": "Describe this image in one sentence." },
{ "type": "image_url", "image_url": { "url": "https://example.com/photo.jpg" } }
]
}]
}'

Read the vision guide

POST/v1/embeddings

Generate embeddings

Use an embedding model from /v1/models for text. For vision embedding models, pass input as an object with image or contents.

cURL
curl https://test.sealink.io/v1/embeddings \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tongyi-embedding-vision-plus",
"input": ["Hello", "您好", "สวัสดี"]
}'
Vision embedding
IMG_B64="$(base64 -w0 photo.png)"
curl https://test.sealink.io/v1/embeddings \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.6-plus",
"input": {
"image": "data:image/png;base64,'"$IMG_B64"'"
}
}'
POST/v1/rerank

Rerank documents

Rank candidate documents by relevance to a query for RAG, enterprise search, and post-retrieval refinement.

cURL
curl https://test.sealink.io/v1/rerank \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-rerank",
"query": "best API gateway for Qwen models",
"documents": [
"SeaLink exposes one rerank API.",
"A sourdough starter needs regular feeding.",
"Rerank models improve retrieval quality for RAG."
],
"top_n": 2
}'
POST/v1/images/generations

Generate images

Generate images from a prompt. Use size values such as 1024x1024; SeaLink will pass them to the selected model in the format it expects.

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 clean product photo of a white ceramic mug on a wooden desk",
"n": 1,
"size": "1024x1024",
"response_format": "url"
}'
POST/v1/images/edits

Edit images

Image editing models use this endpoint, not /v1/images/generations. Choose an image-edit model from /v1/models, then send image_url in JSON or upload a local image with multipart form data.

cURL
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": "Replace the background with a bright studio backdrop",
"n": 1,
"size": "1024x1024"
}'
POST/v1/images/variations

Create image variations

Upload a source image and create one or more variations.

cURL
curl https://test.sealink.io/v1/images/variations \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-F "image=@photo.png" \
-F "model=<image-variation-model-from-/v1/models>" \
-F "n=2" \
-F "size=1024x1024"
POST/v1/images/upscale

Upscale images

Increase image resolution from a URL or base64 input.

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": 2
}'
POST/v1/images/style-transfer

Style transfer

Apply a style reference image to an image.

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/photo.png",
"style_reference": "https://example.com/style.png",
"strength": 0.7
}'
POST/v1/images/background-remove

Remove image background

Remove the background from an image and return a transparent result.

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/photo.png"
}'
POST/v1/video/generations

Generate videos

Video generation is asynchronous. Submit a short task first, store the returned id, then poll the status endpoint. Use duration, size, image_url, and last_image_url in SeaLink requests; SeaLink sends the matching fields to the selected model. Check /v1/models for each model's supported video input mode and resolution.

Submit
curl https://test.sealink.io/v1/video/generations \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v3-omni",
"prompt": "A coffee cup on a desk, soft morning light, slow camera move",
"size": "1280x720",
"duration": 5,
"n": 1
}'
Image-to-video
IMG_B64="$(base64 -w0 first-frame.png)"
curl https://test.sealink.io/v1/video/generations \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<image-to-video-model-from-/v1/models>",
"prompt": "A tiny product photo turning slowly on a clean table",
"image_url": "data:image/png;base64,'"$IMG_B64"'",
"size": "832x480",
"duration": 5,
"n": 1
}'
Remote image-to-video
curl https://test.sealink.io/v1/video/generations \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<remote-image-to-video-model-from-/v1/models>",
"prompt": "A tiny product photo turning slowly on a clean table",
"image_url": "https://raw.githubusercontent.com/mathiasbynens/small/master/jpeg.jpg",
"size": "832x480",
"duration": 3,
"n": 1
}'
Keyframe video
FIRST_B64="$(base64 -w0 first-frame.png)"
LAST_B64="$(base64 -w0 last-frame.png)"
curl https://test.sealink.io/v1/video/generations \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<keyframe-video-model-from-/v1/models>",
"prompt": "Smoothly move from the first frame to the last frame",
"image_url": "data:image/png;base64,'"$FIRST_B64"'",
"last_image_url": "data:image/png;base64,'"$LAST_B64"'",
"size": "832x480",
"duration": 5,
"n": 1
}'
Poll
curl https://test.sealink.io/v1/tasks/task_abc123 \
-H "Authorization: Bearer $SEALINK_API_KEY"
POST/v1/video/edits

Edit videos

Edit an existing video with a prompt. Wan animate models require both a video input and a reference image. The video must be publicly downloadable and contain exactly one clearly visible human body.

Submit
curl https://test.sealink.io/v1/video/edits \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v3-omni",
"video": "https://example.com/input-video.mp4",
"prompt": "Change the background to a beach sunset",
"resolution": "1280x720",
"duration": 5
}'
Wan animate
IMG_B64="$(base64 -w0 character.png)"
curl https://test.sealink.io/v1/video/edits \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<video-animate-model-from-/v1/models>",
"prompt": "Make the subject wave gently",
"image_url": "data:image/png;base64,'"$IMG_B64"'",
"video_url": "https://example.com/single-person.mp4",
"size": "832x480",
"duration": 5,
"n": 1
}'
GET/ws/dashscope/realtime

Realtime WebSocket

Use WebSocket transport for realtime ASR, Omni, and TTS models. Plain HTTP requests return 426 because the client must send WebSocket Upgrade headers.

Node.js
import WebSocket from "ws";
const ws = new WebSocket(
"wss://api.sealink.io/ws/dashscope/realtime?model=<realtime-model-from-/v1/models>",
{ headers: { Authorization: `Bearer ${process.env.SEALINK_API_KEY}` } },
);
ws.on("message", (event) => {
console.log(event.toString());
});
POST/v1/audio/speech

Text to speech

Generate audio from text. The response is audio binary; write it to a file.

cURL
curl https://test.sealink.io/v1/audio/speech \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-omni-flash",
"input": "Hello, welcome to SeaLink.",
"voice": "Cherry",
"response_format": "mp3"
}' \
--output speech.mp3
POST/v1/audio/transcriptions

Speech to text

Transcribe audio. Use public audio-stt models from /v1/models; Alibaba ASR models support JSON file_url/file_urls and long ASR tasks return 202 for /v1/tasks polling.

cURL
curl https://test.sealink.io/v1/audio/transcriptions \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-F "model=fun-asr" \
-F "file_url=https://raw.githubusercontent.com/Jakobovski/free-spoken-digit-dataset/master/recordings/1_jackson_0.wav" \
-F "response_format=json" \
-F "language=en"
POST/v1/audio/translations

Translate audio

Upload audio and receive an English translation transcript.

cURL
curl https://test.sealink.io/v1/audio/translations \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-F "file=@korean_speech.mp3" \
-F "model=<audio-translation-model-from-/v1/models>"
POST/v1/audio/music

Generate music

Generate music from a prompt. Duration, style, and instrumental options depend on the model.

cURL
curl https://test.sealink.io/v1/audio/music \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<audio-music-model-from-/v1/models>",
"prompt": "An uplifting orchestral piece with piano and strings",
"lyrics_prompt": "[Verse]\nMorning light across the city\n[Chorus]\nWe rise together",
"duration": 30,
"instrumental": false
}'
POST/v1/audio/sound-effects

Generate sound effects

Generate a short sound effect from a natural-language description.

cURL
curl https://test.sealink.io/v1/audio/sound-effects \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<audio-sfx-model-from-/v1/models>",
"prompt": "A soft notification chime",
"duration_seconds": 3
}'
POST/v1/audio/voice-clone

Clone a voice

Provide a reference audio file or URL and text to synthesize in that voice. Use a public or private voice-clone model from your catalog snapshot.

cURL
curl https://test.sealink.io/v1/audio/voice-clone \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<audio-voice-clone-model-from-/v1/models>",
"audio": "https://raw.githubusercontent.com/Jakobovski/free-spoken-digit-dataset/master/recordings/1_jackson_0.wav",
"text": "This is a SeaLink voice clone sample."
}'
POST/v1/moderations

Moderate text and images

Check user input before sending it into generation flows. Accepts text strings and image content objects.

cURL
curl https://test.sealink.io/v1/moderations \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<moderation-model-from-/v1/models>",
"input": "Please check this user message."
}'
GET/v1/models

List models

Public — no auth needed. Returns OpenAI-format model list.

cURL
curl https://test.sealink.io/v1/models
POST/anthropic/v1/messages

Anthropic Messages (compat)

Used by Claude Code. Auth via x-api-key or Authorization header.

cURL
curl https://test.sealink.io/anthropic/v1/messages \
-H "x-api-key: $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-pro",
"max_tokens": 256,
"messages": [{"role":"user","content":"Hi"}]
}'

Want more depth?

Error codes: /docs/error-codes. Rate limits: /docs/rate-limits. Streaming: /docs/streaming.

GET/v1/me

Identity + quota snapshot

Validate an API Key and read its current balance, monthly budget, and RPM/TPM limits. Useful for CLIs and key health checks.

cURL
curl https://test.sealink.io/v1/me \
-H "Authorization: Bearer $SEALINK_API_KEY"

Task tagging — metadata.task_type

v2 preview

Add `metadata.task_type` to your request body to tag a call with a business task ("translation", "summary", "support_reply", etc. — free-form, max 64 chars). SeaLink stores it on the usage_events row; you'll see spend rolled up by task on /dashboard/usage.

cURL with task tag
curl https://test.sealink.io/v1/chat/completions \
-H "Authorization: Bearer $SEALINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-pro",
"metadata": { "task_type": "translation" },
"messages": [{"role": "user", "content": "..."}]
}'

The metadata field does not affect model execution. Tagging is optional; calls without a tag work fine.

Key Management

Create, rotate, and revoke API Keys. Keys are access credentials for your account — treat them like passwords.

Create a key

Sign in → /dashboard/keys → 'New API Key' → enter a name and optional monthly budget cap → Create. Keys start with sk-sealink-. The full key is shown once at creation and never again.

Rotate a key

If a key may be compromised: create a new key → update your app config to use it → revoke the old key in /dashboard/keys. Revoked keys stop working immediately; in-flight requests complete. Rotate every 90 days as a best practice.

Revoke a key

Find the key in /dashboard/keys → Revoke → confirm. Revocation is irreversible. All requests with that key will return 401 after revocation. Create a new key to resume access.

Key security best practices

  • Never commit keys to a repo. Use env vars or a secret manager.
  • Use a different key per environment (dev / staging / production).
  • Set a monthly budget cap on keys to prevent surprise bills.
  • Periodically check /dashboard/usage per key for unusual activity.
  • The full key is only visible once at creation; the dashboard shows only the prefix and last 4 chars thereafter.