Sign inGet started

Docs

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

LangChain

Overview

Any framework built on the OpenAI SDK works unchanged.

You need a LIBRA API key (libra_sk_...) from the console (API keys > Create key), and the base URL https://<your-host>/v1.

Installation

  1. pip install langchain-openai

Configure LIBRA

from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="libra/smart", base_url="https://<your-host>/v1", api_key="libra_sk_...")
print(llm.invoke("Siapa kamu?").content)

Quick start (up and running in 5 minutes)

  1. Install, paste the snippet, run it.
  2. Open Usage in the console: the call is there with its IDR cost.

FAQ

  • 404 / timeout? The base URL is missing /v1 or has an extra /chat/completions. Use exactly https://<your-host>/v1.
  • Model not found? Model ids are case-sensitive and must match the console Models page, e.g. libra/smart or asix-deepseek-v4/deepseek-v4-flash.
  • 401? The key is wrong, disabled or expired. 402? Your organization balance is Rp 0; see Credits.
  • 403 model_not_allowed? The key's guardrails block that model. Ask your workspace Admin or pick another model.