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:

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

FieldTypeDescription
modelstring · requiredModel ID, e.g. anthropic/claude-sonnet-5. See the model catalog.
messagesarray · requiredConversation messages: system / user / assistant / tool roles.
temperaturenumberSampling temperature, 0–2. Default 1.
max_tokensnumberMaximum completion tokens.
streambooleanStream partial deltas over SSE. Default false.
response_formatobject{ "type": "json_object" } for JSON mode on supported models.
toolsarrayFunction-calling tool definitions (OpenAI format).

Response

json
{
  "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 price
openai/gpt-5:nitroFastest available route, price-insensitive
openai/gpt-5:floorCheapest available route, latency-insensitive

If a provider route fails mid-request, the gateway retries on a healthy route automatically. Failovers are logged in your console activity feed.

Rate Limits

TierRequests/minTokens/min
Pay as you go60200,000
Startup3001,000,000
BusinessCustomCustom

Exceeded limits return 429 with a Retry-After header. Back off exponentially and you'll rarely notice them.

Error Handling

400
invalid_request

Malformed request body or unsupported parameter.

401
unauthorized

Missing, invalid or revoked API key.

402
insufficient_credits

Balance is exhausted — top up to continue.

404
model_not_found

Unknown model ID. Check the catalog for exact IDs.

429
rate_limited

Rate limit exceeded. Respect Retry-After.

500
gateway_error

Unexpected gateway error. Safe to retry with backoff.

503
provider_unavailable

All 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:

python
# 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