Integrating an Uncensored LLM API with Python
Developers often need a reliable way to integrate an uncensored text API into their workflows using standard libraries. This guide provides a step-by-step process for connecting to our service, configuring parameters for unfiltered output, and verifying the setup with a practical checklist.

Setting Up the Connection
Integrating an uncensored LLM API with Python begins with establishing a secure connection to the service. You will need to install the official OpenAI SDK, which provides the necessary client libraries to handle requests. Once installed, you can initialize the client by providing your API key and specifying the base URL for our hosted service. This approach allows you to use familiar methods while directing traffic to our specific uncensored model endpoint.
The base URL for our API is https://api.nanbeige.cc/v1. You should set this value in your client configuration to ensure all requests are routed correctly. Your API key is generated immediately upon signup, whether you choose to continue with Google or use an email and password combination. It is important to keep this key secure, as it provides access to your prepaid credit and allows you to make requests.
After setting up the client, you can verify the connection by making a simple request to the models endpoint. This GET request will return a list of available models, confirming that your credentials are valid and the network path is open. This step is important for debugging any connectivity issues before moving on to more complex interactions with the chat completions endpoint.
Once the connection is established, you can proceed to send requests. The API accepts text input and returns text output, making it suitable for a wide range of applications. By using the standard OpenAI SDK, you can use existing code patterns and tools, reducing the learning curve for integrating this uncensored service into your existing projects.
Configuring Parameters for Unfiltered Output
To achieve the desired unfiltered behavior, you need to configure specific parameters in your API requests. The model supports standard parameters such as temperature, top_p, stop sequences, and seed. Adjusting these settings allows you to control the randomness and creativity of the output. For example, a higher temperature value will result in more diverse and unpredictable responses, which can be useful for creative writing or role-playing scenarios.
The temperature parameter influences the probability distribution of the next token. A value of 1.0 is often a good starting point for balanced output. You can also use top_p to control the nucleus sampling, which limits the model to consider only the most likely tokens. This can help in generating more coherent and focused text while still maintaining an uncensored nature.
Additionally, you can use the stop parameter to define sequences that signal the end of a response. This is useful for controlling the length of the output or stopping the model at specific points. The seed parameter allows for reproducible results, which is valuable for testing and debugging your integration. By experimenting with these parameters, you can fine-tune the model's behavior to match your specific needs.
It is important to note that while these parameters help control the output, the model itself does not refuse lawful adult, fictional, security-research, or controversial topics. This means that the unfiltered nature is inherent to the model's design. You do not need to implement additional filtering logic in your application unless you have specific requirements for your use case.
Understanding Pricing and Credits
Our API operates on a prepaid credit system charged by real token usage. The pricing is straightforward: $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. Errors and refusals are free, so you only pay for actual content generated. This model ensures that you are not charged for failed requests or rate-limit errors, making it cost-effective for testing and development.
To add credit to your account, you can use cryptocurrency. The supported methods are USDT on the TRC20 network or USDC on the Base network. You can top up with any whole amount between $20 and $500. If you top up with $50 or more, you may receive bonus credit, ranging from +5% to +15%. This bonus credit provides extra value for larger purchases.
It is important to note that credit never expires, and there are no monthly subscription fees. This allows you to use your credits at your own pace without the pressure of a recurring billing cycle. You can start with a trial credit of $0.50 when you create a new account, which requires no credit card. This allows you to test the API thoroughly before committing to a larger purchase.
When estimating costs, focus on token counts rather than dollar amounts. You can calculate the cost by dividing the number of tokens by 1,000,000 and multiplying by the per-million price. This method helps you budget accurately for your projects. Since the API is text-only, you do not need to account for additional costs associated with image or audio generation.
Implementing Streaming and Tools
The API supports streaming over Server-Sent Events (SSE), which allows you to receive responses in real-time. This is particularly useful for applications that require immediate feedback, such as chat interfaces or live coding assistants. When streaming, the usage information is included in the last chunk of the response, allowing you to track token consumption accurately.
In addition to streaming, the API supports function calling, also known as tools. This feature allows the model to generate structured data that can be used to trigger actions in your application. You can define functions in your request, and the model will return the necessary arguments to call those functions. This is useful for integrating the API with external services or databases.
You can also use JSON mode to ensure that the model's output is strictly formatted as JSON. This is helpful when you need to parse the response programmatically. By setting the response format to JSON, you can reduce the need for additional parsing logic in your code. This feature is particularly useful for applications that rely on structured data.
When implementing streaming and tools, it is important to handle errors gracefully. The API returns specific error codes for different scenarios, such as 401 for invalid keys, 402 for insufficient credit, and 429 for rate limits. By handling these errors appropriately, you can ensure a smooth user experience and prevent your application from crashing.
When This API Is Not the Right Choice
While our API is excellent for text generation, it may not be the right choice for all projects. The service is focused on text input and output, meaning it does not support embeddings, image generation, audio, video, or OCR. If your application requires these additional capabilities, you may need to integrate with other services or use a different API that offers a broader range of features.
Additionally, the API does not support fine-tuning or model routing. If you need to customize the model's behavior through fine-tuning or route requests to different models based on specific criteria, this service may not meet your needs. The model is fixed, and you cannot train it on your own data or switch between different model versions.
The API also has a context window of 100,000 tokens, which is the sum of the prompt and completion. While this is a large context window, it may not be sufficient for applications that require processing extremely long documents or conversations. If your use case involves very long inputs, you may need to implement chunking strategies to manage the context effectively.
Finally, the payment method is limited to cryptocurrency. If your organization prefers to pay with credit cards, PayPal, or bank transfers, this service may not be compatible with your financial workflows. You can only top up with USDT on TRC20 or USDC on Base, which may require additional steps for users who are not familiar with cryptocurrency transactions.
Addressing Common Developer Questions
Developers often ask about the best uncensored models for role-playing and creative writing. Many users are looking for models that can handle complex narratives and diverse character interactions without imposing strict content filters. Our API provides a reliable solution for these use cases, allowing you to generate unfiltered text that fits your creative vision.
Another common question is how to find an uncensored LLM that is not specifically marketed as "spicy" or "character-based." Some developers prefer a more neutral, unfiltered model that tells the truth without trying to be politically correct. Our service offers a straightforward, unfiltered text API that can be used for a variety of purposes, from casual chat to technical tasks.
Users also inquire about the best uncensored LLM for coding and technical tasks. While our model is primarily designed for general text generation, its unfiltered nature can be beneficial for coding tasks that require creative problem-solving or unconventional solutions. You can use the API to generate code snippets, debug errors, or brainstorm ideas without the constraints of traditional content filters.
Finally, developers often ask about the best uncensored LLM available at the moment. While there are many options in the market, our API provides a consistent and reliable experience. You can trust that the model will deliver unfiltered output for lawful adult, fictional, and controversial topics, making it a solid choice for developers who prioritize freedom of expression in their applications.
Verification and Troubleshooting Checklist
To ensure your integration is working correctly, you should perform a series of verification steps. First, confirm that your API key is valid by making a request to the models endpoint. If you receive a 401 error, check that your key is correct and has not been revoked. If you receive a 402 error, ensure that you have sufficient credit in your account.
Next, test the streaming functionality by sending a request with the stream parameter set to true. Verify that you receive chunks of data in real-time and that the final chunk contains the usage information. This step is important for applications that rely on immediate feedback.
You should also test the function calling feature by defining a simple function and requesting the model to call it. Verify that the model returns the correct arguments and that your application can process the response. This step ensures that the API is functioning as expected for more complex use cases.
Finally, check the rate limits by sending multiple requests in quick succession. If you encounter a 429 error, you may need to implement exponential backoff in your code to handle rate limiting gracefully. By following this checklist, you can ensure that your integration is reliable and reliable.
Frequently asked questions
How do I sign up for the uncensored LLM API?
You can sign up by continuing with Google or using an email and password. Your API key is shown immediately after signup, allowing you to start making requests right away.
What payment methods are accepted for topping up credit?
The API accepts crypto payments only, specifically USDT on the TRC20 network or USDC on the Base network. You can top up with amounts between $20 and $500.
Does the API support image or audio generation?
No, the API is text-only. It does not support embeddings, image, audio, video generation, OCR, fine-tuning, or model routing. It serves a single uncensored text model.
What happens if I run out of credit?
If you run out of credit, you will receive a 402 error. You can add more credit by topping up with cryptocurrency. Errors and refusals are free, so you only pay for actual token usage.