Quancisuancis

Start

Quickstart

Create a key, check your balance, and send your first request in a few minutes.

  1. 1

    Create an API key

    Sign in, open API keys, choose New Key, name it, and choose Create Key. Copy the secret straight away. It starts with sk-quan- and is shown only once.

  2. 2

    Check your balance

    Kael is prepaid. A request is refused with a 402 error when your balance is $0 or below. Your balance is on the dashboard. To add credit, see Pricing and billing.

  3. 3

    Send a request

    Use the OpenAI SDK you already have, or plain HTTP. Only the base URL and the model name change. Kael also speaks the Anthropic Messages format; the last tab shows it.

    curl https://api.quancis.space/v1/chat/completions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer $QUAN_API_KEY" \
      -d '{
        "model": "kael-beta",
        "messages": [
          {"role": "user", "content": "What is wrong with this loop? for i in range(len(xs) + 1): total += xs[i]"}
        ]
      }'

Read the response

The answer is in choices[0].message.content. The usage object shows exactly what you were billed for: prompt_tokens in, completion_tokens out, and how many input tokens were served from cache.

Response
{
  "id": "...",
  "object": "chat.completion",
  "created": 1790000000,
  "model": "kael-beta",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The range goes one step too far: ..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 38,
    "completion_tokens": 214,
    "total_tokens": 252,
    "prompt_cache_hit_tokens": 0
  }
}

Next