Docs / Integrations
Use Cent AI with Open WebUI
Add Cent AI to Open WebUI as an OpenAI-compatible connection with a URL and an API key, then chat with its models.
Last updated
Your setup
Fills in YOUR_API_KEY in the code on this page. The key stays in this tab: it is never sent and never saved.
Open WebUI speaks the OpenAI Chat Completions format, so it connects to Cent AI at https://api.cent-ai.dev/v1 and adds /chat/completions itself. It reads the model list from /v1/models.
Prerequisites
- A Cent AI account with balance. See Quickstart.
- An API key from Keys. It looks like
cai_<secret>and is shown once. - Open WebUI running, and an admin account on it. The version we tested is at the end of this page.
Configure Open WebUI
- Open Settings > Admin > Connections and find the OpenAI API connections list.
- Click + to add a connection.
- Fill in the fields below, then click Save.
| Field | Value |
|---|---|
| URL | https://api.cent-ai.dev/v1 |
| API Key | Your key, cai_<secret> |
| Model IDs | Leave empty to load the model list from GET /v1/models, or add only the names you want, for example glm-5.3 |
Leave the provider type under Advanced on its default. The Cent AI models then appear in the model picker of a new chat.
Open WebUI sends requests from the machine it runs on, not from your browser. If your key has an IP allowlist, add the address of that machine.
Test it
Check the key and the model name with one request. Replace YOUR_API_KEY with your key.
export CENT_AI_KEY="YOUR_API_KEY"
curl https://api.cent-ai.dev/v1/chat/completions \
-H "Authorization: Bearer $CENT_AI_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"glm-5.3","messages":[{"role":"user","content":"Hello"}]}'
The response has usage.cost, the amount charged for this request in USD. Then open a new chat in Open WebUI, pick glm-5.3 and send a short message. Each request appears on the Requests page of the dashboard with its tokens per rate and its cost. See Request cost.
Open WebUI can also send background requests, such as a title, tags or follow-up suggestions for a chat. By default they use the chat model, so each one is a charged request on the Requests page. You can turn them off or give them another model under Settings > Admin > Interface.
Cache continuity
Open WebUI resends the conversation on every turn, so much of the input of a long chat can be read from the model's cache. Cent AI sends the next turns of a conversation to the route that served the previous turn. It uses the session signal a tool sends when there is one; without it, it uses the stable start of the prompt. You do not add anything to the connection for this.
- Keep a conversation in one chat and on one model. A new chat or another model starts a new cache.
- Keep the system prompt the same during a conversation. A change near the start of the prompt changes everything after it.
Cent AI does not promise a cache hit rate. Cache tokens are charged only when the model reports them. See Prompt caching.
Troubleshooting
To look up a failed request, find the x-request-id of the response on the Requests page. All codes are in 4xx errors and 5xx errors.
401 invalid_api_key
The key in the connection is wrong, cut off, revoked, or a management key (cai_mgmt_…). With a wrong key, the model list stays empty. Paste the key again, or create a new one in Keys.
402 insufficient_balance
The balance available for this model is empty, or the model is not in your budget pack. Top up or buy a pack. See Balance.
403 ip_not_allowed or model_not_allowed
The key has an IP allowlist without the address of the machine that runs Open WebUI, or a model allowlist without the chosen model. Add the address or the model to the key. A background task on another model needs that model in the allowlist too.
404 model_not_found
The model name is not one Cent AI serves. Copy the exact name from Models or GET /v1/models; names from other providers, such as gpt-4o-mini, are not aliases. A :free name works only for today's event model (see Free tokens daily); on any other model, including a previous day's event model, it returns 404.
429 rate_limited, key_limit_exceeded or project_budget_exceeded
rate_limited: more than 600 requests per minute on this key. Many users sharing one connection can reach it. Wait forRetry-After, or give groups of users their own keys. See Rate limits.rate_limitedon a:freename: today's free pool is used up, or the event is off.Retry-Afterruns to 00:00 UTC; the model's own name stays available at its normal price.key_limit_exceeded: the daily or monthly limit you set on the key was reached.project_budget_exceeded: the budget of the key's project was reached.
501 not_available_yet
The endpoint is not open yet. Speech, transcription and embeddings return 501 for now. Do not point those Open WebUI features at Cent AI. The image endpoints are open; see Images.
Stream timeout
If a reply stops with upstream_timeout or upstream_unavailable in the stream, see Stream timeout.