EN ▾
Get API key

Quickstart for Mistral users

Integrate the uncensored Mistral API in minutes using standard OpenAI-compatible libraries. Drop in the base URL and API key, then send requests just like you would to any other provider.

Base URL & Authentication

Our API is fully compatible with the OpenAI SDKs. You only need to update the base URL and provide your API key. The base URL for this service is https://api.mistralapi.com/v1. Authentication is handled via the Authorization header using a Bearer token. Unlike some providers, we do not require complex routing or vendor-specific headers; just pass your key as you normally would.

  • Base URL: https://api.mistralapi.com/v1
  • Header: Authorization: Bearer YOUR_API_KEY

Your API key is generated immediately upon signup. Keep it secure, as it grants access to your prepaid credit. There are no monthly subscription fees, only pay-as-you-go pricing based on token usage.

Chat Completions Endpoint

The core of our API is the POST /v1/chat/completions endpoint. It accepts a list of messages and returns a generated response. This endpoint supports the standard message format used by most LLM clients. You must specify the model ID as "uncensored". This model is an open-weight large language model hosted on our servers, tuned to answer without content refusals for lawful adult use.

  • Endpoint: POST /v1/chat/completions
  • Model ID: uncensored

The API returns text responses only. It does not support images, audio, video, or embeddings. For most developers, this endpoint replaces the standard OpenAI chat endpoint with zero code changes beyond the base URL and model ID.

Python SDK Integration

Using the official OpenAI Python library is the fastest way to integrate. Set the base URL to our endpoint and provide your API key. The code below demonstrates a simple text completion request.

  • Install the library: pip install openai
  • Set base_url to https://api.mistralapi.com/v1
  • Use model="uncensored"

This approach works because our API mirrors the OpenAI response structure. You can use existing libraries for streaming, function calling, and JSON mode without modification.

Node SDK Integration

For JavaScript/TypeScript developers, the openai npm package works seamlessly. Configure the client with our base URL and your API key. This allows you to use the same codebase for both OpenAI and our uncensored model.

  • Install the library: npm install openai
  • Configure baseUrl to https://api.mistralapi.com/v1
  • Specify model: "uncensored"

This compatibility extends to all standard parameters like temperature, top_p, and stop sequences. You can switch between providers easily by changing the client configuration.

Streaming Responses

We support streaming responses via Server-Sent Events (SSE). This allows you to receive tokens as they are generated, reducing perceived latency for users. The final chunk of the stream includes the token usage statistics for billing.

  • Set stream: true in your request
  • Read chunks from the response
  • Parse the final chunk for usage data

Streaming is ideal for chat interfaces and real-time applications. The response format matches the OpenAI streaming standard, so your existing streaming logic will work without changes.

Limits, Errors & Context Window

Our API has specific limits to ensure stability. Each API key supports 300 requests per minute and 8 concurrent requests. The maximum request body size is 8 MB. The context window is 100,000 tokens total (prompt + completion). If you do not set max_tokens, the default output is 2,048 tokens; otherwise, the max output is 32,000 tokens.

  • 401: Invalid API key
  • 402: Insufficient credit
  • 429: Rate limit exceeded

Premium credit never expires. Errors and refusals are free. If you encounter issues, use the Support page for refunds or account help.

cURL

curl https://api.mistralapi.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."}]
  }'

Python

from openai import OpenAI

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

Questions and answers

How is billing calculated?

Billing is based on real token usage. Input tokens cost $0.15 per 1M tokens, and output tokens cost $0.50 per 1M tokens. Errors and refusals are free. Credit is prepaid and never expires.

What payment methods are accepted?

We accept top-ups by crypto (USDT on TRC20, USDC on Base). Payments range from $20 to $500 per transaction.

Does the model refuse content?

The model is uncensored and does not refuse lawful adult, fictional, or controversial topics. The only hard limit is sexual content involving minors, which is always blocked.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key

What the API supports

If your tool speaks the OpenAI API, these are the details that matter.

ParameterDetails
CompatibilityOpenAI Chat Completions schema; official openai SDKs work unchanged
Model IDuncensored
MethodsPOST /v1/chat/completions · GET /v1/models
API keyBearer token in the Authorization header
Base URLhttps://api.mistralapi.com/v1
Function callingYes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool
StreamingSupported (stream: true), usage included at the end
Max outputup to the rest of the 100,000-token window; max_tokens optional (no separate cap)
Max context100,000 tokens, input and output combined
JSON modeJSON object mode via response_format json_object
Other parameterstemperature, top_p, stop, seed, presence_penalty, frequency_penalty
Parallel requests8 requests at the same time per key
Response headersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Max body8 MB request body
Requests per minute300/min per key
Credit expiryno monthly fee; paid credit does not expire
Priceinput $0.15 / 1M tokens, output $0.50 / 1M tokens
Billingprepaid credit, charged by real token usage; errors and refusals are free
Paymentcrypto: USDT on TRON or USDC on Base, $20–$500, any whole sum
Bonus credit+5% on $50+, +10% on $100+, +15% on $200+
Free trial$0.50 of credit valid 7 days, no card needed · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up
Sign-insign in with Google or with e-mail + password
Key managementone key per account, regenerate any time (the old one stops working)
Contentuncensored for adults; the only hard rule: no sexual content involving minors

Errors and what to do

The type field is stable, the message is for humans. Errors cost nothing.

CodeTypeMeaning
400bad_requestinvalid JSON, empty messages, bad parameter, or prompt + max_tokens over the window — fix and resend
401missing_key · invalid_key · key_revokedno key, wrong key, or a key replaced by a newer one
402no_creditout of credit; add credit and retry
403content_blockedrefused by the content policy
404not_foundonly /v1/chat/completions and /v1/models exist
413request_too_largebody over 8 MB
429rate_limited · concurrencyslow down: rate or parallel limit reached
503upstream_busytemporary overload, retry shortly