EN ▾
Get API key

Troubleshooting Flux API Key Errors and NSFW Settings

Developers integrating Flux models often face hurdles with key management and content moderation. This guide addresses common risks, explaining how to configure your key for uncensored text output and troubleshoot connection issues specific to our hosted service.

A glowing key representing API access in a digital neural network setting

Understanding API Error Codes

When building applications with our API, encountering error codes is a normal part of the development lifecycle. The most common errors you will face are 401, 402, and 429. A 401 error indicates an invalid key, which usually happens when the key is missing, expired, or typed incorrectly. A 402 error means you have no credit remaining, and a 429 error signals that you have hit the rate limit of 300 requests per minute. These errors are designed to help you manage your usage and billing effectively.

It is important to handle these errors gracefully in your code. Instead of crashing your application, you should implement logic to retry requests or notify the user when credit is low. Since our API charges by real token usage, errors do not consume credit, which is a significant advantage for developers testing their integrations. This means you can iterate quickly without worrying about wasting funds on failed requests.

Debugging these errors often involves checking your request headers and payload. Ensure that you are sending the correct model ID, which is uncensored, and that your authentication header is formatted correctly. If you are using a library or SDK, verify that it is up to date with the latest API specifications. This will help you avoid common pitfalls that lead to authentication or rate limit errors.

Finally, remember that our API is straightforward in its error reporting. There are no hidden fees or complex billing structures to decipher. If you encounter a 402 error, simply top up your credit using crypto to resume service. This transparency allows you to focus on building your application rather than managing complex billing accounts.

Configuring Uncensored Text Output

One of the key features of our API is the ability to generate uncensored text. The model does not refuse lawful adult, fictional, security-research, or controversial topics. This makes it ideal for developers who need raw output without additional moderation layers. To utilize this feature, you simply send the model ID uncensored in your request. The model will then process your prompt and return text without applying external filters.

However, there is one hard content limit to be aware of. Requests involving sexual content with minors are refused by the model. This is a fundamental safety guard that cannot be disabled. For all other types of content, the model is designed to be permissive. This allows you to build applications that can handle a wide range of topics, from creative writing to technical analysis, without unexpected refusals.

When configuring your requests, you can also use parameters like temperature, top_p, and stop to fine-tune the output. These parameters allow you to control the creativity and determinism of the model. For example, a lower temperature will produce more consistent results, while a higher temperature will introduce more variability. Experimenting with these settings can help you find the right balance for your specific use case.

It is also worth noting that the model is an open-weight text model. This means you can trust the output to be consistent with the model's training data. There are no hidden filters or post-processing steps that might alter the text. This transparency is important for developers who need to ensure the integrity of the generated content.

Managing Crypto Payments and Credits

Our API uses a prepaid credit system charged by real token usage. You can top up your account using crypto, specifically USDT on TRC20 or USDC on Base. The minimum top-up amount is $20, and the maximum is $500. This flexibility allows you to choose the payment method that best suits your needs. Additionally, if you top up $50 or more, you may receive bonus credit, ranging from +5% to +15%.

It is important to note that we do not accept credit cards, PayPal, or bank transfers. All payments must be made using the specified crypto options. This simplified payment process helps reduce administrative overhead and allows for faster processing of top-ups. Once your credit is added, it never expires, giving you the freedom to use it at your own pace.

When you create a new account, you receive $0.50 of trial credit. This allows you to test the API without any financial commitment. The trial credit is sufficient to make a few requests and evaluate the model's performance. If you find that the API meets your needs, you can then proceed to top up your account with crypto.

Errors and refusals are free, which means you do not lose credit when a request fails or is refused. This is a significant benefit for developers who are testing their integrations. You can make as many test requests as you need without worrying about wasting your prepaid credit. This allows you to iterate quickly and efficiently.

Rate Limits and Request Handling

Our API has a rate limit of 300 requests per minute per key. This limit is designed to ensure fair usage and prevent abuse. If you exceed this limit, you will receive a 429 error. It is important to handle this error gracefully in your code by implementing exponential backoff or queuing requests. This will help you avoid overwhelming the API and ensure that your application remains responsive.

When building applications that require high throughput, you may need to consider distributing your requests across multiple keys. This can help you bypass the rate limit and achieve higher performance. However, keep in mind that each key is subject to the same rate limit. So, if you have multiple keys, you can multiply your effective rate limit by the number of keys you have.

It is also important to monitor your usage to ensure that you do not exceed your rate limit unexpectedly. You can do this by logging your requests and tracking the number of requests per minute. If you notice that you are approaching the limit, you can slow down your request rate or add more keys to your pool. This proactive approach will help you avoid disruptions in your application.

Finally, remember that the rate limit is per key, not per account. This means that if you have multiple keys, you can use them independently. This flexibility allows you to scale your application as needed. You can add more keys as your usage grows, ensuring that your application can handle increased demand.

When Our API Is Not the Right Choice

While our API is powerful for text generation, it is not the right choice for every use case. Our API serves ONE uncensored open-weight text model. It does not support embeddings, image generation, audio, video, OCR, or fine-tuning. If your application requires any of these capabilities, our API will not be sufficient. For example, if you need to generate images from text, you would need a different API that supports image generation.

Additionally, our API is a hosted service. If you require on-premises deployment or specific compliance certifications like SOC2 or HIPAA, our API may not meet your needs. Our API is designed for developers who need a simple, reliable text generation service without the complexity of managing infrastructure. If you need more control over your infrastructure, you might consider hosting the model yourself.

Furthermore, our API does not offer model routing. You are limited to the uncensored model. If you need to switch between different models or use a ensemble of models, our API will not support this. You would need to build this functionality yourself or use a different API that offers model routing.

Finally, if you need a free unlimited tier, our API is not the right choice. We offer a prepaid credit system with no monthly fee, but you must pay for usage. If you are looking for a free tier with unlimited usage, you might need to explore other options. However, for developers who need reliable, uncensored text generation, our API is an excellent choice.

Addressing Community Questions on Reddit

Developers on Reddit often ask about the best ways to interact with Flux models outside of specific ecosystems. For instance, in threads on r/resonite, users discuss how to interact with ProtoFlux outside of the Resonite environment. Some users mention community-made tools like protograph that allow text-based interaction. This highlights a common need for flexible, text-based APIs that can be integrated into various platforms.

Another common question relates to disabling NSFW protection. Users on r/Freepik_AI have asked how to enable NSFW features on their API keys. The general consensus is that moderation guidelines are set by the model providers. Our API addresses this by offering an uncensored model that does not refuse lawful adult content. This provides a straightforward solution for developers who need uncensored output without complex configuration.

Additionally, developers on r/SideProject have discussed which Flux API feels best to build on. Since many hosts run the same open family of models, the differentiation often comes down to ease of use and feature set. Our API offers a simple, OpenAI-compatible interface with streaming, function calling, and JSON mode. This makes it easy to integrate into existing workflows.

Finally, users often ask about the best way to manage API keys and errors. Our API provides clear error codes and a straightforward payment system. This transparency helps developers troubleshoot issues quickly and efficiently. By addressing these common questions, we aim to provide a clear path for developers who want to use our API for their projects.

Best Practices for Integration

When integrating our API into your application, it is important to follow best practices to ensure smooth operation. First, always handle errors gracefully. Implement logic to retry requests on 429 errors and to notify users when credit is low. This will help you avoid disruptions and provide a better user experience.

Second, use the correct model ID, which is uncensored. This ensures that you are using the uncensored model that does not refuse lawful adult content. If you use the wrong model ID, you may encounter unexpected refusals or errors. Always double-check your request payload to ensure that the correct model ID is being sent.

Third, monitor your usage to ensure that you do not exceed your rate limit. Implement logging to track your requests and identify any patterns that may indicate abuse or errors. This will help you proactively manage your API usage and avoid unexpected disruptions.

Finally, take advantage of the trial credit to test your integration before committing to a top-up. This allows you to evaluate the model's performance and ensure that it meets your needs. Once you are satisfied with the results, you can proceed to top up your account with crypto. This approach minimizes risk and ensures that you are making an informed decision.

Frequently asked questions

What model ID should I use for uncensored text?

You should use the model ID uncensored in your request. This model does not refuse lawful adult, fictional, or controversial topics, providing raw text output without additional moderation.

How do I top up my account?

You can top up your account using USDT on TRC20 or USDC on Base. The minimum amount is $20, and the maximum is $500. We do not accept credit cards or PayPal.

What happens if I hit the rate limit?

If you exceed 300 requests per minute, you will receive a 429 error. You should implement exponential backoff or queue your requests to handle this error gracefully.

Does the API support image generation?

No, our API serves only a text model. It does not support image, audio, video, or embedding generation. You would need a different API for those capabilities.