EN ▾
Get API key

Integrating Uncensored AI API: SDK Setup Checklist

Connecting to an uncensored text model requires precise configuration to ensure your application handles the unique behavior of open-weight models. This guide walks you through the SDK setup for our API, covering authentication, parameter tuning, and error handling.

Developer workspace with laptop and abstract neural network visualization

Understanding the API Endpoint and Model ID

Before writing any code, you must configure your SDK to communicate with the correct endpoint. Our API is hosted at https://api.uncensoredaigenerator.cc/v1. This base URL is distinct from other providers, so ensure your environment variables or configuration files point here. The service is an OpenAI-compatible chat-completions API, meaning you can use standard SDKs like the official OpenAI Python or JavaScript libraries without major modifications.

The most critical setting is the model identifier. You must send the model ID as uncensored in your requests. This tells the backend which uncensored open-weight model to invoke. Unlike services that offer multiple model versions, this service serves one specific model. If you send a different ID, the request will likely fail or default incorrectly.

It is important to note that this is a text-in, text-out service. There are no embeddings, image generation, audio processing, or video generation capabilities. If your application requires multimodal inputs, you will need to handle those separately before sending the text to this API. The API strictly processes text tokens and returns text responses.

When initializing your client, verify that the base URL is correct. A common mistake is using a generic OpenAI URL instead of our specific domain. Double-check that your SDK is configured to use the uncensored model ID for all chat completion requests. This ensures you are interacting with the correct uncensored backend.

Authentication and Key Management

Authentication for this API relies on API keys. You can sign up using Google or an email and password combination. Upon signup, your API key is shown immediately, so copy it securely. This key is required for all requests to the /v1/chat/completions and /v1/responses endpoints. If you send an invalid key, you will receive a 401 error.

Include your API key in the Authorization header of your HTTP requests. The standard format is Bearer YOUR_API_KEY. Ensure that your SDK is configured to automatically attach this header to every request. If the key is missing or incorrect, the API will reject the request, and you will not be charged for the attempt.

Keep your API key secure and do not expose it in public repositories. Since there is no subscription fee, your access is tied directly to your prepaid credit. If you lose your key, you may need to generate a new one through your account dashboard. The key is the primary mechanism for accessing the service and making requests.

Remember that the API key is unique to your account. Do not share it with others if you want to track usage and credit consumption accurately. The key allows you to make requests up to the rate limit of 300 requests per minute. If you exceed this limit, you will receive a 429 rate limit error.

Pricing, Credit, and Payment Methods

Understanding the pricing structure is essential for budgeting your usage. The API charges $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. These prices are charged based on real token usage. Errors and refusals are free, meaning you do not pay for tokens that are rejected or for failed requests.

Payment is prepaid, and credit never expires. You can top up your account using cryptocurrency. The accepted currencies are USDT on the TRC20 network or USDC on the Base network. You can top up any whole amount between $20 and $500. There are no monthly fees or subscriptions, so you only pay for what you use.

When you top up from $50, you receive bonus credit ranging from +5% to +15%. This bonus is added to your account automatically. Note that cards, PayPal, and bank transfers are not accepted. You must use the specified crypto networks for all transactions. This crypto-only model ensures fast and borderless top-ups.

New accounts receive $0.50 of trial credit, allowing you to test the API without immediate payment. This trial credit has no card requirement. You can use it to verify your integration before committing to a larger top-up. The trial credit is charged against your usage just like prepaid credit.

SDK Configuration and Parameters

Configuring your SDK involves setting the correct parameters for the chat completions endpoint. You can use parameters like temperature, top_p, stop sequences, seed, and penalties to control the model's behavior. These parameters allow you to fine-tune the output for your specific use case. For example, setting a lower temperature can make the output more deterministic.

The API supports streaming responses over Server-Sent Events (SSE). This is useful for applications that need to display text as it is generated. The usage information, including token counts, is provided in the last chunk of the stream. Ensure your SDK is configured to handle streaming responses correctly to avoid blocking your application.

Function calling (tools) is also supported. You can define tools in your request, and the model will return structured data that can be used to trigger actions in your application. JSON mode is available for applications that require strict JSON output. This ensures that the model's response can be easily parsed by your code.

When setting up your SDK, verify that the context window is handled correctly. The context window is 100,000 tokens, including both the prompt and the completion. Ensure your application manages the context length to stay within this limit. If the context exceeds this limit, the API may truncate the input or return an error.

Testing and Error Handling

Testing your integration is important to ensure that your application handles responses and errors correctly. Start by sending a simple request with a short prompt to verify that the API is reachable and that the model is responding. Check that the response format matches your expectations, especially if you are using JSON mode or function calling.

Handle errors gracefully by checking the status codes. A 401 error indicates an invalid key, so verify your authentication. A 402 error means you have no credit, so you need to top up your account. A 429 error indicates that you have exceeded the rate limit of 300 requests per minute. Implement retry logic with exponential backoff to handle rate limits effectively.

It is important to note that the API has a hard content limit. Requests involving sexual content with minors are refused. Your application should handle these refusals gracefully and inform the user if necessary. Other types of uncensored content, such as adult, fictional, or controversial topics, are allowed.

Use the trial credit to test various scenarios, including streaming, function calling, and different parameter settings. This will help you identify any potential issues before you commit to a larger top-up. Ensure that your error handling covers all possible error codes and provides meaningful feedback to your users.

When This API Is Not the Right Choice

While this API is excellent for text generation, it may not be the right choice for all projects. If your application requires image generation, audio processing, or video creation, this text-only API will not suffice. You would need to integrate additional services to handle those modalities.

Similarly, if you need embeddings for semantic search or vector databases, this API does not provide embedding endpoints. You would need to use a separate embedding service or model. The same applies if you require OCR capabilities to extract text from images, as this API only processes text input.

Additionally, if you need fine-tuning capabilities to customize the model on your specific dataset, this API does not offer fine-tuning. You would need to use a service that supports fine-tuning or deploy a model locally. The API is designed for inference only, not for model training or customization.

Finally, if you require real-time audio or video generation, this text-in, text-out API is not suitable. It is focused on generating text responses based on text inputs. Ensure that your project's requirements align with the text-only nature of this API before integrating it.

Community Insights and Common Questions

Discussions in communities like r/BrandNewSentence and r/AccidentalAlly often highlight that uncensored AIs can be 'extremely horny' because they are trained on data from sources like Archive of Our Own. Users note that these models are essentially glorified autocomplete, which means they reflect the biases and prejudices of their training data. This can lead to unexpected or overly enthusiastic responses.

On r/LocalLLaMA, users discuss the search for uncensored AI that is technically advanced and not just adult-oriented. They mention that de-censoring models can sometimes make them 'stupider' due to the manipulation required. Users also highlight the importance of reasoning capabilities, noting that some models refuse to answer questions about potentially harmful topics, like making antibiotics, even if the context is safe.

On r/StableDiffusion, users discuss the demand for open, uncensored AI but point out that it is a legal and money minefield. They argue that capitalism and regulation play significant roles in the development of these models. This context helps developers understand the broader market of uncensored AI and the trade-offs involved.

On r/GeminiAI, users share their favorite uncensored AI generators, often recommending specific tools for different use cases. They emphasize the importance of using these tools responsibly, as the models can generate a wide range of content. This community feedback helps developers choose the right tools for their specific needs.

Frequently asked questions

How do I top up my account?

You can top up your account using USDT on the TRC20 network or USDC on the Base network. The minimum top-up amount is $20, and the maximum is $500. You can also receive bonus credit from $50.

What is the context window size?

The context window is 100,000 tokens, which includes both the prompt and the completion. Ensure your application manages the context length to stay within this limit.

Does the API support streaming?

Yes, the API supports streaming responses over Server-Sent Events (SSE). Usage information, including token counts, is provided in the last chunk of the stream.

What happens if I run out of credit?

If you run out of credit, you will receive a 402 error. You need to top up your account using crypto to continue making requests. Errors and refusals are free, so you are not charged for failed requests.