EN ▾
Try with trial credit

Calculate AI Cost Per Use with Worked Examples

Developers often ask how to predict monthly spend for a specific feature before committing to a budget. This article teaches a method for estimating token usage based on input and output lengths, using our $0.15 per 1M input and $0.50 per 1M output rates to show exactly how much a single chat interaction costs.

Illustration of a calculator showing token costs for AI API pricing

Understanding Token-Based Pricing

This site is an independent service and is not affiliated with OpenAI.

Most modern AI APIs charge based on token consumption rather than per-request fees. A token is a fragment of a word, and the model processes text in these chunks. Our API uses a straightforward pricing model where you pay for the tokens you send and the tokens the model generates. This approach allows you to predict costs accurately if you understand the length of your inputs and expected outputs.

The base rates for our uncensored text model are $0.15 per one million input tokens and $0.50 per one million output tokens. These rates apply to the uncensored model served through our hosted endpoints. Since we do not charge for embeddings, image generation, or fine-tuning, your costs are strictly tied to text completion tasks.

It is important to note that errors do not consume credit. If you send a request that results in a 401 invalid key, 402 no credit, or 429 rate limit error, you are not charged. Additionally, if the model refuses a request due to the hard content limit regarding sexual content involving minors, that request is also free. This means your bill reflects only the tokens successfully processed in valid completions.

Because we use prepaid credit that never expires, you can top up with crypto only. The minimum top-up is $20, and the maximum is $500. You can add USDT on TRC20 or USDC on Base. There is no monthly subscription fee, and you do not need to worry about credits expiring at the end of a billing cycle. This structure is ideal for developers who want precise control over their spending without recurring charges.

Calculating Input Token Costs

To estimate the cost of your input, you first need to determine the number of tokens in your prompt. A prompt includes the system instructions, the user message, and any conversation history sent with the request. The context window for our model is 100,000 tokens, which includes both the prompt and the completion together. This allows for long conversations without immediate truncation.

Once you have the token count for your input, you apply the input rate of $0.15 per million tokens. The formula for calculating the cost is the number of input tokens divided by one million, multiplied by $0.15. For example, if your prompt contains 5,000 tokens, the calculation is 5,000 divided by 1,000,000, which equals 0.005. Multiplying 0.005 by $0.15 gives you the exact cost for that input portion.

This method ensures you know exactly how much each piece of context costs. Long system prompts or extensive conversation histories will increase the input token count significantly. By tracking these numbers, you can optimize your prompts to reduce costs. For instance, you might condense system instructions or limit the history sent with each request to keep the input token count manageable.

Remember that the input cost is just one part of the total expense. The output tokens, which are the model's responses, are charged at a different rate. Understanding the balance between input and output length is key to accurate budgeting. You can monitor token usage in the last chunk of streaming responses, which helps you track consumption in real-time during development.

Calculating Output Token Costs

The output tokens are the words the model generates in response to your prompt. These are charged at $0.50 per million tokens, which is higher than the input rate. This reflects the computational cost of generating text. To calculate the cost, take the number of output tokens and divide by one million, then multiply by $0.50.

For instance, if the model generates 1,000 tokens in its response, the calculation is 1,000 divided by 1,000,000, which equals 0.001. Multiplying 0.001 by $0.50 results in the cost for that specific output. This formula applies to every successful completion. If you are using streaming over SSE, you can see the usage in the last chunk, which helps you verify the token count before finalizing the request.

Output length can vary depending on the complexity of the task. Simple questions might result in short answers, while complex reasoning tasks or creative writing prompts may produce longer outputs. By estimating the average output length for your specific use case, you can predict the output costs more accurately. This is particularly useful for features that require detailed explanations or long-form content generation.

Since errors are free, you do not pay for output tokens if the request fails due to a rate limit or invalid key. However, if the request is valid but the model refuses the content due to the hard limit on minor sexual content, you still do not pay. This makes the pricing model forgiving for developers who are testing different prompts or content types.

Estimating Monthly Spend for Features

To predict your monthly spend, you need to estimate the total number of requests and the average token usage per request. Multiply the number of input tokens per request by the number of requests, then apply the input rate. Do the same for output tokens using the output rate. Sum these values to get the total estimated cost.

For example, if you expect 10,000 requests per month, with an average of 2,000 input tokens and 500 output tokens per request, you can calculate the monthly cost. The input cost would be 10,000 times 2,000 divided by one million, multiplied by $0.15. The output cost would be 10,000 times 500 divided by one million, multiplied by $0.50. Adding these gives you the total monthly spend.

This method allows you to budget precisely for specific features. If you are building a chatbot, you can estimate the cost based on the expected number of conversations and the average length of each exchange. This helps you decide if the feature is economically viable for your product. You can adjust the frequency of requests or the length of prompts to stay within your budget.

Since prepaid credit never expires, you can top up only when needed. The minimum top-up is $20, and the maximum is $500. This flexibility allows you to manage cash flow effectively. You do not need to commit to a large upfront investment if your usage is low. You can start with a small top-up and increase it as your usage grows.

When Our API Is Not the Right Choice

While our API is excellent for text completion, it is not the right choice if you need multimodal capabilities. We do not support image generation, audio processing, video creation, or OCR. If your application requires converting images to text or generating visual content, you will need to use a different service for those specific tasks.

Our API also does not offer embeddings, which are essential for semantic search and vector databases. If you need to store and retrieve information based on meaning rather than keywords, you will need to integrate a separate embedding service. Similarly, we do not provide fine-tuning options, so you cannot train the model on your specific dataset.

Additionally, if you require model routing to switch between different models based on the task, our service does not support this. We serve a single uncensored open-weight text model identified by the id uncensored. If you need to access multiple models or switch between them dynamically, you should look for a provider that offers model routing.

Finally, if you need on-premises deployment for data sovereignty or latency reasons, our hosted service may not fit your needs. We offer a cloud-based solution with endpoints at https://api.pricingapiopen.com/v1. If you require local deployment, you will need to find a provider that offers self-hosted options. Our service is designed for developers who want a simple, uncensored text API without the complexity of managing infrastructure.

Addressing Common Developer Concerns

Developers often discuss concerns about AI ethics and content moderation in online communities. Threads on r/pcmasterrace and r/technology highlight worries about AI companies partnering with military entities or making controversial decisions. Users frequently ask how to find an AI service that offers more control over content and less corporate oversight.

Our API addresses these concerns by offering an uncensored model that does not refuse lawful adult, fictional, security-research, or controversial topics. This gives developers more freedom to experiment with different types of content. However, we do maintain a hard limit on sexual content involving minors, which is refused to ensure a baseline of safety.

Another common concern is the cost predictability. Users want to know exactly how much they will pay for each interaction. Our token-based pricing with clear rates of $0.15 for input and $0.50 for output provides this transparency. You can calculate costs before making requests, which helps avoid unexpected bills.

Users also ask about payment methods. Our service accepts crypto only, specifically USDT on TRC20 or USDC on Base. There are no credit cards, PayPal, or bank transfers. This appeals to developers who prefer decentralized payment options. The minimum top-up is $20, and the maximum is $500, with no monthly fees. This structure aligns with the preferences of many indie builders and developers who value privacy and control.

Integrating and Troubleshooting

To integrate our API, you send POST requests to /v1/chat/completions or /v1/responses. You can also use GET /v1/models to verify the available models. The base URL is https://api.pricingapiopen.com/v1. You authenticate using an API key, which is shown immediately after signup. You can sign up with Google or using an email and password.

Our API supports streaming over SSE, function calling with tools, and JSON mode. You can also set parameters like temperature, top_p, stop, seed, and penalties. These features allow you to customize the model's behavior and output format. For example, you can use JSON mode to ensure the output is valid JSON, which is useful for parsing responses in your application.

If you encounter errors, our API returns specific status codes. A 401 error indicates an invalid key, while a 402 error means you have no credit. A 429 error indicates that you have exceeded the rate limit of 300 requests per minute per key. These errors are free, so you do not lose credit when they occur.

To troubleshoot, check your API key and ensure you have sufficient prepaid credit. If you are hitting rate limits, consider implementing exponential backoff in your code. You can also reduce the frequency of requests or optimize your prompts to use fewer tokens. Since errors are free, you can test different configurations without worrying about costs.

Frequently asked questions

How do I calculate the cost of a single request?

Divide the number of input tokens by one million and multiply by $0.15. Then divide the number of output tokens by one million and multiply by $0.50. Add these two values together to get the total cost for that request.

What happens if my request fails?

Errors such as 401, 402, or 429 are free and do not consume your prepaid credit. You only pay for tokens in successful completions. This means you can test your API key and limits without risking your balance.

Can I use credit cards to top up?

No, we only accept crypto. You can top up with USDT on TRC20 or USDC on Base. The minimum top-up is $20, and the maximum is $500. There are no credit cards, PayPal, or bank transfers.

Does the API support image generation?

No, our API serves a text-only model. It does not support image, audio, or video generation. If you need multimodal capabilities, you will need to use a different service for those tasks.