Ollama API: Switch your client in three lines
Get started with our uncensored, OpenAI-compatible chat API in minutes. Switch your client configuration to a single model with a 100k context window and start generating content immediately.
- Base URL
https://api.ollamaapi.com/v1- Model
uncensored
Prerequisites and Base URL
To use this uncensored LLM API, you need an account with an API key and an OpenAI-compatible SDK installed in your environment. The base URL for all requests is https://api.ollamaapi.com/v1. This endpoint is designed as a drop-in replacement for existing OpenAI clients, meaning you only need to update the base URL and API key in your configuration. The API supports text-in, text-out completions with streaming via Server-Sent Events (SSE) and tool calling. It does not support embeddings, image generation, or fine-tuning. Ensure your SDK version supports these features for the best experience. You will use the model ID uncensored for all completions.
Authentication and First Request
Authentication is handled via a Bearer token in the Authorization header. Sign up on the site to receive your key immediately; no credit card is required for the trial. Use the following cURL command to send your first message. Replace YOUR_API_KEY with your actual key. The request targets the standard chat completions endpoint. If successful, you will receive a text response from the uncensored model. Ensure you set the model field to uncensored to utilize the specific large language model hosted on our GPU servers.
curl https://api.ollamaapi.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
}'
Remember that prompts are not used for training your data. The API enforces a hard limit on sexual content involving minors, but otherwise allows lawful adult and controversial topics without refusal.
Python SDK Integration
Using the official OpenAI Python SDK is the most straightforward way to integrate. Install the library via pip, then initialize the client with the custom base URL and your API key. This setup allows you to use the same client code you might use for GPT-4, but directed at our uncensored model. The code below demonstrates a simple chat completion request. You can adjust the max_tokens and temperature parameters as needed. The response object will contain the generated text in response.choices[0].message.content.
from openai import OpenAI
client = OpenAI(base_url="https://api.ollamaapi.com/v1", api_key="YOUR_KEY")
resp = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Summarise this thread without softening it."}],
)
print(resp.choices[0].message.content)
This approach works because our API is fully OpenAI-compatible. You do not need a separate client library specifically for our service.
Node.js SDK Setup
For JavaScript or TypeScript projects, the OpenAI Node SDK works seamlessly with our endpoint. Install the package and configure the client with the baseURL pointing to our domain. Pass your API key in the apiKey field. The request structure mirrors the OpenAI format exactly. This allows you to drop our API into existing Node.js applications without significant refactoring. The model ID remains uncensored. You can manage your API key via the dashboard if you need to regenerate it.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.ollamaapi.com/v1", apiKey: process.env.API_KEY });
const resp = await client.chat.completions.create({
model: "uncensored",
messages: [{ role: "user", content: "Draft a villain monologue for my game." }],
});
console.log(resp.choices[0].message.content);
Ensure your environment variables are set correctly to avoid exposing your key in source control. The API key is shown immediately upon signup.
Streaming Responses
For applications requiring real-time token generation, the API supports Server-Sent Events (SSE). Set the stream parameter to true in your request. The server will send a series of chunks, each containing a partial delta of the response. This is ideal for chat interfaces where you want to display text as it is generated. The streaming behavior is identical to the OpenAI streaming API, so existing streaming logic should work with minimal changes. Handle the stream until the final chunk indicates the response is complete.
stream = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Tell the story in second person."}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
Streaming does not affect the token pricing or the context window limits.
Limits, Errors, and Context
The API has a 100,000 token context window, combining prompt and completion. This allows for extensive document processing or long conversations. Rate limits are set to 300 requests per minute per key. If you exceed this, you will receive a 429 error. Authentication errors return a 401 status, usually due to an invalid or revoked key. Insufficient funds result in a 402 error. Request bodies are limited to 8 MB. There is no subscription; you pay as you go with prepaid credits that never expire. You can top up starting at $20. Credits do not expire, so you can pause usage indefinitely without losing your balance.
Questions and answers
Does this API support image or audio generation?
No, this API is strictly for text completions. It does not support embeddings, image generation, audio, or video. It focuses on a single uncensored large language model for text-to-text interactions.
How does the pricing work?
Pricing is pay-as-you-go with prepaid credits that never expire. Input tokens cost $0.15 per million, and output tokens cost $0.50 per million. You can top up with crypto (USDT or USDC), and bonus credits are available for larger deposits.
Is my data used for training?
No, prompts sent to the API are not used for training. The service is designed for privacy, requiring only an email and password for account creation.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.
API facts in one table
Everything the endpoint can and cannot do, in one place — check it before you top up.
| Spec | Value |
|---|---|
| Protocol | OpenAI Chat Completions schema; official openai SDKs work unchanged |
| Authentication | Bearer token in the Authorization header |
| Base URL | https://api.ollamaapi.com/v1 |
| Endpoints | POST /v1/chat/completions · GET /v1/models |
| Model ID | uncensored |
| Other parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| Context window | 100,000 tokens, input and output combined |
| Streaming | Supported (stream: true), usage included at the end |
| Max output | prompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap |
| Structured output | JSON object mode via response_format json_object |
| Tools / tool calls | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Requests per minute | 300 requests per minute per key |
| Request size | up to 8 MB per request |
| Headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Concurrency | up to 8 in parallel per key |
| Free trial | $0.50 for 7 days, no card · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up |
| Volume bonus | +5% on $50+, +10% on $100+, +15% on $200+ |
| Token prices | $0.15 per 1M input tokens · $0.50 per 1M output tokens |
| Billing | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Credit expiry | no monthly fee; paid credit does not expire |
| Top-up | crypto: USDT on TRON or USDC on Base, $20–$500, any whole sum |
| Content policy | uncensored for adults; the only hard rule: no sexual content involving minors |
| Key management | one key per account, regenerate any time (the old one stops working) |
| Account | sign in with Google or with e-mail + password |
When a request fails
Errors come back as JSON with a stable type; failed and refused requests are not billed.
| HTTP | Type | What to do |
|---|---|---|
400 | bad_request | malformed request or too long for the context window |
401 | missing_key · invalid_key · key_revoked | check the Authorization header or use your current key |
402 | no_credit | balance is empty — top up, requests resume at once |
403 | content_blocked | refused by the content policy |
404 | not_found | only /v1/chat/completions and /v1/models exist |
413 | request_too_large | body over 8 MB |
429 | rate_limited · concurrency | slow down: rate or parallel limit reached |
503 | upstream_busy | temporary overload, retry shortly |