Skip to main content
KiosAPI is fully compatible with the official OpenAI SDK. Swap in your KiosAPI base URL and API key, and every line of existing code continues to work — no other changes required. You get instant access to all chat models KiosAPI offers, including non-OpenAI models.

Installation

Install the OpenAI Python package with pip:

Configuration

Set your API key and point the base URL at KiosAPI:
The base_url must include the /v1/ suffix with a trailing slash. Omitting it will result in 404 Not Found errors on every request.

Chat Completion

Send a basic chat completion request using the configured client:

Streaming

Enable streaming by passing stream=True and iterating over the returned chunks:
Every chat model on KiosAPI — including Claude and Gemini — works with the OpenAI SDK. You do not need a separate SDK for non-OpenAI model families. Change only the model parameter and keep the same client configuration.

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.