Build with Astrea

The Astrea API is OpenAI-compatible: if your code already talks to an OpenAI-style endpoint, point it at our base URL, swap the model name, and it works — streaming included.

Base URLhttps://api.altworld.io/v1
Modelastrea
AuthAuthorization: Bearer aw_live_…
Context32,768 tokens

Get a key

Keys are self-serve at altworld.io/developer: sign in with your Altworld account, create a key (shown once), and load prepaid credits with your card — $5 minimum, and credits never expire. Usage bills per token from your balance at the rates on the pricing page; when the balance runs out, requests return 402 until you top up.

First request

curl

curl https://api.altworld.io/v1/chat/completions \
  -H "Authorization: Bearer $ASTREA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "astrea",
    "messages": [{"role": "user", "content": "Open a story in a lighthouse, first person, no cliches."}],
    "stream": true
  }'

Python (openai SDK)

from openai import OpenAI

client = OpenAI(
    base_url="https://api.altworld.io/v1",
    api_key="aw_live_...",
)

stream = client.chat.completions.create(
    model="astrea",
    messages=[{"role": "user", "content": "Open a story in a lighthouse, first person, no cliches."}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="", flush=True)

JavaScript (fetch)

const res = await fetch("https://api.altworld.io/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.ASTREA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "astrea",
    messages: [{ role: "user", content: "Open a story in a lighthouse, first person, no cliches." }],
  }),
});
const data = await res.json();
console.log(data.choices[0].message.content);

How Astrea is different to prompt

  • No system channel. Astrea answers bare conversations. If you send a system message at the start, we fold it into your first user turn — it works, but plain user instructions are the native path. A system message anywhere else is rejected.
  • The defaults are the tuned settings. Requests run at temperature 0.8, min_p 0.025, repetition_penalty 1.08 — the configuration every published benchmark number was measured at. Override only if you know what you want; drop temperature to ~0.2 for factual back-and-forth.
  • The last message must be from the user. Assistant prefill isn't supported yet.
  • Ask for length. Astrea follows length instructions unusually well ("about 300 words", "one paragraph") — say what you want instead of relying on max_tokens cutoffs.
  • Ask for style, too. The same obedience applies to prose style: "plain prose, no em-dashes, no closing moral" visibly changes how it writes. One-shot "write me a story" requests lean on its most generic storyteller voice — a line of style direction gets you its best register.

Full details — every parameter, streaming format, errors, rate limits — live in the API reference.