Integrating Uncensored LLM API in Python
Developers often seek an uncensored LLM API for Python projects that require raw text generation without the usual guardrails. This guide walks you through configuring an OpenAI-compatible client to connect with our service, ensuring you get the text output you need for your applications.

Setting Up the Python Environment
Before you can integrate our API, you need to prepare your Python environment. The most straightforward way to interact with our service is by using the official openai Python package. This package is widely used and provides a familiar interface for developers who have worked with other large language model providers. You can install it using pip, which is the standard package installer for Python. Once installed, you can import the necessary modules to start making requests.
It is important to note that our API is hosted and OpenAI-compatible. This means you do not need to write custom HTTP clients from scratch. The existing tools you already know will work with our service. You simply need to point your client to the correct base URL. This reduces the learning curve and allows you to focus on building your application logic rather than debugging network connections.
The base URL for our API is https://api.unrestrictedchatbot.cc/v1. You will need to configure your client to use this endpoint instead of the default OpenAI endpoint. This ensures that your requests are routed to our uncensored model. The model ID you must send is uncensored. This tells the server which specific model to use for generating the text response.
Keep in mind that our service is text-in, text-out. We do not support image, audio, or video generation. If your project requires multimodal capabilities, you may need to combine our text API with other tools. For now, focus on setting up your environment to handle text data. This includes configuring your API key and ensuring your network connection is stable. A stable connection is important for maintaining consistent performance during high-volume requests.
Configuring the Client and Authentication
Authentication is handled via an API key that you receive immediately after signing up. You can sign up using Google or an email and password. The key is shown right away, so make sure to copy it securely. This key is required for all requests to our API. Without a valid key, you will receive a 401 error indicating an invalid key. It is essential to store this key in an environment variable or a secure configuration file to avoid exposing it in your code.
When initializing the OpenAI client in Python, you pass the base URL and the API key. This setup allows the client to authenticate your requests automatically. The client handles the headers and formatting for you. You do not need to manually add the authorization header to every request. This simplifies the integration process and reduces the chance of errors in your code.
Our service supports streaming over Server-Sent Events (SSE). This is useful for applications that need to display text as it is generated. The client library supports streaming out of the box. You can enable this feature by setting the stream parameter to true in your request. This allows you to process the output in real-time, which improves the user experience for chat-based applications.
Remember that our API charges based on token usage. You pay $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. Your prepaid credit is charged by real token usage. Errors and refusals are free, so you do not pay for failed requests. This pricing model is transparent and fair. It allows you to control your costs by monitoring your token consumption closely.
Constructing the Request Payload
The core of our API interaction is the request payload. You send a JSON object containing the messages you want the model to process. Each message has a role, such as user or assistant, and content. The content is the text you want to send to the model. You can send multiple messages to provide context for the model. This is similar to how you would interact with other OpenAI-compatible models.
Our model supports a context window of 100,000 tokens. This includes both the prompt and the completion. This large context window allows you to send long documents or conversation histories. You can use this feature to provide detailed instructions or background information to the model. Just be mindful of the token count to stay within your budget.
You can also use parameters to control the model's behavior. The supported parameters include temperature, top_p, stop, seed, and penalties. The temperature controls the randomness of the output. A higher temperature results in more creative responses. The top_p parameter controls the diversity of the output. The stop parameter allows you to specify sequences that terminate the generation.
Function calling is also supported. This allows you to define tools that the model can use. You can pass a list of tools in the request. The model will return a function call if it determines that a tool is needed. This is useful for building applications that need to interact with external systems. You can use this feature to extend the capabilities of your application beyond simple text generation.
Handling Streaming Responses
Streaming responses are a key feature of our API. They allow you to receive text as it is generated, rather than waiting for the entire response to complete. This is particularly useful for chat applications where users expect immediate feedback. The OpenAI Python client handles the parsing of Server-Sent Events automatically. You can iterate over the stream to process each chunk of text.
When streaming, the usage information is included in the last chunk. This allows you to track token consumption in real-time. You can use this information to update your UI or log the usage for billing purposes. It is important to handle the end of the stream correctly to ensure that your application does not hang or crash.
One thing to note is that our API does not support embeddings, image generation, or other multimodal features. If you need those features, you will need to use a different service. For text-based applications, however, our API is fully capable. It provides the speed and flexibility needed for responsive user interfaces.
When implementing streaming, consider adding error handling to manage network issues. If the connection drops, you may need to retry the request. The client library provides tools to help with this. You can also implement a timeout to prevent long-running requests from consuming too many resources. This ensures that your application remains responsive even under heavy load.
When Our API Is Not the Right Choice
While our API is excellent for uncensored text generation, it may not be the right choice for every project. If your application requires image generation, audio synthesis, or video creation, our service will not meet your needs. We do not offer these capabilities. You would need to integrate a separate service for those tasks.
Similarly, if you need fine-tuning capabilities to customize the model for your specific domain, our API does not support this. You would need to use a provider that offers fine-tuning services. Our model is pre-trained and ready to use, but you cannot adjust its weights.
Another limitation is the lack of model routing. Our API serves a single uncensored open-weight text model. If you need to switch between different models based on performance or cost, our service does not support this. You would need to build your own routing logic or use a provider that offers multi-model support.
Finally, if you require a service with a guaranteed SLA or certifications like SOC2 or HIPAA, our API may not be suitable. We are an independent service and do not claim these certifications. For enterprises with strict compliance requirements, you may need to choose a different provider. However, for indie builders and developers who need raw text output, our API is a strong option.
Addressing Common Developer Questions
Developers often ask about the best models for role-playing or creative writing. Our uncensored model is well-suited for these tasks. It does not refuse lawful adult, fictional, or controversial topics. This makes it ideal for generating engaging narratives and character interactions. You can use it to create dynamic storylines and immersive experiences.
Another common question is about the cost of using the API. As mentioned, we charge $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. This is competitive for the level of uncensored output provided. You can estimate your costs by calculating the token count of your requests. The formula is tokens divided by 1,000,000 times the per-million price.
Users also inquire about the trial credit. Every new account gets $0.50 of trial credit, with no card needed. This allows you to test the API before committing to a purchase. You can use this credit to explore the features and evaluate the model's performance. It is a great way to get started without any financial risk.
Finally, developers often wonder about the limits on requests. Our API allows 300 requests per minute per key. This is sufficient for most applications. If you need higher throughput, you can use multiple keys. The rate limit is designed to ensure fair usage and maintain service stability. You can monitor your usage to stay within these limits.
Managing Credits and Payments
Our service uses a prepaid credit system. You top up your account using crypto only. We accept USDT on the TRC20 network or USDC on the Base network. You can top up any whole amount from $20 to $500. This gives you flexibility in how you fund your account. The credit never expires, so you can use it whenever you need it.
If you top up from $50, you receive bonus credit. The bonus ranges from +5% to +15%. This is a great way to get more value for your money. The bonus credit is added to your account immediately after the transaction is confirmed. You can use it just like your regular credit.
Payments are processed securely using blockchain technology. You do not need to provide a credit card or bank account. This adds a layer of privacy and convenience. The transaction is recorded on the blockchain, providing transparency and traceability. You can track your top-ups and usage easily through your account dashboard.
It is important to note that we do not accept cards, PayPal, or bank transfers. If you prefer traditional payment methods, you may need to use a crypto exchange to convert your funds. Once you have the crypto, you can send it to our address to top up your account. The process is straightforward and efficient.
Frequently asked questions
How do I get an API key?
You can sign up using Google or an email and password. The API key is shown immediately after signup. Make sure to copy it and store it securely in your environment variables.
What is the context window size?
Our model supports a context window of 100,000 tokens. This includes both the prompt and the completion. You can send long documents or conversation histories within this limit.
Does the API support streaming?
Yes, the API supports streaming over Server-Sent Events (SSE). You can enable this by setting the stream parameter to true in your request. The usage information is included in the last chunk.
What happens if I run out of credit?
If you run out of credit, you will receive a 402 error. You can top up your account using USDT on TRC20 or USDC on Base. Errors and refusals are free, so you do not lose credit on failed requests.