Base URL and Authentication
Our API replaces the standard OpenAI base URL with our own endpoint. You authenticate using a single API key passed in the Authorization header. This setup ensures your client code works without modification, just by changing the base URL and key. The base URL is https://api.consolemistralapi.com/v1.
Generate your key via the dashboard. It works immediately with any OpenAI-compatible SDK. You do not need to install extra libraries.
First Request with cURL
Send your first prompt using any HTTP client. The endpoint accepts standard chat completion parameters. This confirms your key and credit balance are active.
curl https://api.consolemistralapi.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Return current system uptime stats in JSON format."}]
}'The response returns a JSON object with the generated text. Check the usage field to see token consumption. Errors return standard HTTP codes with a JSON error object.
Python SDK Integration
Use the official openai Python package. Configure the client with your key and our base URL. This approach keeps your code compatible with OpenAI’s ecosystem while using our uncensored model.
from openai import OpenAI
client = OpenAI(base_url="https://api.consolemistralapi.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)The model ID is uncensored. Set parameters like temperature for creativity. The SDK handles JSON serialization automatically. Errors raise standard exceptions you can catch.
Node.js SDK Setup
Initialize the OpenAI Node client with your credentials. Point it to our base URL. This works for both server-side and browser-based applications.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.consolemistralapi.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);Request the completion and handle the response. The SDK streams data if enabled. Token usage is reported in the final chunk. Adjust max_tokens to control output length.
Streaming Responses
Enable streaming by setting stream: true. The API returns data chunks as they are generated. This reduces perceived latency for long outputs. The final chunk contains the total token usage.
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)Buffer the chunks to reconstruct the full text. Use this for chat interfaces or real-time displays. Streaming does not affect token pricing or limits.
Rate Limits and Errors
Respect the limits to avoid service interruptions. The API allows 300 requests per minute per key. You can have 8 concurrent requests. The request body must be under 8 MB. A 429 error indicates you have exceeded these limits. Wait and retry.
Use a 401 error to check your key. A 402 error means your prepaid credit is exhausted. Add more crypto top-up to continue. The context window is 100,000 tokens for prompt and completion combined. Outputs max out at 16,000 tokens. Errors and refusals do not consume credit.