Skip to content

Quick Start

Quick Start

Get started with the CanaryLLM API in 3 steps.

Using TypeScript? The TypeScript SDK wraps these calls in a typed client (bun add @canarycoders/canaryllm) and handles the queue polling for you.

1. Get your API key

Request an API key from CanaryCoders via contact@canarycoders.es. Keys follow the format clk_live_...

2. Make your first request

All completions go through a queue system. Submit a request, then poll for the result.

bash
# Submit a completion request
curl -X POST https://canaryllm.canarycoders.es/api/llm/complete \
  -H "Authorization: Bearer clk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "openai",
    "model": "gpt-4.1-mini",
    "messages": [
      { "role": "user", "content": "Hello, world!" }
    ]
  }'
json
{
  "success": true,
  "data": {
    "queueId": "abc123-def456",
    "status": "queued",
    "message": "Task added to queue for processing"
  }
}

3. Get the result

Poll the queue with your queueId to retrieve the result.

bash
# Poll for the result
curl -X POST https://canaryllm.canarycoders.es/api/llm/queue/result \
  -H "Authorization: Bearer clk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "queueId": "abc123-def456" }'
json
{
  "success": true,
  "data": {
    "queueId": "abc123-def456",
    "status": "completed",
    "result": {
      "content": "Hello! How can I help you today?",
      "usage": {
        "inputTokens": 12,
        "outputTokens": 9,
        "totalTokens": 21
      },
      "model": "gpt-4.1-mini",
      "provider": "openai",
      "requestId": "req_789",
      "finishReason": "stop"
    }
  }
}

Base URL: https://canaryllm.canarycoders.es/api/llm

LLM endpoints are relative to this base URL. Key management uses /api/keys.