First request in five minutes
Switch your client in three lines by pointing an OpenAI-compatible SDK to our base URL and authenticating with your API key. This quickstart guides you through the exact code needed to start sending requests to the uncensored endpoint.
Authentication & Base URL
Our moonshot api endpoint is fully compatible with standard OpenAI clients. You only need to update two configuration values: the base_url and the api_key. This allows you to swap out your current provider without rewriting your application logic. The base URL for this service is https://api.moonshotapi.top/v1. Ensure you generate a key via the dashboard before attempting any requests. The model identifier you will use for all completions is uncensored.
Note: Do not confuse this service with the official ollama api, which typically runs locally on your machine. Our service is fully hosted, meaning you do not need to manage local GPU resources or Docker containers to get started. Simply configure your SDK and proceed to your first request.
Chat Completions Endpoint
Send a POST request to /v1/chat/completions with your system and user messages. The endpoint expects a JSON body containing the model name, the message history, and optional parameters like temperature or top_p. Our model, identified as uncensored, is an open-weight model tuned for fewer content refusals on lawful adult or controversial topics. It is not DeepSeek, Qwen, or any other vendor's model. To begin, use the following curl command to verify your key works and see the raw JSON response.
curl https://api.moonshotapi.top/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."}]
}'Check the response for the choices array containing the generated text. If you receive a 401 error, your API key is invalid or missing. A 402 error indicates your prepaid credit is exhausted.
Python SDK
Using the official OpenAI Python SDK is the most straightforward way to integrate. Initialize the client with your key and our base URL, then call chat.completions.create. This approach keeps your code vendor-agnostic if you switch back later. The following snippet demonstrates a simple text generation request.
from openai import OpenAI
client = OpenAI(base_url="https://api.moonshotapi.top/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)Ensure your base_url points to https://api.moonshotapi.top/v1. The response object contains the generated text in response.choices[0].message.content. This method is ideal for batch processing or integrating the uncensored model into a larger Python application without managing HTTP streams manually.
Node SDK
For JavaScript developers, the @anthropic-ai/sdk or openai Node package works with minimal configuration. Set the baseURL to our endpoint and provide your API key in the apiKey field. This allows you to use the same client code you might already have for other providers.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.moonshotapi.top/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);Call chat.completions.create with the model set to uncensored. This returns a Promise that resolves to the completion object. Node developers can easily chain this into existing Express routes or serverless functions. Remember that our model is not the mistral api or uncensored qwen; it is a distinct open-weight model hosted on our infrastructure.
Streaming Responses (SSE)
For real-time user experiences, enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE) containing partial text chunks. This reduces perceived latency significantly compared to waiting for the full response. The final chunk in the stream includes the token usage statistics for billing.
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)Parse the data field from each SSE event. Aggregate the content to display the final output. Streaming is supported for all request types, including function calling. Ensure your client can handle the asynchronous nature of SSE data. This is critical for chat interfaces where users expect immediate feedback.
Limits, Errors & Context Window
Our API enforces strict limits to ensure stability. You are allowed 300 requests per minute per key and up to 8 concurrent requests. The maximum request body size is 8 MB. The context window supports 100,000 tokens total (prompt plus completion), with no separate output cap, and if you do not set max_tokens, the response can run to the end of the window. Errors are standard HTTP codes: 401 for invalid keys, 402 for insufficient credit, and 429 for rate limits. Credit never expires, so you can top up at your own pace by crypto (USDT on TRC20, USDC on Base).
Capabilities and limits
A quick checklist for developers: format, limits, features, billing.
| Parameter | Details |
|---|---|
| API format | OpenAI Chat Completions schema; official openai SDKs work unchanged |
| Methods | POST /v1/chat/completions · GET /v1/models |
| Model ID | uncensored |
| Base URL | https://api.moonshotapi.top/v1 |
| Authentication | Bearer token in the Authorization header |
| Max output | up to the rest of the 100,000-token window; max_tokens optional (no separate cap) |
| Max context | 100,000 tokens, input and output combined |
| Structured output | JSON object mode via response_format json_object |
| SSE streaming | Supported (stream: true), usage included at the end |
| Tools / tool calls | Supported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages |
| Other parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| Requests per minute | 300 requests per minute per key |
| Request size | up to 8 MB per request |
| Parallel requests | up to 8 in parallel per key |
| Response headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| How you pay | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Subscription | paid credit never expires, no subscription |
| Payment | crypto: USDT on TRON or USDC on Base, $20–$500, any whole sum |
| Volume bonus | +5% from $50, +10% from $100, +15% from $200 |
| Price | input $0.15 / 1M tokens, output $0.50 / 1M tokens |
| Trial credit | $0.50 for 7 days, no card · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up |
| Sign-in | Google or e-mail and password |
| Keys | one key per account, regenerate any time (the old one stops working) |
| Content | uncensored for adults; the only hard rule: no sexual content involving minors |
Errors and what to do
Every error is JSON with a type you can switch on. You are never charged for an error.
| Status | Type | Reason |
|---|---|---|
400 | bad_request | invalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend |
401 | missing_key · invalid_key · key_revoked | check the Authorization header or use your current key |
402 | no_credit | out of credit; add credit and retry |
403 | content_blocked | refused by the content policy |
404 | not_found | only /v1/chat/completions and /v1/models exist |
413 | request_too_large | body over 8 MB |
429 | rate_limited · concurrency | over 300/min or 8 parallel — back off and retry |
503 | upstream_busy | temporary overload, retry shortly |
Questions and answers
Does this service support embeddings or image generation?
No. This API only serves the uncensored text model via /v1/chat/completions. We do not offer embeddings, image, audio, or video generation endpoints.
How is billing calculated?
You pay per token: $0.15 per 1M input tokens and $0.50 per 1M output tokens. Errors and refusals are free. Credit is topped up via crypto (USDT TRC20 or USDC Base) and never expires.
Is this the official Mistral or DeepSeek API?
No. We are an independent host. Our model is an open-weight model tuned for fewer refusals. It is not Mistral, DeepSeek, Qwen, or any other vendor's model.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.