🐍
Python SDK
SDKQubax is fully OpenAI-compatible, so you can use the official openai Python SDK. Point the client at the Qubax base URL, supply your API key, and every chat completion, streaming, and embedding call works unchanged.
Official docsInstall
Shell
pip install openaiQuickstart
Python
from openai import OpenAI
client = OpenAI(
base_url="https://api.qubax.ai/v1",
api_key="YOUR_API_KEY",
)
response = client.chat.completions.create(
model="gpt-5",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain quantum entanglement in one sentence."},
],
)
print(response.choices[0].message.content)Setup steps
- 1
Install the SDK
Run pip install openai in your terminal or virtual environment. Python 3.8+ is required.
- 2
Create the client
Import OpenAI and instantiate it with base_url set to https://api.qubax.ai/v1 and api_key set to your Qubax key (starts with qbx_live_).
- 3
Make a request
Call client.chat.completions.create() with a model (e.g. gpt-5) and a list of messages. Streaming and embeddings work identically to OpenAI.
ℹ️
You can also configure the client with environment variables: OPENAI_API_KEY and OPENAI_BASE_URL.
💡
Use AsyncOpenAI for non-blocking workloads such as web servers or concurrent fan-out.
Test your connection
Paste your Qubax API key and send a live request to verify everything is wired up. Don't have a key yet?
Create one in the dashboard