Start from the action you want to perform. SeaLink keeps one customer API surface while each public model detail explains the supported endpoint, parameters, task behavior, and billing unit.
Do not copy a model ID from a blog post or an old ticket. Read /v1/models with your API key, then open the model detail for modalities, endpoint family, async behavior, pricing unit, and supported parameters.
curl https://api.sealink.io/v1/models \-H "Authorization: Bearer $SEALINK_API_KEY"
curl https://api.sealink.io/v1/models/<model_id> \-H "Authorization: Bearer $SEALINK_API_KEY"
Read pricing by billable unit
For non-text models, do not infer cost from input_per_1m or output_per_1m compatibility aliases. Use billing_unit, pricing.metered.retail_unit_price, and pricing.metered_lines from /v1/models or /v1/pricing. Those fields describe the model maker's billable unit, such as image, second, clip, character, search, or token.
| Action | Endpoint | Core parameters | Result pattern |
|---|---|---|---|
| Chat / vision | /v1/chat/completions, /v1/responses, /v1/messages | model, messages/input, max_tokens, stream | Synchronous or SSE stream |
| Images | /v1/images/generations, /v1/images/edits, /v1/images/variations, /v1/images/upscale, /v1/images/background-remove, /v1/images/style-transfer | model, prompt, n, size, image_url, images, image | URL, base64 image data, or multipart upload |
| Video | /v1/video/generations, /v1/video/edits, /v1/tasks/<task_id> | model, prompt, duration, resolution, image_url, video | Async task, polling, and optional cancellation |
| Audio | /v1/audio/speech, /v1/audio/transcriptions, /v1/audio/translations, /v1/audio/music, /v1/audio/sound-effects, /v1/audio/voice-clone | model, input, voice, file_url, file_urls, prompt, duration | Binary, JSON, or async task by model |
| Embeddings / rerank | /v1/embeddings, /v1/rerank | model, input, query, documents | JSON vectors or ranking scores |
| Moderations | /v1/moderations | model, input | JSON response |
Use the chat endpoint for text, tools, streaming, and image input on models whose detail lists vision or multimodal support.
curl https://api.sealink.io/v1/chat/completions \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<chat-model-from-/v1/models>","messages": [{ "role": "user", "content": "Write a concise support reply." }],"max_tokens": 512}'
IMG_B64="$(base64 -w0 screenshot.png)"curl https://api.sealink.io/v1/chat/completions \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<vision-model-from-/v1/models>","messages": [{"role": "user","content": [{ "type": "text", "text": "List the visible UI issues." },{ "type": "image_url", "image_url": { "url": "data:image/png;base64,'"$IMG_B64"'" } }]}],"max_tokens": 512}'
Start with n=1 and one supported size. For reference images, data:image/...;base64,... is the most stable production input; plain URLs must be directly downloadable.
curl https://api.sealink.io/v1/images/generations \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<image-model-from-/v1/models>","prompt": "A clean studio product render of a stainless steel water bottle","n": 1,"size": "1024x1024","response_format": "url"}'
IMG_B64="$(base64 -w0 product.png)"curl https://api.sealink.io/v1/images/generations \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<reference-image-model-from-/v1/models>","prompt": "Place this product in a bright catalog scene","images": ["data:image/png;base64,'"$IMG_B64"'"],"n": 1,"size": "1024x1024"}'
Video usually returns a task. Store task_id and poll /v1/tasks/{task_id} until the task reaches a final status. Charges are based on actual usage at that point. For a first test, use n=1, the shortest supported duration, and the lowest supported resolution.
curl https://api.sealink.io/v1/video/generations \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<video-model-from-/v1/models>","prompt": "A simple product shot with a slow camera push-in","duration": 5,"resolution": "720p","n": 1}'
curl https://api.sealink.io/v1/video/edits \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<video-edit-model-from-/v1/models>","video": "<publicly-downloadable-video-url>","prompt": "Replace the background with a bright studio","duration": 5,"resolution": "720p"}'
curl https://api.sealink.io/v1/tasks/<task_id> \-H "Authorization: Bearer $SEALINK_API_KEY"
curl -X DELETE https://api.sealink.io/v1/tasks/<task_id> \-H "Authorization: Bearer $SEALINK_API_KEY"
Audio models differ by upload mode, voice list, response format, and task behavior. Embeddings should use batches when possible. Rerank accepts a query and documents array.
curl https://api.sealink.io/v1/audio/speech \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<audio-speech-model-from-/v1/models>","input": "Your report is ready.","voice": "<voice-from-model-detail>","response_format": "mp3"}' \--output speech.mp3
curl https://api.sealink.io/v1/audio/transcriptions \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<audio-transcription-model-from-/v1/models>","file_url": "https://raw.githubusercontent.com/Jakobovski/free-spoken-digit-dataset/master/recordings/1_jackson_0.wav","response_format": "json","language": "en"}'
curl https://api.sealink.io/v1/embeddings \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<embedding-model-from-/v1/models>","input": ["Refund policy", "API key rotation"],"encoding_format": "float"}'
curl https://api.sealink.io/v1/rerank \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "<rerank-model-from-/v1/models>","query": "How do I rotate a key?","documents": ["Create a new key first.", "Delete invoices from billing."]}'
For chat, vision, embeddings, and realtime-capable models, use the endpoint shown in the model detail. Some models bill separate input, output, cache, reasoning, audio, or image meters.
Image models usually bill per generated asset. Video models usually return an async task and bill by the final duration, selected quality, and successful terminal result.
Speech, transcription, and music models may use character, second, clip, or token meters. Always read the model detail before sending production traffic.
| HTTP | Code | Meaning | Action |
|---|---|---|---|
| 400 | invalid_request_error | Missing required field, unsupported input mode, duration, or resolution. | Read model detail and retry with supported parameters. |
| 401/403 | auth_error | Missing, invalid, or unauthorized API key. | Create or rotate a key and check model access. |
| 402 | insufficient_balance | Balance or budget is not enough for the request. | Top up or lower the requested output size. |
| 404 | model_not_found | The model ID is not visible to your key or is not callable on that endpoint. | Read /v1/models again and confirm the endpoint family in model detail. |
| 413 | request_too_large | The request body, file, or batch is larger than the endpoint accepts. | Reduce file size, document count, or batch size before retrying. |
| 429 | rate_limit_error | The key exceeded request, concurrency, or token pacing limits. | Use Retry-After when present and reduce concurrency. |
| 503 | upstream_error | The selected model is temporarily unavailable for this API key. | Record request_id and task_id, then check status or retry later. |
| 503 | billing_circuit_open | Usage is temporarily paused. | Wait before retrying; check status or contact support with request_id. |