Key points
- Ollama only serves models it runs itself, so a hosted model is added as a second OpenAI-compatible connection in your frontend or code.
- Change two values: the base URL and the key. The model ID is uncensored.
- Streaming, tool calling and JSON mode work the same way as in any OpenAI client.
- Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens, from prepaid credit.
The short answer
Ollama is a local runner. It downloads open-weight models to your computer and serves them on localhost:11434. It does not forward requests to a remote provider, so you cannot "switch Ollama over" to a hosted model. What you can do is use the same tools that already talk to Ollama and give them a second connection that points to a hosted endpoint.
That works because both sides speak the OpenAI chat format. Ollama exposes an OpenAI-compatible route under /v1, and this API does too. Any frontend or script that accepts a custom base URL and API key can use either one. For a hosted unrestricted model, the setup is: base URL https://api.unrestrictedaichat.top/v1, model uncensored, and an Authorization: Bearer key from your account.
The rest of this page shows the three places you will do that: a quick curl test, a Python script that switches between local and hosted with one variable, and a chat frontend. It also covers cost and the errors you are most likely to hit.
What Ollama does and what a hosted API adds
Running locally has real advantages. Nothing leaves your machine, it works offline, and there is no per-token bill. The trade-off is that you are limited to what your hardware can hold. Small and mid-size models run fine on a decent GPU or on recent laptop chips, but a long context needs memory on top of the model weights, and the more you stretch it the slower and heavier it gets.
A hosted endpoint covers the cases where local falls short:
- Context length. The hosted model has a 100,000-token context window, prompt plus completion. That is enough for a long roleplay history, a large pasted document or a long agent session.
- No refusals for lawful adult use. The model behind the API is an open-weight model tuned to answer without content refusals for lawful adult use. The one hard limit is that sexual content involving minors is not allowed.
- Parallel requests. A full key allows 8 concurrent requests, which is useful for batch jobs and multi-character setups.
- Nothing to install. No weights to download, no drivers, no quantization choices.
This is one model run by an independent provider. It is not the official API of any model vendor, and it is text only: no images, audio, embeddings or fine-tuning. If you need those, keep using your local tools for them.
Step 1: Get a key and test with curl
Create an account on the API key page. Sign-up works with Google or with email and password. After sign-up, one click on the same page claims $0.50 of trial credit, valid for 7 days. It is one per person and needs no payment. A trial key is limited to 2 concurrent requests and 60 requests per minute, which is plenty for testing.
Check that the key works before you touch any other software:
curl https://api.unrestrictedaichat.top/v1/chat/completions \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Say hello in one short sentence."}]
}'
You should get a normal chat completion back. To list the model, call GET https://api.unrestrictedaichat.top/v1/models with the same header. The response headers include X-Balance-USD, which shows your remaining credit, and X-Request-Id, which is handy if you ever contact support.
Step 2: One Python script for both backends
Ollama's own documentation shows the OpenAI Python client pointed at http://localhost:11434/v1 with a placeholder key. The hosted endpoint uses the same client with a real key. That means you can switch with an environment variable and keep the rest of the script unchanged.
import os
from openai import OpenAI
USE_HOSTED = os.getenv("USE_HOSTED") == "1"
if USE_HOSTED:
client = OpenAI(base_url="https://api.unrestrictedaichat.top/v1", api_key=os.environ["API_KEY"])
model = "uncensored"
else:
client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")
model = "llama3.1" # whatever you pulled with ollama pull
stream = client.chat.completions.create(
model=model,
messages=[
{"role": "system", "content": "You are a blunt, helpful writing partner."},
{"role": "user", "content": "Outline a tense scene in an abandoned station."},
],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
Run it with USE_HOSTED=1 API_KEY=... python chat.py for the hosted model, or without the variable for your local one. The same applies to Node: the official openai package takes a baseURL option, so the change is one line there as well.
Sampling settings
Temperature, top_p, stop, seed and the frequency and presence penalties are passed through to the model. If a preset from your local setup includes settings the API does not know, such as Ollama-specific options like num_ctx, drop them for the hosted call. The context window is fixed at 100,000 tokens, so there is nothing to size.
Step 3: Add the endpoint to a chat frontend
Most chat frontends that support Ollama also support a generic OpenAI-compatible connection. The menu names differ, but the three fields are always the same:
| Field | Value |
|---|---|
| Base URL | https://api.unrestrictedaichat.top/v1 |
| API key | The key from your account |
| Model | uncensored |
In Open WebUI, the place to look is the connections section of the admin settings, where you add an OpenAI-type connection next to the Ollama one. In SillyTavern, choose a chat completion source that lets you enter a custom OpenAI-compatible endpoint. In editors and coding tools that offer a "custom OpenAI provider" option, the same three values apply. If a frontend asks you to pick the model from a list, it will fetch it from /v1/models, so uncensored should appear there.
Two details trip people up. First, some frontends append /chat/completions themselves, so enter the base URL exactly as shown, ending in /v1, and no further. Second, if the frontend has a "max response length" field, you can leave it low for chat. max_tokens is optional on this API, and the completion may use whatever is left of the 100,000-token window.
For fiction and companion-style apps, the page on the NSFW chat API covers prompt structure and the content rule in more detail.
A simple local-first router
A pattern that keeps the best of both: send ordinary requests to Ollama and send the ones that need a long context or a model without refusals to the hosted endpoint. You decide with a rule you can read at a glance.
def pick_backend(messages, needs_uncensored=False):
approx_tokens = sum(len(m["content"]) for m in messages) // 4
if needs_uncensored or approx_tokens > 6000:
return "hosted"
return "local"
The four-characters-per-token estimate is rough but good enough for routing. Everything about the call after that is identical, which is the point of using one client class for both. If the hosted call returns HTTP 429, wait and retry, as described below.
What it costs, with real numbers
Billing is per token from prepaid credit: $0.15 per 1M input tokens and $0.50 per 1M output tokens. There is no subscription, credit does not expire, and failed or refused requests are not charged.
Take a chat turn with a 6,000-token history and an 800-token reply:
- Input: 6,000 × $0.15 / 1,000,000 = $0.0009
- Output: 800 × $0.50 / 1,000,000 = $0.0004
- Total: $0.0013 per turn
At that rate, $20 covers a little over 15,000 turns. The trial credit of $0.50 is enough for roughly 380 turns of the same size, which is a fair test of a real setup. Remember that chat history is sent again on every turn, so input tokens grow as a conversation gets longer. That is the main cost driver in roleplay.
Top-ups are any whole amount from $20 to $500, paid in crypto (USDT on TRC20 or USDC on Base). You get +5% extra credit from $50, +10% from $100 and +15% from $200. The pricing page has the current table.
Errors and limits you may meet
A full key allows 8 concurrent requests and 300 requests per minute. The trial key allows 2 and 60. If you go over, the API returns HTTP 429. The error code rate_limited means too many requests per minute, and concurrency means too many requests at once. A 429 with a Retry-After: 5 header means temporary overload, so wait five seconds and try again.
One thing worth knowing: a streamed request holds its concurrency slot until the stream finishes. A frontend that fires several generations at once, or a script that does not read the stream to the end, can hit the concurrency error even at low volume. Read streams fully, and cap parallel calls to the number your key allows.
The maximum request body is 8 MB. Prompts are not used for training, and the docs list every parameter the endpoint accepts. If the key is rejected, check that it is sent as Authorization: Bearer and that the base URL has no trailing path after /v1.
