Why self-host an OpenAI-compatible API
gpuos supports OpenAI-compatible chat completions, completions and embeddings, including streaming. For those operations, configure your client with the gpuos base URL, a workspace API key and a deployed model id. Check model-specific capabilities before changing an application.
Ollama runs inference on the GPU machine you connect. Your app's prompts and the model's outputs pass through the hosted gpuos gateway, which checks keys and records usage. You control the inference hardware and model deployment, while gpuos remains part of the request data flow.
Three ways to do it
Scroll horizontally to see every column.
| Approach | What you get | What you still build |
|---|---|---|
| Ollama or vLLM on a public port | An OpenAI-compatible endpoint on one machine | TLS, authentication, per-user keys, quotas, metering, firewall rules |
| A gateway like LiteLLM in front | Keys and routing | GPU nodes, model deployment, VRAM planning, the engine itself |
| gpuos | Agent, model deployment, gateway, keys, quotas, metering | Your machine, drivers, model license review and workload validation |
Exposing Ollama directly is fine for a single developer. It has no notion of users or keys, so as soon as a team or an application depends on it you end up rebuilding a gateway.
Step by step with gpuos
- Create a free workspace. The Community plan covers one node with one GPU.
- In Nodes, click Add node and run the install command on your GPU machine. It installs Ollama and the
gpuos-agentservice; the agent only makes outbound HTTPS connections. - In Models, deploy a model such as Qwen3 8B. The VRAM gauge estimates short-context memory use; test the context length and concurrency your app needs.
- In API keys, create a key, optionally with a monthly token quota and a requests-per-minute limit.
- Call the supported chat completions, completions or embeddings endpoints at
https://gpuos.si/v1with your OpenAI client.
curl https://gpuos.si/v1/chat/completions \
-H "Authorization: Bearer $GPUOS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "qwen3-8b", "stream": true, "messages": [{"role": "user", "content": "Hello"}]}'What production use needs
- One key per app or teammate, so you can revoke one without breaking the others.
- Optional quotas and rate limits per key: a monthly token quota and a requests-per-minute limit bound API access. They do not guarantee GPU capacity or latency.
- Metering: prompt and completion tokens, latency and status per key, model and node.
- OpenAI error format: 401, 403, 404, 429 and 503 errors that SDKs already know how to handle.
- No inbound port: the agent connects out, so the GPU box stays behind its firewall.
gpuos covers all five. The quickstart lists every error code and its meaning.
Before you make the first request
Start with an NVIDIA GPU visible in nvidia-smi, enough free disk space for the weights, and an available gpuOS workspace. The LLM VRAM calculator compares the catalog estimates with your GPU before a download.
An OpenAI-compatible endpoint implements selected OpenAI API routes; it does not make every hosted OpenAI feature available. Check the model’s supported endpoints and tool-calling behavior before changing an application.
Keep GPUOS_API_KEY in a server-side environment variable. Browser applications should call your backend, which forwards authorized requests to the model.
Check the response and diagnose failures
- A successful chat request returns content, or streaming chunks, for the catalog model id you selected. Test a short prompt first, then your actual workload.
- 401: check the key and Authorization header. 404: check the path and deployed model id, which can differ from the Ollama tag.
- 429: inspect the key’s quota or rate limit. 503: check whether the node is connected and the model has finished loading.
- An out-of-memory error requires a shorter context, a smaller model or more VRAM; adding API retries cannot solve it.
References: Ollama’s supported OpenAI routes and the gpuOS quickstart.