- Python
- Node.js
Next Steps
Quickstart
Minimal setup to make your first KiosAPI request in under a minute.
Concurrency
Scale up to thousands of parallel requests using asyncio and aiohttp.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Learn to configure the OpenAI Python or Node.js SDK for KiosAPI — swap base URL and API key to access all chat models including Claude and Gemini.
pip install openai
import openai
openai.api_key = "sk-xxx"
openai.base_url = "https://kiosapi.com/v1/"
base_url must include the /v1/ suffix with a trailing slash. Omitting it will result in 404 Not Found errors on every request.import openai
openai.api_key = "sk-xxx"
openai.base_url = "https://kiosapi.com/v1/"
response = openai.chat.completions.create(
model="gpt-4o-mini",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Write a haiku about the ocean."},
],
)
print(response.choices[0].message.content)
stream=True and iterating over the returned chunks:import openai
openai.api_key = "sk-xxx"
openai.base_url = "https://kiosapi.com/v1/"
stream = openai.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Tell me a story."}],
stream=True,
)
for chunk in stream:
content = chunk.choices[0].delta.content
if content:
print(content, end="", flush=True)
npm install openai
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "sk-xxx",
baseURL: "https://kiosapi.com/v1/",
});
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "sk-xxx",
baseURL: "https://kiosapi.com/v1/",
});
async function main() {
const response = await client.chat.completions.create({
model: "gpt-4o-mini",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: "Write a haiku about the ocean." },
],
});
console.log(response.choices[0].message.content);
}
main();
model parameter and keep the same client configuration.