Troubleshooting API Limits and Retry Logic
Building reliable automated agents requires more than just sending requests; it demands reliable error handling. This guide explains how to manage rate limits and transient errors effectively. We focus on implementing exponential backoff and monitoring token usage to ensure stability.

Understanding Rate Limits and 429 Errors
This site is an independent service and is not affiliated with Unfiltered AI.
When building automated agents, you will eventually encounter rate limits. Our API enforces a limit of 300 requests per minute per key. This limit is designed to ensure fair usage across all users. If you exceed this threshold, the API returns a 429 status code. This error indicates that you have sent too many requests in a short period. It is important to handle this error correctly to avoid disrupting your application's workflow.
A 429 error does not mean your key is invalid. It simply means you need to wait before sending more requests. Ignoring this limit can lead to service interruptions. Therefore, your code must be prepared to detect this specific error code. When detected, the agent should pause its operation temporarily. This pause allows the rate counter to reset, enabling the agent to resume normal operations.
It is important to distinguish between a 429 error and other errors. A 401 error indicates an invalid key, while a 402 error means you have no credit. The 429 error is purely about velocity. It is not about the content of your request or the size of your payload. Understanding this distinction helps you troubleshoot issues more effectively. You do not need to change your model or your prompt to resolve a rate limit error. You only need to adjust the timing of your requests.
Monitoring your request volume is the first step in managing rate limits. You should track how many requests your agent sends in a minute. If you approach the 300 request limit, you can proactively slow down your agent. This proactive approach prevents sudden pauses in your application. It also ensures a smoother experience for your users. By respecting the rate limit, you maintain a stable connection to the API.
Implementing Exponential Backoff
Exponential backoff is a standard strategy for handling transient errors. It involves waiting for increasing amounts of time between retry attempts. This method prevents your agent from overwhelming the server with rapid retries. When you receive a 429 error, you should wait for a short period before retrying. The first retry might wait for one second. The second retry might wait for two seconds, and so on.
This approach is effective because it reduces the load on the server. It also gives your application time to recover from temporary spikes in traffic. Without exponential backoff, your agent might flood the API with requests, causing more errors. This can lead to a cascade of failures that are difficult to debug. By spreading out your retries, you increase the likelihood of success.
You should also consider adding a random jitter to your backoff times. This prevents multiple agents from retrying at the exact same time. If many agents retry simultaneously, they might collide again, causing more 429 errors. Jitter adds a small random delay to each retry, distributing the load more evenly. This simple addition can significantly improve the stability of your system.
It is also important to set a maximum retry count. You do not want your agent to retry indefinitely. If the API continues to return 429 errors after several attempts, it might indicate a more serious issue. In such cases, you should log the error and alert your team. This ensures that you are aware of persistent problems. It also prevents your agent from consuming resources unnecessarily while waiting for a response.
Monitoring Input and Output Tokens
Our API charges based on token usage, not just request counts. The context window is 100,000 tokens, which includes both the prompt and the completion. It is essential to monitor these token counts to avoid unexpected costs. You can track the number of tokens in your requests to ensure you stay within your budget.
Input tokens are the tokens you send to the API, including the system prompt and user messages. Output tokens are the tokens generated by the model. The API returns usage information in the last chunk of the response. You can parse this information to track your token consumption. This allows you to adjust your prompts or limit the length of responses.
Understanding token usage is important for cost management. The price is $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. By monitoring tokens, you can estimate your costs more accurately. You can also identify inefficient prompts that consume too many tokens. This helps you optimize your agent's performance and reduce expenses.
You should also consider the impact of long conversations on token usage. As the conversation grows, the number of input tokens increases. This can eventually reach the 100,000 token limit. When this happens, you may need to truncate older messages or start a new conversation. Monitoring token usage helps you manage these transitions smoothly. It ensures that your agent continues to function correctly even as conversations expand.
When This API Is Not the Right Choice
While our API is excellent for text-based tasks, it may not be the right choice for every project. If you need image generation, audio processing, or video creation, this service does not support those features. It is a text-only API, meaning it only handles text in and text out. If your application requires multimodal capabilities, you might need a different solution.
Similarly, if you need embeddings for semantic search, this API does not provide that feature. It focuses on chat completions and responses. If your use case involves vector databases or search functionality, you may need to integrate with a separate embedding service. Understanding these limitations helps you choose the right tool for your specific needs.
Another consideration is the payment method. Our API accepts only cryptocurrency, specifically USDT on TRC20 or USDC on Base. If your organization prefers traditional payment methods like credit cards or bank transfers, this service might not be suitable. You cannot use cards, PayPal, or bank transfers for top-ups. This is an important factor to consider if you are integrating with existing financial systems.
Finally, if you require strict SLA guarantees or certifications like SOC2 or HIPAA, this independent service may not meet those requirements. We do not claim SLA percentages or certifications. If your project demands these guarantees, you should look for a provider that offers them. Our API is designed for flexibility and uncensored text generation, not for enterprise-grade compliance.
Addressing Community Questions on Reliability
Developers in online communities often ask if they should pay for a reliable, uncensored LLM API. The consensus is that reliability is key for production applications. Users value consistent performance and predictable behavior. Our API provides a stable platform for automated agents, with clear error codes and predictable rate limits.
Another common question is whether it is worth building an uncensored LLM API to avoid fighting filters. Many developers find that managing their own models can be complex. Using a hosted service like ours allows them to focus on their application logic. The uncensored nature of the model means fewer refusals for lawful adult or controversial topics, which can improve the user experience.
Users also discuss what feels different about uncensored models. They often note that the model does not refuse requests for fictional or security-research topics. This can be particularly useful for creative writing or testing edge cases. The lack of strict filtering allows for more diverse and nuanced responses, which can be beneficial for certain use cases.
Finally, developers ask about the ease of integration. Our API is OpenAI-compatible, which means you can use existing SDKs and tools. This reduces the learning curve for developers who are already familiar with the OpenAI ecosystem. The ability to stream responses and use function calling further enhances the usability of the API. These features make it easier to build sophisticated agents that can interact with other tools and services.
Handling Transient Errors and Refusals
Transient errors can occur for various reasons, such as network issues or temporary server overload. Our API returns specific error codes to help you diagnose these issues. A 401 error indicates an invalid key, while a 402 error means you have no credit. These errors are not transient; they require immediate action, such as updating your key or topping up your balance.
Refusals are another type of error to consider. Our API has a hard content limit: no sexual content involving minors. Requests that violate this limit are refused. However, other lawful adult, fictional, or controversial topics are generally not refused. Understanding this limit helps you design your prompts to avoid unnecessary refusals.
It is important to handle refusals gracefully in your application. You can log the refused requests and analyze the patterns. This can help you identify common causes of refusal and adjust your prompts accordingly. You can also inform your users about the content limits, so they understand why certain requests are rejected.
For transient errors, exponential backoff is again the recommended strategy. If you receive a transient error, wait and retry. If the error persists, consider logging it and moving on. This approach ensures that your agent remains resilient in the face of temporary disruptions. It also prevents your application from hanging indefinitely while waiting for a response.
Best Practices for Agent Stability
To maintain stability, you should implement a comprehensive error handling strategy. This includes handling rate limits, transient errors, and content refusals. You should also monitor your token usage and adjust your prompts as needed. By combining these strategies, you can build a reliable agent that performs well under various conditions.
It is also important to test your agent thoroughly before deploying it to production. You can simulate different scenarios, such as high traffic or low credit, to see how your agent responds. This helps you identify potential issues and refine your error handling logic. Testing also allows you to optimize your agent's performance and reduce latency.
Documenting your error handling logic is another best practice. This makes it easier for other developers to understand and maintain your code. You should also keep track of any changes you make to your error handling strategy. This helps you track the effectiveness of your improvements over time.
Finally, stay informed about updates to our API. We may introduce new features or change our rate limits. By staying up to date, you can ensure that your agent continues to perform optimally. You can check our documentation for the latest information on endpoints, parameters, and pricing. This proactive approach helps you avoid surprises and maintain a stable integration.
Frequently asked questions
How do I handle a 429 rate limit error?
Implement exponential backoff with jitter. Wait for an increasing amount of time between retries to avoid overwhelming the server. The limit is 300 requests per minute per key.
What is the context window size?
The context window is 100,000 tokens, which includes both the prompt and the completion. You should monitor token usage to stay within this limit.
Does the API support image generation?
No, this is a text-only API. It does not support image, audio, or video generation. It only handles text in and text out.
What payment methods are accepted?
We accept only crypto: USDT on TRC20 or USDC on Base. Credit cards, PayPal, and bank transfers are not supported.
More guides
- Unfiltered AI API Key: Create One, Make a First Call
- Unfiltered AI Models: Types, Trade-offs, How to Use
- How to Unfilter ChatGPT: What Works, What to Use Instead
- Unfiltered GPT AI: Honest Guide and API Alternative
- Telegram Bot API GitHub Examples With an LLM Backend
- Unfiltered GPT: Unfiltered AI API: setup, costs and alternatives
- Calculate LLM API Costs: A Budgeting Formula
- Integrate Uncensored Text API: A Tested Checklist