EN ▾
Try with trial credit

Uncensored ai Production Checklist

Developers need a production-ready, unrestricted endpoint that handles adult content without breaking their existing code. This guide walks you through the critical integration steps for an uncensored AI API, focusing on token management, streaming, and policy boundaries.

Last updated

Summary

  1. Use the standard /v1/chat/completions endpoint with your specific base URL and model id.
  2. Strictly monitor input and output token counts to avoid truncation in long context windows.
  3. Implement Server-Sent Events (SSE) to stream responses for a better user experience.
  4. Validate content policy boundaries early, especially regarding age restrictions and refusal behavior.

1. Verify Your Base URL and Endpoint Compatibility

Start by confirming your base URL matches the service provider's documentation. We use the standard /v1/chat/completions path, which means you can reuse most OpenAI-compatible client libraries without major changes. Just update the base_url and provide your API key in the header. Our model id is simply uncensored, so you do not need to hunt for complex model names. This approach ensures that your existing integration logic remains intact while granting access to unrestricted generation capabilities.

Check your client library version to ensure it supports the latest API parameters. Some older SDKs might struggle with new features like tool calling or JSON mode. Verify that the library can handle the specific response format returned by the server. If you encounter errors, compare your request structure against the official OpenAI documentation for a baseline. This standardization reduces debugging time significantly when switching from a moderated model to an uncensored one.

2. Handle Token Counts: Input vs. Output Limits

Your API calls will fail if you exceed the token limits defined by the provider. We charge $0.15 per 1M input tokens and $0.50 per 1M output tokens, so accurate counting matters for cost prediction. The context window supports up to 100,000 tokens combined, but the maximum output per request is 16,000 tokens. If you do not set max_tokens, the default is 2,048 tokens. This default is often too short for complex reasoning or long-form content generation.

Monitor your token usage closely during the initial integration phase. Use the streaming response to track token consumption in real-time. This helps you adjust your max_tokens setting dynamically based on the content type. Overestimating output tokens wastes money, while underestimating them truncates your response. Always account for the system prompt and conversation history in your input token calculations.

3. Implement Streaming for Better UX

Streaming responses via Server-Sent Events (SSE) is crucial for a smooth user experience. It allows users to see the model's output as it generates, rather than waiting for the entire response to complete. This is especially important for longer outputs that might take several seconds. The last chunk of the stream contains the final token usage statistics, which you can log for billing and monitoring purposes.

Handle network interruptions gracefully by implementing reconnection logic. Streaming connections can drop due to unstable networks or server timeouts. Ensure your client can resume or restart the generation process without losing context. Use the stream parameter in your request body to enable this feature. This approach reduces perceived latency and keeps users engaged during generation.

4. Manage Context Window Constraints

The 100,000-token context window is powerful but requires careful management. You must track the token count of the entire conversation history, not just the current message. If the context exceeds the limit, the model will truncate earlier messages, potentially losing critical information. This can lead to incoherent responses or loss of role-play context in creative writing scenarios.

Implement a sliding window or summarization strategy for long conversations. This keeps the most relevant information within the context limit. Monitor the token count of each message to ensure you stay within the 100,000-token boundary. If you approach the limit, consider summarizing older messages or removing less relevant turns. This strategy maintains context relevance while staying within technical constraints.

5. Monitor Rate Limits and Concurrent Requests

Our API enforces strict rate limits to ensure fair usage across all clients. You are allowed 300 requests per minute per key and 8 concurrent requests simultaneously. Exceeding these limits will result in HTTP 429 errors. Implement exponential backoff in your retry logic to handle these errors gracefully. This prevents your application from flooding the server with repeated requests.

Track your concurrent request count to avoid hitting the 8-request limit. If you are processing multiple user requests simultaneously, ensure your application can queue or delay requests appropriately. This is especially important for high-traffic applications or batch processing jobs. Monitor your API key usage to ensure you stay within the 8 MB request body limit. Exceeding this limit will result in a rejection of the request.

6. Ensure JSON Mode Stability

When using JSON mode, the model is constrained to output valid JSON objects. This is useful for structured data extraction or API integrations. Set the response_format parameter to {"type": "json_object"} in your request. The model will then attempt to output only valid JSON, which can be parsed directly by your application.

Validate the JSON output before processing it further. Even in JSON mode, the model might occasionally output invalid syntax. Use a JSON parser to catch errors and handle them appropriately. This ensures that your application does not crash due to malformed responses. Consider adding a fallback mechanism to handle parsing errors gracefully.

7. Handle Refusals and Error Codes

Most requests will succeed, but some may return errors or refusals. HTTP 400 errors indicate invalid request parameters, while 429 errors indicate rate limits. 500 errors suggest server-side issues. Handle these errors appropriately in your application logic. Implement logging to track error patterns and identify potential issues.

Refusals are rare but possible. The model may refuse content that violates specific policies, such as sexual content involving minors. This hard limit always applies regardless of the uncensored nature of the model. Check the response status and content to determine if a refusal occurred. Implement a user-friendly message to inform them of the refusal reason.

8. Validate Content Policy Boundaries

While the model is uncensored, it still enforces a hard limit on sexual content involving minors. This is the only strict content policy that applies. All other adult, fictional, or controversial topics are generally allowed. This makes it suitable for creative writing, role-playing, and adult content generation.

Test your application with a variety of content types to ensure it handles them correctly. Verify that the model does not refuse lawful adult content. This validation step ensures that your application meets the expectations of your target audience. Monitor user feedback to identify any unexpected refusals or content issues.

9. Test with Real NSFW Prompts

Conduct thorough testing with real-world NSFW prompts to evaluate the model's performance. Use a diverse set of prompts covering different styles, tones, and content types. This helps identify any limitations or biases in the model's generation. Pay attention to the coherence and relevance of the responses.

Document your test cases and results for future reference. This helps in maintaining consistency and improving the integration over time. Share your findings with your team to ensure everyone understands the model's capabilities and limitations. This collaborative approach leads to a more robust and reliable API integration.

Common questions

What is the uncensored AI API base URL?

The base URL for our service is HTTPS://api.uncensoredgemma.com/v1. You can use any standard OpenAI-compatible client by updating this URL and providing your API key. This ensures compatibility with existing codebases while granting access to unrestricted generation.

How do I top up my credit?

You can top up your credit using cryptocurrency, specifically USDT on TRC20 or USDC on Base. The minimum top-up amount is $20, and the maximum is $500. You receive bonus credit for larger top-ups: +5% from $50, +10% from $100, and +15% from $200.

Does the uncensored AI model refuse content?

The model generally allows adult, fictional, and controversial content. However, it enforces a hard limit on sexual content involving minors, which is always refused. All other content types are typically allowed, making it suitable for various use cases.

What are the rate limits for the API?

You are allowed 300 requests per minute and 8 concurrent requests per API key. The request body limit is 8 MB. Exceeding these limits will result in HTTP 429 errors. Implement exponential backoff in your retry logic to handle these errors gracefully.

Generate your API key

Register, retrieve your key, and update your endpoint URL. That is all.

Try with trial credit