Design-partner phase. The public
api.schneeai.comendpoint is activated at general availability. To run the examples below today, request design-partner access at [email protected] — we will issue a partner-specific endpoint and API key. Replacehttps://api.schneeai.comin the examples with your partner endpoint.
Pinning a model. The examples below pin
"model": "gpt-4o-mini"— a concrete alias from the Model Directory that the catalog resolves today."model": "auto"— where SchneeAI’s router picks based on routing policy — is on the roadmap; see Failover design for the routing and failover roadmap. For now, replacegpt-4o-miniwith any alias the catalog seeds (gpt-4o,claude-sonnet-4,claude-haiku,gemini-2.5-pro,gemini-2.5-flash,deepseek-chat,deepseek-reasoner, or theschneeai-flash/schneeai-standard/schneeai-protiers).
Prerequisites
- A SchneeAI account and API key. Email [email protected] to request design-partner access.
- Any HTTP client. The examples below use
curl, Python 3.9+, and TypeScript 5+.
Step 1 — Your first request
The Gateway exposes an OpenAI-compatible endpoint at POST /v1/chat/completions. The simplest call:
The model field accepts any alias from the Model Directory. During the design-partner stage, pin a specific alias such as gpt-4o-mini. "model": "auto" — where SchneeAI’s router picks based on routing policy — is on the roadmap; see Failover design for the routing and failover roadmap.
Response shape (abridged):
The model field echoes what the router actually selected. The request_id is your trace handle for support.
Step 2 — Stream tokens as they arrive
For chat UIs, streaming is essential. Set stream: true and the Gateway returns Server-Sent Events (SSE).
Python
=
continue
=
break
=
=
TypeScript (browser / Node 18+)
;
;
;
;
while true
Step 3 — Use a named prompt
Hardcoded prompts rot. Register a prompt in the PromptOps UI, version it, then call it by name:
SchneeAI resolves the active version of support-reply, fills in {{user_message}} and {{tone}}, applies the registered model and parameters, and returns the completion. See the Prompt Template Library for prompt patterns that work well across models.
Step 4 — Handle errors correctly
Network calls fail. Production code must:
- Retry only on 429, 500, 502, 503, 504.
- Honor
Retry-Afterwhen present. - Send
Idempotency-Keyso retries do not double-charge.
pass
=
return
Full error code reference, retry rules, and idempotency details: Error Handling.
Step 5 — Track cost and usage
Every response includes a usage object. SchneeAI records structured usage server-side too, queryable via GET /v1/usage:
To estimate cost before sending, paste your prompt into the Token Counter, then pass the resulting token count to the Cost Calculator.
Next steps
- Model Directory — every model SchneeAI routes to, with effective pricing.
- Prompt Template Library — copy-ready prompts for summarization, RAG, code review, and more.
- Migration tutorial — moving from the OpenAI or Anthropic SDK? The client-side diff in Python, TypeScript, and curl.
- Error Handling — the full error reference.
- API Reference — the complete API spec (coming soon).
Interactive version coming: a CodeMirror-based playground where you can edit and run each snippet live in the browser is on the roadmap. Today, copy any block into your terminal or editor to run it.