Streaming 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
Gateway v2 is live — one endpoint, every model, streaming tool-calls. Read the changelog
Each recipe is tested against the live gateway and includes the telemetry you should watch afterwards.
for chunk in client.chat.completions.create( model="zeph-nexus-4", messages=msgs, stream=True, ): print(chunk.choices[0].delta.content, end="")
tools=[{
"type": "function",
"function": { "name": "read_file",
"strict": True,
"parameters": schema } }]
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)])
{
"model": "zeph-nexus-4",
"fallbacks": ["novalab-mix-70b",
"zeph-small-2"],
"max_retries": 2
}
client.chat.completions.create( model="novalab-mix-70b", messages=msgs, metadata={ "feature": "support-reply", "tenant": tenant_id, })
verdict = client.chat.completions.create( model="nova-guard-8b", messages=[{"role":"user", "content": user_text}], response_format={"type":"json_object"})
route = classify(text, model="zeph-small-2") if route.confidence < 0.72: answer = complete(text, model="zeph-nexus-4")
job = client.batches.create( input_file_id=upload("repo.jsonl"), endpoint="/v1/chat/completions", completion_window="24h") # 50% discount, results in ≤24h
const ranked = await client.rerank.create({ model: "lumen-embed-v3", query, documents: candidates.slice(0, 50), top_n: 6, });
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}}]}])
usage = client.usage.retrieve( start="2026-11-01", end="2026-11-30") if usage.spend_usd > 40: alerts.fire("budget-80")
plan := Plan(goal, "orbital-reasoner-r1") for _, step := range plan.Steps { out := Run(step, "zeph-nexus-4") if !Verify(out) { Retry(step) } }
Try another language or task filter.
| Recipe | Languages | Task | Models | Watch metric | |
|---|---|---|---|---|---|
| Streaming chat with retries | Python Node | Chat | zeph-nexus-4 | TTFT p50 | Open |
| Strict tool calling | Python Go | Agents | zeph-nexus-4 | Tool error rate | Open |
| RAG with citations | Python Node | RAG | lumen-embed-v3 · nexus-4 | Groundedness | Open |
| Failover chains | All | Ops | fallbacks[] | Failover rate | Open |
| Cost attribution by feature | Python Node | Ops | metadata | Cost / feature | Open |
| Moderation before generation | Python cURL | Ops | nova-guard-8b | p50 latency | Open |
| Classify → escalate routing | Python Node | Chat | zeph-small-2 → nexus-4 | Cost / ticket | Open |
| 24h batch processing | Python cURL | Ops | /v1/batch | Job completion | Open |
| Rerank before answering | Node Go | RAG | lumen-embed-v3 | Recall@6 | Open |
| PDF page → answer | Python cURL | Chat | helix-vision-pro | $ / page | Open |
| Budget guard in code | Python Node | Ops | /v1/usage | spend_usd | Open |
| Plan → verify agent loop | Go cURL | Agents | r1 → nexus-4 | Completion % | Open |
Tell us the pattern you're trying to build — we add recipes weekly and credit the author.
Acciones rápidas
No hay coincidencias: pruebe con "claves", "precios" o "uso".