Quickstart

In about five minutes, you’ll mint an API key, create a book from a one-line premise, generate its outline, write the first chapter, and publish it to a public URL — all from the command line.

1. Mint an API key

  1. Sign in to Anthra at /signin.
  2. Open /account/api-keys.
  3. Name the key (e.g. “Quickstart — laptop”), check the scopes books:write, generation:run, and publish:write, then click Create key.
  4. Copy the token (it starts with ant_live_) — this is the only time it will be shown.
export ANTHRA_TOKEN="ant_live_…paste here…"
export ANTHRA_BASE="https://anthra.vercel.app/api/v1"

2. Create a book

curl -X POST "$ANTHRA_BASE/books" \
  -H "authorization: Bearer $ANTHRA_TOKEN" \
  -H "content-type: application/json" \
  -d '{
    "premise": "A travel memoir about a year spent walking the old salt roads of southern Europe.",
    "genre": "Memoir",
    "modelTier": "sonnet"
  }'

The response includes a book id. Save it:

export BOOK_ID="…uuid…"

3. Generate the outline

This is synchronous (10–60s). When it returns, the book has a title, subtitle, description, cover color, and a seeded list of chapters.

curl -X POST "$ANTHRA_BASE/books/$BOOK_ID/outline" \
  -H "authorization: Bearer $ANTHRA_TOKEN"

4. Write the first chapter

The write endpoint streams the prose back as text/plain and persists the chapter when the stream closes. Pipe it straight to a file:

# Get the first chapter id from the outline response, or list them:
CH_ID=$(curl -s "$ANTHRA_BASE/books/$BOOK_ID" \
  -H "authorization: Bearer $ANTHRA_TOKEN" \
  | python -c "import sys,json; print(json.load(sys.stdin)['data']['chapters'][0]['id'])")

curl -N -X POST "$ANTHRA_BASE/books/$BOOK_ID/chapters/$CH_ID/write" \
  -H "authorization: Bearer $ANTHRA_TOKEN"

Keep calling /write for each chapter in order — the writer uses the tail of the previous chapter for continuity.

5. Publish

curl -X POST "$ANTHRA_BASE/books/$BOOK_ID/publish" \
  -H "authorization: Bearer $ANTHRA_TOKEN" \
  -H "content-type: application/json" \
  -d '{ "publish": true, "visibility": "unlisted" }'

The response includes readerUrl — share it.

Next

  • Generation endpoints — narration, rewrite, and what each scope unlocks.
  • MCP setup — wire Anthra into Claude Desktop, Cursor, or Claude Code so the same operations run from chat.