Troubleshooting API Errors and Rate Limits
Developers often encounter unexpected failures when integrating with LLM backends. This guide explains how to handle common errors and rate limits with our service, ensuring your application runs smoothly during high traffic periods.

Understanding Common HTTP Error Codes
When building applications with our API, you will eventually encounter HTTP error codes that indicate issues with your requests or account status. The most common errors you might see are 401, 402, and 429. A 401 error indicates an invalid key, which means the authentication token you are sending is either incorrect, expired, or missing. A 402 error signals that you have no credit remaining on your account, preventing further requests until you top up. A 429 error represents a rate limit, meaning you have exceeded the allowed number of requests within a specific time window.
These errors are designed to protect the service from abuse and ensure fair usage. When you receive a 401, you should verify your API key in the dashboard and ensure it is being sent in the Authorization header. For 402 errors, you need to add more credit using cryptocurrency. A 429 error requires you to implement exponential backoff in your code to wait before retrying. Understanding these codes helps you build more resilient applications that can handle failures gracefully without crashing.
It is important to note that errors and refusals are free, meaning you are only charged for successful token usage. This feature allows you to test your prompts without worrying about wasting credit on malformed requests or content that the model refuses to generate. By handling these errors correctly, you can provide a better user experience and avoid unnecessary charges.
Always check the response body for detailed error messages, which can provide additional context about what went wrong. This information is important for debugging issues in your integration. By monitoring these errors, you can identify patterns and optimize your application's performance.
Managing Rate Limits and Throttling
Our API enforces a limit of 300 requests per minute per key. This limit is in place to prevent abuse and ensure stable performance for all users. When you exceed this limit, you will receive a 429 Too Many Requests error. To handle this, you should implement a retry mechanism with exponential backoff in your application. This means waiting longer between retries as the number of attempts increases, which helps to avoid overwhelming the server.
Rate limits can be particularly challenging when dealing with high traffic or batch processing. If you are sending multiple requests simultaneously, you might hit the limit quickly. To mitigate this, you can distribute your requests over time or use multiple API keys if you have them. However, keep in mind that each key has its own rate limit, so using multiple keys does not double your capacity indefinitely.
It is also important to monitor your request volume to ensure you stay within the limit. You can do this by logging your requests and tracking the number of calls per minute. This helps you identify when you are approaching the limit and adjust your strategy accordingly. By managing rate limits effectively, you can avoid interruptions in your service and provide a consistent experience for your users.
Remember that rate limits are per key, so if you have multiple applications using the same key, they all share the same limit. This means you need to coordinate your request volume across all applications to avoid hitting the limit. By planning your request distribution, you can optimize your usage and avoid unnecessary throttling.
Handling Crypto Top-Ups and Credits
Our service requires payment via cryptocurrency, specifically USDT on the TRC20 network or USDC on the Base network. You can top up your account with any whole amount between $20 and $500. This method ensures fast and secure transactions without the need for traditional banking methods. When you top up, your credit is added to your account immediately, allowing you to start making requests right away.
The pricing structure is simple: $0.15 per million input tokens and $0.50 per million output tokens. This means you are only charged for the tokens used in your requests, excluding errors and refusals. This transparent pricing model helps you predict your costs accurately. You can monitor your usage in the dashboard to see how much credit you have remaining and how much you are spending.
Top-ups are permanent and never expire, so you can add credit whenever it is convenient for you. This flexibility allows you to manage your budget effectively without worrying about losing unused credit. Additionally, you can receive bonus credit when you top up from $50, which gives you extra value for your money. This bonus ranges from +5% to +15%, depending on the amount you top up.
Since we do not accept cards, PayPal, or bank transfers, you need to have a cryptocurrency wallet to make payments. This might be a barrier for some users, but it offers anonymity and speed. By understanding the top-up process, you can ensure you have enough credit to keep your application running smoothly.
Troubleshooting Integration Issues
When integrating with our API, you might encounter issues that are not related to errors or rate limits. One common issue is incorrect request formatting. Ensure that you are sending the correct JSON structure in your POST requests to /v1/chat/completions or /v1/responses. The model ID should be set to "uncensored" to access the uncensored model. If you send an incorrect model ID, the request might fail or return unexpected results.
Another common issue is network connectivity. If your application is behind a firewall or proxy, you might experience timeouts or connection errors. Make sure that your application can reach the base URL https://api.chatterbotapi.com/v1. You can test this by sending a simple request to the /v1/models endpoint, which returns information about available models. This helps you verify that your network connection is working correctly.
Parameter errors are also frequent. Our API supports parameters like temperature, top_p, stop, and seed. If you send an invalid parameter or a value outside the allowed range, the request might fail. Always refer to the documentation for the correct parameter values and ranges. By validating your parameters before sending requests, you can avoid unnecessary errors and improve the reliability of your integration.
Finally, check your API key permissions. If you are using multiple keys, ensure that each key has the necessary permissions to access the features you need. Some keys might have restricted access, which could cause issues when trying to use certain endpoints. By verifying your key permissions, you can ensure that your application has the access it needs to function correctly.
When Our API Is Not the Right Choice
While our API is excellent for text-based applications, it might not be the right choice for every project. Our service is a hosted, OpenAI-compatible chat-completions API that serves one uncensored open-weight text model. It does not support embeddings, image, audio, or video generation, OCR, fine-tuning, or model routing. If your application requires any of these features, our API might not meet your needs.
For example, if you need to generate images from text descriptions, you would need a different service that supports image generation. Similarly, if you need to transcribe audio or video files, our API does not have OCR capabilities. In these cases, you might need to use a different provider that offers these specific features. Our API is best suited for applications that primarily deal with text input and output.
Additionally, if you need real-time audio or video processing, our text-only API might not be sufficient. You would need a service that can handle multimedia inputs and outputs. Our API is designed for text-based interactions, such as chatbots, content generation, and data analysis. If your project involves multimedia, you should consider a more comprehensive solution.
Another consideration is the payment method. Since we only accept cryptocurrency, if your team or users prefer traditional payment methods like credit cards or PayPal, our API might not be the best fit. You would need to set up a cryptocurrency wallet and manage crypto transactions, which might be a barrier for some users. By evaluating these factors, you can determine if our API is the right choice for your project.
Answering Common Developer Questions
Developers often ask about the reliability of the API during high traffic periods. Many users wonder if the rate limits are strict and how they can avoid hitting them. The answer is that the 300 requests per minute limit is enforced per key, so you can manage your traffic by distributing requests or using multiple keys. This ensures that your application can handle high volumes of requests without interruption.
Another common question is about the trial credit. New accounts receive $0.50 of trial credit, which allows you to test the API without needing to add credit immediately. This is useful for developers who want to evaluate the service before committing to a top-up. You can use this trial credit to send a few requests and see how the API performs.
Users also ask about the bonus credit for top-ups. When you top up from $50, you receive a bonus ranging from +5% to +15%. This bonus is added to your account immediately, giving you extra value for your money. This is a great incentive for users who plan to use the API extensively.
Finally, developers often inquire about the uncensored nature of the model. The model does not refuse lawful adult, fictional, security-research, or controversial topics, except for sexual content involving minors. This makes it suitable for applications that require less restrictive content filtering. By understanding these common questions, you can make informed decisions about using our API.
Best Practices for Error Handling
To ensure your application handles errors effectively, you should implement a reliable error handling strategy. This includes logging errors, retrying failed requests, and notifying users when issues occur. By logging errors, you can track the frequency and type of errors, which helps you identify patterns and optimize your integration.
Retrying failed requests is important for handling transient errors like 429 rate limits. Implement exponential backoff to avoid overwhelming the server with retries. This means waiting longer between retries as the number of attempts increases. This strategy helps to prevent further throttling and ensures that your requests are processed successfully.
Notifying users when errors occur is important for providing a good user experience. If a request fails, inform the user about the issue and suggest a solution, such as retrying the request or checking their account balance. This helps to reduce frustration and keeps the user engaged with your application.
Additionally, monitor your API usage regularly to ensure you are staying within your rate limits and credit balance. This helps you avoid unexpected interruptions and ensures that your application runs smoothly. By following these best practices, you can build a reliable and user-friendly application that uses our API effectively.
Frequently asked questions
What happens if I run out of credit?
You will receive a 402 error, indicating that you have no credit remaining. You can top up your account with USDT on TRC20 or USDC on Base to continue using the API.
How do I handle rate limits?
Implement exponential backoff in your code to wait longer between retries. You can also distribute requests or use multiple API keys to manage traffic.
Is there a trial credit for new users?
Yes, every new account gets $0.50 of trial credit, which you can use to test the API without adding credit immediately.
What payment methods are accepted?
We only accept cryptocurrency top-ups: USDT on the TRC20 network or USDC on the Base network. Cards, PayPal, and bank transfers are not supported.