Quickstart

Four 1-minute walkthroughs. Pick the one that matches what you're building.

Prerequisites

  1. Sign up at platform.epithre.com and verify your email. You get Rp50,000 of free credit on first verification.
  2. Create an API key at platform.epithre.com/#/keys. Copy it once and store it somewhere safe (we hash it server-side, so we can't show it again).
  3. Install the openai SDK (or use any HTTP client):
pip install openai
# or
npm install openai

1. Chat completion (30 seconds)

Send a message, get a reply.

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["EPITHRE_KEY"],
    base_url="https://api.epithre.com/v1",
)

resp = client.chat.completions.create(
    model="epithre-omni",
    messages=[
        {"role": "system", "content": "Kamu asisten yang menjawab dengan singkat dan akurat."},
        {"role": "user", "content": "Apa ibu kota provinsi DI Yogyakarta?"},
    ],
)
print(resp.choices[0].message.content)
# -> "Yogyakarta (kota Yogyakarta atau sering disingkat Jogja)."

epithre-omni is the default flagship model. Use epithre-prme for long-context reasoning (200K), epithre-lyt for fast cheap chat. See the model selection guide.

2. Embedding (45 seconds)

Convert text to 4000-dimensional vectors for semantic search or RAG.

texts = [
    "Saham pertambangan turun setelah harga batu bara melemah",
    "Bank Indonesia menahan suku bunga acuan di 5.75%",
    "Resep gulai kepala ikan khas Padang",
]

resp = client.embeddings.create(
    model="epithre-embed",
    input=texts,
)

import numpy as np
vecs = np.array([d.embedding for d in resp.data])
print(vecs.shape)  # (3, 4000)

Embeddings are L2-normalized. For cosine similarity, just dot-product two vectors. To shrink storage, pass dimensions=1024 for Matryoshka-truncated 1024-dim vectors. See the embeddings reference.

3. Image generation (1 minute)

import base64
resp = client.images.generate(
    model="epithre-iris",
    prompt="warung kopi pinggir jalan Jakarta malam hari, cinematic photo",
    size="768x768",
)
img_bytes = base64.b64decode(resp.data[0].b64_json)
open("warkop.png", "wb").write(img_bytes)

Default 4 steps for fast preview (~12-19s). Crank up to num_steps=20-30 for final renders. Use lora="dark" or lora="anime" for style. See image reference.

4. Batch processing (90 seconds)

Submit thousands of requests at a 50% discount, get results within 24 hours (most batches complete in minutes).

import json

# Build a JSONL of requests
with open("batch.jsonl", "w") as f:
    for i, text in enumerate(my_corpus):
        f.write(json.dumps({
            "custom_id": f"doc-{i}",
            "method": "POST",
            "url": "/v1/embeddings",
            "body": {"model": "epithre-embed", "input": [text]},
        }) + "\n")

# Upload input file
input_file = client.files.create(
    file=open("batch.jsonl", "rb"),
    purpose="batch_input",
)

# Create batch
batch = client.batches.create(
    input_file_id=input_file.id,
    endpoint="/v1/embeddings",
    completion_window="24h",
)

# Poll status (or use a webhook, see /reference/webhooks)
import time
while batch.status not in ("completed", "failed"):
    time.sleep(5)
    batch = client.batches.retrieve(batch.id)

# Download output
out = client.files.content(batch.output_file_id)
for line in out.text.splitlines():
    r = json.loads(line)
    if r["error"] is None:
        emb = r["response"]["body"]["data"][0]["embedding"]
        # ... store in your DB

50% off chat / embed / rerank tokens via batch. See batches reference.

Where to go next