Documentation
API reference
trilinkai exposes an OpenAI-compatible chat completions API. Use your API key from the console with any OpenAI SDK or plain HTTP.
Base URL and auth
Requests go to /v1 or the OpenRouter-compatible /api/v1 prefix on the same host as this console. Authenticate inference requests with a bearer token; the model catalogue is public.
Authorization: Bearer sk-trilinkai-... Content-Type: application/json
Quickstart
curl https://your-gateway/api/v1/chat/completions \
-H "Authorization: Bearer sk-trilinkai-..." \
-H "Content-Type: application/json" \
-d '{
"model": "fast-coding",
"messages": [{"role": "user", "content": "Hello"}]
}'Streaming
Set stream: true to receive server-sent events.
curl -N https://your-gateway/api/v1/chat/completions \
-H "Authorization: Bearer sk-trilinkai-..." \
-H "Content-Type: application/json" \
-d '{
"model": "fast-coding",
"stream": true,
"messages": [{"role": "user", "content": "Stream this"}]
}'Model catalogue
The public catalogue follows the OpenRouter model schema and does not require an API key.
curl https://your-gateway/api/v1/models
Models
| Model | Best for |
|---|---|
| frontier-reasoning | Deep reasoning, planning, and hard debugging. |
| fast-coding | Low-latency coding and everyday chat. |
| long-context | Large documents and long conversations. |
| open-weights | Cheapest tier for high-volume jobs. |
Errors
| Status | Meaning |
|---|---|
| 401 | Missing, invalid, revoked, or blocked API key. |
| 403 | The key is not allowed to use this model. |
| 429 | Rate limit or budget exhausted. |
| 5xx | Upstream provider error; retry with backoff. |
Limits
- 20 requests/second per IP at the edge, burst 40.
- 120 requests/minute and 200k tokens/minute per API key.
- Keys can be scoped to all models or a single tier.
- Calls stop with 401 when the workspace balance reaches zero.