gpuos

Integration · SDK

OpenAI Python SDK with your own GPUs

Use the official openai package with your own GPUs by changing the base URL and the key.

Base URL
https://gpuos.si/v1
API key
gpuos_key_… from the dashboard
Model
a catalog id, e.g. qwen3-32b

Point the client at gpuos

The gpuos gateway speaks the OpenAI API, so the official openai package works as is. Set base_url to your gpuos endpoint and use a gpuos key.

Install
pip install openai
Chat completion
import os
from openai import OpenAI

client = OpenAI(base_url="https://gpuos.si/v1", api_key=os.environ["GPUOS_API_KEY"])

reply = client.chat.completions.create(
    model="qwen3-32b",
    messages=[{"role": "user", "content": "Write a haiku about GPUs."}],
)
print(reply.choices[0].message.content)

Create the key in API keys in your gpuos dashboard, and deploy the model first in Models. GET /v1/models lists what your workspace can call.

Streaming and embeddings

Python
stream = client.chat.completions.create(
    model="qwen3-32b",
    messages=[{"role": "user", "content": "Explain VRAM in two sentences."}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

vectors = client.embeddings.create(model="bge-m3", input=["first text", "second text"])

Errors come back in the OpenAI format, so openai.RateLimitError, openai.AuthenticationError and openai.PermissionDeniedError behave as usual. A quota or rate limit set on the key returns a 429.

Official documentation: github.com/openai/openai-python

Questions

Do I need a different SDK for gpuos?
No. The official OpenAI Python SDK works unchanged; only base_url, api_key and the model name differ.
Can I set OPENAI_BASE_URL instead?
Yes. The SDK reads OPENAI_BASE_URL and OPENAI_API_KEY, so exporting OPENAI_BASE_URL=https://gpuos.si/v1 and your gpuos key as OPENAI_API_KEY works without code changes.

Related

Use OpenAI Python SDK with models on your GPUs

Free for one GPU. Connect a machine, deploy a model, then paste the base URL and your key.