EN ▾
Get API key

Budgeting for NSFW API Calls: Cost Estimation Guide

Developers often ask how to predict monthly spend for high-volume uncensored text generation before committing to a budget. This article teaches a step-by-step method to calculate token usage and apply our specific per-token rates to estimate costs for a typical roleplay or creative writing workflow.

Developer workspace with floating glowing tokens representing API usage costs

Understanding Our Pricing Model

Our API operates on a simple prepaid credit model, where you pay only for what you use. The cost is determined by the number of tokens processed, with separate rates for input and output. Input tokens, which include your prompt and conversation history, are charged at $0.15 per million tokens. Output tokens, which represent the model's generated response, are charged at $0.50 per million tokens. This structure allows you to control costs by managing the length of your prompts and the verbosity of the model's responses.

It is important to note that errors and refusals do not incur charges. If your request results in a 401, 402, or 429 error, or if the model refuses to generate content due to the hard content limit, you are not billed for those tokens. This means you can experiment with different prompts and parameters without worrying about unexpected costs for failed requests. The prepaid credit is charged by real token usage, ensuring that you only pay for successful completions.

The prepaid credit never expires, and there are no monthly subscription fees or hidden charges. You can top up your account with crypto, specifically USDT on TRC20 or USDC on Base, in amounts ranging from $20 to $500. For top-ups of $50 or more, you may receive bonus credit, which can range from +5% to +15% depending on the amount. This flexibility allows you to scale your usage up or down as needed without being locked into a rigid plan.

When estimating your budget, it is helpful to think in terms of token counts rather than dollar amounts. The API charges by the million tokens, so small usage spikes will have a minimal impact on your overall cost. By understanding the per-token rates and the way tokens are counted, you can accurately predict your monthly spend and avoid surprises on your bill. This approach provides transparency and control over your API expenses.

Calculating Token Usage for Roleplay

To estimate costs for a roleplay workflow, you need to understand how tokens are consumed in a conversation. Each turn in the conversation consumes tokens for both the input (your prompt and the history) and the output (the model's response). The context window for our API is 100,000 tokens, which includes both the prompt and the completion together. This means that as the conversation grows, the input tokens increase, potentially affecting the cost of each subsequent turn.

Let's consider a typical roleplay scenario where you send a prompt of 100 tokens and receive a response of 50 tokens. The input cost for this turn would be calculated as (100 / 1,000,000) * $0.15, and the output cost would be (50 / 1,000,000) * $0.50. While these individual costs are small, they add up quickly if you are running a high-volume roleplay with many users or long conversations. It is essential to track the token usage over time to get a accurate picture of your expenses.

You can also use the streaming feature to monitor usage in real-time. The API supports streaming over SSE, and you can see the usage information in the last chunk of the response. This allows you to track the number of tokens generated for each response and adjust your budget accordingly. By using streaming, you can also reduce latency and improve the user experience, as the model starts generating text as soon as it is ready.

When planning your budget, consider the average length of your prompts and responses. If you are using a model with a large context window, you might be tempted to send longer prompts, but this will increase your input costs. Conversely, if you want to reduce output costs, you can use parameters like temperature and top_p to control the verbosity of the model. By balancing these factors, you can optimize your token usage and keep your costs low.

Estimating Monthly Costs for Creative Writing

Creative writing workflows often involve generating long-form content, such as stories or articles, which can consume a significant number of tokens. To estimate your monthly costs, you need to calculate the total number of tokens generated per month. This includes both the input tokens from your prompts and the output tokens from the model's responses. By multiplying the token counts by the respective per-million rates, you can get a clear picture of your expected spend.

For example, if you are generating 1,000 words of text per day, and each word is approximately 1.3 tokens, you would use about 1,300 tokens per day. Over a month, this would amount to 39,000 tokens. If the model generates a response of similar length, you would have 78,000 tokens per month. The input cost would be (39,000 / 1,000,000) * $0.15, and the output cost would be (39,000 / 1,000,000) * $0.50. This gives you a baseline for your monthly budget.

You can also use the JSON mode and function calling features to structure your output and reduce unnecessary tokens. By sending structured prompts and receiving structured responses, you can minimize the number of tokens used for formatting and focus on the content. This can help you save on output costs, especially if you are generating large volumes of text. Additionally, using the stop parameter can help you control the length of the response and prevent the model from generating excessive text.

When estimating costs, it is also important to consider the frequency of your API calls. If you are making many small requests, the overhead of each request might add up. However, if you are making fewer, larger requests, you might save on the overhead but increase the risk of hitting the rate limit. Our API allows up to 300 requests per minute per key, so you can scale your usage as needed. By balancing the frequency and size of your requests, you can optimize your token usage and keep your costs predictable.

Optimizing Token Usage with Parameters

Our API offers several parameters that can help you optimize token usage and control the cost of your API calls. The temperature parameter controls the randomness of the output, with higher values leading to more diverse and creative responses. The top_p parameter controls the diversity of the output by filtering out low-probability tokens. By adjusting these parameters, you can influence the length and quality of the model's responses, which can impact your token usage.

For example, if you set the temperature to a lower value, the model will be more deterministic and likely to generate shorter, more focused responses. This can help reduce output tokens and lower your costs. Conversely, if you set the temperature to a higher value, the model will be more creative and likely to generate longer, more varied responses. This can increase output tokens but may result in higher quality content. It is important to find the right balance for your specific use case.

The stop parameter allows you to specify a sequence of characters that will stop the model from generating further text. This can be useful for controlling the length of the response and preventing the model from generating excessive text. By setting a stop sequence, you can ensure that the model stops generating text at a specific point, which can help you save on output tokens. This is particularly useful for roleplay scenarios where you want to control the flow of the conversation.

Additionally, you can use the seed parameter to get reproducible results. This is useful for testing and debugging, as it allows you to generate the same output for the same input. By using a fixed seed, you can ensure that your tests are consistent and that you are not wasting tokens on random variations. This can help you save on input tokens when testing different prompts and parameters. By using these parameters effectively, you can optimize your token usage and keep your costs low.

When Our API Is Not the Right Choice

While our API is well-suited for uncensored text generation, it may not be the right choice for every project. If you need features such as image, audio, or video generation, our API does not support these capabilities. We also do not offer embeddings, OCR, fine-tuning, or model routing. If your project requires any of these features, you may need to look for a different service that offers a broader range of capabilities.

Another consideration is the context window. Our API has a context window of 100,000 tokens, which is quite large but may not be sufficient for very long documents or conversations. If you need to process documents with more than 100,000 tokens, you may need to chunk the text and process it in smaller parts. This can add complexity to your workflow and may increase the number of API calls required.

Additionally, our API is focused on text generation and does not offer real-time voice or video streaming. If you need to integrate voice or video into your application, you may need to use a different service for those features and combine it with our API for text generation. This can be a powerful combination, but it requires additional development work to integrate the different services.

Finally, if you need a service with a guaranteed SLA or specific certifications such as SOC2 or HIPAA, our API may not be the best fit. We do not claim any SLA percentages or certifications, and we do not offer on-prem deployment. If these features are critical for your project, you may need to look for a different provider. By understanding the limitations of our API, you can make an informed decision about whether it is the right choice for your project.

Addressing Common Questions from Developers

Developers often ask about the differences between our API and other models, particularly in the context of recent discussions about distillation and training data. In threads on r/LocalLLaMA and r/ClaudeAI, users have discussed how some companies are using large-scale distillation to extract capabilities from other models. While our API does not claim to be distilling data from other models, it is important to understand that our model is an open-weight text model that serves uncensored content.

Users have also asked about the cost-effectiveness of our API compared to other providers. While we do not claim to be the cheapest option, our per-token pricing is competitive, and our prepaid credit model allows you to pay only for what you use. This can be more cost-effective than subscription-based models, especially for high-volume usage. By understanding the token usage and optimizing your parameters, you can keep your costs low.

Another common question is about the reliability of our API. Our API supports streaming over SSE, which allows for real-time responses and better user experience. We also offer function calling and JSON mode, which can help you integrate our API into your application more easily. By using these features, you can ensure that your application is responsive and reliable.

Finally, users have asked about the hard content limit and how it affects usage. Our API refuses requests involving sexual content with minors, but otherwise allows a wide range of adult, fictional, and controversial topics. This can be beneficial for projects that need uncensored content but want to avoid legal issues. By understanding these limits, you can design your application to handle refusals gracefully and avoid unexpected costs.

Final Tips for Budgeting Your API Usage

To ensure you stay within your budget, it is important to monitor your token usage regularly. You can use the streaming feature to track usage in real-time and adjust your parameters as needed. By keeping an eye on your usage, you can identify any unexpected spikes and take action to control costs. You can also set up alerts or notifications to warn you when your credit is running low.

Another tip is to use the trial credit to test your application before committing to a larger budget. Every new account gets $0.50 of trial credit, which you can use to experiment with different prompts and parameters. This can help you understand how the API works and estimate your costs more accurately. By using the trial credit, you can avoid wasting money on a service that may not meet your needs.

You can also optimize your usage by using the stop parameter and controlling the length of your responses. By setting a stop sequence, you can prevent the model from generating excessive text and save on output tokens. This is particularly useful for roleplay scenarios where you want to control the flow of the conversation. By using these techniques, you can keep your costs low and ensure that you get the most value from your API calls.

Finally, consider the frequency and size of your API calls. If you are making many small requests, the overhead of each request might add up. However, if you are making fewer, larger requests, you might save on the overhead but increase the risk of hitting the rate limit. Our API allows up to 300 requests per minute per key, so you can scale your usage as needed. By balancing the frequency and size of your requests, you can optimize your token usage and keep your costs predictable. This approach provides a solid foundation for budgeting your API usage and ensuring that you get the most value from your investment.

Frequently asked questions

How do I calculate the cost of a single API call?

Calculate the cost by dividing the number of input tokens by 1,000,000 and multiplying by $0.15, then divide the number of output tokens by 1,000,000 and multiply by $0.50. Sum these two values to get the total cost for the call.

What happens if my API call fails?

Errors such as 401, 402, or 429 do not incur charges. You are only billed for successful token usage, so failed requests are free.

Can I use credit cards to top up my account?

No, we only accept crypto. You can top up with USDT on TRC20 or USDC on Base in amounts from $20 to $500.

Is there a free trial available?

Yes, every new account gets $0.50 of trial credit with no card needed. This allows you to test the API before purchasing credit.