EN ▾
Get API key

How to Estimate Flux API Text Costs

Developers often ask how to budget for high-volume text generation without hidden fees. This article teaches you to calculate exact costs using our $0.15 per 1M input tokens and $0.50 per 1M output tokens model, including a worked example for a typical prompt-response workflow.

Developer workspace with code and token counter illustrating API cost estimation

Understanding the Pricing Model

When integrating an LLM into your application, understanding the pricing structure is essential for budgeting. Our API uses a straightforward pay-as-you-go model based on token consumption. You are charged $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. This means you only pay for the text you send and receive, with no monthly subscription fees or hidden charges.

The model is uncensored, meaning it does not refuse lawful adult, fictional, security-research, or controversial topics. This feature is particularly useful for developers building chatbots or content generation tools that require flexible content filtering. The model id you send is simply "uncensored".

Errors and refusals are free, which helps keep costs down when testing or handling edge cases. For example, if a request fails due to a network issue or a rate limit, you are not charged for those tokens. This makes the API predictable for development and testing phases.

Unlike some providers that charge for unused capacity, our API charges by real token usage. This transparency allows you to estimate costs accurately based on your expected traffic. You can also start with a trial credit of $0.50 for new accounts, allowing you to test the API without immediate payment.

Calculating Input and Output Costs

To estimate your costs, you need to calculate the total tokens used in each request. The formula is simple: divide the token count by 1,000,000 and multiply by the per-million price. For input tokens, the rate is $0.15, and for output tokens, it is $0.50. This calculation helps you predict the cost of each interaction.

For instance, if your prompt uses 50,000 tokens, the input cost is calculated as (50,000 / 1,000,000) * $0.15. This results in a very small fraction of a cent, demonstrating the efficiency of the pricing model for high-volume usage. Similarly, if the response generates 10,000 tokens, the output cost is (10,000 / 1,000,000) * $0.50.

It is important to note that the context window is 100,000 tokens, which includes both the prompt and the completion together. This means you can send long prompts without exceeding the limit, but you must account for the total token usage in your budgeting.

By tracking your token usage, you can optimize your prompts to reduce costs. Shorter prompts with clear instructions can help minimize input tokens, while efficient response generation can keep output tokens low. This approach ensures you stay within your budget while maintaining high-quality outputs.

Prepaid Credits and Top-Up Options

Our API uses a prepaid credit system, which means you must add funds to your account before making requests. This model ensures that you only pay for what you use, with no recurring charges. The prepaid credit never expires, so you can use it at your own pace without pressure.

Top-ups are available in crypto only, specifically USDT on TRC20 or USDC on Base. You can add any whole amount from $20 to $500. This flexibility allows you to choose the amount that best fits your needs, if you are testing the API or scaling up for production.

Additionally, there is a bonus credit program for larger top-ups. If you add $50 or more, you receive a bonus credit ranging from +5% to +15%. This bonus can help you get more value from your investment, especially when you are starting with higher volumes.

Since cards, PayPal, and bank transfers are not accepted, ensure you have a crypto wallet ready for top-ups. This method is secure and efficient, allowing you to fund your account quickly and start using the API without delay. The trial credit of $0.50 is also available for new accounts, giving you a head start.

Rate Limits and Error Handling

When using the API, it is important to be aware of the rate limits to avoid disruptions. Our API allows 300 requests per minute per key. This limit is designed to ensure fair usage and maintain performance for all users. If you exceed this limit, you will receive a 429 rate limit error.

Errors such as 401 for an invalid key or 402 for no credit are also common. These errors are free, meaning you are not charged for tokens when these issues occur. This helps keep costs down during debugging and testing phases. Understanding these error codes can help you troubleshoot issues quickly.

Streaming over SSE is supported, allowing you to receive usage information in the last chunk. This feature is useful for real-time applications where you need to monitor token usage as it happens. You can also use function calling, JSON mode, and various parameters like temperature and top_p to customize your responses.

By monitoring your rate limits and handling errors appropriately, you can ensure a smooth experience with the API. The prepaid credit system and free error handling make it easy to manage costs and maintain performance. Always check your key and credit status to avoid unexpected interruptions.

When Our API Is Not the Right Choice

While our API is excellent for text generation, it may not be the right choice for everyone. If you need embeddings, image generation, audio processing, or video generation, our API does not support these features. We focus solely on text-in, text-out capabilities with the uncensored model.

Additionally, if you require OCR, fine-tuning, or model routing, our API does not offer these services. The API is designed for developers who need a simple, uncensored text model without the complexity of multi-modal capabilities. If you need these advanced features, you may need to look for a different provider.

Our API also does not support on-prem deployment, so if you need to run the model locally, this hosted solution may not fit your needs. The API is ideal for developers who want a straightforward, reliable text generation service without the overhead of managing infrastructure.

Finally, if you are looking for a provider with an SLA, certifications like SOC2 or HIPAA, or named customers, our API does not claim these. We are an independent service focused on providing a high-quality, uncensored text model. If these factors are critical to your project, you may need to consider other options.

Community Questions and Answers

Developers often ask about the best ways to use the Flux API for various projects. On Reddit, threads on r/resonite discuss how to interact with ProtoFlux outside of Resonite, similar to how you can interact with objects with the Unity SDK. Some users mention community-made tools like protograph that allow text-based interaction with Flux.

Another common question is how to disable NSFW protection on Flux API keys. Users on r/Freepik_AI ask how to enable NSFW features on models pulled from their respective websites. The moderation guidelines are set by the model providers, so you need to check their documentation for specific instructions.

On r/SideProject, developers discuss which Flux API feels best to build on now that every host runs the same open family. The consensus is that the choice depends on the specific needs of the project, such as rate limits, pricing, and ease of integration. Our API offers a straightforward, uncensored model with clear pricing.

These community discussions highlight the importance of choosing the right API for your needs. By understanding the features and limitations of each provider, you can make an informed decision. Our API is designed to be simple and reliable, making it a good choice for many developers.

Best Practices for Cost Estimation

To estimate costs effectively, start by understanding your token usage. Use the formula (tokens divided by 1,000,000 times the per-million price) to calculate the cost for each request. This method ensures you have a clear picture of your expenses. For input tokens, use the $0.15 rate, and for output tokens, use the $0.50 rate.

Monitor your token usage regularly to identify patterns and optimize your prompts. Shorter prompts with clear instructions can help reduce input tokens, while efficient response generation can keep output tokens low. This approach helps you stay within your budget while maintaining high-quality outputs.

Use the trial credit of $0.50 to test the API before committing to a larger top-up. This allows you to verify the integration and understand the token usage without financial risk. You can also use the prepaid credit system to manage your budget effectively.

Finally, take advantage of the bonus credit program for larger top-ups. If you add $50 or more, you receive a bonus credit ranging from +5% to +15%. This can help you get more value from your investment, especially when you are scaling up for production. By following these best practices, you can maximize the efficiency of your API usage.

Frequently asked questions

How do I calculate the cost of a request?

Divide the token count by 1,000,000 and multiply by the per-million price. For input tokens, the rate is $0.15, and for output tokens, it is $0.50.

What happens if I exceed the rate limit?

You will receive a 429 rate limit error. Errors and refusals are free, so you are not charged for tokens when these issues occur.

Can I use a credit card to top up?

No, top-ups are available in crypto only, specifically USDT on TRC20 or USDC on Base. You can add any whole amount from $20 to $500.

Does the prepaid credit expire?

No, the prepaid credit never expires. You can use it at your own pace without pressure, and you only pay for real token usage.