Budgeting LLM Search API Costs with a Worked Example
Developers often struggle to predict token spend for web search integration before committing to a budget. This article demonstrates a cost estimation method using specific input and output token rates to calculate the total expense for a typical retrieval-augmented generation workflow.

Understanding the Token-Based Pricing Model
When integrating a web search API into your application, the first step is understanding how billing works. Our API uses a token-based pricing model, which means you pay for the amount of text processed rather than a fixed monthly fee. The rates are straightforward: $0.15 per million input tokens and $0.50 per million output tokens. This structure allows you to scale your usage up or down without worrying about tiered subscription limits or overage penalties.
- Input tokens cover the prompt you send, including the system instructions, user query, and any context retrieved from the web.
- Output tokens cover the model's response, which typically includes the generated text and any structured data like JSON.
- The model id to send is "uncensored", which affects how the model handles various topics but does not change the token counting method.
This model is particularly useful for developers building agents that make frequent calls, as you only pay for what you use. Errors and refusals are free, so you do not lose credit if a request fails or is filtered. This ensures that your budget is strictly tied to successful, productive interactions.
Estimating Input Tokens for Web Search
Input tokens are the most significant part of your cost when using a web search API. Each time you send a request, the API counts every token in your prompt. This includes the system message, the user's query, and any additional context you provide. For a web search integration, the input size can vary widely depending on how much data you retrieve and how you structure your prompt.
- A simple query might use only a few hundred tokens, while a complex RAG pipeline could consume thousands.
- Context windows allow up to 100,000 tokens, so you can include extensive search results in your prompt.
- Streaming over SSE includes usage in the last chunk, so you can monitor token usage in real-time.
To estimate your input costs, count the tokens in your prompt before sending the request. You can use standard tokenizers to get an accurate count. Multiply this number by $0.15 and divide by 1,000,000 to get the cost. This method helps you predict the expense for each individual call.
Estimating Output Tokens for Responses
Output tokens are charged at a higher rate of $0.50 per million tokens. This reflects the computational cost of generating text. When using a web search API, the output size depends on the model's response length. Some responses may be concise, while others might include detailed explanations or structured data.
- Short responses, such as a single sentence, might use only a few dozen tokens.
- Long responses, such as a detailed report, could use several thousand tokens.
- Function calling and JSON mode can increase output size due to structured formatting.
To estimate output costs, predict the length of the model's response. Multiply the estimated token count by $0.50 and divide by 1,000,000. This gives you the cost for the response. By combining input and output estimates, you can calculate the total cost for a single API call.
Calculating Total Cost for a RAG Workflow
Retrieval-Augmented Generation (RAG) workflows often involve multiple API calls. Each call has its own input and output costs. To budget effectively, you need to estimate the total token usage for a typical workflow. This includes the initial search query, the retrieval of search results, and the final generation of the response.
- Estimate the tokens for the search query and any system instructions.
- Estimate the tokens for the retrieved search results included in the prompt.
- Estimate the tokens for the final generated response.
Sum the input and output tokens for each step, then apply the pricing rates. This gives you a comprehensive view of the cost for a complete workflow. By tracking these numbers, you can identify areas where you might optimize token usage, such as reducing the size of retrieved context or shortening prompts.
Managing Budgets with Prepaid Credit
Our API uses a prepaid credit system, which means you top up your account before using the service. There are no monthly fees or subscriptions, so you only pay for what you use. Credit never expires, so you can top up when prices are favorable and use it over time. This flexibility is ideal for developers with variable usage patterns.
- Top-up amounts range from $20 to $500, allowing you to choose a budget that fits your needs.
- Crypto payments are accepted, including USDT on TRC20 or USDC on Base.
- Bonus credit is available for top-ups of $50 or more, with bonuses ranging from +5% to +15%.
By monitoring your token usage and keeping track of your balance, you can ensure that you always have enough credit for your workflows. The absence of monthly fees means you do not pay for idle time, making this model cost-effective for sporadic or high-volume usage.
When Our API Is Not the Right Choice
While our API is excellent for text-based web search and generation, it may not be the right choice for every use case. If you need embeddings, image generation, audio processing, or video generation, our API does not support these features. Similarly, if you require fine-tuning, model routing, or OCR capabilities, you should look elsewhere.
- Our API serves only one uncensored open-weight text model, so you cannot switch between different models.
- There is no support for image, audio, or video generation, so visual or audio outputs are not available.
- Embeddings are not generated, so you cannot use our API for vector search or semantic similarity tasks.
If your project requires these additional capabilities, consider using a more comprehensive API provider. However, for pure text-based web search and generation, our API offers a simple, cost-effective solution. Always evaluate your specific needs before committing to a provider.
Addressing Common Developer Questions
Developers often ask about the best search API for LLMs and how to handle rate limits. Threads on r/ProxyEngineering and r/BlackboxAI_ highlight concerns about search speed and data extraction. Our API addresses these by offering a high rate limit of 300 requests per minute per key, which is suitable for most agent workflows.
- For high-volume agent calls, our API provides fast response times and reliable performance.
- Function calling and JSON mode allow for structured data extraction, which is useful for real-estate newsletters or automated reporting.
- The uncensored model handles controversial topics well, making it suitable for diverse content generation.
Another common question is about payment methods. Our API accepts crypto only, with no cards or PayPal. This might be a drawback for some users, but it offers privacy and flexibility. For those who prefer traditional payment methods, other vendors may be a better fit. Check the vendor's documentation for current prices and limits to find the best match for your needs.
Frequently asked questions
How do I calculate the cost of a single API call?
Count the input and output tokens in your request. Multiply input tokens by $0.15 and output tokens by $0.50, then divide each by 1,000,000. Sum the results to get the total cost for that call.
What happens if my API request fails or is refused?
Errors and refusals are free, so you do not lose any credit. You only pay for successful requests that consume tokens. This ensures that your budget is not affected by failed attempts.
Can I use a credit card to top up my account?
No, our API accepts crypto only. You can top up with USDT on TRC20 or USDC on Base. Amounts must be between $20 and $500. No cards, PayPal, or bank transfers are accepted.
Does my prepaid credit expire?
No, prepaid credit never expires. You can top up your account at any time and use the credit whenever you need it. This makes it easy to manage your budget without worrying about expiration dates.