Cookbook
Token-by-token SSE with the OpenAI SDK.
from openai import OpenAI
client = OpenAI(api_key="$RUNAII_API_KEY",
base_url="https://api.runaii.cloud/v1")
for chunk in client.chat.completions.create(
model="runaii/glm-5.3",
messages=[{"role": "user", "content": "Hello!"}],
stream=True):
print(chunk.choices[0].delta.content or "", end="")Tools schema works on fn-calling models (e.g. glm-5.3).
resp = client.chat.completions.create(
model="runaii/glm-5.3",
messages=[{"role": "user", "content": "What GPUs are cheapest?"}],
tools=[{"type": "function",
"function": {"name": "get_pricing",
"parameters": {"type": "object",
"properties": {}}}},
tool_choice="auto")Qwen3 embeddings + cross-encoder rerank — endpoints not live yet.
# Not yet available — /v1/embeddings and /v1/rerank # do not exist today (both 404). The models are listed in # the catalog but have no served endpoint yet; dedicated # endpoints are rolling out. Until then, do retrieval # client-side and call the chat models directly.
Simulated console demo today — jobs are not processed or billed.
# console → Batch API → submit job # demo only: jobs are simulated, nothing is processed, # no results are produced, and nothing is billed. # A production batch path (and any batch pricing) # is not live yet.
Never wake up to a surprise bill.
# console → Settings # hard spend limit ($) → over-limit calls get 402 # low-credit alerts via email + webhook (credit.low)
HMAC-SHA256 over the raw body.
import hmac
sig = hmac.new(WHSEC.encode(), raw_body, "sha256").hexdigest()
assert hmac.compare_digest("sha256=" + sig,
headers["X-Runaii-Signature"])