EN ▾
Get your key

API Documentation

Start generating text immediately with our OpenAI-compatible API. This guide covers authentication, endpoints, and streaming for the uncensored model.

01

Authentication and Base URL

Use your API key with the base URL HTTPS://api.mistralllmapi.com/v1. Generate it instantly via Google or email on the Get API key page. Send the key in the Authorization header as a Bearer token. This works with any standard OpenAI SDK client.

  • Sign up without a phone number.
  • Keep one active key per account.
  • Replace old keys when you rotate them.
curl https://api.mistralllmapi.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Check if port 8080 is open on 10.0.0.5"}]
  }'

Chat Completions Endpoint

Send POST requests to /v1/chat/completions. Pass the model id as "uncensored". Provide messages in an array with role and content fields. The model returns text without standard content filters for lawful adult use. Context window totals 100,000 tokens including input and output.

from openai import OpenAI

client = OpenAI(base_url="https://api.mistralllmapi.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)

Models Endpoint

Query GET /v1/models to list available models. Verify the model id matches "uncensored". This endpoint confirms your connection works. Use it to debug authentication before sending heavy payloads. The API serves only this single uncensored model.

Streaming Responses

Enable streaming by setting stream to true. Receive Server-Sent Events (SSE). Token usage details appear in the final chunk. This method reduces perceived latency for long outputs. Handle partial tokens carefully in your client code.

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)

Function Calling and JSON Mode

Define tools in the request body for function calling. Set tool_choice to enforce specific functions. Use response_format with json_object for strict JSON output. Parameters like temperature and top_p adjust randomness. These features support structured data extraction.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.mistralllmapi.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);

Rate Limits and Errors

Expect 300 requests per minute per key. Limit concurrent requests to 8. Requests exceed 8 MB body size. Return 401 for invalid keys. Return 402 if credit is insufficient. Return 429 on rate limits. Errors consume no tokens. Credit never expires.

02

FAQ

How do I get my mistral API key?

Sign up via Google or email on the Get API key page. The key displays immediately. No phone number is required. Rotate keys if needed, but only one remains active.

What is the context window size?

The model supports 100,000 tokens total. This includes both the prompt and the completion. Max output per request is 16,000 tokens. Default output is 2,048 tokens if unspecified.

How much does the uncensored LLM API cost?

Pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens. Errors and refusals are free. Top up with crypto only. Start with $0.50 trial credit.

Get your API key

Sign up, copy the key, update your base URL. That is all.

Get your key