Integrating Unrestricted AI Model: JSON Mode and SDK Setup
Developers often struggle with parsing responses from uncensored text APIs in automated workflows. This guide provides a step-by-step integration checklist, covering SDK configuration, JSON mode settings, and error handling to ensure your application handles text-in, text-out requests smoothly.

Understanding the Uncensored Text API
The core of this service is a hosted, OpenAI-compatible chat-completions API. It serves a single uncensored open-weight text model, identified by the ID "uncensored". The interface is strictly text in, text out, meaning you send prompts and receive text responses. There are no embeddings, image generation, audio processing, or video capabilities. This simplicity makes it ideal for developers who need reliable text generation without the overhead of multimodal features.
The base URL for all requests is https://api.unrestrictedaimodel.top/v1. You will interact with three main endpoints: POST /v1/chat/completions for generating responses, POST /v1/responses for alternative response formats, and GET /v1/models to verify available models. Keeping these endpoints in mind ensures your integration stays within the supported scope of the service.
One key feature is the lack of content refusal for lawful adult, fictional, security-research, or controversial topics. The model does not refuse these requests, which is the primary reason developers seek this uncensored option. However, there is a hard limit: sexual content involving minors is refused. Understanding this boundary helps in designing your application's content filters if needed.
When integrating, remember that this is an independent service. It is not an official site or partner of any other company. The model is uncensored, but the service itself has specific pricing and limit structures. Always refer to the product facts for current details, as features like streaming and function calling are supported, but more complex capabilities like fine-tuning are not available.
Configuring JSON Mode for Structured Output
One of the most powerful features for developers is JSON mode. This setting ensures that the model outputs data in a valid JSON format, which is important for automated workflows. To enable this, you include the response_format parameter in your request with the value {"type": "json_object"}. This tells the model to structure its response as a JSON object, making it easier to parse in your application code.
When using JSON mode, the model will attempt to adhere to the structure you expect. However, since the model is uncensored, it might include unexpected fields or data types if not properly constrained. It is best to provide clear instructions in your system prompt to guide the model toward the desired JSON structure. This reduces the likelihood of parsing errors and ensures consistent output.
Another important parameter to consider is temperature. Adjusting the temperature can affect the randomness of the output. A lower temperature makes the output more deterministic, which is beneficial for JSON generation. Experiment with different temperature values to find the right balance between creativity and consistency for your specific use case.
Additionally, you can use top_p and stop parameters to further control the output. The top_p parameter limits the diversity of tokens considered, while stop allows you to specify sequences that terminate the response. These parameters help in fine-tuning the model's behavior to meet your application's requirements.
Setting Up SDKs and Authentication
Getting started with the API requires signing up for an account. You can continue with Google or use an email and password combination. Upon signup, you receive an API key immediately, which is essential for authenticating your requests. The key is shown right after registration, so make sure to store it securely in your environment variables or secret manager.
Authentication is handled via the API key in the request header. Ensure that your SDK is configured to include this key in every request. If the key is invalid, you will receive a 401 error. This error indicates that the key provided is not recognized or has been revoked. Always check your key validity if you encounter this issue.
The API supports multiple SDKs, allowing you to integrate it into various programming languages. If you are using Python, JavaScript, or another language, the OpenAI-compatible interface means you can likely use existing SDKs with minor adjustments. This compatibility simplifies the integration process, as you do not need to learn a new API structure from scratch.
Remember that the API key is tied to your prepaid credit. If you run out of credit, you will receive a 402 error. To avoid interruptions, monitor your usage and top up your account as needed. The API key remains valid as long as you have credit, so ensure your billing is up to date.
Handling Streaming and SSE Events
Streaming is a key feature for real-time applications. The API supports streaming over Server-Sent Events (SSE), allowing you to receive responses chunk by chunk. This is particularly useful for chat applications where you want to display text as it is generated. The usage information is included in the last chunk, so you can track token consumption in real-time.
To implement streaming, set the stream parameter to true in your request. The API will then send a series of SSE events, each containing a partial response. Your application needs to handle these events and concatenate the chunks to form the complete response. This approach reduces the perceived latency for users, as they see text appearing immediately.
When working with streaming, it is important to handle errors gracefully. If the connection is interrupted, you may need to retry the request. The API supports retries, but be mindful of the rate limits. The API allows 300 requests per minute per key, so ensure your application does not exceed this limit to avoid a 429 error.
Additionally, you can use the seed parameter to ensure reproducibility in your streaming responses. By setting a specific seed, you can get the same response for the same input, which is useful for testing and debugging. This feature helps in maintaining consistency across different runs of your application.
Managing Credits and Pricing
The API uses a prepaid credit system, charged by real token usage. Errors and refusals are free, which means you only pay for successful responses. The pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens. This transparent pricing allows you to estimate costs based on your expected token usage.
To top up your account, you can use cryptocurrency. The supported currencies are USDT on TRC20 or USDC on Base. You can top up any whole amount from $20 to $500. Additionally, there are bonus credits available for top-ups of $50 or more, ranging from +5% to +15%. This bonus credit can help you get more value for your money.
It is important to note that paid credit never expires. This means you can top up your account at your convenience and use the credit whenever you need it. There are no monthly fees or subscriptions, making it a flexible option for developers with variable usage patterns.
When estimating costs, focus on token counts rather than dollar amounts. Use the formula (tokens divided by 1,000,000 times the per-million price) to calculate the cost. This approach helps you understand the true cost of your API usage without being distracted by fluctuating currency values.
When This API Is Not the Right Choice
While this API is excellent for uncensored text generation, it may not be the right choice for all use cases. If you need embeddings, image generation, audio processing, or video generation, this service does not support those features. The API is strictly text-in, text-out, so applications requiring multimodal capabilities should look elsewhere.
Additionally, if you need fine-tuning or model routing, this API does not offer these features. The service serves a single uncensored open-weight model, so you cannot switch between different models or fine-tune the model for specific tasks. Developers requiring these advanced features should consider other providers.
Another consideration is the payment method. The API accepts only cryptocurrency, specifically USDT on TRC20 or USDC on Base. If you prefer to pay with credit cards, PayPal, or bank transfers, this service may not be suitable for you. The crypto-only payment model is a key differentiator that may not appeal to all users.
Finally, if you need an SLA guarantee or certifications like SOC2, HIPAA, or ISO, this service does not provide these. The service is an independent platform without these formal guarantees. Developers requiring strict compliance or uptime guarantees should evaluate other options carefully.
Addressing Common Developer Questions
Developers often ask about the best ways to handle uncensored LLMs for specific tasks. Threads on Reddit discuss various tools and models, with users sharing their experiences and recommendations. For example, some users look for free uncensored LLMs to help adjust prompts for image generation models. Others seek tools for creating NSFW content or stories.
One common question is how to find the best unrestricted AI for porn videos or images. Users often compare different services, noting that some offer free credits or better quality than paid options. It is important to note that while this API is uncensored, it is primarily for text generation. For image and video generation, you may need to combine it with other tools.
Another frequent topic is the comparison between different uncensored models. Users discuss the pros and cons of various models, such as Gemma or Llama variants, and how they perform in different scenarios. It is helpful to check the documentation of other vendors for current prices and limits, as these can change frequently.
Finally, developers often ask about the best way to integrate uncensored AI into their workflows. This guide provides a step-by-step approach, covering SDK setup, JSON mode, and error handling. By following these steps, you can ensure a smooth integration and maximize the benefits of the uncensored text API.
Frequently asked questions
How do I enable JSON mode in the API?
Set the response_format parameter to {"type": "json_object"} in your request. This ensures the model outputs valid JSON, which is easier to parse in your application.
What happens if I run out of credit?
You will receive a 402 error. You can top up your account with USDT on TRC20 or USDC on Base to continue using the API.
Can I use this API for image generation?
No, the API is strictly text-in, text-out. It does not support image, audio, or video generation. You would need to use a different service for those capabilities.
Is there a free trial available?
Yes, every new account gets $0.50 of trial credit, and no card is needed. This allows you to test the API before making a purchase.