Docs

Getting started

If your code already speaks to an OpenAI-compatible API, this is a two-line change: the base URL and the key.

OpenAI-compatible Two-line change SSE streaming What's new · 16/10/2026 →

Quick start

Three steps to a live request.

Start right away — no system migration. Change just a few lines.

  1. 01

    Create a key

    In the member portal, under API keys. The key is shown once — we store only a hash of it, so we cannot show it to you again or recover it for you.

  2. 02

    Point your client at us

    Set the base URL to our endpoint and use your key as the API key. Model names come from GET /v1/models.

  3. 03

    Streaming

    Server-sent events work exactly as you expect — tokens arrive as they are produced, not batched at the end.

Example

A minimal request

Same shape as the OpenAI Chat Completions API — model, messages, and the usual sampling parameters, though some models ignore some of them. stream: true switches the response to server-sent events on the same endpoint.

python
# pip install openai
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.ic-lueur.ai/v1",
    api_key=os.environ["LLMR_API_KEY"],
)

resp = client.chat.completions.create(
    model="gpt-5-mini",
    messages=[{"role": "user", "content": "Sawasdee!"}],
)

Connect your tools

Connect your tools to IC Lueur Ai

Use a Base URL and API key to connect any tool that supports the OpenAI API — set up in just a few steps and start right away.

Base URL
https://api.ic-lueur.ai/v1
API Key

Create or manage API keys in Member Portal → API Keys

Connect your AI coding tools with one Base URL and API Key

  1. 1 Install Roo Code from the VS Code Marketplace (RooVeterinaryInc.roo-cline)
  2. 2 Click the Roo Code icon in the Activity Bar
  3. 3 Open Settings → set API Provider to OpenAI Compatible
  4. 4 Paste the Base URL and your API key
  5. 5 Type a model name (e.g. claude-sonnet-4-6) and click Save
Roo Code also works inside Windsurf and VSCodium — same install flow.

Roo Code sidebar showing the API Provider dropdown set to OpenAI Compatible

Disconnecting doesn't cancel the bill

Set stream: true and read the response as server-sent events, same shape as OpenAI's Chat Completions streaming.

  1. 1
    Send request Include stream: true
  2. 2
    Open connection Keep the HTTP connection open
  3. 3
    Streaming server-sent events arrive as tokens
  4. 4
    Done Stream ends with [DONE]

Format

Standard server-sent events — the same chunked data: format and termination OpenAI's streaming responses use. The model field in each chunk shows the model name you requested.

Disconnecting early

Tokens already generated before you close the connection are still billed. An interrupted request is metered the same as a completed one.

What a failed request looks like

Errors use the same shape as OpenAI's, {"error": {"message": "<message>"}}, with the HTTP status. The type and code values do not always match OpenAI's, so branch on the HTTP status and the message text instead.

400 Bad Request

The requested model has no configured deployment (check the model name against GET /v1/models), or the request sets a field this gateway does not accept: extra_body, kwargs, litellm_params or custom_llm_provider. Send model options as top-level fields — the OpenAI SDKs already do this with their own extra_body.

401 Unauthorized

The key is missing, unknown, or has been revoked.

402 Insufficient Balance

Your account balance is too low to cover this request. The message states the balance in THB.

403 Forbidden

The organization has been suspended, the key is an operator/master key (which cannot be billed for inference), or the key’s creator has reached a daily or monthly spend limit set by the organization’s owner or admin.

413 Payload Too Large

The prompt is too large to qualify for a free-model promotion window (see Free-model promotions below).

429 Rate Limit

This key has exceeded its requests-per-minute limit. Wait for the Retry-After header, when present, and read the message before retrying.

429 covers several conditions. If your retry logic needs to tell them apart, match on how the message starts, not on the status code alone, and match case-sensitively: the key's own rate limit starts with rate limit exceeded: in lower case; a region that is temporarily unavailable starts with no region available; the three free-model-promotion limits below start with QUOTA_EXCEEDED, REQUEST_LIMIT_EXCEEDED or RATE_LIMIT_EXCEEDED in capitals.

RATE_LIMIT_EXCEEDEDQUOTA_EXCEEDEDREQUEST_LIMIT_EXCEEDED
503 Service Unavailable

Our internal key store is unreachable, or the model has no price configured yet. We fail closed rather than let an unverifiable key or an unpriced request through.

Free-model-of-the-week

Any model can carry a temporary free window — same request, no charge, while it lasts.

Rate limit

15 requests / min per key

Separate from your key's own rate limit, and usually tighter

Weekly quota

1,000,000 tokens or 1,000 requests

Per organisation, whichever is hit first

Quota resets

Every Monday

00:00, Asia/Bangkok time

Max prompt size

32,000 tokens

Over this, the request is refused outright — never billed instead

Max output size

16,000 tokens

Capped automatically; a smaller max_tokens you set is still honoured

When the quota runs out

Blocked until Monday

Unless you turn on auto-fallback in the member portal (Top-up settings)

See what's free right now in the pricing catalogue — filter by "Free" there.

Every request follows your organisation’s routing policy.

Your organisation has one routing policy, which our team sets for you on request. A new key takes it when it is created and it is enforced on every call; changing the policy later does not change keys created before. Read the note below first — it says where requests are actually served from today.

Where requests run today

Most requests are served from Singapore (ap-southeast-1) and Tokyo (ap-northeast-1). Some models are only offered in a provider’s global region, which can be outside Asia, for example the United States, and organisations on the available policy can also reach providers in mainland China. Your account data, balance, billing ledger and tax invoices are stored on AWS in Thailand regardless of which region served the request.

strict
Bangkok only, never another region. No model is served from Bangkok yet, so requests under strict are currently refused with a 400.
regional
The default. The nearest region is tried first — Bangkok, then Singapore, then Tokyo — and a model not served in any of them goes to the provider’s global region, which can be outside Asia.
available
Only for organisations that ask for it in writing. Reaches everything regional does plus providers in mainland China, and is required for image and video models served outside Bangkok, Singapore and Tokyo.

Top up credit and get a Thai tax invoice

Every request is paid from your organisation’s prepaid THB credit. Top up in the member portal under Credit Wallet; the credit is added once the payment is confirmed.

Topping up

Who can top up
The organisation’s owner and admins. Other members can send them a top-up request from the portal.
Amount
At least ฿300, in baht with up to two decimals. That amount is the credit you get; 7% VAT is added on top when you pay.
How to pay
PromptPay QR (the default) or credit / debit card. A QR is valid for 30 minutes, and the portal checks the payment status for you.
Paid but no credit
Upload a photo of the bank slip on that top-up. Our staff check it against the bank’s record before adding the credit — a slip never adds credit on its own.

Tax invoices and withholding tax

Every top-up
Give a buyer name and email and you get an abbreviated tax invoice.
Full tax invoice
Choose a full tax invoice when you top up, then give the 13-digit tax ID, whether the buyer is an individual or a juristic person, and the address. A juristic person also gives its 5-digit branch code — 00000 for head office, otherwise the branch name as well.
Withholding tax (3%)
For organisation (B2B) accounts. Pay the full amount, then the owner or an admin claims back the 3% in the portal: upload the withholding tax certificate (50 Tawi) as an image or PDF of up to 10 MB and pick the top-ups it covers — one certificate can cover several. Only paid top-ups of ฿1,000 or more before VAT qualify, and the 3% is worked out on the amount before VAT. Once our staff approve the claim, the 3% is added to your credit.

Ready-made assistants for everyday work

An assistant is a task you set up once — categorize an expense, summarize an email, sort a review, pull fields out of a message. You pick the task, a name and a model, and we keep the instructions. Your system then calls it by name, app/your-name, in any program that takes an OpenAI-style model field.

Create one in the portal

  1. Choose a task. Start from a ready-made task — categorize expenses, summarize a document or email, sort customer feedback into praise, complaint or question, or extract a name, phone number, amount and date as structured data — or start from scratch and write your own instructions.
  2. Name it. Give it a display name and a call name made of a–z, 0–9 and -, 3–40 characters. The call name becomes app/<name> and cannot be changed later, because your systems refer to it.
  3. Choose a model. Models are labelled economy, balanced or best, with an estimated cost per 1,000 typical calls, so you can compare them without knowing what a token is. You can change the model later.
  4. Try it, then connect it. Send a real message from the Try it tab (billed like any call), then copy the Base URL and call name from the Connect tab into your system.

Call it

Use the same base URL and API key as any other request, and put the assistant’s name where the model goes. Send only the text for it to work on — the stored instructions are added in front for you.

python
resp = client.chat.completions.create(
    model="app/accounting-helper",
    messages=[{"role": "user", "content": "Taxi to see a client, 250 baht"}],
)
print(resp.choices[0].message.content)

Good to know

Who sets them up
Owners and admins create, edit, switch off and delete assistants in the portal. Other members can use and try them.
Change it without touching your system
The model and the instructions live with us. Edit them in the portal and the next call uses the new version. Every edit is saved as a version you can go back to.
What you pay
Per token at the chosen model’s price, exactly as if you called that model yourself. The stored instructions and examples count as input tokens on every call, so shorter instructions cost less. There is no extra fee for using an assistant.
What you send
Your messages go after the stored instructions. The length of the answer is capped at the lower of the assistant’s own limit and the max_tokens you send. When the assistant sets a temperature or an output format, the assistant wins, not the request.
Structured data (JSON)
An assistant set to return JSON always answers in the structure defined for it, and can only use a model that supports structured output.
Listing and usage
GET /v1/models includes your organization’s assistants, as app/<name>, next to the models. Fetching a single one with GET /v1/models/app/<name> is not supported. The portal’s Usage page shows which assistant each request went through.

Errors specific to assistants

404 No such assistant

The name is wrong, the assistant is switched off or deleted, or it belongs to another organization. The answer is the same for all of these on purpose. After you create or switch one on, allow up to about 30 seconds. Nothing is charged.

No assistant named … exists for this organisation.
400 Not a chat request

An assistant only works with chat completions: the request must carry a messages list. Nothing is charged.

… is an assistant and can only be used with the chat completions endpoint …
503 Temporarily unavailable

The assistant exists but its stored definition could not be applied. We never run the request without its instructions, so nothing is charged; try again shortly.

… is temporarily unavailable. Please try again shortly.

Errors come back as {"error": {"message": …}} with the HTTP status. Balance (402) and rate-limit (429) errors are exactly as above.

Latest updates

What changed in recent releases

  1. New

    AI assistants and receipts by email

    • AI assistants: a new menu in the member portal to create ready-made assistants you call by name (`app/<name>`) instead of wiring up models yourself. A step-by-step wizard walks you through creating one.
    • Built-in guides on the assistants page, with starter examples and a try-it-out box, plus connection guides for n8n and Make.
    • Use an assistant from Google Sheets: a step-by-step guide with a ready-made script you paste into your sheet, so you can call an assistant from a cell formula.
  2. NewImprovedFixed

    Customer reviews and linked sign-in accounts

    • Customer reviews: write a review of the service from the member portal (one per month); approved reviews appear on the home page.
    • Linked sign-in accounts on your profile: see which Google or Microsoft account is connected, and disconnect it after confirming your password.
    • Security history now also lists failed sign-in and two-factor attempts.
See all updates →

Ready for a real request.

Create a key, then check per-model rates before you commit spend.