CLI

Two commands. That is the whole tool.

The CLI reads LAZAPI_KEY from the environment, defaults to the gateway base URL, and prints raw JSON so it composes with jq.

CommandWhat it does
lazapi chatSends a prompt to a named model, streams or prints the reply
lazapi bench20 samples against one model, prints p50 latency and tok/s

Install

# pip
pip install lazapi

# or straight from the repo
git clone https://lazarus-th.duckdns.org/lazapi.git
cd lazapi && pip install -e .

Set the key

export LAZAPI_KEY=sk-...
export LAZAPI_BASE=https://lazarus-th.duckdns.org/v1

Chat

lazapi chat --model zai-org/GLM-5.3-Flash "explain paged attention in two lines"

# stream
lazapi chat --model deepseek-ai/DeepSeek-V4-Flash-0731 --stream "count to 50"

# raw JSON for jq
lazapi chat --model MiniMaxAI/MiniMax-M2.7 --json "hi" | jq '.usage'

Benchmark a route

lazapi bench --model zai-org/GLM-5.3-Flash --n 20 --tokens 512

model   zai-org/GLM-5.3-Flash
samples 20/20 ok
ttft    p50 0.31s  p95 0.48s
tok/s   112
cost    $0.0004 per call

Exit codes

  • 0 — the call succeeded and the body parsed
  • 1 — transport failure, no response
  • 2 — the gateway answered with an error object
  • 3 — the model was not in the key's allow-list