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.
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
- Create an API Key in the dashboard and confirm your balance or trial credit is available.
- Choose a model ID from /models; match the model to chat, vision, image, video, audio, embedding, or rerank work.
- Set Base URL to https://api.sealink.io/v1, or call the SeaLink API paths below directly.
- Before launch, verify with minimal requests: one chat message, one image, a short video task, and short text/file audio.
- 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.
Chat completion (OpenAI-compatible)
OpenAI-compatible chat completion endpoint. Use stream=true for streaming responses.
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"}]}'
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 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" } }]}]}'
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 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", "您好", "สวัสดี"]}'
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"'"}}'
Rerank documents
Rank candidate documents by relevance to a query for RAG, enterprise search, and post-retrieval refinement.
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}'
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 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"}'
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.
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"}'
Create image variations
Upload a source image and create one or more variations.
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"
Upscale images
Increase image resolution from a URL or base64 input.
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}'
Style transfer
Apply a style reference image to an image.
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}'
Remove image background
Remove the background from an image and return a transparent result.
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"}'
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.
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}'
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}'
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}'
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}'
curl https://test.sealink.io/v1/tasks/task_abc123 \-H "Authorization: Bearer $SEALINK_API_KEY"
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.
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}'
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}'
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.
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());});
Text to speech
Generate audio from text. The response is audio binary; write it to a file.
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
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 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"
Translate audio
Upload audio and receive an English translation transcript.
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>"
Generate music
Generate music from a prompt. Duration, style, and instrumental options depend on the model.
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}'
Generate sound effects
Generate a short sound effect from a natural-language description.
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}'
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 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."}'
Moderate text and images
Check user input before sending it into generation flows. Accepts text strings and image content objects.
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."}'
List models
Public — no auth needed. Returns OpenAI-format model list.
curl https://test.sealink.io/v1/models
Anthropic Messages (compat)
Used by Claude Code. Auth via x-api-key or Authorization header.
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.
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 https://test.sealink.io/v1/me \-H "Authorization: Bearer $SEALINK_API_KEY"
Task tagging — metadata.task_type
v2 previewAdd `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 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.