Authentication
Send your API key in the Authorization header as a Bearer token. You get this key immediately after signing up with Google or email on the Get API key page. If you generate a new one, it replaces the old one instantly. Errors like invalid keys return a 401 status. Mistakes such as double charges are fixed through the Support page.
Chat Completions Endpoint
Post JSON to POST /v1/chat/completions to get text responses. This is the only endpoint for generating text. It does not support embeddings, images, or audio.
Set the model field to "uncensored". The model answers without content refusals for lawful adult use. It is an open-weight model tuned for unrestricted output. It is not GPT, Claude, or any other vendor's model.
Models Endpoint
Call GET /v1/models to list available models. The response includes the uncensored model ID. Use this to verify connectivity or debug configuration issues in your client.
The endpoint returns standard OpenAI format metadata. This helps you confirm that your base URL and authentication are working correctly before sending heavy payloads.
Parameters & Options
Support standard parameters like temperature, top_p, stop, seed, presence_penalty, and frequency_penalty. Set max_tokens to control output length. The default is 2,048 tokens if you omit this field.
The context window is 100,000 tokens for prompt and completion combined. Requests exceed 8 MB body size may fail. Function calling and JSON mode are also supported via standard fields.
Streaming Responses
Enable streaming by setting stream: true. You receive Server-Sent Events (SSE) as tokens are generated. This reduces perceived latency for interactive applications.
Token usage statistics appear in the last chunk of the stream. This allows you to track costs accurately in real-time. Errors during streaming still return proper HTTP status codes.
Function Calling & JSON Mode
Use response_format with {"type": "json_object"} for strict JSON output. This is useful for parsing structured data from the LLM. Function calling works with standard tool definitions.
Set tool_choice to control how the model uses functions. The model supports both automatic and forced tool usage. This ensures reliable integration with your backend logic.
cURL
curl https://api.mistralaiapikey.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "what is the api limit for this service"}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.mistralaiapikey.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)Node.js
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.mistralaiapikey.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);Streaming
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)