EN ▾
Open account

Integrating Uncensored AI API: SDK Setup Checklist

Developers often seek a straightforward way to connect to an uncensored text API that prioritizes freedom of expression. This guide provides a tested checklist for API key authentication, endpoint configuration, and SDK integration steps to ensure a reliable text-in, text-out experience.

Neon blue terminal screen with code and floating digital tokens in a dark cyberpunk setting

Understanding the API Architecture

Our API is designed as a hosted service that delivers an uncensored open-weight text model. It operates on a simple principle: text in, text out. The base URL for all requests is https://api.uncensensoredai.com/v1. This service does not offer embeddings, image generation, audio processing, or video capabilities. It focuses solely on text completion and chat completions. Developers should note that there is no fine-tuning or model routing available. The model identifier you must send is 'uncensored'. This simplicity allows for rapid integration without the complexity of managing multiple model endpoints.

The API supports standard OpenAI-compatible endpoints. You will primarily interact with POST /v1/chat/completions and POST /v1/responses. A GET /v1/models endpoint is also available to verify the current model status. The context window is fixed at 100,000 tokens, which includes both the prompt and the completion. This large window allows for extensive context retention, which is important for complex conversations or long-form content generation. The service is independent and does not claim to be an official partner of any major AI vendor.

When integrating, remember that this is a prepaid service. There are no monthly subscriptions or fees. Credit is charged based on real token usage. Errors and refusals do not consume credit, which helps manage costs during development. The credit never expires, so you can top up when convenient. This model is ideal for developers who want predictable costs without the risk of unexpected monthly bills. The system is designed to be straightforward, allowing you to focus on building your application rather than managing complex billing cycles.

It is important to understand that the model does not refuse lawful adult, fictional, security-research, or controversial topics. However, there is a hard limit: sexual content involving minors is refused. This ensures a safe environment for most use cases while maintaining the uncensored nature of the service. The API does not claim any SLA percentages, certifications like SOC2 or HIPAA, or on-prem deployment options. It is a cloud-based solution designed for ease of use and accessibility. Developers should check the vendor's documentation for any updates on model performance or feature additions.

Authentication and Key Management

Authentication is handled via an API key that is generated upon signup. You can create an account using Google or an email and password combination. The key is shown immediately after registration, so ensure you save it securely. The key is required for all API requests. If the key is invalid, you will receive a 401 error. If you do not have enough credit, you will receive a 402 error. Rate limits are enforced at 300 requests per minute per key, resulting in a 429 error if exceeded.

To use the API, include the API key in the Authorization header of your HTTP requests. The format is typically 'Bearer '. This standard method ensures compatibility with most HTTP clients and SDKs. The key is unique to your account and should not be shared publicly. If you suspect the key has been compromised, you can regenerate it from your account dashboard. The key allows access to all features, including streaming, function calling, and JSON mode.

It is important to manage your API key carefully. Since the service is prepaid, unauthorized use of your key will consume your credit. Monitor your usage regularly to detect any unusual activity. The API does not support multiple keys per account, so you must rely on the single key provided. This simplifies management but requires vigilance in securing the key. Store the key in environment variables or a secure configuration file in your application code.

When integrating with third-party tools, ensure that the API key is not hardcoded in your source code. Use environment variables or a secrets manager to inject the key at runtime. This practice enhances security and prevents accidental exposure of your credentials. The API does not offer role-based access control, so the key grants full access to your account. Treat the key as a master password for your service. Regularly review your account activity to ensure that the key is being used as expected.

SDK Integration and Configuration

Integrating the API with your preferred SDK is straightforward due to its OpenAI compatibility. Most popular SDKs support the standard chat completions endpoint. You need to configure the base URL to point to https://api.uncensensoredai.com/v1. This ensures that your requests are routed to the correct service. The model ID to use is 'uncensored'. This model is optimized for generating text without the typical guardrails found in other models.

When configuring the SDK, set the temperature, top_p, stop sequences, and seed parameters as needed. These parameters allow you to control the randomness and creativity of the output. The API supports streaming over Server-Sent Events (SSE), which is useful for real-time applications. Usage information is included in the last chunk of the stream, allowing you to track token consumption in real-time. This feature is particularly valuable for monitoring costs during active sessions.

Function calling and JSON mode are also supported. You can define tools for the model to call, and the API will return structured data. This is useful for building agents or applications that require specific data formats. The API supports parameters like temperature, top_p, stop, seed, and penalties. These settings allow you to fine-tune the model's behavior to match your application's needs. Experiment with these parameters to find the optimal configuration for your use case.

Ensure that your SDK is configured to handle errors gracefully. The API returns standard HTTP status codes for errors. A 401 error indicates an invalid key, a 402 error indicates insufficient credit, and a 429 error indicates a rate limit exceeded. Implement retry logic for transient errors, but be cautious with 402 errors, as they require a top-up. The API does not offer a free tier, so all requests consume credit unless they are errors or refusals. This makes accurate error handling essential for cost management.

Handling Streaming and Responses

Streaming responses are a key feature of this API, allowing for real-time text generation. When you enable streaming, the API sends chunks of text as they are generated. This is ideal for chat applications where users expect immediate feedback. The usage information, including token counts, is included in the last chunk of the stream. This allows you to track consumption accurately without waiting for the entire response to complete.

To implement streaming, configure your SDK to listen for SSE events. Parse each chunk and append it to the output display. This creates a smooth user experience, especially for long responses. The API supports standard SSE formatting, so most modern browsers and HTTP clients can handle it natively. Ensure that your application can handle partial responses and resume if the connection is interrupted. This resilience is important for maintaining a reliable user experience.

When using streaming, be mindful of the rate limits. The API allows 300 requests per minute per key. If you are streaming multiple responses concurrently, ensure that you do not exceed this limit. If you do, you will receive a 429 error. Implement backoff strategies to handle rate limit errors gracefully. The API does not offer priority queuing, so all requests are treated equally. Monitor your usage to ensure that you stay within the limits.

Non-streaming responses are also supported. If you prefer to wait for the full response before processing, you can disable streaming. This can be useful for batch processing or when you need the entire response before taking action. However, streaming is generally recommended for interactive applications. The choice between streaming and non-streaming depends on your specific use case. Consider the user experience and the technical requirements of your application when making this decision.

Token Usage and Cost Management

Understanding token usage is essential for managing costs. The API charges $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. These prices are fixed and do not vary based on the model or usage volume. Credit is charged based on real token usage, meaning that errors and refusals are free. This can help reduce costs during development and testing phases.

To estimate costs, calculate the number of tokens in your prompt and the expected number of tokens in the response. Use the formula: (tokens divided by 1,000,000) times the per-million price. For example, if you send 100,000 input tokens and receive 50,000 output tokens, the cost would be (100,000 / 1,000,000) * $0.15 for input and (50,000 / 1,000,000) * $0.50 for output. This method allows you to predict costs accurately before making requests.

Prepaid credit is required to use the API. You can top up using crypto, specifically USDT on TRC20 or USDC on Base. The minimum top-up amount is $20, and the maximum is $500. Bonus credit is available for top-ups of $50 or more, ranging from +5% to +15%. This bonus can help maximize your credit and reduce the frequency of top-ups. The credit never expires, so you can top up when convenient.

Monitor your usage regularly to ensure that you have sufficient credit. The API does not offer a free tier, so all requests consume credit unless they are errors or refusals. If you run out of credit, you will receive a 402 error. Implement alerts or dashboards to track your usage and anticipate when you need to top up. This proactive approach ensures that your application remains available and responsive. The API does not offer invoices or bank transfers, so crypto is the only payment method.

When This API Is Not the Right Choice

While our API is excellent for uncensored text generation, it may not be the right choice for all use cases. If you need image, audio, or video generation, this API does not support those capabilities. It is a text-only service. If you require embeddings for semantic search, this API does not provide them. Similarly, if you need OCR for text extraction from images, this API does not offer that feature.

Fine-tuning is another capability that this API does not support. If you need to train the model on your specific data, you will need to look for a different service. Model routing is also not available, so you cannot switch between different models dynamically. If your application requires these features, consider a more comprehensive AI platform.

Additionally, if you need on-premises deployment for data privacy or compliance reasons, this hosted service may not meet your requirements. The API does not offer SLA guarantees or certifications like SOC2 or HIPAA. If your industry has strict regulatory requirements, you may need a solution that offers these assurances. The API is designed for developers who prioritize freedom of expression and simplicity over advanced enterprise features.

Finally, if you are looking for a free tier or a pay-as-you-go model without prepaid credit, this API may not be suitable. The service requires prepaid credit, and there is no free unlimited tier. The trial credit of $0.50 is available for new accounts, but it is limited. If you need a solution that offers more flexibility in pricing or a broader range of features, consider exploring other options. This API is best suited for developers who want a straightforward, uncensored text API with predictable costs.

Addressing Common Developer Questions

Developers often discuss the nature of uncensored AI in online forums. Many users note that uncensored models can be 'extremely horny' because they are trained on data from the internet, including creative writing and fan fiction. This means the model may generate content that is more emotionally expressive or imaginative than standard models. However, this does not mean the model is illogical or incapable of reasoning. It simply means it is less constrained by typical safety filters.

Another common discussion point is the balance between freedom and functionality. Some developers seek an AI that acts like a true AI, not a 'hall monitor,' but still maintains technical proficiency. The search for an uncensored AI that is also technically advanced is a common theme. Users often find that de-censoring open-source models can sometimes make them 'a bit stupider' due to the manipulation required. Our API offers a pre-configured model that balances freedom with performance.

Developers also discuss the demand for open, uncensored AI and the challenges of model decentralization. While there is demand, the business market can be complex. Some users argue that the market is not truly free due to the influence of large companies and government regulations. Our API provides a simple, independent solution that avoids these complexities. It offers a straightforward way to access uncensored text generation without the need for complex infrastructure.

Finally, users often ask for recommendations on the best uncensored AI generators. While there are many options, our API stands out for its simplicity and reliability. It offers a hosted solution with a large context window and predictable pricing. Developers can integrate it quickly and start generating text immediately. The API does not claim to be the 'best' in all metrics, but it is a solid choice for those who value freedom and ease of use. Check the vendor's documentation for more details on current features and limits.

Frequently asked questions

How do I authenticate with the API?

Include your API key in the Authorization header as 'Bearer '. You can obtain this key immediately after signing up with Google or email.

What is the cost per token?

The API charges $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. Errors and refusals are free.

Can I use crypto for payment?

Yes, you can top up using USDT on TRC20 or USDC on Base. The minimum amount is $20, and the maximum is $500.

Does the API support streaming?

Yes, the API supports streaming over Server-Sent Events (SSE). Usage information is included in the last chunk of the stream.