Demo Dies ist eine schreibgeschützte Demo. Dokumentation ZephAI kaufen
New

Gateway v2 is live — one endpoint, every model, streaming tool-calls. Read the changelog

Cookbook

Recipes that already run in production

Each recipe is tested against the live gateway and includes the telemetry you should watch afterwards.

Language
Task
24 recipes · updated weekly

Streaming chat

chat
for chunk in client.chat.completions.create(
    model="zeph-nexus-4",
    messages=msgs, stream=True,
):
    print(chunk.choices[0].delta.content, end="")
Watch: TTFT p50 Recipe

Strict tool calling

agents
tools=[{
  "type": "function",
  "function": { "name": "read_file",
    "strict": True,
    "parameters": schema } }]
Watch: tool error rate Recipe

RAG with citations

rag
hits = client.embeddings.create(
  model="lumen-embed-v3", input=query)
answer = client.chat.completions.create(
  model="zeph-nexus-4",
  messages=[system_with_chunks(query, hits)])
Watch: groundedness Recipe

Failover & retries

ops
{
  "model": "zeph-nexus-4",
  "fallbacks": ["novalab-mix-70b",
               "zeph-small-2"],
  "max_retries": 2
}
Watch: failover rate Recipe

Cost attribution

ops
client.chat.completions.create(
  model="novalab-mix-70b",
  messages=msgs,
  metadata={
    "feature": "support-reply",
    "tenant": tenant_id,
  })
Watch: cost per feature Recipe

Moderation pipeline

ops
verdict = client.chat.completions.create(
  model="nova-guard-8b",
  messages=[{"role":"user",
             "content": user_text}],
  response_format={"type":"json_object"})
Watch: p50 (34 ms) Recipe

Classify then escalate

chat
route = classify(text, model="zeph-small-2")
if route.confidence < 0.72:
    answer = complete(text,
        model="zeph-nexus-4")
Watch: cost / ticket Recipe

Nightly batch sweep

ops
job = client.batches.create(
  input_file_id=upload("repo.jsonl"),
  endpoint="/v1/chat/completions",
  completion_window="24h")
# 50% discount, results in ≤24h
Watch: job completion Recipe

Rerank before answering

rag
const ranked = await client.rerank.create({
  model: "lumen-embed-v3",
  query,
  documents: candidates.slice(0, 50),
  top_n: 6,
});
Watch: recall@6 Recipe

Document → answer

chat
resp = client.chat.completions.create(
  model="helix-vision-pro",
  messages=[{"role":"user", "content":[
    {"type":"text","text":"Summarise"},
    {"type":"image_url","image_url":{"url":pdf_page}}]}])
Watch: $0.014 / page Recipe

Budget guard in code

ops
usage = client.usage.retrieve(
  start="2026-11-01", end="2026-11-30")
if usage.spend_usd > 40:
    alerts.fire("budget-80")
Watch: spend_usd Recipe

Plan → verify loop

agents
plan := Plan(goal, "orbital-reasoner-r1")
for _, step := range plan.Steps {
    out := Run(step, "zeph-nexus-4")
    if !Verify(out) { Retry(step) }
}
Watch: completion % Recipe
All recipes

24 recipes, index view

Recipe LanguagesTaskModelsWatch metric
Streaming chat with retriesPython NodeChatzeph-nexus-4TTFT p50Open
Strict tool callingPython GoAgentszeph-nexus-4Tool error rateOpen
RAG with citationsPython NodeRAGlumen-embed-v3 · nexus-4GroundednessOpen
Failover chainsAllOpsfallbacks[]Failover rateOpen
Cost attribution by featurePython NodeOpsmetadataCost / featureOpen
Moderation before generationPython cURLOpsnova-guard-8bp50 latencyOpen
Classify → escalate routingPython NodeChatzeph-small-2 → nexus-4Cost / ticketOpen
24h batch processingPython cURLOps/v1/batchJob completionOpen
Rerank before answeringNode GoRAGlumen-embed-v3Recall@6Open
PDF page → answerPython cURLChathelix-vision-pro$ / pageOpen
Budget guard in codePython NodeOps/v1/usagespend_usdOpen
Plan → verify agent loopGo cURLAgentsr1 → nexus-4Completion %Open
12 of 24 shown · the rest ship in the SDK example foldersSDK examples

Recipe not listed?

Tell us the pattern you're trying to build — we add recipes weekly and credit the author.