Integrating the Uncensored API with Python
Developers often seek a straightforward way to integrate an uncensored text model into their Python applications. This guide walks you through the essential steps for connecting to our API, from setting up authentication to handling streaming responses.

Setting Up Your Environment
Before writing any code, you need to obtain an API key. Our service allows you to sign up using Google or an email and password combination. Once you create an account, the API key is displayed immediately on your dashboard. This key is the primary credential you will use to authenticate your requests. You do not need to attach a credit card or provide banking details to start. The trial credit of $0.50 is available without any payment method verification.
Ensure your Python environment has the necessary libraries installed. While you can use standard HTTP libraries, using a client library simplifies the handling of JSON payloads and streaming data. Install the required packages using pip to ensure compatibility with the API's endpoint structure. This step prepares your development environment to communicate effectively with the server.
The base URL for our API is https://api.openaireverseproxy.com/v1. You must include this URL in your configuration files or environment variables. Keeping this URL central makes it easier to update if the domain changes in the future. It also helps in maintaining a clean codebase where endpoint configurations are distinct from business logic.
Verify your key by making a simple request to the models endpoint. This GET request confirms that your authentication is working correctly. If you receive a valid response, you are ready to proceed with more complex interactions. This early validation prevents frustrating debugging sessions later in the development process.
Handling Crypto Top-Ups
Our pricing model relies on prepaid credit charged by real token usage. To add funds, you must use cryptocurrency. The supported networks are USDT on TRC20 or USDC on Base. You can top up any whole amount between $20 and $500. This range ensures efficient transaction processing while allowing flexibility for different budget sizes.
There is no monthly subscription fee, and your paid credit never expires. This structure is ideal for developers who want to pay only for what they use. Errors and refusals are free, so you only pay for successful token generation. This model reduces the risk of unexpected charges for failed requests.
When you top up, you may receive bonus credit if your amount is $50 or more. The bonus ranges from 5% to 15%, depending on the top-up amount. This bonus provides additional value for larger investments. Keep track of your balance in the dashboard to monitor your usage and avoid running out of credits during critical tasks.
Since no cards or PayPal are accepted, ensure your wallet is funded before initiating a top-up. The process is straightforward: send the specified amount to the provided address. Once confirmed, the credit is added to your account. This method offers a fast and borderless way to fund your API usage without traditional banking delays.
Configuring Streaming Responses
Streaming is a key feature for building responsive applications. Our API supports streaming over Server-Sent Events (SSE). This allows you to receive text chunks as they are generated, rather than waiting for the entire response. This is particularly useful for chat interfaces where users expect immediate feedback.
To enable streaming, set the appropriate parameter in your request. The usage information is included in the last chunk of the stream. This allows you to track token consumption in real-time. You can then update your UI to reflect the current cost or usage limits.
Implementing streaming in Python involves handling the SSE stream correctly. You need to parse each chunk and display it to the user. This approach reduces perceived latency and improves the user experience. It also allows you to interrupt the generation if the user changes their mind.
Remember that the context window is 100,000 tokens. This includes both the prompt and the completion. Ensure your streaming logic can handle large responses without memory issues. Monitoring the stream length helps in managing the context window effectively.
Managing Parameters and Limits
The API supports several parameters to control the output. You can adjust temperature, top_p, stop sequences, and seed. These parameters allow you to fine-tune the model's behavior. For example, a lower temperature produces more deterministic outputs, while a higher temperature increases creativity.
The penalty parameters help in controlling repetition and diversity. You can set stop sequences to halt generation at specific points. This is useful for formatting outputs or preventing the model from going off-topic. The seed parameter allows for reproducible results, which is valuable for testing and debugging.
Your API key is limited to 300 requests per minute. This rate limit applies to all endpoints. If you exceed this limit, you will receive a 429 error. Plan your requests accordingly to avoid throttling. You can implement retry logic with exponential backoff to handle rate limits gracefully.
Errors such as 401 (invalid key) and 402 (no credit) are common. Handle these errors in your code to provide clear feedback to users. A 401 error indicates an authentication issue, while a 402 error means you need to top up your account. Addressing these errors promptly ensures a smooth user experience.
When This API Is Not the Right Choice
While our API is powerful for text generation, it is not suitable for all use cases. If you need image, audio, video, or embedding generation, this service is not the right choice. It is a text-in, text-out model only. You cannot use it for OCR, fine-tuning, or model routing.
If your application requires real-time voice interaction, our text-only API may not meet your needs. You would need to integrate a separate speech-to-text and text-to-speech service. Similarly, if you need to process documents with complex layouts, OCR capabilities are not included.
Developers looking for benchmark scores or SLA guarantees should note that we do not claim specific performance metrics. Our focus is on providing an uncensored text model with transparent pricing. If you require enterprise-level support or specific certifications, this service may not align with your requirements.
For projects requiring extensive model routing or multi-model support, our single-model approach might be limiting. We serve one uncensored open-weight model. If you need to switch between different models based on the task, you would need to build that logic yourself or use a different provider.
Addressing Community Concerns
Discussions in communities like r/Futurology and r/technology often highlight concerns about AI ethics and surveillance. Users are increasingly wary of AI providers that integrate closely with military or government entities. This has led to a growing movement to cancel services perceived as compromising user privacy or autonomy.
Our API addresses these concerns by offering an uncensored model that does not refuse lawful adult, fictional, or controversial topics. This appeals to developers who want more control over their AI interactions. The model does not impose external ethical filters, allowing for more flexible use cases.
Users also discuss the profitability and business models of major AI companies. There is skepticism about the long-term sustainability of free or heavily subsidized services. Our prepaid model offers transparency, allowing users to see exactly what they are paying for. This approach builds trust with developers who value financial clarity.
Another common topic is the reliability of AI in simulations, such as war games. Users want AI that behaves predictably and does not overreact. Our model's uncensored nature allows for more realistic simulations without artificial constraints. This is particularly relevant for developers working on gaming or simulation projects.
Testing and Troubleshooting
Testing your integration is important to ensure everything works as expected. Start with a simple prompt to verify that the API responds correctly. Check the status codes and ensure you are receiving the expected text output. This basic test confirms that your authentication and endpoint configuration are correct.
Next, test the streaming functionality. Send a request with streaming enabled and verify that you receive chunks of text in real-time. Monitor the usage information in the last chunk to ensure it matches your expectations. This step validates your handling of SSE streams.
If you encounter errors, check the response codes. A 401 error means your key is invalid, while a 402 error indicates insufficient credit. A 429 error suggests you have exceeded the rate limit. Address these issues by updating your key, topping up your account, or adjusting your request frequency.
Finally, test the hard content limit. Try sending a request with sexual content involving minors to ensure it is refused. This confirms that the model adheres to the specified content policy. Regular testing helps maintain a reliable integration and ensures a smooth user experience.
Frequently asked questions
How do I get an API key?
Sign up with Google or email and password. The key is shown immediately on your dashboard. No credit card is needed for the trial.
What payment methods are accepted?
We accept only crypto: USDT on TRC20 or USDC on Base. Top-ups range from $20 to $500. Cards and PayPal are not supported.
Is there a rate limit?
Yes, the limit is 300 requests per minute per key. Exceeding this results in a 429 error. Plan your requests to stay within this limit.
Does the API support image generation?
No, this is a text-only API. It does not support image, audio, video, or embedding generation. Use it for text-in, text-out tasks.