EN ▾
Get API key

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.

ParameterDetails
API formatOpenAI Chat Completions schema; official openai SDKs work unchanged
MethodsPOST /v1/chat/completions · GET /v1/models
Model IDuncensored
Base URLhttps://api.moonshotapi.top/v1
AuthenticationBearer token in the Authorization header
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
Structured outputJSON object mode via response_format json_object
SSE streamingSupported (stream: true), usage included at the end
Tools / tool callsSupported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages
Other parameterstemperature, top_p, stop, seed and the two penalties are passed through
Requests per minute300 requests per minute per key
Request sizeup to 8 MB per request
Parallel requestsup to 8 in parallel per key
Response headersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
How you paypay as you go from prepaid credit; nothing is charged for failed or refused requests
Subscriptionpaid credit never expires, no subscription
Paymentcrypto: USDT on TRON or USDC on Base, $20–$500, any whole sum
Volume bonus+5% from $50, +10% from $100, +15% from $200
Priceinput $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-inGoogle or e-mail and password
Keysone 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

Every error is JSON with a type you can switch on. You are never charged for an error.

StatusTypeReason
400bad_requestinvalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend
401missing_key · invalid_key · key_revokedcheck the Authorization header or use your current key
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 · concurrencyover 300/min or 8 parallel — back off and retry
503upstream_busytemporary 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.

Get API key