Chat API Free Integration: Add It to Your App
Integrating this chat API means changing two values in a client you already know: the base URL and the key. This guide covers a free trial start, working code and the pitfalls that show up in production.

Key points
- Point any OpenAI SDK at the base URL, set your key, and put the documented model ID in the model field.
- Streaming, tool calling and JSON mode work through the same chat completions endpoint.
- Handle HTTP 429 by reading the error code: rate_limited and concurrency need different fixes.
- A $0.50 trial credit lets you test the whole integration before paying anything.
What you need before writing code
For a chat api free integration test, you need three things: an account, a key and a base URL. Sign up with Google, or with an email and password. On the API key page, claim the $0.50 trial credit with one click. It is valid for 7 days and needs no payment details, which is enough to run everything in this guide many times over.
Then collect the connection values:
- Base URL:
https://api.unrestrictedchat.cc/v1 - Model ID:
uncensored - Auth header:
Authorization: Bearer YOUR_KEY
The API exposes two methods: POST /v1/chat/completions and GET /v1/models. It is text only, so there are no image, audio or video endpoints, no embeddings and no fine-tuning. If your app needs those, plan to use another service next to this one. Keys are created on the API key page, and the documentation lists the same endpoints in reference form.
Keep the key out of source control. Put it in an environment variable such as UNRESTRICTED_API_KEY and read it at startup. Never ship it inside a browser bundle or a mobile app, because anyone can extract it. Call the API from your own server instead.
First request with curl
Before touching an SDK, check that the key and URL work. A plain curl call isolates network and auth problems from your application code:
curl https://api.unrestrictedchat.cc/v1/chat/completions \
-H "Authorization: Bearer $UNRESTRICTED_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Name three uses of a message queue."}
],
"max_tokens": 200
}'
A successful response has the usual OpenAI shape: a choices array with the assistant message and a usage object with prompt and completion token counts. The response headers include X-Request-Id, X-Balance-USD and the rate limit headers. Save the request ID when something looks wrong, because it makes support questions much easier to answer.
You can also call GET /v1/models with the same header. It is a quick way to confirm the key is accepted and to see the model ID your client should use.
Python with the OpenAI SDK
The official openai package works unchanged. You set base_url when you create the client and use uncensored as the model:
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.unrestrictedchat.cc/v1",
api_key=os.environ["UNRESTRICTED_API_KEY"],
)
history = [{"role": "system", "content": "You are a helpful assistant."}]
def ask(text):
history.append({"role": "user", "content": text})
resp = client.chat.completions.create(
model="uncensored",
messages=history,
temperature=0.7,
)
answer = resp.choices[0].message.content
history.append({"role": "assistant", "content": answer})
return answer
print(ask("Explain idempotency keys in two sentences."))
Notice that you keep the conversation yourself. The API does not store sessions, so each call must carry the messages you want the model to see. The context window is 100,000 tokens for prompt and completion combined, so long-running chats eventually need trimming or summarizing. The parameters temperature, top_p, stop, seed and the penalties are passed through to the model.
Node.js and streaming
Chat interfaces feel faster when text appears as it is generated. Set stream: true and the response arrives over server-sent events. With the Node SDK:
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.unrestrictedchat.cc/v1",
apiKey: process.env.UNRESTRICTED_API_KEY,
});
const stream = await client.chat.completions.create({
model: "uncensored",
messages: [{ role: "user", content: "Write a haiku about queues." }],
stream: true,
stream_options: { include_usage: true },
});
for await (const chunk of stream) {
const delta = chunk.choices[0]?.delta?.content;
if (delta) process.stdout.write(delta);
}
Usage numbers arrive at the end of the stream, so log them after the loop finishes. One detail matters for capacity planning: a streamed request holds its concurrency slot until the stream ends. A user who opens a response and walks away, with your server still reading, keeps one of your slots occupied. Close the stream when the client disconnects.
If you proxy the stream to a browser, forward the chunks as they come and avoid buffering them in middleware. Some reverse proxies buffer by default, which makes streaming look like a single delayed block.
Tool calling and JSON mode
Two features turn a chat endpoint into something your code can depend on. Tool calling lets the model request a function call, and JSON mode constrains the reply to valid JSON.
Tools
Pass a tools array and optionally tool_choice. When the model wants a tool, the message contains tool_calls. You run the function, then send the result back as a message with role: "tool" and the matching tool_call_id:
tools = [{
"type": "function",
"function": {
"name": "get_order_status",
"description": "Look up an order by id",
"parameters": {
"type": "object",
"properties": {"order_id": {"type": "string"}},
"required": ["order_id"],
},
},
}]
first = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Where is order A-1042?"}],
tools=tools,
)
call = first.choices[0].message.tool_calls[0]
# run your own lookup here, then send the result back:
final = client.chat.completions.create(
model="uncensored",
messages=[
{"role": "user", "content": "Where is order A-1042?"},
first.choices[0].message,
{"role": "tool", "tool_call_id": call.id, "content": "shipped, arrives Friday"},
],
tools=tools,
)
print(final.choices[0].message.content)
Always validate the arguments the model produces before you run anything. Treat them like user input.
JSON mode
Add response_format={"type": "json_object"} and mention JSON in your prompt. Parse the result inside a try block anyway, since a reply cut off by max_tokens can still be invalid JSON.
Limits, errors and retries
A full key allows 8 concurrent requests and 300 requests per minute. A trial key allows 2 concurrent requests and 60 per minute. The maximum request body is 8 MB. Going over returns HTTP 429, and the error code tells you which limit you hit:
| Error code | Meaning | Fix |
|---|---|---|
rate_limited | Too many requests per minute | Spread calls out or queue them |
concurrency | Too many requests at once | Cap parallel workers at your key's limit |
429 with Retry-After: 5 | Temporary overload | Wait 5 seconds, then retry |
The simplest durable pattern is a semaphore that limits in-flight calls to 8 for a full key, plus a retry loop that honors Retry-After and otherwise backs off with jitter. Do not retry blindly in a tight loop; that only keeps you rate limited. The official SDKs already retry some failures, so check the max retries setting rather than stacking your own loop on top.
Rejected and failed requests are not charged, so retries do not cost you tokens you never received. You can read your remaining limits from X-RateLimit-Limit-Requests and X-RateLimit-Limit-Concurrency in the response headers.
Keeping the integration healthy
Most integration bugs are not in the HTTP call. They come from how the surrounding application treats the conversation. A few habits prevent the usual ones.
Store messages, not strings
Keep the conversation as a list of role and content objects in your database, one row per message, with a timestamp. When a user returns the next day, you rebuild the list and send it. This also lets you trim the middle of a long thread without losing the original record, and it makes it easy to replay a failing conversation against a different temperature.
Set the system prompt once, deliberately
The system message is paid for on every call, and it shapes tone more than most settings do. Write it as plain instructions: who the assistant is, what format to answer in, and what to avoid. Test two or three versions on the same ten user messages before you commit to one. Because seed is passed through, you can repeat a run to compare prompts fairly.
Separate the model from your product logic
Wrap the call in a single function in your codebase, and read the base URL, key and model ID from configuration. That way a change in provider, or a second environment for staging, is a configuration edit instead of a refactor. It also gives you one place to add logging, metrics and retries.
Test the unhappy paths
Try a request with a wrong key, an oversized body above 8 MB, and a burst of ten parallel calls on a trial key. Seeing the real error shapes on your own machine is better than reading about them after a production incident. Make sure your user interface shows a calm message when the API answers 429 instead of a blank screen.
Moving from trial to production
When the integration works, add a few safeguards before real users arrive. Set a sensible max_tokens so one odd prompt cannot produce a very long answer. Log X-Request-Id with every call. Watch X-Balance-USD and alert yourself before the balance reaches zero, since a drained balance stops requests.
Billing is pay as you go at $0.15 per 1M input tokens and $0.50 per 1M output tokens, with no subscription. A request of 2,000 input and 500 output tokens costs 2,000 x $0.15 / 1M + 500 x $0.50 / 1M = $0.0003 + $0.00025 = $0.00055. Top-ups start at $20 and go up to $500, with bonuses from $50. See the pricing page for the table.
The content rule is simple: the model is tuned to answer without content refusals for lawful adult use, and there is one hard limit, no sexual content involving minors. Your app is responsible for its own users, age checks and terms. Prompts are not used for training.
More guides
Questions and answers
Can I use the official OpenAI SDK?
Yes. Set the base URL to https://api.unrestrictedchat.cc/v1, use your key, and set the model field to "uncensored". No other changes are required.
Is the integration really free?
Starting is free: new users can claim $0.50 of trial credit, valid for 7 days. After that you pay per token from prepaid credit, from $20.
Does it support streaming and function calls?
Yes. Streaming over SSE, tool calling and JSON mode all work on the chat completions endpoint.
What happens when I hit a rate limit?
You get HTTP 429 with the code rate_limited or concurrency. Slow down or reduce parallel requests, and honor Retry-After on overload.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.