Documentation · Quickstart

Getting started

Quickstart

From sign-up to your first model response in five steps and a couple of minutes.

1. Get a key#

Sign up and create a key under API keys. Keys start with sk-flua- and are shown only once — store yours right away.

2. Put the key in an environment variable#

export FLUA_API_KEY="sk-flua-..."

3. Install an SDK#

The official OpenAI SDK is all you need — there is no separate library.

pip install openai

4. Send your first request#

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.flua.ink/v1",
    api_key=os.environ["FLUA_API_KEY"],
)

response = client.chat.completions.create(
    model="claude-opus-5-5",
    messages=[
        {"role": "user", "content": "Hi! What can you do?"},
    ],
)
print(response.choices[0].message.content)
To switch models, change only model — for example gpt-6-astra or gemini-3.8-flash. Every id is in the model catalog.

5. Turn on streaming#

With stream=true the answer arrives in chunks over Server-Sent Events, so you can show text to users immediately.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.flua.ink/v1",
    api_key=os.environ["FLUA_API_KEY"],
)

response = client.chat.completions.create(
    model="claude-opus-5-5",
    messages=[
        {"role": "user", "content": "Hi! What can you do?"},
    ],
    stream=True,
)
for chunk in response:
    print(chunk.choices[0].delta.content or "", end="")

What the response looks like#

200 OK
{
  "id": "chatcmpl-9f1d70b0849e47e7",
  "object": "chat.completion",
  "model": "claude-opus-5-5",
  "choices": [
    {
      "index": 0,
      "message": { "role": "assistant", "content": "Hi! I can…" },
      "finish_reason": "stop"
    }
  ],
  "usage": { "prompt_tokens": 14, "completion_tokens": 96, "total_tokens": 110 }
}

The usage field holds exactly the tokens you are billed for.