Documentation
sylphx.ai exposes an OpenAI-compatible API. If your code already uses the OpenAI SDK, you need to change exactly one line.
Overview
The sylphx.ai gateway serves the Lumen model family — four first-party, continuously-improving models — behind a single OpenAI-compatible API. We implement the OpenAI Chat Completions API, so any client library that targets OpenAI — in any language — works with sylphx.ai without modification beyond the base URL and key.
- ✓Full OpenAI Chat Completions API compatibility (/v1/chat/completions)
- ✓Server-sent events streaming
- ✓Multi-turn conversation support
- ✓System prompts, tool use, and vision inputs
- ✓Session-aware cache affinity for faster multi-turn conversations
Authentication
Pass your sylphx.ai API key in the Authorization header as a Bearer token. You can generate and manage API keys from your dashboard.
Authorization: Bearer YOUR_SYLPHX_API_KEY Content-Type: application/json
SYLPHX_API_KEY).Base URL
https://api.sylphx.ai/v1
All endpoints are relative to this base URL. For example, the chat completions endpoint is POST https://api.sylphx.ai/v1/chat/completions.
Quick Start
Three steps to your first response:
- 1Get your API key from your dashboard.
- 2Point your OpenAI client at the sylphx.ai base URL,
https://api.sylphx.ai/v1. - 3Make your first request, naming a Lumen model id such as
sylphx/lumen.
The example below uses sylphx/lumen, the default tier. Swap in any id from the Model IDs table.
import OpenAI from "openai"
const client = new OpenAI({
apiKey: process.env.SYLPHX_API_KEY,
baseURL: "https://api.sylphx.ai/v1",
})
async function main() {
const response = await client.chat.completions.create({
model: "sylphx/lumen",
messages: [
{
role: "user",
content: "Explain the difference between LLMs and diffusion models.",
},
],
})
console.log(response.choices[0].message.content)
}
main()Streaming
sylphx.ai supports server-sent events (SSE) streaming via the standard OpenAI SDK. Pass stream: true to receive chunks as they arrive.
import OpenAI from "openai"
const client = new OpenAI({
apiKey: process.env.SYLPHX_API_KEY,
baseURL: "https://api.sylphx.ai/v1",
})
const stream = await client.chat.completions.create({
model: "sylphx/lumen-flash",
messages: [
{ role: "user", content: "Write a recursive Fibonacci in TypeScript." }
],
stream: true,
})
for await (const chunk of stream) {
const content = chunk.choices[0]?.delta?.content
if (content) {
process.stdout.write(content)
}
}Resumability
Most streaming APIs give you no way to recover a dropped response — a network blip, a deploy, or a proxy timeout throws away the partial output and you start the request over from scratch. sylphx.ai journals every stream so you can pick up exactly where you left off, using standard SSE reconnection semantics rather than a bespoke protocol.
Every streaming response returns an x-sylphx-resume-token header. If the connection drops mid-stream, reissue the same request with two headers: that resume token, and a Last-Event-ID set to the id of the last event you successfully processed. You get back everything generated after that point — and if the original response hadn't finished, a clean signal telling you so, so you can retry without guessing.
# Every streaming response returns a resume token: x-sylphx-resume-token: <token> # If the connection drops, replay the SAME request with two headers — # the resume token, plus the id of the last event you processed: Authorization: Bearer YOUR_SYLPHX_API_KEY x-sylphx-resume-token: <token> Last-Event-ID: 42
Model IDs
The Lumen family is four tiers of one continuously-improving engine, each tuned to a different quality-and-cost curve. Pass the id as the model field in your request.
| Model | Model ID | Built for |
|---|---|---|
| Lumen Flash | sylphx/lumen-flash | Interactive apps, chat surfaces, high-volume light work |
| Lumen | sylphx/lumen | Everyday agentic work |
| Lumen Pro | sylphx/lumen-pro | Complex agentic work, planning, hard reasoning |
| Lumen Ultra | sylphx/lumen-ultra | Research, critique, the decisions that matter |
Error Codes
sylphx.ai returns standard OpenAI-format error responses. HTTP status codes follow REST conventions.
| Status | Meaning |
|---|---|
| 401 | Invalid or missing API key |
| 403 | Key does not have access to this model |
| 404 | Model not found |
| 429 | Rate limit exceeded — retry with backoff |
| 502 | Temporary internal routing error — retried automatically |
| 503 | The engine is temporarily unable to serve any lane — retry with backoff |