EN ▾
Uncensored Chatbot APIDirect API access to one uncensored LLM

https://api.uncensoredchatbotapi.com/v1

Get API key

Integrating Uncensored Chat via OpenAI SDKs

Developers often ask how to wire an uncensored endpoint into existing applications using standard libraries. This guide details the integration steps, focusing on SDK settings like temperature and top_p that influence creative output, along with a tested checklist for verifying text-in, text-out functionality.

Developer workspace with streaming text code and abstract data nodes

Setting Up the SDK Connection

To begin integrating our service, you need to configure your SDK with the correct base URL and authentication details. The base URL for our API is https://api.uncensoredchatbotapi.com/v1. You will need to obtain an API key by signing up with Google or an email and password. The key is shown immediately upon signup, allowing you to start testing without delay. This key is essential for authenticating your requests and ensuring that your usage is tracked correctly against your prepaid credit balance. Make sure to store this key securely in your environment variables or configuration files to avoid exposing it in your codebase. Once you have the key, you can initialize your SDK client with it. This setup process is straightforward and mirrors the standard practices used for other major chat APIs, making it easy for developers familiar with similar tools to adapt quickly. The SDK handles the authentication headers automatically, so you do not need to manually attach them to every request. This reduces the chance of errors and simplifies the integration process significantly. By following these steps, you ensure that your application can communicate effectively with our uncensored model. The model ID you will use for all requests is "uncensored". This ID tells the API which model to route your request to, ensuring that you get the specific uncensored behavior you are looking for. It is important to use this exact ID to avoid any routing issues or unexpected responses. With the SDK configured and the key in place, you are ready to send your first request. This initial connection sets the foundation for all subsequent interactions with the API. It is a critical step that determines the reliability and performance of your integration. Take the time to verify that the connection is established correctly before moving on to more complex features. A stable connection ensures that your application can handle requests efficiently and respond to users with minimal latency. This foundational setup is key to a successful integration.

Configuring Creative Parameters

Once the connection is established, you can fine-tune the model's output using parameters like temperature and top_p. These settings influence the creativity and variety of the responses generated by the model. The temperature parameter controls the randomness of the output. A higher temperature results in more creative and diverse responses, while a lower temperature produces more deterministic and focused outputs. This is particularly useful for tasks where you want the model to explore different possibilities or generate unique content. The top_p parameter, also known as nucleus sampling, further refines the output by limiting the selection to the most probable tokens. This helps in maintaining coherence while still allowing for some variability. By adjusting these parameters, you can tailor the model's behavior to fit the specific needs of your application. For example, if you are building a chatbot for creative writing, you might set a higher temperature to encourage more imaginative responses. Conversely, if you are using the API for factual queries, a lower temperature might be more appropriate to ensure accuracy. It is important to experiment with these settings to find the right balance for your use case. The API supports these parameters, allowing you to customize the model's output to your liking. This flexibility is a key feature of our API, enabling developers to create more engaging and dynamic user experiences. By understanding how these parameters work, you can optimize the model's performance and deliver better results to your users. This level of control is essential for building applications that require a specific tone or style of communication. It allows you to push the boundaries of what the model can do, creating more immersive and interactive experiences.

Implementing Streaming Responses

For a more responsive user experience, you can implement streaming responses using Server-Sent Events (SSE). Streaming allows you to receive the model's output in real-time as it is being generated, rather than waiting for the entire response to complete. This is particularly useful for chat applications where users expect immediate feedback. The API supports streaming over SSE, and the usage information is included in the last chunk of the stream. This means you can track token usage even while the response is being generated. To implement streaming, you need to set the appropriate flags in your SDK request. This will instruct the API to send the response in chunks as they are generated. You can then handle these chunks in your application to update the user interface in real-time. This approach reduces the perceived latency and makes the interaction feel more natural and fluid. It is important to handle potential errors and interruptions gracefully, as streaming can be more complex to manage than standard responses. However, the benefits in terms of user experience often outweigh the additional complexity. By implementing streaming, you can create a more engaging and responsive application that keeps users engaged and satisfied. This feature is particularly valuable for applications that require continuous interaction, such as chatbots or virtual assistants. It allows you to provide a smooth and intuitive experience that mimics human conversation. The ability to stream responses is a key differentiator of our API, setting it apart from other services that only support batch processing. It enables developers to build more sophisticated and interactive applications that respond to user input in real-time.

Utilizing Function Calling and JSON Mode

Our API also supports function calling and JSON mode, which allows you to integrate the model with external tools and services. Function calling enables the model to generate structured data that can be used to trigger specific actions in your application. This is useful for tasks such as extracting information from text or triggering API calls based on user input. JSON mode ensures that the output is strictly formatted as JSON, making it easier to parse and process in your code. This is particularly helpful when you need to ensure that the model's output is consistent and reliable. By using these features, you can create more powerful and versatile applications that can interact with a wide range of external systems. The API supports these features out of the box, so you do not need to implement complex parsing logic to handle the output. This simplifies the integration process and reduces the chance of errors. It is important to define the function schemas clearly so that the model understands what data to generate. This helps in ensuring that the output is accurate and useful for your application. By using function calling and JSON mode, you can extend the capabilities of the model beyond simple text generation. This allows you to build applications that can perform complex tasks and interact with other systems in a structured and reliable way. It is a powerful feature that opens up new possibilities for how you can use the API in your projects. It enables you to create more intelligent and responsive applications that can adapt to user input and external triggers.

When Our API Is Not the Right Choice

While our API is highly capable for text-based interactions, it may not be the right choice for every project. For instance, if your application requires image, audio, or video generation, our API does not support these capabilities. It is a text-in, text-out service, so you will need to integrate with other services for multimedia content. Similarly, if you need embeddings for semantic search or fine-tuning for custom model behavior, our API does not offer these features. The API is designed for uncensored chat completions, so if you need advanced model routing or OCR capabilities, you might need to look elsewhere. It is important to assess your specific needs before deciding to use our API. If your primary requirement is high-quality, uncensored text generation with a large context window, our API is an excellent choice. However, if you need a more comprehensive suite of AI tools, you might find that other services better meet your needs. The API is also limited to 300 requests per minute per key, so if you expect very high traffic, you may need to manage your rate limits carefully. Additionally, the pricing model is based on token usage, so if you have predictable and low-volume usage, you might find that other subscription-based models are more cost-effective. It is essential to evaluate your project's requirements against the capabilities of our API to ensure it is the right fit. This will help you avoid potential issues and ensure that your application runs smoothly. By understanding the limitations of our API, you can make an informed decision about whether it is the best solution for your specific use case.

Addressing Common Developer Questions

Developers often ask about the best uncensored AI chat apps and how to ensure the writing quality is high. Threads on r/ChatbotRefugees and r/AIChatReviews highlight concerns about filters ruining roleplay and the importance of consistent character voices. Many users find that being uncensored is easy, but maintaining a coherent story with memory is harder. Our API addresses this by providing a large context window of 100,000 tokens, allowing the model to remember earlier parts of the conversation. This helps in maintaining consistency and depth in roleplay scenarios. Users also discuss the importance of parameters like temperature and top_p in controlling the model's output. By adjusting these settings, you can influence the creativity and variety of the responses. Some users mention that other platforms may throttle based on broad safety rules, but our API focuses on uncensored output for lawful adult and controversial topics. It is important to note that while our API is uncensored, it does refuse requests involving sexual content with minors. This is a key distinction that users should be aware of when integrating the API into their applications. By understanding these common questions and concerns, you can better tailor your integration to meet user expectations. It is also helpful to test the API with different parameters to see how it performs in various scenarios. This will help you identify any potential issues and optimize the user experience. By addressing these common questions, you can provide a more reliable and satisfying experience for your users.

Verifying Text-In, Text-Out Functionality

To ensure that your integration is working correctly, you should perform a simple checklist to verify text-in, text-out functionality. Start by sending a basic request with a simple prompt and check that you receive a coherent response. This confirms that the API is responding correctly and that your authentication is working. Next, test the streaming functionality by sending a request with the streaming flag set. Verify that you receive the response in chunks and that the usage information is included in the last chunk. This ensures that the streaming feature is working as expected. You should also test the function calling and JSON mode features to ensure that the model generates the correct structured data. This is important for integrating the API with external tools and services. Additionally, test the rate limits by sending multiple requests in quick succession to ensure that the API handles them correctly. Check that you receive a 429 error when you exceed the limit of 300 requests per minute. Finally, test the error handling by sending invalid keys and checking for 401 errors, and by exhausting your credit to check for 402 errors. This comprehensive testing ensures that your integration is reliable and reliable. By following this checklist, you can identify any potential issues early and ensure that your application performs well in production. It is important to test all features thoroughly to provide a smooth experience for your users. This final verification step is important for delivering a high-quality product that meets user expectations.

Frequently asked questions

How do I get an API key?

You can get an API key by signing up with Google or an email and password. The key is shown immediately upon signup, so you can start using it right away without any delay.

What is the context window size?

The context window is 100,000 tokens, which includes both the prompt and the completion. This large window allows for extensive conversations and detailed context retention.

Can I use the API for image generation?

No, the API is text-in, text-out only. It does not support image, audio, or video generation. You will need to integrate with other services for multimedia content.

What happens if I run out of credit?

If you run out of credit, you will receive a 402 error. You can top up your credit using crypto, such as USDT on TRC20 or USDC on Base, with amounts ranging from $20 to $500.

per 1M input tokens
$0.15
Output tokens / 1M
$0.50
token context
100,000
trial credit
$0.50
requests per minute
300