API Reference
Full surface area of SeaLink's public API. OpenAI-compatible plus Anthropic-compatible entry points.
/v1/chat/completionsChat completion (OpenAI-compatible)
OpenAI-compatible chat completion endpoint. Use stream=true for streaming responses.
curl https://api.sealink.asia/v1/chat/completions \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "claude-sonnet-4-6","messages": [{"role":"user","content":"Hello"}]}'
/v1/embeddingsGenerate embeddings
Use text-embedding-3-large for launch embedding workloads.
curl https://api.sealink.asia/v1/embeddings \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "text-embedding-3-large","input": ["Hello", "您好", "สวัสดี"]}'
/v1/modelsList models
Public — no auth needed. Returns OpenAI-format model list.
curl https://api.sealink.asia/v1/models
/anthropic/v1/messagesAnthropic Messages (compat)
Used by Claude Code. Auth via x-api-key or Authorization header.
curl https://api.sealink.asia/anthropic/v1/messages \-H "x-api-key: $SEALINK_API_KEY" \-H "Content-Type: application/json" \-d '{"model": "claude-sonnet-4-6","max_tokens": 256,"messages": [{"role":"user","content":"Hi"}]}'
Want more depth?
Error codes: /docs/error-codes. Rate limits: /docs/rate-limits. Streaming: /docs/streaming.
/v1/meIdentity + quota snapshot
Validate an API key and read its current balance, monthly budget, RPM/TPM limits, and model whitelist. Useful for CLIs and key health probes.
curl https://api.sealink.asia/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://api.sealink.asia/v1/chat/completions \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "content-type: application/json" \-d '{"model": "claude-haiku-4-5","metadata": { "task_type": "translation" },"messages": [{"role": "user", "content": "..."}]}'
Upstream models ignore the metadata field if they don't recognize it. 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.
CORS / browser usage
SeaLink API endpoints respond to cross-origin requests, so you can call them directly from a browser (the OpenAI and Anthropic SDKs both work in browsers).
| Header | Value |
|---|---|
| Access-Control-Allow-Origin | * |
| Access-Control-Allow-Methods | POST, GET, OPTIONS |
| Access-Control-Allow-Headers | authorization, content-type, x-api-key, anthropic-version, x-stainless-* |
| Access-Control-Expose-Headers | x-sealink-upstream, x-sealink-fallback, x-sealink-original-model, x-sealink-served-model, x-sealink-fallback-reason, retry-after |
Caveat: putting an API key in browser-side JS makes it visible to every visitor. For production, route SeaLink calls through your own server.