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.

Peris.ai Router gives you one OpenAI-compatible endpoint in front of ASIX-hosted models (such as DeepSeek V4 Flash, JiuTian 75B and Qwen 3 Coder Next) and other providers' models. Every model can be a fallback for any other. 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 Peris.ai Router host (for example https://perisairouter.my.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.

Prefer Google? Click Continue with Google on /signup instead (when your Peris.ai Router host has it turned on); later, use it on /login to sign in. No password is needed. For a company organization, tick I'm signing up as a company and type the company name first; the Google button waits until the name is filled in.

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 at Rp 0.

Open Credits in the sidebar. If the balance is Rp 0, top up there: Buy credit pays through Midtrans (transfer, virtual account, card, QRIS or e-wallet), or use the sales contact on that page. 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 perisai_router_sk_... and are 49 characters. Peris.ai Router 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 PERISAI_ROUTER_API_KEY="perisai_router_sk_..."
export PERISAI_ROUTER_BASE_URL="https://<your-host>/v1"

cURL

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

Python (pip install openai)

import os
from openai import OpenAI

client = OpenAI(base_url=os.environ["PERISAI_ROUTER_BASE_URL"], api_key=os.environ["PERISAI_ROUTER_API_KEY"])

stream = client.chat.completions.create(
    model="perisairouter/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.PERISAI_ROUTER_BASE_URL, apiKey: process.env.PERISAI_ROUTER_API_KEY });

const stream = await client.chat.completions.create({
  model: "perisairouter/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("PERISAI_ROUTER_BASE_URL")),
		option.WithAPIKey(os.Getenv("PERISAI_ROUTER_API_KEY")),
	)

	stream := client.Chat.Completions.NewStreaming(context.TODO(), openai.ChatCompletionNewParams{
		Model:    "perisairouter/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
perisairouter/auto Recommended. Picks the best available model for each request (vision for images, tool-capable for tools, strong for code and reasoning, fast for short chat, ASIX for Indonesian) and falls back to the next best. Billed at the price of the model that answers
perisairouter/auto:code, :reasoning, :summarize, :translate, :extract-json, :chat, :chat-id perisairouter/auto with the task named, when you already know it. Only the model is picked
perisairouter/auto:low, :medium, :high, or a task and a tier like perisairouter/auto:code:low perisairouter/auto within a price band: the cheaper half, all, or the dearer half
perisairouter/smart Best quality. DeepSeek V4 Flash (ASIX), then Claude Sonnet 4.5, then GPT-5
perisairouter/fast Lowest latency
perisairouter/cheap Lowest cost
ASIX-hosted models (DeepSeek V4 Flash, JiuTian 75B, Qwen 3 Coder Next, ...) Served in Indonesia, marked Local on /models. Their ids follow what ASIX has deployed, so take them from /models or GET /v1/models, for example deepseek/deepseek-v4-flash
openai/gpt-5, openai/gpt-5-astra Models from other providers, called directly. Like every model, each can also be a fallback

With perisairouter/auto, the response headers x-perisai-router-served-by and x-perisai-router-task tell you which model answered and what kind of task it read the request as. To keep it to cheaper models, add "libra": {"cost_tier": "low"} to the request body (high for the dearer half; medium or nothing for all). Later turns of a conversation stay on the model that answered the first one, so the voice of the answers doesn't change mid-conversation; add "libra": {"sticky": false} to rank every turn on its own.

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

Next steps

  • Use it from your editor - Cursor, 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 perisai_router_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).