SwymbyAI speaks the OpenAI API. Anything that can talk to OpenAI — SDKs, LangChain, n8n, your own agent loop — connects by changing two settings: the base URL and the API key.
| Base URL | https://api.llm.jasv.online/v1 |
|---|---|
| API key | sk-YOUR-API-KEY |
| Models | qwen-tiny, qwen-small (depends on your tier) |
Your key is on the dashboard. Check which models your tier includes:
curl https://api.llm.jasv.online/v1/models \ -H "Authorization: Bearer sk-YOUR-API-KEY"
Python, with the official OpenAI SDK (pip install openai):
from openai import OpenAI
client = OpenAI(
base_url="https://api.llm.jasv.online/v1",
api_key="sk-YOUR-API-KEY",
)
r = client.chat.completions.create(
model="qwen-tiny",
messages=[{"role": "user", "content": "Ahoj! Introduce yourself."}],
)
print(r.choices[0].message.content)Node.js (npm install openai):
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.llm.jasv.online/v1",
apiKey: "sk-YOUR-API-KEY",
});
const r = await client.chat.completions.create({
model: "qwen-tiny",
messages: [{ role: "user", content: "Ahoj! Introduce yourself." }],
});
console.log(r.choices[0].message.content);Streaming works the standard way — pass stream: true and iterate the chunks.
An agent is just a loop: the model answers or asks to use a tool; you run the tool and feed the result back. Here is a complete, runnable one:
import json
from openai import OpenAI
client = OpenAI(base_url="https://api.llm.jasv.online/v1",
api_key="sk-YOUR-API-KEY")
def get_time(city: str) -> str:
return f"In {city} it is 14:32." # your real tool goes here
TOOLS = [{
"type": "function",
"function": {
"name": "get_time",
"description": "Get the current local time in a city",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"],
},
},
}]
messages = [{"role": "user", "content": "What time is it in Prague?"}]
while True:
r = client.chat.completions.create(
model="qwen-small", messages=messages, tools=TOOLS)
msg = r.choices[0].message
messages.append(msg)
if not msg.tool_calls: # model answered — done
print(msg.content)
break
for call in msg.tool_calls: # model wants tools — run them
args = json.loads(call.function.arguments)
result = get_time(**args)
messages.append({
"role": "tool",
"tool_call_id": call.id,
"content": result,
})LangChain — use the OpenAI chat model with a custom endpoint:
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
base_url="https://api.llm.jasv.online/v1",
api_key="sk-YOUR-API-KEY",
model="qwen-small",
)
print(llm.invoke("Three facts about Brno, one line each.").content)n8n — add an OpenAI credential, set its Base URL to https://api.llm.jasv.online/v1 and paste your key. Every OpenAI node (Chat Model, AI Agent) then runs against SwymbyAI.
Anything else (LlamaIndex, Vercel AI SDK, Continue, Open WebUI, …) — look for “OpenAI-compatible” or “custom base URL” in its settings; the same two values work everywhere.
| 429 rate limit | You exceeded your tier's requests/min or tokens/min. Back off and retry; upgrade the tier for more. |
|---|---|
| Budget exceeded | Monthly plans include a token credit; when it's burned the API returns an error until the 30-day window resets. |
| 403 model access | Your tier doesn't include that model — check /v1/models. |
| Context length | Demo models accept ~2k tokens per request. Keep agent histories short, or summarize old turns. |
Every request is metered per token — watch live spend on your dashboard, or experiment first in the playground.