Syok AI

Quickstart

Syok AI gives you one OpenAI-compatible endpoint in front of every AI provider you've connected. When one runs out of free credits or hits a rate limit, the next one answers automatically. Your code doesn't change.

How Syok AI works

  1. You bring your own keys. For example Gemini, Groq, Mistral, OpenRouter or Cloudflare Workers AI, which all have free tiers.
  2. Syok AI puts them in order, either your order or cheapest first.
  3. It sends each request to the first provider that can take it.
  4. If a provider fails because of a rate limit, no credit, or being down, it automatically retries on the next one.

You pay each provider directly on your own key. Syok AI only charges for the switching service.

Your Syok AI endpoint runs as a personal worker in your own Cloudflare account. It's created automatically the first time you sign in, and your keys and chats stay there.

1. Connect providers

  1. Open the Syok AI app and sign in with Cloudflare. A free Cloudflare account works.
  2. On Providers, click Connect next to a provider. The guide opens that provider's key page for you.
  3. Paste the key, click Test, then Save.
  4. Connect at least 2 or 3 providers so there's always a backup. A good free set is Gemini + Groq + Mistral + Cloudflare Workers AI.

2. Get a developer key

  1. In the app, open the menu and choose Developer API.
  2. Switch the Developer API on.
  3. Click Create key. Copy it straight away: it starts with syk_ and is shown only once.
  4. Copy your Base URL from the same page. It looks like https://…workers.dev/v1.
Keep your key secret. Put it in an environment variable. Never put it in website code or a public GitHub repo. Keys don't work from web pages (no CORS) on purpose.

In the examples below, replace https://YOUR-SYOK-URL/v1 with your Base URL, and SYOK_API_KEY with your key.

Call the API directly

Send a POST to /chat/completions in the standard OpenAI format. Use the model syok-auto and Syok AI picks the provider.

import os, requests

r = requests.post(
    "https://YOUR-SYOK-URL/v1/chat/completions",
    headers={"Authorization": f"Bearer {os.environ['SYOK_API_KEY']}"},
    json={
        "model": "syok-auto",
        "messages": [{"role": "user", "content": "What is the meaning of life?"}],
    },
)
print(r.json()["choices"][0]["message"]["content"])
print("Answered by:", r.headers.get("X-Syok-Provider"))

Supported request fields:

Using the OpenAI SDK

Syok AI speaks the OpenAI API, so the official OpenAI SDKs work as a drop-in replacement. Only the base_url and the key change.

# pip install openai
import os
from openai import OpenAI

client = OpenAI(base_url="https://YOUR-SYOK-URL/v1", api_key=os.environ["SYOK_API_KEY"])

completion = client.chat.completions.create(
    model="syok-auto",
    messages=[{"role": "user", "content": "What is the meaning of life?"}],
)
print(completion.choices[0].message.content)

Streaming

Set "stream": true to get a standard Server-Sent Events stream, for tools that require one. Syok AI waits until one provider has finished the whole answer before it starts sending. That way a provider switch halfway through can never mix two answers together.

stream = client.chat.completions.create(
    model="syok-auto",
    messages=[{"role": "user", "content": "Write a haiku about the ocean"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

Tool calling

Tool (function) calling uses the standard OpenAI tools format:

  1. Your code describes the tools.
  2. The AI replies with tool_calls.
  3. Your code runs the tools and sends back the results.

Syok AI skips providers that can't do tool calling and fails over between the ones that can.

tools = [{
    "type": "function",
    "function": {
        "name": "get_weather",
        "description": "Get the current weather in a city",
        "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]},
    },
}]

r = client.chat.completions.create(
    model="syok-auto",
    messages=[{"role": "user", "content": "What's the weather in London?"}],
    tools=tools,
)
print(r.choices[0].message.tool_calls)

Keeping one AI per chat

By default each request goes to the best available provider. To keep the same AI for a whole conversation, so the tone and style stay consistent, send a conversation ID. Syok AI then tries the provider that answered last time first, and only switches if that one fails.

client.chat.completions.create(
    model="syok-auto",
    messages=history,
    extra_headers={"X-Syok-Conversation": "chat-123"},
)

You can also pass it as metadata.conversation_id, or use the OpenAI user field. Long conversations are trimmed from the oldest messages so they fit each AI. Your system message and the latest message are always kept.

Response headers

HeaderMeaning
X-Syok-ProviderWhich provider answered, e.g. Groq
X-Syok-ModelThe exact model that answered
X-Syok-FallbacksHow many providers were skipped before this one answered (0 = the first one worked)
X-Syok-Request-IdA request ID (req_…). Include it when you contact support.

Models

GET /models lists the models your key can use. Today that's syok-auto, which means "route across my connected providers". Your provider order and the cheapest-first setting in the app decide which provider is tried first.

curl https://YOUR-SYOK-URL/v1/models -H "Authorization: Bearer $SYOK_API_KEY"

Frameworks & apps

Anything that lets you set an "OpenAI-compatible" base URL works with Syok AI. Use model syok-auto.

# pip install langchain-openai
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(model="syok-auto", base_url="https://YOUR-SYOK-URL/v1", api_key=os.environ["SYOK_API_KEY"])
print(llm.invoke("Hello!").content)

Other frameworks work the same way, including:

Point their OpenAI-compatible client at your Base URL.

Limits & key safety

LimitValue
Requests per minute, per key30
Daily cap, per keyYou set it (default 500, up to 10,000). Resets at midnight UTC.
Keys per accountUp to 5
Key lifetime30, 90 (default) or 365 days
Request size6 MB

Built-in protection:

Errors

Errors use the OpenAI error format: {"error": {"message", "type", "code"}}.

StatusCodeWhat to do
400invalid_request, invalid_jsonFix the request body (check messages)
401invalid_api_key, key_revoked, key_expiredUse a valid syk_ key, or create a new one
403api_disabledSwitch the Developer API on in the app
413request_too_largeSend less than 6 MB
429rate_limited, daily_limit_reachedWait (see Retry-After), or raise your daily cap
502upstream_errorEvery connected provider failed. Connect more providers or top up one of them.

Playground: files & skills

In the app's Playground, the 📎 paperclip opens a small menu with two choices.

Attach a file or picture

Skills & plugins

A skill is a set of standing instructions the AI follows in every Playground chat. To add one:

Turn each skill on or off with its switch. Skills that are on are sent as a system message, so they work with every provider.

---
name: Spanish customer replies
description: Reply to customers in friendly, simple Spanish
---
Always reply in simple, friendly Spanish.
Keep replies under 120 words and end with a helpful next step.

FAQ

Is Syok AI a model provider?

No. Syok AI routes your requests to providers using your own keys, and switches automatically when one runs out.

Does it cost extra per request?

No. There's no per-token markup. You pay the Syok AI subscription (after a 3-day free trial), plus whatever your providers charge on your own keys. Free tiers cost nothing.

Which providers are free?

Google Gemini, Groq, Mistral, OpenRouter's free models and Cloudflare Workers AI all have genuinely free API access, with no card needed. Stack several so you rarely run out.

Where is my data?

Your keys (encrypted) and chats are stored in your personal worker in your own Cloudflare account. See the Privacy Policy.

Need help?

Email support@syok-ai.com, or use the support chat in the app. Include the X-Syok-Request-Id if you have one.