API Documentation
Simplio provides OpenAI-compatible API endpoints — chat completions, embeddings, and model listing. Use your existing OpenAI SDK or any HTTP client — just swap the base URL and API key.
Quick Start
Make your first API call in seconds. Replace sk_simplio_YOUR_KEY with your Master Key from the dashboard.
curl https://simpliodev.vercel.app/api/v1/chat/completions \
-H "Authorization: Bearer sk_simplio_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "Hello, world!"}
]
}'Authentication
All requests require a Bearer token in the Authorization header.
Authorization: Bearer sk_simplio_YOUR_MASTER_KEY
Generate your Master Key in the Dashboard. Your key is shown once — store it securely. We only store a SHA-256 hash.
Endpoint
/api/v1/chat/completionsFully compatible with the OpenAI Chat Completions API. Use any OpenAI SDK — just change the base URL.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "sk_simplio_YOUR_KEY",
baseURL: "https://simpliodev.vercel.app/api/v1",
});
const response = await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Hello!" }],
});Request Format
Standard OpenAI Chat Completions request body:
{
"model": "gpt-4o", // optional — defaults to gpt-4o
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "What is 2+2?"
}
],
"temperature": 0.7, // optional, 0-2
"max_tokens": 1000, // optional
"stream": true // always true (SSE)
}Supported Models
Response Format
Responses are Server-Sent Events (SSE) in OpenAI format, regardless of the underlying provider:
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1700000000,"model":"gpt-4o","choices":[{"index":0,"delta":{"content":"Hello"},"finish_reason":null}]}
data: {"id":"chatcmpl-abc123","object":"chat.completion.chunk","created":1700000000,"model":"gpt-4o","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: [DONE]Streaming
All responses are streamed as SSE. Anthropic responses are automatically transformed into OpenAI-compatible format.
const response = await fetch(
"https://simpliodev.vercel.app/api/v1/chat/completions",
{
method: "POST",
headers: {
"Authorization": "Bearer sk_simplio_YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "gpt-4o",
messages: [{ role: "user", content: "Hi!" }],
}),
}
);
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
// Parse SSE lines: "data: {...}"
console.log(chunk);
}Embeddings
/api/v1/embeddingsGenerate vector embeddings for text. OpenAI-compatible — use the same SDK methods you already know. Embeddings require an OpenAI API key configured in the dashboard.
Supported Embedding Models
| Model | Dimensions | Cost / 1K tokens |
|---|---|---|
text-embedding-3-small | 1536 | $0.00002 |
text-embedding-3-large | 3072 | $0.00013 |
text-embedding-ada-002 | 1536 | $0.0001 |
Request Format
{
"model": "text-embedding-3-small",
"input": "Hello world" // string or string[]
"encoding_format": "float", // optional
"dimensions": 256 // optional
}Response Format
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [0.0023, -0.0094, ...]
}
],
"model": "text-embedding-3-small",
"usage": { "prompt_tokens": 2, "total_tokens": 2 }
}Examples
curl
curl https://simplio.dev/api/v1/embeddings \
-H "Authorization: Bearer sk_simplio_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "text-embedding-3-small", "input": "Hello world"}'Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="sk_simplio_YOUR_KEY",
base_url="https://simplio.dev/api/v1",
)
response = client.embeddings.create(
model="text-embedding-3-small",
input="Hello world",
)
print(response.data[0].embedding[:5])Node.js (OpenAI SDK)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "sk_simplio_YOUR_KEY",
baseURL: "https://simplio.dev/api/v1",
});
const response = await client.embeddings.create({
model: "text-embedding-3-small",
input: "Hello world",
});
console.log(response.data[0].embedding.slice(0, 5));Models
/api/v1/modelsList all models available to your account. Returns models based on which provider API keys you have configured in the dashboard.
Response Format
{
"object": "list",
"data": [
{
"id": "gpt-4o",
"object": "model",
"created": 1715367049,
"owned_by": "openai"
},
...
]
}Example
curl https://simplio.dev/api/v1/models \ -H "Authorization: Bearer sk_simplio_YOUR_KEY"
Code Examples
Simplio is OpenAI-compatible — use any language or SDK. Just swap the base URL and API key.
Python (requests)
import requests
response = requests.post(
"https://simplio.dev/api/v1/chat/completions",
headers={
"Authorization": "Bearer sk_simplio_YOUR_KEY",
"Content-Type": "application/json",
},
json={
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello!"}],
},
stream=True,
)
for line in response.iter_lines():
if line:
text = line.decode("utf-8")
if text.startswith("data: ") and text != "data: [DONE]":
print(text[6:])Python (OpenAI SDK)
from openai import OpenAI
client = OpenAI(
api_key="sk_simplio_YOUR_KEY",
base_url="https://simplio.dev/api/v1",
)
stream = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")Node.js (OpenAI SDK)
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "sk_simplio_YOUR_KEY",
baseURL: "https://simplio.dev/api/v1",
});
const stream = await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Hello!" }],
stream: true,
});
for await (const chunk of stream) {
const content = chunk.choices[0]?.delta?.content;
if (content) process.stdout.write(content);
}API Reference
Request body parameters for POST /api/v1/chat/completions
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | No | gpt-4o | Model to use |
messages | array | Yes | — | Array of message objects ({role, content}) |
temperature | number | No | Provider default | Sampling temperature (0–2) |
max_tokens | number | No | 4096 | Maximum tokens in response |
stream | boolean | No | true | Always true (SSE streaming) |
Maximum request body size: 100 KB. Requests exceeding this limit receive a 413 response.
Headers
Optional Request Headers
| Header | Description |
|---|---|
Idempotency-Key | Unique key to prevent duplicate requests (cached 5 min) |
X-Simplio-No-Eco | Set to "true" to skip Eco-mode and use the default provider for this request (Pro) |
Response Headers
| Header | Description |
|---|---|
x-trace-id | Unique request identifier for debugging |
x-provider | Provider used (openai, deepseek, anthropic) |
x-model | Model used for the request |
x-fallback | "true" if Smart Fallback was triggered |
x-ratelimit-limit | Total requests allowed in current window |
x-ratelimit-remaining | Remaining requests in current window |
x-ratelimit-reset | Unix timestamp when limit resets |
Error Codes
| Code | Meaning |
|---|---|
400 | Invalid request body or missing messages |
401 | Missing, invalid, or deactivated API key |
413 | Request body too large (max 100KB) |
402 | Provider unavailable (upgrade to Pro for fallback) |
403 | API key has been deactivated |
422 | No provider keys configured in dashboard |
429 | Rate limit exceeded (burst or monthly quota) |
500 | Internal server error |
502 | All providers unavailable — try again later |
All errors return JSON with a trace_id for debugging:
{
"error": {
"message": "Invalid API key",
"type": "simplio_error",
"code": 401,
"trace_id": "abc123-def456"
}
}Rate Limits
| Limit | Free | Pro |
|---|---|---|
| Burst (per second) | 5 req/s | 50 req/s |
| Monthly quota | 20,000 req/mo | Unlimited |
| Smart Fallback | - | Included |
| Eco-mode | - | Included |
Features
Eco-mode
When enabled, requests are automatically routed to DeepSeek (up to 18x cheaper) instead of OpenAI GPT-4o. Toggle it in the dashboard — no code changes needed. Pro feature.
For critical requests where you need the original provider, send the X-Simplio-No-Eco: true header to skip Eco-mode routing on a per-request basis.
curl ... -H "X-Simplio-No-Eco: true"
Smart Fallback
If your primary provider (OpenAI) fails, Simplio automatically retries with a fallback provider (Anthropic). The switch is transparent — your client never sees provider-specific errors. Check the x-fallback response header to detect when fallback was used. Pro feature.
Idempotency
Include an Idempotency-Key header to prevent duplicate requests. Cached responses are returned for 5 minutes.
curl ... -H "Idempotency-Key: my-unique-key-123"
Troubleshooting
Getting 401 Unauthorized?
Check that your API key starts with sk_simplio_ and is correctly included in the Authorization header. If it still fails, regenerate your key in the dashboard — the old one may have been deactivated.
Getting 422 Unprocessable Entity?
This means your provider API key (OpenAI, Anthropic, etc.) is missing or was rejected. Go to the dashboard and add or re-save your provider keys.
Getting 429 Too Many Requests?
You've hit a rate limit. Free tier allows 5 req/s burst and 20,000 req/month. Wait for the Retry-After period or upgrade to Pro for higher limits.
Getting 402 Payment Required?
Your primary provider is down and Smart Fallback is a Pro feature. Upgrade to Pro for automatic failover to a backup provider.
Responses seem slow?
Check the x-fallback response header. If it says "true", your request was routed to a fallback provider because the primary was unavailable. This may add latency.
Getting 413 Request Too Large?
The request body exceeds the 100KB limit. Reduce the number or length of messages in your request.
OpenAPI Specification
The complete API specification is available as an OpenAPI 3.1 document. Use it to generate client SDKs, import into Postman, or integrate with any OpenAPI-compatible tool.