EN ▾
Try with trial credit

Budgeting Text API Costs: A Token Math Guide

Developers often ask how to predict monthly spend for high-volume text generation without hidden fees. This article teaches a method to estimate costs using our $0.15 per 1M input and $0.50 per 1M output rates, with a worked example for a typical automation workflow.

Developer desk with laptop showing API token math and crypto coins

Understanding the Pricing Model

When building applications with large language models, understanding the pricing model is essential for sustainable development. Our API uses a straightforward token-based pricing structure that charges only for actual usage. This means you pay for the input tokens sent to the model and the output tokens generated in response. The rates are set at $0.15 per million input tokens and $0.50 per million output tokens. This structure ensures that you are not paying for idle time or unused capacity.

It is important to note that this pricing applies specifically to our API service. Other vendors may have different pricing models, so it is always wise to check their documentation for current rates. By using a per-token model, you can precisely estimate your costs based on the volume of text you process. This transparency helps in planning budgets for high-volume applications without unexpected surprises.

The model id you will use for these requests is "uncensored". This uncensored model does not refuse lawful adult, fictional, security-research, or controversial topics. However, it does have a hard content limit regarding sexual content involving minors. Requests that violate this limit are refused, and you are not charged for these refusals. This feature is particularly useful for developers testing content filters or building applications that require flexible content handling.

Another key aspect of our pricing is that prepaid credit never expires. This allows you to top up your account when convenient and use the credits over an extended period. There are no monthly fees or subscription requirements, which makes it easy to scale your usage up or down as needed. You only pay for what you use, and any remaining credit stays in your account until you decide to use it or top up again.

Calculating Input and Output Costs

To calculate your costs, you need to understand how tokens are counted. A token is a basic unit of text, and the model processes text in chunks of tokens. The context window for our API is 100,000 tokens, which includes both the prompt and the completion. This means you can send large inputs and receive large outputs within a single request, as long as the total token count does not exceed the limit.

When you send a request, the input tokens are counted from the prompt you provide. The output tokens are counted from the response generated by the model. The cost for input tokens is $0.15 per million, while the cost for output tokens is $0.50 per million. To find the total cost, you multiply the number of tokens by the respective rate and divide by one million. This formula helps you estimate the cost for any given request.

For example, if you send 10,000 input tokens and receive 5,000 output tokens, the cost would be calculated as follows: (10,000 / 1,000,000) * $0.15 for input, and (5,000 / 1,000,000) * $0.50 for output. This simple calculation allows you to predict costs accurately. You can also use the streaming feature to monitor usage in real-time, as usage information is provided in the last chunk of the response.

It is important to keep track of your token usage to manage your budget effectively. You can monitor your usage through the API responses and adjust your workflows accordingly. By understanding the token count and the associated costs, you can optimize your applications to minimize expenses while maintaining performance. This approach ensures that you get the most value from your API usage.

Working Example: Automation Workflow

Let us consider a typical automation workflow to illustrate how these costs work in practice. Imagine you are building a chatbot that processes user queries and generates responses. Each user query is sent as a prompt, and the chatbot generates a response based on the input. The cost for each interaction depends on the number of tokens in the prompt and the response.

Suppose a user sends a prompt with 500 tokens, and the chatbot generates a response with 200 tokens. The cost for this interaction would be calculated using the formula: (500 / 1,000,000) * $0.15 for input and (200 / 1,000,000) * $0.50 for output. This results in a very small cost per interaction, which adds up as the volume of interactions increases. By tracking these costs, you can estimate your monthly spend based on expected usage.

In a high-volume scenario, you might process thousands of requests per day. If you expect 10,000 requests per day, each with 500 input tokens and 200 output tokens, you can calculate the daily cost and then multiply by 30 to estimate the monthly cost. This method helps you plan your budget and ensure that you have sufficient prepaid credit to cover your usage.

Additionally, you can optimize your workflow to reduce costs. For example, you can limit the length of responses or use caching to avoid redundant requests. By monitoring your token usage and adjusting your workflows, you can keep costs under control while delivering a high-quality service to your users. This proactive approach to cost management is essential for sustainable development.

Managing Credit and Top-Ups

Our API requires prepaid credit, which can be topped up using cryptocurrency. The accepted payment methods are USDT on TRC20 or USDC on Base. You can top up with any whole amount from $20 to $500. This flexibility allows you to choose the amount that best suits your needs. There are no other payment options, such as credit cards or bank transfers, so you need to have a cryptocurrency wallet to top up your account.

When you top up your account, you may also receive bonus credit. For top-ups of $50 or more, you receive a bonus ranging from +5% to +15%. This bonus credit is added to your account and can be used for requests, just like your regular credit. The bonus helps you get more value from your top-ups, especially for larger amounts. This feature is a great way to stretch your budget and get more usage for your money.

It is important to note that errors and refusals are free. If a request fails due to an invalid key, no credit, or a rate limit, you are not charged for that request. This means you do not lose credit for failed attempts, which can happen frequently in high-volume applications. You can test your integration thoroughly without worrying about wasting credit on errors.

Since prepaid credit never expires, you can top up your account whenever it is convenient. This allows you to manage your budget flexibly and avoid the pressure of monthly subscription fees. You can top up with smaller amounts more frequently or with larger amounts less frequently, depending on your usage patterns. This flexibility is a key advantage of our pricing model.

When Our API Is Not the Right Choice

While our API is excellent for text generation, it may not be the right choice for every use case. Our API serves only one uncensored open-weight text model, and it does not support embeddings, image generation, audio or video generation, OCR, or fine-tuning. If your application requires any of these features, our API may not meet your needs.

For example, if you need to generate images or videos, you would need to use a different service that specializes in those capabilities. Similarly, if you need to perform OCR on documents or fine-tune a model for a specific task, our API would not be suitable. In these cases, you might need to combine our API with other services to achieve your goals.

Additionally, our API has a rate limit of 300 requests per minute per key. If your application requires higher throughput, you may need to implement rate limiting or use multiple keys to distribute the load. This is a common challenge in high-volume applications, and you should plan your architecture accordingly to avoid hitting the rate limit.

Finally, our API is best suited for developers who need a simple, uncensored text generation service. If you require advanced features like model routing or multi-modal support, you might want to explore other options. By understanding the limitations of our API, you can make an informed decision about whether it is the right tool for your project.

Addressing Common Developer Questions

Developers often discuss various topics related to uncensored AI generators on Reddit. Threads on r/GeminiAI and r/AIToolsAndTips frequently feature questions about the best uncensored AI generators and image generators. Users share their experiences with different platforms, highlighting the trade-offs between flexibility and model quality. Some users mention that certain platforms are better for specific tasks, while others are more versatile.

In discussions about uncensored AI chatbots, users often talk about the challenges of finding bots that stay in character for roleplay and romance scenarios. Some users recommend trying specific options that offer slow-burn storytelling and consistent character behavior. These discussions help developers understand the market of uncensored AI tools and choose the right solution for their needs.

When it comes to image generation, users on r/AITips101 and r/AIJailbreak share their rankings of the best uncensored AI image generators. They note that some tools are genuinely flexible but have trade-offs, such as data privacy concerns or limited model options. Users often recommend checking the documentation of each vendor for current prices and limits to make an informed decision.

Overall, the Reddit community provides valuable insights into the uncensored AI space. By reading these threads, developers can learn about the strengths and weaknesses of different platforms. This information helps in selecting the right tools for specific use cases, whether it is text generation, image creation, or chatbot development. It is always a good idea to stay updated with community discussions to find the best solutions.

Optimizing Your API Usage

To optimize your API usage, you should focus on efficient token management. This involves minimizing the number of tokens sent in prompts and received in responses. You can achieve this by using concise prompts and limiting the length of responses. For example, you can set parameters like temperature and top_p to control the creativity and diversity of the output, which can help in generating more relevant and concise responses.

Another way to optimize usage is to use the streaming feature. Streaming allows you to receive the response in chunks, which can be useful for real-time applications. You can monitor the usage in the last chunk of the response, which provides information about the total tokens used. This helps you keep track of your costs in real-time and adjust your workflows accordingly.

You can also use the function calling feature to enhance your applications. Function calling allows the model to call external functions, which can be useful for integrating with other services or performing specific tasks. This feature can help you build more complex and interactive applications without increasing the token count significantly.

Finally, you should regularly review your API usage to identify areas for improvement. You can analyze the token counts for different types of requests and look for patterns that indicate inefficiencies. By optimizing your usage, you can reduce costs and improve the performance of your application. This continuous improvement process is key to maximizing the value of your API usage.

Frequently asked questions

How do I calculate the cost of a request?

Multiply the number of input tokens by $0.15 and the number of output tokens by $0.50, then divide each by one million. Sum these values to get the total cost for the request.

What happens if a request fails?

Errors and refusals are free. You are not charged for requests that fail due to invalid keys, insufficient credit, or rate limits.

Can I use credit cards to top up?

No, top-ups are crypto only. You can use USDT on TRC20 or USDC on Base for amounts between $20 and $500.

Does my prepaid credit expire?

No, prepaid credit never expires. You can use it whenever you need it, without any monthly fees or subscription requirements.