Integrating an Uncensored API: A Step-by-Step Checklist
Connecting an uncensored text endpoint requires more than just an API key; it demands a clear understanding of authentication flows and error handling. This guide provides a tested checklist for SDK configuration and text-in/text-out workflows using our hosted service.

Understanding the API Endpoint Structure
Before writing any code, you must identify the correct base URL and endpoint paths for your integration. Our service operates as a hosted, OpenAI-compatible chat-completions API. The base URL is https://api.opensourcellmapi.com/v1. You will interact primarily with the POST /v1/chat/completions endpoint for generating text responses. This endpoint accepts text input and returns text output, ensuring a straightforward data flow for your application.
It is important to note that this service serves only one uncensored open-weight text model. The model ID you must send in your requests is "uncensored". Unlike multi-model platforms, you do not need to select or switch between different model versions. This simplicity reduces configuration complexity but means your application is tied to this specific model's behavior and capabilities.
Additionally, the API supports the POST /v1/responses endpoint for alternative response formats and GET /v1/models for retrieving model information. However, the core functionality for text generation remains centered on the chat completions endpoint. Ensure your SDK is configured to point to this specific base URL to avoid connection errors.
Remember that this service does not offer embeddings, image generation, audio processing, or video generation. If your application requires these features, you will need to integrate additional tools. The focus here is strictly on text-in, text-out workflows, making it ideal for chatbots, content generation tools, and data processing pipelines that rely on pure text interaction.
Authentication and Key Management
Authentication is handled via API keys, which are generated immediately upon signup. You can create an account by continuing with Google or using an email and password combination. Once registered, your API key is displayed immediately, allowing you to start integrating without delay. This key is essential for all subsequent requests and must be kept secure to prevent unauthorized usage of your prepaid credits.
When making requests, include your API key in the authorization header. The API validates this key for every request, returning a 401 error if the key is invalid or missing. This immediate feedback helps in debugging connection issues early in the development process. It is important to store your key in environment variables rather than hardcoding it in your source code to maintain security.
Our service uses a prepaid credit system charged by real token usage. Errors and refusals are free, meaning you only pay for successful token generation. The pricing is $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. Top-ups are available in crypto only, specifically USDT on TRC20 or USDC on Base, with amounts ranging from $20 to $500. This model ensures that you only pay for what you use, with no monthly subscriptions or hidden fees.
Keep in mind that paid credit never expires, providing flexibility in when you choose to top up. However, you must monitor your balance to avoid service interruptions. A 402 error indicates that you have no credit left, while a 429 error signifies that you have hit the rate limit. Understanding these error codes is important for maintaining a smooth user experience in your application.
Configuring SDK and Request Parameters
Integrating the API into your application involves configuring your SDK to handle the specific parameters supported by our endpoint. The API supports streaming over Server-Sent Events (SSE), which allows for real-time text generation. This is particularly useful for chat applications where immediate feedback is important. The usage statistics are included in the last chunk of the stream, providing accurate data for billing and monitoring purposes.
For applications requiring structured data, the API supports JSON mode. This ensures that the output is strictly formatted as JSON, making it easier to parse and integrate into your backend systems. You can also utilize function calling (tools) to enable the model to invoke specific functions based on the input. This feature enhances the interactivity of your application by allowing the model to perform actions beyond simple text generation.
Several parameters allow you to fine-tune the model's behavior. You can adjust the temperature for creativity, top_p for diversity, and stop sequences to control output length. The seed parameter allows for reproducible results, which is useful for testing and debugging. Additionally, penalties can be applied to discourage repetitive or unwanted text patterns. These parameters provide granular control over the generation process, allowing you to tailor the output to your specific needs.
When configuring your SDK, ensure that you handle these parameters correctly. Incorrect configuration can lead to unexpected results or increased token usage. Test your integration thoroughly with different parameter combinations to understand their impact on the output. This experimentation will help you optimize your application for both performance and cost efficiency.
Handling Context Windows and Token Usage
Understanding the context window is essential for managing long conversations or large documents. Our API supports a context window of 100,000 tokens, which includes both the prompt and the completion. This generous limit allows for extensive interactions without the need for frequent context truncation. However, it is important to monitor token usage to stay within your prepaid budget.
Token usage is charged based on the number of tokens processed. Input tokens are charged at $0.15 per million, while output tokens are charged at $0.50 per million. To estimate costs, you can use the formula: (tokens divided by 1,000,000) times the per-million price. This allows you to predict expenses before making requests. For example, processing 1 million input tokens would cost $0.15, while generating 1 million output tokens would cost $0.50.
When working with large contexts, consider the trade-offs between context length and response time. Longer contexts may require more processing power and time, potentially affecting the user experience. Additionally, ensure that your application handles the retrieval of previous messages efficiently to maintain the integrity of the conversation history. This is particularly important for applications that rely on long-term memory or complex multi-turn dialogues.
Regularly review your token usage statistics to identify areas for optimization. If you notice high token consumption, consider refining your prompts or adjusting the model parameters to reduce unnecessary output. This proactive approach helps in maintaining cost efficiency while delivering high-quality text generation. Remember that errors and refusals do not incur charges, so you can experiment freely without financial risk.
Error Handling and Rate Limits
Reliable error handling is critical for a smooth user experience. Our API returns specific error codes to help you diagnose issues. A 401 error indicates an invalid API key, which should be checked for correctness and expiration. A 402 error signifies that you have no credit left, requiring a top-up to resume service. A 429 error indicates that you have exceeded the rate limit of 300 requests per minute per key.
To handle rate limits effectively, implement exponential backoff strategies in your application. This involves waiting for a short period before retrying a request, gradually increasing the wait time with each attempt. This approach prevents overwhelming the API and ensures that your application remains responsive even during peak usage. Additionally, consider implementing request queuing to manage high volumes of requests efficiently.
It is also important to handle network errors and timeouts gracefully. These can occur due to connectivity issues or server overload. By implementing retry logic with appropriate delays, you can mitigate the impact of transient errors. Ensure that your application provides clear feedback to users when errors occur, explaining the issue and suggesting possible solutions.
Regularly monitor your API usage and error rates to identify potential issues early. This allows you to address problems before they affect your users. Additionally, consider implementing logging and monitoring tools to track API performance and usage patterns. This data can provide valuable insights into how your application interacts with the API and help you optimize your integration over time.
When This API Is Not the Right Choice
While our API excels in text generation, it may not be the right choice for all applications. If your project requires image, audio, or video generation, you will need to integrate additional tools, as our service focuses solely on text. Similarly, if you need embeddings for semantic search or fine-tuning for custom model behavior, this API does not support these features.
Applications that require on-premises deployment or strict data privacy controls may also find this hosted service less suitable. Our service is cloud-based, and while it offers a reliable and scalable solution, it may not meet the specific infrastructure requirements of enterprises with strict data residency laws. Additionally, if you need real-time audio processing or OCR capabilities, you will need to look elsewhere.
Furthermore, if your application relies on a specific model benchmark or performance metric that our uncensored model does not meet, you may need to consider other options. While our model is designed for unrestricted use, it may not match the performance of specialized models in certain domains. It is essential to evaluate your specific needs and compare them against the capabilities of our API before deciding to integrate.
Finally, if you require a free unlimited tier or subscription-based pricing, our prepaid crypto model may not align with your budget. Our service charges based on actual token usage, which can be cost-effective for variable workloads but may not be ideal for applications with predictable, high-volume usage. Consider your long-term cost projections and usage patterns to determine if this pricing model suits your needs.
Addressing Common Developer Questions
Developers often ask about linking uncensored AI APIs to agentic workflows or frontend tools like Blackbox. The key is to ensure that the API endpoint is correctly configured to handle the specific requirements of your workflow. Our API supports standard chat completions, which can be integrated into various agentic frameworks. However, you may need to adjust the request format to match the expectations of your frontend tool.
Another common question relates to the cost-effectiveness of using an uncensored API compared to local models. While local models offer full control over data and privacy, they require significant hardware resources. Our API provides a hosted solution with no upfront hardware costs, making it a viable option for developers who prefer a managed service. However, for high-volume, low-latency requirements, local inference might be more cost-effective.
Developers also inquire about the ease of integration and the availability of documentation. Our API is designed to be compatible with existing OpenAI SDKs, simplifying the integration process. Detailed documentation is available to guide you through the setup and configuration steps. Additionally, the support for streaming and JSON mode enhances the flexibility of your integration, allowing for real-time updates and structured data handling.
Finally, questions about rate limits and error handling are frequent. Our API supports 300 requests per minute per key, which is sufficient for most applications. However, for high-traffic scenarios, you may need to implement request queuing or multiple API keys to distribute the load. Understanding these limits and implementing appropriate strategies ensures a smooth and reliable integration.
Frequently asked questions
How do I get an API key?
You can create an account by continuing with Google or using an email and password. Your API key is displayed immediately upon signup, allowing you to start using the service right away.
What is the context window size?
The context window is 100,000 tokens, which includes both the prompt and the completion. This allows for extensive interactions without frequent truncation.
How are credits charged?
Credits are charged by real token usage at $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. Errors and refusals are free.
What payment methods are accepted?
Top-ups are accepted in crypto only: USDT on TRC20 or USDC on Base. Amounts range from $20 to $500, with bonus credits available for larger top-ups.