Sign inGet started

Docs

Quick start, editor setup and FAQ for the OpenAI-compatible API.

Quick Start

From zero to your first LLM response in about 10 minutes. You need an email address and either curl, Python or Node.js.

LIBRA gives you one OpenAI-compatible endpoint in front of ASIX-hosted models (DeepSeek V4 Flash, Jiu Tian) with Claude and GPT as fallback. You pay in IDR from a prepaid balance. Any client that speaks the OpenAI API works unchanged.


Step 1: Sign up and sign in

Go to /signup on your LIBRA host (for example https://libra.asix.id/signup).

  1. Enter your name, email and a password (8+ characters).
  2. Signing up on behalf of a company? Tick I'm signing up as a company and enter the company name. Otherwise a personal organization is created under your name.
  3. Click Create account. You are now the Owner of a new organization with one workspace called Default.

Already invited by a colleague? Open the link they sent (/join/<token>) instead; it puts you straight into their organization.

Sign in later at /login. Sessions last 30 days.

Limits: 5 signups per hour per network address; 10 failed logins per 15 minutes.

Step 2: Get credit

Every request is billed in IDR against your organization's prepaid balance. New organizations start with the platform's starter credit (may be 0).

Open Credits in the sidebar. If the balance is Rp 0, use the Contact sales details on that page to top up. Until credit is loaded, API calls return 402 insufficient_credits.

Step 3: Create an API key

  1. Open API keys in the sidebar and click Create key.
  2. Give it a name (for example my-laptop). Optionally set a budget, period and expiry.
  3. Click Create. The key is shown once. Copy it now.

Keys look like libra_sk_... and are 49 characters. LIBRA stores only a hash; if you lose the key, disable it and create a new one.

Keep the key secret. Never commit it, never put it in a browser. If it leaks, open API keys, click the key, Disable, and create a new one.

Step 4: Set the base URL

Your SDK / client Base URL Notes
OpenAI SDK (Python, Node, Go, ...) https://<your-host>/v1 SDK appends /chat/completions itself, so /v1 is required
Any OpenAI-compatible tool (Cursor, LangChain) https://<your-host>/v1 Same rule
Raw HTTP https://<your-host>/v1/chat/completions Full path

A wrong base URL is the most common integration mistake: if you get 404, check that the URL ends in /v1 and nothing else.

Step 5: Make your first call

Set the key as an environment variable, then pick a language.

export LIBRA_API_KEY="libra_sk_..."
export LIBRA_BASE_URL="https://<your-host>/v1"

cURL

curl "$LIBRA_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $LIBRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "libra/smart",
    "messages": [{"role": "user", "content": "Halo, siapa kamu?"}]
  }'

Python (pip install openai)

import os
from openai import OpenAI

client = OpenAI(base_url=os.environ["LIBRA_BASE_URL"], api_key=os.environ["LIBRA_API_KEY"])

stream = client.chat.completions.create(
    model="libra/smart",
    messages=[{"role": "user", "content": "Halo, siapa kamu?"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

Node.js (npm install openai)

import OpenAI from "openai";

const client = new OpenAI({ baseURL: process.env.LIBRA_BASE_URL, apiKey: process.env.LIBRA_API_KEY });

const stream = await client.chat.completions.create({
  model: "libra/smart",
  messages: [{ role: "user", content: "Halo, siapa kamu?" }],
  stream: true,
});
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta?.content ?? "");

Go (go get github.com/openai/openai-go)

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/openai/openai-go"
	"github.com/openai/openai-go/option"
)

func main() {
	client := openai.NewClient(
		option.WithBaseURL(os.Getenv("LIBRA_BASE_URL")),
		option.WithAPIKey(os.Getenv("LIBRA_API_KEY")),
	)

	stream := client.Chat.Completions.NewStreaming(context.TODO(), openai.ChatCompletionNewParams{
		Model:    "libra/smart",
		Messages: []openai.ChatCompletionMessageParamUnion{openai.UserMessage("Halo, siapa kamu?")},
	})
	defer stream.Close()

	for stream.Next() {
		chunk := stream.Current()
		if len(chunk.Choices) > 0 {
			fmt.Print(chunk.Choices[0].Delta.Content)
		}
	}
	if err := stream.Err(); err != nil {
		panic(err)
	}
}

You should see a streamed reply. Open Usage in the console to see the request, its cost in IDR and which model served it.

Step 6: Pick a model

Use an alias unless you need a specific model. Aliases route to the best available target and fall through automatically if a provider is down or killed.

Model id What it is
libra/smart Best quality. DeepSeek V4 Flash (ASIX), then Claude Sonnet 4.5, then GPT-5
libra/fast Lowest latency. Jiu Tian (ASIX) first
libra/cheap Lowest cost. Jiu Tian (ASIX) first
asix-deepseek-v4/deepseek-v4-flash DeepSeek V4 Flash, served through ASIX, 128k context
asix-jiutian/jiutian Jiu Tian, fast and low cost, served through ASIX
anthropic/claude-sonnet-4-5, openai/gpt-5, openai/gpt-5-astra Direct fallback models

The live list with prices is at /models (public) and GET /v1/models.

Next steps

  • Use it from your editor - Cursor, Claude Code, Codex, Cline, LangChain.

  • Try it in the browser first - Playground in the sidebar runs the same request with your key and shows the cost.

  • Add your team - Members > Invite. Admins manage one workspace; Members can only use keys.

  • Set limits - per-key budgets, workspace budgets and Guardrails (allowed models, max tokens, request logging).

  • Watch spend - Usage (by day, model, key) and Logs (when a key's guardrails enable request logging).

  • Full console manual: the console manual (docs/USER-GUIDE.md in the repository). API details and error codes: the API reference (docs/API.md in the repository).

Common errors

Status Code Fix
401 invalid_api_key, key_disabled, key_expired Check Authorization: Bearer libra_sk_...; create a new key if disabled or expired
402 insufficient_credits Organization balance is Rp 0. Top up via Credits
402 key_budget_reached, workspace_budget_reached Budget for the period is spent. Raise it or wait for the reset
403 model_not_allowed Key's guardrails block that model. Ask your workspace Admin
404 model_not_found Unknown model id. See /models
404 (HTML page) Base URL is wrong. It must end in /v1
429 rate_limited Slow down
502 all_providers_failed Every target in the chain failed. Retry, or try an alias

Full list in the API reference (docs/API.md in the repository).