EN ▾
Get API key

Integrating Uncensored LLMs via OpenAI SDK

Developers often seek to replace filtered models with uncensored alternatives for creative writing, roleplay, or security research. This guide explains how to integrate an uncensored API using the standard OpenAI SDK structure. You will learn to configure endpoints, manage parameters, and handle responses without changing your core application logic.

Developer desk with laptop and abstract AI sculpture

Understanding the Uncensored API Structure

Most modern LLM applications rely on the OpenAI SDK for its consistent interface. This consistency allows developers to swap backend providers without rewriting significant portions of their code. Our API follows this standard, making it easy to integrate into existing projects. The service hosts a single open-weight text model that does not refuse lawful adult, fictional, or controversial topics. This makes it ideal for use cases where standard filters might interrupt creative flow or block nuanced discussions.

The base URL for our API is https://api.uncensoredaimodels.cc/v1. You do not need to change your SDK version or install new libraries. Simply update the base URL configuration in your client. The model ID you must send in your requests is uncensored. This ID tells the server which specific model to route your prompt to. Unlike services that offer multiple models, this service focuses on one uncensored text model, ensuring predictable behavior across all requests.

The API supports standard chat-completions endpoints. You can use POST /v1/chat/completions for standard conversations or POST /v1/responses for newer response formats. Both endpoints accept the same parameters and return text in response. There are no embeddings, image generation, or audio features. This simplicity reduces integration complexity and focuses entirely on high-quality text generation. You can verify the available models by sending a GET /v1/models request, which will list the uncensored model.

When integrating, ensure your application handles the specific error codes returned by the service. A 401 error indicates an invalid API key, while a 402 error means you have no prepaid credit left. A 429 error signals that you have exceeded the rate limit of 300 requests per minute. Understanding these codes helps you build reliable error handling in your application. The service never claims SLA percentages or certifications, so you should design your system to handle occasional interruptions gracefully.

Configuring the SDK Client

To start integrating, you need to obtain an API key from the service. You can sign up using Google or an email and password. The key is shown immediately after signup, so copy it securely. This key is used for authentication in all subsequent requests. The service does not require a credit card or bank transfer for initial access, as new accounts receive $0.50 of trial credit. This allows you to test the integration before committing to a purchase.

Update your SDK configuration to point to the new base URL. In Python, this might look like setting the base URL environment variable or passing it directly to the client constructor. The API key should be stored in an environment variable to keep it secure. The SDK handles the authentication headers automatically, so you do not need to manually attach them to every request. This reduces the risk of exposing your key in logs or version control.

Since the service accepts crypto only, you will need to top up your balance using USDT on TRC20 or USDC on Base. The minimum top-up amount is $20, and the maximum is $500. You can receive bonus credit when you top up $50 or more. The credit never expires, and you are charged based on real token usage. Errors and refusals are free, so you do not pay for failed requests. This pricing model is transparent and predictable for developers who want to control their costs.

When configuring the client, ensure you handle the specific parameters supported by the API. The service supports streaming over SSE, function calling, and JSON mode. You can also adjust parameters like temperature, top_p, stop sequences, and seed. These parameters allow you to fine-tune the output of the model. For example, a lower temperature produces more deterministic results, while a higher temperature encourages creativity. The API supports a context window of 100,000 tokens, allowing for long conversations or large documents.

Making Your First Request

Once your client is configured, you can make your first request. Use the POST /v1/chat/completions endpoint to send a message. The request body should include the model ID uncensored, the messages array, and any optional parameters. The messages array should follow the standard OpenAI format, with roles like system, user, and assistant. This format is widely supported and easy to use.

For example, you might send a system message instructing the model to be uncensored. Then, send a user message with your query. The API will return a response containing the generated text. You can parse this response and display it in your application. The service supports streaming, so you can also receive tokens as they are generated. This improves the user experience by showing output in real-time. The usage information is included in the last chunk of the stream.

When making requests, be mindful of the rate limit. You can send up to 300 requests per minute per key. If you exceed this limit, you will receive a 429 error. You should implement retry logic with exponential backoff to handle this gracefully. The service does not offer a free unlimited tier, so you need to monitor your usage to avoid running out of credit. The trial credit of $0.50 is a good starting point to test your integration.

The API supports function calling, which allows you to define tools that the model can call. This is useful for integrating with external services or databases. You can define functions in the request body, and the model will return a JSON object with the function name and arguments. You can then execute the function and send the result back to the model. This enables complex workflows and automated tasks. The service supports JSON mode, which ensures the model outputs valid JSON when required.

Managing Tokens and Costs

Understanding token usage is important for managing costs. The service charges $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. You are charged only for tokens that are actually processed. Errors and refusals are free, so you do not pay for failed requests. The context window is 100,000 tokens, which includes both the prompt and the completion. This allows for long conversations without losing context.

To estimate costs, you can count the tokens in your prompts and responses. The SDK often provides token usage information in the response. You can use this information to track your spending and adjust your budget accordingly. Since the credit never expires, you can top up as needed. The minimum top-up is $20, and the maximum is $500. You can receive bonus credit when you top up $50 or more, which reduces your effective cost per token.

When integrating, consider implementing a token counter in your application. This allows you to display the current usage to users or log it for analytics. You can also set up alerts when usage reaches a certain threshold. This helps you avoid unexpected charges and ensures you have enough credit for critical operations. The service does not offer a subscription model, so you pay only for what you use. This is ideal for developers who want flexible spending.

Remember that the model does not refuse lawful adult, fictional, or controversial topics. However, it does refuse requests involving sexual content with minors. This is a hard limit enforced by the service. You should design your application to handle these refusals gracefully. The service does not claim any specific benchmark scores or certifications, so you should test the model yourself to ensure it meets your needs. The pricing is transparent, and you can calculate costs based on token usage.

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 use case. If you need image, audio, or video generation, this service does not support those features. It is a text-only API, so you will need to integrate other services for multimodal tasks. Similarly, if you need embeddings for vector search, this service does not provide them. You can use the text outputs for other purposes, but you will need a separate embedding service.

The service also does not support fine-tuning. If you need to train the model on your specific data, you will need to look for a different provider. The model is fixed, and you cannot customize its weights. This is a trade-off for the simplicity and uncensored nature of the service. If you need model routing to switch between different models based on cost or performance, this service does not offer that feature. You are locked into the single uncensored model.

Additionally, the service does not offer an on-prem deployment option. If you need to run the model on your own servers for data privacy or latency reasons, this hosted API may not fit your needs. The service is fully hosted, so you rely on their infrastructure. If you need high availability or specific SLA guarantees, you should check the vendor's documentation for current limits and features. The service does not claim any SLA percentages, so you should design your system to handle potential downtime.

Finally, if you need a free unlimited tier, this service is not the right choice. You must pay for token usage, with a minimum top-up of $20. While the trial credit is free, it is limited to $0.50. For developers who need a free tier for testing or low-volume use, other providers might be more suitable. However, for those who need an uncensored text model with predictable pricing, this service offers a solid solution. Always evaluate your specific needs before integrating any API.

Addressing Common Developer Questions

Developers often ask about the best uncensored models for roleplay and creative writing. Threads on r/LocalLLM and r/JanitorAI_Official discuss various models for these purposes. Users frequently seek models that can handle complex narratives and character interactions without strict filters. The uncensored nature of this API makes it suitable for such use cases. You can use it to generate dynamic responses for roleplay scenarios or creative writing projects.

Another common question is how to find an uncensored model that is not advertised as "spicy" or character-based. Users on r/AIToolTesting look for unfiltered LLMs that tell the truth without political correctness. This API fits that description, as it does not impose a specific persona or filter. It is a general-purpose uncensored model that can be used for various tasks. You can configure the system prompt to suit your specific needs, whether it is roleplay, coding, or general conversation.

Developers also ask about the best uncensored models for coding and technical tasks. While this API is primarily focused on text generation, it can handle coding tasks effectively. You can use it to generate code snippets, debug errors, or explain technical concepts. The uncensored nature allows it to provide straightforward answers without unnecessary filters. You can use the function calling feature to integrate with coding tools or databases.

Finally, users often inquire about the pricing and limits of uncensored models. Threads on r/GPT_jailbreaks and r/u_unrestricted-sh discuss various options. This API offers a transparent pricing model with no hidden fees. You pay only for token usage, with a minimum top-up of $20. The trial credit allows you to test the service before committing. The rate limit of 300 requests per minute is generous for most use cases. Always check the vendor's documentation for current prices and limits to ensure you have the latest information.

Troubleshooting and Best Practices

When integrating the API, you may encounter common issues such as authentication errors or rate limits. A 401 error indicates an invalid API key, so verify that you are using the correct key. A 402 error means you have no credit left, so check your balance and top up if necessary. A 429 error indicates you have exceeded the rate limit, so implement retry logic with exponential backoff. These errors are straightforward to handle and do not require complex debugging.

Another best practice is to use the correct model ID. The model ID for this service is uncensored. Using the wrong ID will result in an error. Ensure that your SDK is configured to use this ID. You can also verify the available models by sending a GET /v1/models request. This helps you confirm that your integration is correct. The service supports standard OpenAI SDK parameters, so you can use familiar tools and libraries.

When using the API, be mindful of the context window. The service supports 100,000 tokens, which is a large context window. However, you should still manage your prompts efficiently to avoid unnecessary token usage. You can truncate long conversations or summarize previous messages to save tokens. This helps you stay within your budget and reduces latency. The service does not charge for errors, so you can experiment with different prompt strategies without worrying about costs.

Finally, consider the security of your API key. Store it in an environment variable or a secure vault. Do not hardcode it in your application or commit it to version control. The key is shown immediately after signup, so copy it securely. You can also rotate your key if you suspect it has been compromised. The service does not offer key rotation features, so you may need to create a new key and update your configuration. Always monitor your usage to detect any unusual activity.

Frequently asked questions

How do I get an API key for the uncensored model?

You can sign up using Google or an email and password. The API key is shown immediately after signup. You can then use this key to authenticate your requests to the API.

What is the cost of using the uncensored API?

The API charges $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. You pay only for token usage, with a minimum top-up of $20. Trial credit is $0.50 for new accounts.

Does the API support streaming?

Yes, the API supports streaming over SSE. You can receive tokens as they are generated, which improves the user experience. Usage information is included in the last chunk of the stream.

What happens if I exceed the rate limit?

If you exceed the rate limit of 300 requests per minute, you will receive a 429 error. You should implement retry logic with exponential backoff to handle this gracefully.