EN ▾
Get API key

How to Budget for Uncensored Text API Costs

Developers often ask how to estimate monthly spend for high-volume uncensored text generation without hitting hidden fees. This article teaches a method for calculating token-based costs using Unrestricted AI's pricing model, with a worked example to help you forecast your budget accurately.

Digital token counter display with uncensored lock icon on dark gradient background

Understanding Token-Based Pricing

When building applications with large language models, the most common source of billing confusion is the difference between tokens and characters. Our API charges based on token usage, which is a measure of text volume rather than the number of words or characters you type. A single token can represent a whole word, a partial word, or even a punctuation mark, depending on the model's tokenizer. This means that the cost of a request is determined by the total number of tokens in both the prompt and the completion combined.

The pricing structure is straightforward: we charge $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. This means that generating text is significantly more expensive than sending text to the model. For developers, this distinction is important because long responses can quickly inflate your bill if you are not monitoring the output length. By understanding that you pay for the volume of data processed, you can better predict your monthly expenses based on your expected usage patterns.

It is important to note that errors and refusals are free. If a request fails due to a network issue or if the model refuses a request for a specific reason, you are not charged for those tokens. This safety net allows you to experiment with different prompts and parameters without worrying about wasting credit on failed attempts. However, successful completions, regardless of their quality, will incur charges based on the token count.

To manage your budget effectively, you should track the token count of your requests. Most SDKs and libraries provide methods to estimate or count tokens before sending a request. By doing this, you can estimate the cost of each call and multiply it by your expected volume to get a monthly forecast. This proactive approach helps you avoid unexpected bills and ensures that your application remains cost-effective as it scales.

Calculating Input vs. Output Costs

One of the key aspects of budgeting for our API is understanding the disparity between input and output costs. Input tokens are the instructions you send to the model, such as system prompts, user messages, and context. Output tokens are the text the model generates in response. Since output tokens cost more, your budget will be heavily influenced by how much text the model produces for each request.

For example, if you send a prompt with 1,000 tokens and receive a response of 500 tokens, you are charged for 1,000 input tokens and 500 output tokens. The cost for the input would be calculated as (1,000 / 1,000,000) * $0.15, and the cost for the output would be (500 / 1,000,000) * $0.50. While these individual costs are small, they add up quickly when you are making thousands of requests per day.

To minimize output costs, you can use parameters like max_tokens to limit the length of the response. This ensures that the model does not generate unnecessary text, which can save you money in the long run. Additionally, using streaming mode can help you monitor the response in real-time, allowing you to stop generation early if the model starts producing irrelevant content.

Another strategy is to optimize your prompts. A well-crafted prompt can reduce the number of input tokens required while still providing the model with enough context to generate a high-quality response. This involves being concise and specific in your instructions, which can reduce both input and output costs. By balancing the length of your prompts and the expected response length, you can create a more efficient and cost-effective application.

Optimizing Token Usage with Parameters

Our API offers several parameters that can help you optimize token usage and control the behavior of the model. These parameters include temperature, top_p, stop, and seed. By tuning these settings, you can influence the length and quality of the output, which directly impacts your costs.

The temperature parameter controls the randomness of the model's output. A lower temperature makes the output more deterministic and focused, which can reduce the likelihood of the model generating long, rambling responses. A higher temperature introduces more creativity and variability, which might result in longer outputs. Experimenting with different temperature values can help you find the right balance between creativity and cost.

The stop parameter allows you to specify a sequence of characters that will cause the model to stop generating text. This is useful for ensuring that the model does not produce unnecessary content after a certain point. For example, you might set the stop sequence to a specific delimiter or phrase that marks the end of the desired output. This can help you save on output tokens by preventing the model from continuing to generate text after the intended response is complete.

Using json_mode can also help you control the output format. When you enable JSON mode, the model is constrained to output valid JSON, which can reduce the amount of extra text or explanations that the model might include. This is particularly useful for applications that require structured data, as it ensures that the output is clean and easy to parse, while also potentially reducing the token count.

Handling Errors and Refusals

One of the benefits of our API is that errors and refusals are free. If a request fails due to a network issue, an invalid key, or a rate limit, you are not charged for the tokens. This means that you can experiment with different prompts and parameters without worrying about wasting credit on failed attempts. However, it is important to handle errors gracefully in your application to avoid unnecessary retries that could lead to higher costs.

The API returns specific error codes to help you diagnose issues. A 401 error indicates an invalid key, a 402 error means you have no credit, and a 429 error indicates that you have hit the rate limit of 300 requests per minute. By monitoring these errors, you can adjust your application's behavior to avoid them. For example, if you hit the rate limit, you can implement exponential backoff to retry requests after a delay.

Refusals are also free. If the model refuses a request due to the hard content limit on sexual content involving minors, you are not charged for that request. This allows you to test your content filters and ensure that your application is compliant with the terms of service without incurring costs for refused requests.

It is also worth noting that the model does not refuse lawful adult, fictional, security-research, or controversial topics. This means that you can use the API for a wide range of applications without worrying about unexpected refusals. However, you should still implement your own content filters if needed to ensure that your application meets your specific requirements.

When Our API Is Not the Right Choice

While our API is excellent for text generation, it is important to recognize when it might not be the right choice for your project. Our API is a hosted, OpenAI-compatible chat-completions API that serves a single uncensored open-weight text model. It does not support embeddings, image generation, audio or video generation, OCR, fine-tuning, or model routing. If your application requires any of these features, our API may not be the best fit.

For example, if you need to generate images or videos, you would need a different service that specializes in multimedia generation. Similarly, if you need to perform semantic search or retrieve relevant documents, you would need an embedding model, which our API does not provide. In these cases, you might need to integrate multiple APIs to build a comprehensive solution.

Additionally, our API has a context window of 100,000 tokens. If your application requires a larger context window, you might need to look for a different provider. However, for most text generation tasks, 100,000 tokens is more than sufficient to handle long documents or conversations.

Finally, if you need on-premises deployment or specific certifications like SOC2 or HIPAA, our API might not meet your requirements. We are an independent service that does not offer on-prem deployment or these certifications. If these are critical for your use case, you should evaluate other providers that specialize in enterprise-grade solutions.

What Developers Are Asking on Reddit

Developers on Reddit are often looking for reliable uncensored AI APIs for various workflows. In threads on r/VeniceAI, users discuss the need for a new truly unrestricted AI generator, especially for mobile users who want to avoid filtered content. They are looking for the current best website for completely uncensored, unfiltered image and video generation, but many are also interested in text APIs for agentic workflows.

In r/BlackboxAI_, developers are curious about linking uncensored AI APIs or GPU endpoints to Blackbox for agentic workflows. They are trying to get it working smoothly and are looking for recommendations for APIs that can handle unrestricted use. Some users mention specific APIs and suggest using them with certain frontends to achieve the desired results.

Other threads discuss the need for free or low-cost uncensored AI APIs. Users are looking for solutions that do not require a subscription or monthly fee, and are interested in prepaid credit models. They are also interested in APIs that offer a trial period with no card required, allowing them to test the service before committing to a payment method.

Overall, the consensus among developers is that there is a need for reliable, uncensored text APIs that are easy to integrate and cost-effective. Our API addresses these needs by offering a simple pricing model, a generous trial period, and a wide range of parameters for controlling the output. By understanding what developers are asking for, we can continue to improve our service to meet their needs.

Forecasting Your Monthly Budget

To forecast your monthly budget, you need to estimate the number of requests you will make and the average token count for each request. Start by calculating the cost of a single request using the formula: (input tokens / 1,000,000 * $0.15) + (output tokens / 1,000,000 * $0.50). Then, multiply this cost by the number of requests you expect to make per month.

For example, if you expect to make 10,000 requests per month, with an average of 1,000 input tokens and 500 output tokens per request, your monthly cost would be calculated as follows: (1,000 / 1,000,000 * $0.15 * 10,000) + (500 / 1,000,000 * $0.50 * 10,000). This gives you a clear picture of your expected expenses.

It is also important to consider the cost of the trial credit. Every new account gets $0.50 of trial credit, which can be used to test the API without spending any real money. This is a great way to familiarize yourself with the API and estimate your usage patterns before committing to a paid plan.

Finally, remember that prepaid credit never expires. You can top up your account with crypto at any time, and the credit will remain available for use. This flexibility allows you to manage your budget more effectively, as you can add funds only when needed. By tracking your usage and adjusting your budget accordingly, you can ensure that your application remains cost-effective over time.

Frequently asked questions

How do I calculate the cost of a single request?

You calculate the cost by multiplying the number of input tokens by $0.15 per million, and the number of output tokens by $0.50 per million. Sum these two values to get the total cost for that request.

Do I get charged for failed requests?

No, errors and refusals are free. You are only charged for successful completions where tokens are generated.

Can I use the API for image generation?

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

How do I top up my credit?

You can top up your credit using crypto only, specifically USDT on TRC20 or USDC on Base. The minimum amount is $20 and the maximum is $500.