SeaLink
← Docs

API Reference

Full surface area of SeaLink's public API. OpenAI-compatible plus Anthropic-compatible entry points.

POST/v1/chat/completions

Chat completion (OpenAI-compatible)

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

cURL
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"}]
}'
POST/v1/embeddings

Generate embeddings

Use text-embedding-3-large for launch embedding workloads.

cURL
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", "您好", "สวัสดี"]
}'
GET/v1/models

List models

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

cURL
curl https://api.sealink.asia/v1/models
POST/anthropic/v1/messages

Anthropic Messages (compat)

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

cURL
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.

GET/v1/me

Identity + 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
curl https://api.sealink.asia/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://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).

HeaderValue
Access-Control-Allow-Origin*
Access-Control-Allow-MethodsPOST, GET, OPTIONS
Access-Control-Allow-Headersauthorization, content-type, x-api-key, anthropic-version, x-stainless-*
Access-Control-Expose-Headersx-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.