OpenUI Gateway
OpenUI Gateway provides a unified API to access models across different providers through a single endpoint. It adds reliability to OpenUI Lang generation with automatic failover and model-output correction.
import OpenAI from "openai";
const gateway = new OpenAI({
apiKey: process.env.THESYS_API_KEY,
baseURL: "https://api.thesys.dev/v1/embed",
});
const completion = await gateway.chat.completions.create({
model: "openai/gpt-5",
messages: [
{ role: "user", content: "Compare quarterly revenue by region." },
],
stream: true,
});import OpenAI from "openai";
const gateway = new OpenAI({
apiKey: process.env.THESYS_API_KEY,
baseURL: "https://api.thesys.dev/v1/embed",
});
const response = await gateway.responses.create({
model: "openai/gpt-5",
input: "Compare quarterly revenue by region.",
stream: true,
});Choose an API
Chat Completions
Keep the standard messages format when integrating an existing OpenAI-compatible application.
Responses API
Build stateful model interactions with persistent conversations and hosted tools.
What OpenUI Gateway provides
- Validated generated UI. Validates generated UI during the stream and fixes malformed syntax, invalid component usage, and schema violations before forwarding the response.
- Unified API. Switch between providers and models with minimal code changes.
- High reliability. Automatically retries requests with other providers if one fails.
- No markup on tokens. Tokens cost the same as they would from the provider directly, with zero markup, including with Bring Your Own Key (BYOK).