Docs

Ship in 60 seconds.

Simplex speaks the OpenAI Chat Completions dialect. If you've used the OpenAI SDK, you already know how to use us.

Quickstart

  1. Create a free account and copy your API key from the dashboard.
  2. Point your existing OpenAI SDK at https://api.simplex.ai/v1.
  3. Send a request. That's it.

Authentication

All requests require a bearer token. Never ship keys to the client — keep them on your server or in env vars.

bash
curl https://api.simplex.ai/v1/chat/completions \
  -H "Authorization: Bearer $SIMPLEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "simplex-structured-1",
    "messages": [{"role": "user", "content": "Say hi"}]
  }'

Chat completions

A minimal chat completion looks identical to OpenAI's.

ts
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.SIMPLEX_API_KEY,
  baseURL: "https://api.simplex.ai/v1",
});

const r = await client.chat.completions.create({
  model: "simplex-structured-1",
  messages: [{ role: "user", content: "Categorize: 'refund please'" }],
});

console.log(r.choices[0].message.content);

Structured outputs

Pass a JSON schema and Simplex guarantees a valid response — or a clean error. This is the primary use case; you'll get the best price and lowest latency here.

ts
const res = await client.chat.completions.create({
  model: "simplex-structured-1",
  messages: [
    { role: "system", content: "Extract order details." },
    { role: "user", content: "2 large pepperoni pizzas to 42 Main St" },
  ],
  response_format: {
    type: "json_schema",
    json_schema: {
      name: "order",
      schema: {
        type: "object",
        properties: {
          items: { type: "array", items: { type: "string" } },
          address: { type: "string" },
        },
        required: ["items", "address"],
      },
    },
  },
});

Rate limits

Every response carries standard rate-limit headers so your framework can back off cleanly.

http
x-ratelimit-limit-requests: 400000
x-ratelimit-remaining-requests: 398742
x-ratelimit-reset-requests: 2026-08-01T00:00:00Z

SDK examples

Python

py
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["SIMPLEX_API_KEY"],
    base_url="https://api.simplex.ai/v1",
)

resp = client.chat.completions.create(
    model="simplex-structured-1",
    messages=[{"role": "user", "content": "classify: spam or ham?"}],
)

Next.js Route Handler

ts
// app/api/classify/route.ts
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.SIMPLEX_API_KEY!,
  baseURL: "https://api.simplex.ai/v1",
});

export async function POST(req: Request) {
  const { text } = await req.json();
  const r = await client.chat.completions.create({
    model: "simplex-structured-1",
    messages: [{ role: "user", content: `Classify: ${text}` }],
  });
  return Response.json({ label: r.choices[0].message.content });
}

Bring your own endpoint (RunPod / vLLM)

Simplex runs on any OpenAI-compatible inference server. The default backend is a RunPod Serverless vLLM worker, but the same three environment variables point at a self-hosted vLLM, TGI, or SGLang deployment.

  1. Deploy a RunPod Serverless vLLM endpoint and note the endpoint ID.
  2. In Lovable Cloud, add these secrets:
    • MODEL_BASE_URL — e.g. https://api.runpod.ai/v2/<ENDPOINT_ID>/openai/v1
    • MODEL_API_KEY — your RunPod API key (or the --api-key for self-hosted vLLM)
    • MODEL_NAME — defaults to Qwen/Qwen2.5-14B-Instruct-AWQ
  3. Redeploy. Simplex will route /v1/chat/completions through your endpoint with a low default temperature (0.1) tuned for structured tasks.

For a self-hosted vLLM server, launch it with the OpenAI-compatible API and point MODEL_BASE_URL at https://your-host/v1:

bash
python -m vllm.entrypoints.openai.api_server \
  --model Qwen/Qwen2.5-14B-Instruct-AWQ \
  --quantization awq \
  --api-key $MODEL_API_KEY \
  --port 8000

If MODEL_BASE_URL is not set, Simplex returns a deterministic mock response so local development keeps working.