EN ▾
Get API key

Troubleshooting Rate Limits and Token Usage in Uncensored APIs

Developers running uncensored models often face unexpected errors or budget overruns during heavy usage. This article explains how to monitor token consumption and handle API responses effectively with our text-only service to keep your projects stable.

Server rack with glowing data streams and floating digital tokens representing token usage and rate limits.

Understanding Token Costs and Billing

When you integrate an uncensored model into your application, the first thing to understand is how billing works. Our service uses a prepaid credit system, meaning you pay only for what you use. The pricing is straightforward: $0.15 per million input tokens and $0.50 per million output tokens. This structure allows you to budget precisely based on your expected token usage.

It is important to note that errors and refusals do not consume your credit. If you send a request that results in a 401 or 402 error, you are not charged. This feature helps you test your integration without worrying about wasting funds on failed attempts. You can top up your account with crypto, specifically USDT on TRC20 or USDC on Base, with amounts ranging from $20 to $500.

Another key benefit is that your paid credit never expires. You do not need to worry about monthly fees or subscriptions. This makes it ideal for indie builders who may have irregular usage patterns. You can top up whenever you need, and the balance remains available for future use.

When calculating your costs, focus on the token counts rather than trying to estimate dollar totals manually. Use the formula of tokens divided by one million, multiplied by the per-million price. This method gives you a clear picture of your expenses. By tracking your input and output tokens, you can ensure you stay within your budget and avoid unexpected charges.

Managing Rate Limits and Throttling

Rate limits are a critical aspect of any API integration. Our API allows 300 requests per minute per key. If you exceed this limit, you will receive a 429 error. This limit is in place to ensure fair usage and maintain service stability for all users. It is essential to monitor your request volume to avoid interruptions in your application.

To manage rate limits effectively, you should implement exponential backoff in your code. This technique involves waiting for a short period before retrying a request, then doubling the wait time for subsequent attempts. This approach prevents your application from overwhelming the API during peak usage. It also helps you recover gracefully from temporary spikes in traffic.

Another strategy is to batch your requests when possible. Instead of sending individual requests for each item, group them into a single call if the API supports it. This reduces the total number of requests you make, helping you stay within your rate limit. It also improves efficiency by reducing the overhead associated with each request.

If you find that 300 requests per minute is too restrictive for your use case, consider using multiple API keys. Each key has its own rate limit, so distributing your requests across several keys can increase your overall throughput. Just remember to keep track of each key's usage to avoid hitting the limit on any single key.

Handling Errors and Refusals

Errors are a natural part of working with APIs. Our service returns specific error codes to help you diagnose issues. A 401 error indicates an invalid key, while a 402 error means you have no credit left. A 429 error signals that you have hit the rate limit. Understanding these codes allows you to troubleshoot quickly and efficiently.

When you encounter a 401 error, check your API key to ensure it is correct and active. If the key is valid, verify that you have not accidentally deleted or revoked it. For a 402 error, you need to top up your account with crypto to continue using the service. Since errors do not consume credit, you can retry your request after resolving the issue without losing funds.

Refusals are also common with uncensored models. Our model refuses requests involving sexual content with minors, but it allows lawful adult, fictional, security-research, or controversial topics. If your request is refused, check the content against these guidelines. You can adjust your prompts to align with the model's constraints while still achieving your desired output.

It is helpful to log these errors and refusals in your application. This data can provide insights into common issues and help you optimize your prompts. By analyzing error patterns, you can identify areas for improvement and enhance the user experience. Regular monitoring of error rates ensures that your application remains reliable and responsive.

Monitoring Token Consumption

Monitoring token consumption is important for maintaining control over your budget and performance. Our API provides usage data in the last chunk of streaming responses, allowing you to track token usage in real-time. This feature is particularly useful for applications that rely on streaming output, as it gives you immediate feedback on resource consumption.

To monitor token usage effectively, you should parse the usage data from each response. This data includes the number of input and output tokens, which you can use to calculate costs. By aggregating this data over time, you can identify trends and predict future usage. This proactive approach helps you avoid surprise bills and plan your budget more accurately.

It is also important to set up alerts for high token usage. If your application consumes tokens at an unexpected rate, you may want to investigate the cause. This could be due to inefficient prompts, excessive retries, or unexpected behavior from the model. By setting up alerts, you can respond quickly to potential issues before they impact your budget.

Regularly reviewing your token usage reports can also help you optimize your prompts. Shorter, more precise prompts often result in fewer tokens being used, which reduces costs. Experiment with different prompt structures to find the most efficient way to achieve your desired output. This optimization can lead to significant savings over time, especially for high-volume applications.

Integrating with OpenAI SDK

Our API is compatible with the OpenAI SDK, making it easy to integrate into existing projects. You can use the same code structure you would use for OpenAI, simply by changing the base URL to our endpoint. This compatibility allows you to use the familiar tools and libraries you already know, reducing the learning curve for integration.

To get started, you need to set the base URL to our service and provide your API key. The SDK handles the communication with the API, including error handling and response parsing. This simplifies the integration process, allowing you to focus on building your application rather than managing the API connection.

One advantage of using the OpenAI SDK is its support for streaming. You can enable streaming to receive responses in real-time, which is useful for chat applications or live data feeds. The SDK handles the streaming logic, making it easy to implement this feature in your application. You can also use the SDK to access usage data in the last chunk, as mentioned earlier.

Another benefit is the SDK's support for various parameters, such as temperature, top_p, and stop sequences. These parameters allow you to fine-tune the model's output to better suit your needs. By experimenting with these settings, you can improve the quality and relevance of the generated text. The SDK makes it easy to adjust these parameters on the fly, allowing for dynamic control over the model's behavior.

When Our API Is Not the Right Choice

While our API is excellent for text generation, it may not be the right choice for all use cases. Our service is text-only, meaning it does not support embeddings, image, audio, or video generation. If your application requires these capabilities, you may need to use a different service or combine our API with other tools.

For example, if you are building an application that generates images, our API can help with the text prompts, but you will need a separate image generation model to create the actual images. Similarly, if you need audio or video processing, our API can provide the text content, but you will need additional tools to handle the media formats.

Another limitation is that our API does not support fine-tuning. If you need to train the model on specific data to improve its performance for a particular task, you may need to use a service that offers fine-tuning capabilities. Our model is pre-trained and ready to use, but it cannot be customized through fine-tuning.

Finally, if you require high availability with specific SLA guarantees, our service may not meet your needs. We do not claim specific SLA percentages, so you should consider this if uptime is critical for your application. For most text-based applications, however, our API provides a reliable and cost-effective solution.

Addressing Community Questions on Local Models

Developers often discuss the best uncensored models for local deployment on platforms like Reddit. Threads on r/StableDiffusion and r/LocalLLaMA frequently ask about the best models for specific hardware configurations, such as 12GB or 16GB VRAM. Users share their experiences with models like Flux.2 Klein 9B and Qwen3.6-35B-Uncensored, highlighting the trade-offs between performance and resource usage.

One common question is whether it is better to run a model locally or use an API. For users with limited VRAM, such as 6GB on an RTX 3050, using an API can be more efficient than running a local model. The free model on platforms like Chub may offer better performance than what can be achieved locally with limited resources. This is particularly true for tasks that require significant computational power.

Another topic of discussion is the use of specific models for consistent character generation. Users mention training LoRAs for models like Z image to achieve consistent results. While our API does not support image generation, it can be used to generate the text prompts that drive these image models. This combination allows for greater flexibility and control over the output.

Users also discuss the importance of monitoring model performance and resource usage. Running local models can be resource-intensive, and users often share tips on optimizing settings to improve performance. By comparing local and API-based approaches, developers can make informed decisions about which solution best fits their needs. Our API offers a reliable alternative for those who prefer not to manage local infrastructure.

Frequently asked questions

How do I check my token usage?

You can monitor token usage by parsing the usage data returned in the last chunk of streaming responses. This data includes the number of input and output tokens, which you can use to calculate costs and track consumption.

What happens if I hit the rate limit?

If you exceed 300 requests per minute, you will receive a 429 error. To resolve this, implement exponential backoff in your code to wait before retrying, or distribute your requests across multiple API keys to increase your overall throughput.

Can I use my own API key with the OpenAI SDK?

Yes, our API is compatible with the OpenAI SDK. You can set the base URL to our endpoint and provide your API key to integrate the service into your existing projects. This allows you to use familiar tools and libraries for easier integration.

Does the API support image generation?

No, our API is text-only and does not support image, audio, or video generation. It is designed for text generation tasks, so you may need to combine it with other tools if your application requires multimedia capabilities.