FirmLink API Docs
Everything you need to integrate the FirmLink unified model API. Base URL: https://api.firmlinktech.com/v1
Quickstart
1. Register with your invite code, then create an API key in Console → API Keys. 2. Make your first call:
export FIRMLINK_API_KEY="sk-fl-..."
curl https://api.firmlinktech.com/v1/chat/completions \
-H "Authorization: Bearer $FIRMLINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5",
"messages": [{ "role": "user", "content": "What is MaaS?" }]
}'That's it — the response format is identical to OpenAI's Chat Completions API.
Authentication
All endpoints require a Bearer token in the Authorization header. Keys begin with sk-fl- and are shown only once at creation. Treat them like passwords: store them in a secret manager, never in client-side code or version control. Revoke a compromised key instantly from the console — revocation propagates within seconds.
API Reference
POST /v1/chat/completions
Creates a chat completion. Fully compatible with the OpenAI schema.
| Field | Type | Description |
|---|---|---|
| model | string · required | Model ID, e.g. anthropic/claude-sonnet-5. See the model catalog. |
| messages | array · required | Conversation messages: system / user / assistant / tool roles. |
| temperature | number | Sampling temperature, 0–2. Default 1. |
| max_tokens | number | Maximum completion tokens. |
| stream | boolean | Stream partial deltas over SSE. Default false. |
| response_format | object | { "type": "json_object" } for JSON mode on supported models. |
| tools | array | Function-calling tool definitions (OpenAI format). |
Response
{
"id": "chatcmpl-fl-9f2ac1",
"object": "chat.completion",
"created": 1758012000,
"model": "anthropic/claude-sonnet-5",
"choices": [{
"index": 0,
"message": { "role": "assistant", "content": "MaaS (Model as a Service) is..." },
"finish_reason": "stop"
}],
"usage": { "prompt_tokens": 24, "completion_tokens": 118, "total_tokens": 142 }
}GET /v1/models
Returns the full catalog of models available to your key, including context lengths and per-token pricing.
Model Routing
Append routing hints to any model ID to control how the gateway selects a provider route:
openai/gpt-6-astraDefault — balanced latency and priceopenai/gpt-5:nitroFastest available route, price-insensitiveopenai/gpt-5:floorCheapest available route, latency-insensitiveIf a provider route fails mid-request, the gateway retries on a healthy route automatically. Failovers are logged in your console activity feed.
Rate Limits
| Tier | Requests/min | Tokens/min |
|---|---|---|
| Pay as you go | 60 | 200,000 |
| Startup | 300 | 1,000,000 |
| Business | Custom | Custom |
Exceeded limits return 429 with a Retry-After header. Back off exponentially and you'll rarely notice them.
Error Handling
invalid_requestMalformed request body or unsupported parameter.
unauthorizedMissing, invalid or revoked API key.
insufficient_creditsBalance is exhausted — top up to continue.
model_not_foundUnknown model ID. Check the catalog for exact IDs.
rate_limitedRate limit exceeded. Respect Retry-After.
gateway_errorUnexpected gateway error. Safe to retry with backoff.
provider_unavailableAll routes for this model are degraded. Retry shortly or switch models.
Migrating from OpenAI
Existing OpenAI integrations move in two lines — the base URL and the key:
# Before
client = OpenAI(api_key="sk-...")
# After
client = OpenAI(
base_url="https://api.firmlinktech.com/v1",
api_key="sk-fl-...",
)
# Everything else — streaming, tools, JSON mode — works unchanged.From there, every model in the catalog is one model-field change away.
Need a hand?
Our support team answers integration questions within one business day — support@firmlinktech.com