Sypnia AI documentation
Sypnia AI is the layer between your app and the AI models. One key and one API reach many models, from OpenRouter and from AWS, and you choose the right one for each task. Every call is paid with credits, shown under the use case that made it, kept inside the limits you set, and sent to Telemetry as part of the case’s trace. Your keys never reach a browser.
Make your first call
Name the task, not the model. Sypnia AI picks the model for it, charges the call to your credits and files it under the use case.
npm install @sypnia/aiimport { createAI } from '@sypnia/ai/server';
const ai = createAI({ apiKey: process.env.SYPNIA_SECRET_KEY! });
const { text } = await ai.chat({
task: 'write',
case: 'publish-bread-of-the-day',
messages: [{ role: 'user', content: 'Today: rye loaf and almond croissants.' }],
});Or let your agent do it
Models, routes, usage and recent calls are in the API. Your agent reads them through MCP and drafts route changes; a person applies them.
claude mcp add --transport http sypnia-ai https://mcp.ai.sypnia.comOur provider accounts, paid with credits
Use Sypnia AI in Sypnia Cloud
- Models fromSypnia’s accounts, zero-retention providers only; or your own key, which Sypnia does not charge for.
- Paid withPrepaid credits, shown by project, case, key and person.
- LogsSpans in your project’s Telemetry, inside the case’s trace.
Open source, with your own OpenRouter or AWS account
Run the open-source gateway with your own keys
- Models fromYour OpenRouter key, AWS account or any OpenAI-compatible endpoint.
- Paid withYour provider’s bill; the gateway counts it for you.
- LogsSpans to any OpenTelemetry endpoint, Telemetry included.
Sypnia Cloud runs the same open-source gateway, plus Sypnia’s provider accounts, the console, usage in credits and the limits of your organization. Compare the two, line by line
The map
Every page says whether it is about the gateway, Sypnia Cloud or both.
-
What Sypnia AI is, how it works, what is open source and what is Sypnia Cloud, and the quickstarts.
-
How you choose a model for each task, where models come from, and what happens when one is down.
-
Chat and streaming, tools and structured answers, images and files, embeddings, the browser, and use cases.
-
What each call spends, how to see it, the limits you set, budgets per case and per person, and caching.
-
What is kept and for how long, content checks, prompt injection, and what goes to Telemetry.
-
The @sypnia/ai package, the ai command and the MCP tools for agents.
-
The AI API: addresses, authentication, the Sypnia headers, errors and limits.
-
How Sypnia AI is built: the gateway's parts, where Rust runs, and how they connect.
-
Run the open-source gateway yourself, with your own OpenRouter key, AWS account or a model on your own machine.
-
Keys, the threat model and the checklist.
-
Projects, what is measured in credits, and plans.
-
Glossary, limits, design decisions, common questions and the changelog.
Written for people and for coding agents. Every page is also plain Markdown: add .md to its address, or use the «Copy page for your agent» button. Agents can start from the index.