Integrating Uncensored AI API with Custom Workflows
Developers often seek a straightforward way to integrate uncensored language models into their applications without complex vendor lock-in. This guide outlines the essential steps for connecting to an OpenAI-compatible endpoint, ensuring your workflow handles text generation with minimal friction.

Understanding the API Endpoint Structure
Before writing any code, it is essential to understand the base URL and the specific endpoints available for integration. The service provides a standard OpenAI-compatible interface, which means most existing SDKs can connect with minimal modification. The base URL for all requests is https://api.unrestrictedai.cc/v1. This structure ensures that developers familiar with OpenAI's API can transition smoothly to this uncensored model.
The primary endpoint for generating text is POST /v1/chat/completions. This endpoint accepts JSON payloads containing messages, model identifiers, and various generation parameters. By using a familiar structure, teams can use existing client libraries and reduce the learning curve for new integrations. The model identifier to use for uncensored outputs is simply "uncensored". This single model ID simplifies the configuration process, as there is no need to select from multiple model versions or sizes.
Additional endpoints include POST /v1/responses for alternative response formats and GET /v1/models to retrieve available model information. However, the core functionality relies on the chat completions endpoint. It is important to note that this service does not support embeddings, image generation, audio processing, or video creation. The focus is strictly on text-in, text-out capabilities. Developers should verify the current endpoint details in the official documentation to ensure compatibility with their specific version requirements.
When integrating, ensure that your HTTP client is configured to handle JSON requests and responses. The API expects standard headers, including an authorization header with your API key. This key is generated immediately upon signup, either via Google or email. Keeping your key secure and rotating it periodically is a best practice for maintaining access to the service. The API key is shown immediately after account creation, allowing for rapid prototyping and testing.
Configuring Parameters for Maximum Freedom
To achieve uncensored outputs, configuring the generation parameters correctly is important. The API supports several parameters that influence the model's behavior, including temperature, top_p, stop sequences, seed, and penalties. These parameters allow developers to fine-tune the creativity and randomness of the generated text. By adjusting these settings, you can control how deterministic or varied the model's responses are.
Setting the temperature parameter to a higher value increases the randomness of the output, making the model more creative and less predictable. This is often desirable for uncensored content where diverse and unconventional responses are expected. Similarly, top_p controls the nucleus sampling, limiting the model to consider only the top percentage of tokens with sufficient probability. Combining a high temperature with an appropriate top_p setting can yield rich, unfiltered text that aligns with the uncensored nature of the model.
The stop parameter allows you to specify sequences that signal the end of a generation. This is useful for controlling the length of the output or stopping the model at specific markers. The seed parameter enables reproducibility by setting a starting point for the random number generator. This is particularly useful for debugging and testing, as it ensures that the same inputs produce the same outputs. Penalties can be applied to discourage certain tokens, further refining the output quality.
It is important to experiment with these parameters to find the optimal configuration for your specific use case. Different applications may require different balances between creativity and coherence. For example, a chatbot might benefit from a lower temperature for more consistent responses, while a creative writing tool might prefer a higher temperature for more imaginative outputs. Always refer to the API documentation for the latest details on parameter behavior and limits.
Implementing Streaming Responses
Streaming responses are a key feature for providing a smooth user experience in chat applications. The API supports streaming over Server-Sent Events (SSE), allowing developers to receive partial responses as they are generated. This reduces the perceived latency for users, as they can start reading the response before it is fully completed. Implementing streaming requires handling the SSE stream and parsing the incoming data chunks.
When using streaming, the usage information, such as token counts, is typically included in the last chunk of the response. This allows developers to track token consumption accurately for billing purposes. The API charges based on real token usage, with prepaid credit deducted for each token generated. Errors and refusals are free, so streaming errors do not incur additional costs. This billing model ensures that you only pay for the actual content generated.
To implement streaming, configure your HTTP client to handle SSE streams. Most modern programming languages have libraries that simplify this process. For example, in Python, you can use the requests library with a stream option, or in JavaScript, you can use the fetch API with a ReadableStream. Ensure that your client can handle partial responses and update the user interface in real-time. This provides a smooth experience for users interacting with the uncensored model.
Additionally, consider handling edge cases where the stream might be interrupted or fail. Implementing retry logic and error handling is essential for reliable applications. The API returns specific error codes, such as 401 for invalid keys, 402 for insufficient credit, and 429 for rate limits. Handling these errors gracefully ensures that your application remains stable even under adverse conditions. Always check the API documentation for the latest details on streaming behavior and error codes.
Managing Credits and Rate Limits
Understanding the credit system and rate limits is important for maintaining uninterrupted service. The API operates on a prepaid credit model, where users purchase credit using cryptocurrency. The accepted payment methods are USDT on the TRC20 network or USDC on the Base network. Credits can be topped up in amounts ranging from $20 to $500. This flexibility allows users to choose the amount that best fits their needs.
New accounts receive $0.50 of trial credit, allowing for immediate testing without requiring a payment method. This trial credit is sufficient for initial exploration and integration testing. Paid credit never expires, providing long-term value for users who do not consume their credits quickly. However, it is important to monitor your balance to avoid service interruptions. The API charges $0.15 per million input tokens and $0.50 per million output tokens. Errors and refusals are free, so you only pay for successful generations.
Rate limits are set at 300 requests per minute per key. This limit ensures fair usage and prevents abuse. If you exceed this limit, the API returns a 429 error. Implementing exponential backoff in your application can help manage rate limits effectively. This involves waiting for a short period before retrying a request, increasing the wait time with each subsequent attempt. This strategy helps prevent overwhelming the API and ensures smooth operation.
It is also important to note that the API does not support subscriptions or monthly fees. Users pay only for what they use, with no recurring charges. This model is ideal for developers who want to avoid fixed costs and only pay for actual usage. Always check the official documentation for the latest details on credit management and rate limits to ensure your application runs smoothly.
Handling Function Calling and JSON Mode
For developers building agentic workflows or applications that require structured data, the API supports function calling and JSON mode. Function calling allows the model to generate structured data that can be used to invoke functions in your application. This is particularly useful for tasks such as extracting information from text, generating code, or interacting with external APIs. The API supports the standard OpenAI function calling format, making it easy to integrate with existing tools.
JSON mode ensures that the model outputs valid JSON, which is essential for parsing and processing the generated data. This mode is useful for applications that require strict data formats, such as databases or configuration files. By enabling JSON mode, you can reduce the need for post-processing and validation, making your application more efficient and reliable. The API supports various parameters that can be used to fine-tune the output format, ensuring that the generated data meets your specific requirements.
When using function calling, define the functions your application supports and provide their schemas to the API. The model will then generate structured data that matches these schemas. This allows for smooth integration between the AI model and your application logic. You can also use the stop parameter to control the length of the generated JSON, ensuring that it does not exceed your application's limits. Always refer to the API documentation for the latest details on function calling and JSON mode behavior.
Additionally, consider using the seed parameter to ensure reproducibility when generating structured data. This is particularly useful for testing and debugging, as it allows you to reproduce specific outputs. By combining function calling with JSON mode, you can build reliable applications that use the power of uncensored AI while maintaining data integrity. Always test your integration thoroughly to ensure that the generated data meets your application's requirements.
When This API Is Not the Right Choice
While this uncensored API is powerful for text generation, it may not be the right choice for every project. If your application requires image, audio, or video generation, this service does not support these capabilities. The API is strictly text-in, text-out, meaning it cannot process or generate multimedia content. Developers looking for a comprehensive AI solution that includes multimodal capabilities should consider other vendors that offer image and video generation.
Similarly, if you need embeddings for semantic search or vector databases, this API does not provide embedding endpoints. The focus is on chat completions and text generation. For projects that require semantic search or vector-based retrieval, you may need to integrate a separate embedding service. This adds complexity to your architecture but ensures that you have the necessary tools for your specific use case.
Additionally, if you require fine-tuning of the model to specialize it for your domain, this API does not support fine-tuning. The model is pre-trained and ready to use, but you cannot train it on your own data. For projects that require a customized model, you may need to explore other options that offer fine-tuning capabilities. This is an important consideration for teams that need a model tailored to their specific data and requirements.
Finally, if you need on-premises deployment for data privacy or compliance reasons, this hosted service may not be suitable. The API is a cloud-based service, meaning your data is processed on the provider's servers. For projects that require strict data control and on-premises deployment, you may need to consider other vendors that offer self-hosted solutions. Always evaluate your specific needs and constraints before choosing this API for your workflow.
Addressing Common Developer Inquiries
Developers frequently inquire about specific SDK settings and request headers required to enable uncensored outputs. A common question is how to configure the API for maximum freedom in outputs. The key is to use the uncensored model ID and adjust parameters like temperature and top_p to encourage creative and unfiltered responses. By setting a high temperature, you increase the randomness of the output, making it more likely to produce diverse and unconventional text.
Another common inquiry is about the integration of streaming responses. Developers often ask how to handle Server-Sent Events (SSE) for real-time updates. The API supports streaming, and the usage information is included in the last chunk of the response. This allows for accurate token tracking and billing. Developers should ensure their clients can handle SSE streams and parse the incoming data chunks correctly.
Users also ask about the differences between this API and other uncensored models available on the market. While other vendors may offer similar uncensored models, this API provides a simple, OpenAI-compatible interface with a focus on text generation. It is important to check the vendor's documentation for current prices, limits, and features, as these can vary. The key advantage of this API is its straightforward integration and prepaid credit model, which avoids subscription fees.
Finally, developers often inquire about the hard content limits of the API. The API refuses requests involving sexual content with minors, which is a standard safety measure. However, it does not refuse other lawful adult, fictional, security-research, or controversial topics. This makes it suitable for a wide range of applications, from creative writing to research. Always refer to the API documentation for the latest details on content limits and refusal criteria.
Frequently asked questions
How do I enable uncensored outputs in the API?
Use the model ID "uncensored" and set the temperature parameter to a higher value to increase randomness. You can also adjust top_p to control the nucleus sampling for more diverse outputs.
What payment methods are accepted for topping up credits?
The API accepts cryptocurrency only, specifically USDT on the TRC20 network or USDC on the Base network. You can top up with any whole amount from $20 to $500.
Does the API support image or video generation?
No, the API is strictly text-in, text-out. It does not support embeddings, image, audio, or video generation. For multimedia capabilities, you may need to integrate other services.
How are errors and refusals billed?
Errors and refusals are free. You only pay for successful token usage, with charges of $0.15 per million input tokens and $0.50 per million output tokens.
More guides
- Unrestricted AI Models: A Developer Comparison
- Curl AI API Examples: Chat, Stream, JSON and Tools
- Agentic AI Using LangChain With an Uncensored API
- How to Integrate an Unrestricted AI API for Uncensored Outputs
- Estimating Uncensored AI API Costs for Developers
- Troubleshooting Uncensored AI API Outputs and Safety