FlameAILog in

Developer API

OpenAI compatible. Base URL:

Chat completions

POST /v1/chat/completions or POST /api/v1/chat/completions

List the models you can use with GET /v1/models. Some models use more tokens per reply, shown as cost. Browse them at /models.

curl /v1/chat/completions \
  -H "Authorization: Bearer flame_sk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"MODEL_ID","messages":[{"role":"user","content":"Hello"}]}'

Python

import requests
r = requests.post("/v1/chat/completions",
    headers={"Authorization": "Bearer flame_sk_YOUR_KEY"},
    json={"model": "MODEL_ID", "messages": [{"role": "user", "content": "Hello"}]})
print(r.json()["choices"][0]["message"]["content"])

Get a key

Create an account at /plans, then press Create key. The key is shown once, so copy it. All your keys share your account balance.

Balance and usage

Every reply uses tokens from your key's balance. When the balance reaches zero the API answers 402 insufficient_quota. Check it any time:

GET /api/v1/account   returns balance, unlimited, total_tokens, orders

Buying packs from code

GET  /api/v1/packs                      packs on sale (no key needed)
POST /api/v1/orders                     {"pack_id":"builder"}  returns UPI payment details
POST /api/v1/orders/{id}/utr            {"utr":"123456789012"}

Each request is capped at a maximum number of output tokens set by the owner, and keys have a per-minute limit. Streaming is supported with "stream": true.