API Documentation

Complete reference for all TIAMAT endpoints

Authentication & Payment

Free tier requests need no authentication. Paid requests require a USDC payment on Base.

HeaderFormatDescription
X-Payment0x... (66 hex chars)Transaction hash of USDC transfer to TIAMAT wallet
X-Payment-ProofSame as aboveAlias for X-Payment
AuthorizationBearer 0x...Tx hash as bearer token

Wallet: 0xdc118c4e1284e61e4d5277936a64B9E08Ad9e7EE • Chain: Base (8453) • Token: USDC • Payment page

POST /summarize

Summarize text into 2-4 concise sentences.

FieldDetails
Price$0.01 USDC • Free: 3/day per IP (text < 2000 chars)
ModelGroq llama-3.3-70b-versatile
Rate limitNone (paid), 3/day (free)

Request

POST https://tiamat.live/summarize
Content-Type: application/json

{"text": "Your text to summarize..."}

Response (200)

{"summary": "Concise 2-4 sentence summary.",
 "text_length": 1240,
 "charged": false,
 "free_calls_remaining": 0,
 "model": "groq/llama-3.3-70b"}

Error (402 — Payment Required)

{"error": "Payment required",
 "payment": {
   "protocol": "x402",
   "chain": "Base (Chain ID 8453)",
   "token": "USDC",
   "recipient": "0xdc118c...e7EE",
   "amount_usdc": 0.01
 },
 "pay_page": "https://tiamat.live/pay"}

cURL Examples

# Free tier
curl -X POST https://tiamat.live/summarize \
  -H "Content-Type: application/json" \
  -d '{"text": "Your long text here..."}'

# Paid (with tx hash)
curl -X POST https://tiamat.live/summarize \
  -H "Content-Type: application/json" \
  -H "X-Payment: 0xYOUR_TX_HASH" \
  -d '{"text": "Any length text..."}'

POST /generate

Generate algorithmic art (1024x1024 PNG).

FieldDetails
Price$0.01 USDC • Free: 3/day per IP
Stylesfractal glitch neural sigil emergence data_portrait

Request

POST https://tiamat.live/generate
Content-Type: application/json

{"style": "fractal", "seed": 42}

Both fields optional. Default style: fractal. Seed: random if omitted.

Response (200)

{"image_url": "https://tiamat.live/images/1234_fractal.png",
 "style": "fractal",
 "charged": false,
 "free_images_remaining": 0}

cURL

curl -X POST https://tiamat.live/generate \
  -H "Content-Type: application/json" \
  -d '{"style": "neural"}'

POST /chat

Streaming chat with Groq llama-3.3-70b. Returns text/event-stream.

FieldDetails
Price$0.005 USDC • Free: 5/day per IP
Max input2000 chars
Max output1024 tokens

Request

POST https://tiamat.live/chat
Content-Type: application/json

{"message": "Hello, TIAMAT",
 "history": [
   {"role": "user", "content": "Previous message"},
   {"role": "assistant", "content": "Previous response"}
 ]}

history is optional. Omit for single-turn.

Response

Streams plain text (mimetype text/event-stream). Read until connection closes.

cURL

curl -N -X POST https://tiamat.live/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Explain quantum computing in one paragraph"}'

Memory API (memory.tiamat.live)

Persistent memory for AI agents. Requires an API key (X-API-Key header).

EndpointMethodDescription
/api/keys/registerPOSTGet a free API key (instant)
/api/memory/storePOSTStore a memory with tags & importance
/api/memory/recallGETSemantic search (FTS5) — ?query=...&limit=5
/api/memory/learnPOSTStore knowledge triple (subject/predicate/object)
/api/memory/listGETList recent memories — ?limit=10&offset=0
/api/memory/statsGETUsage statistics for your key

Free: 100 memories, 50 recalls/day. Paid: $0.05 USDC/1000 ops. Full docs

Error Codes

CodeMeaning
200Success
400Bad request — missing or invalid fields
402Payment required — free tier exhausted, include tx hash
500Internal server error

POST /verify-payment

Check a tx hash before using it in an API call.

POST https://tiamat.live/verify-payment
Content-Type: application/json

{"tx_hash": "0x...", "amount": 0.01}

Response

{"valid": true,
 "reason": "Payment verified",
 "amount_usdc": 0.01,
 "sender": "0x..."}