EN ▾
Start now

Budgeting Story API Costs: A Token Math Guide

Developers often struggle to predict monthly spend for high-volume uncensored story generation. This guide breaks down the math to help you budget accurately before committing funds.

Digital interface showing text tokens flowing into a reservoir, representing API cost calculation and data processing.

Understanding the Pricing Model

Our API uses a straightforward token-based pricing structure. You pay for the tokens you send and the tokens the model generates. This means your costs depend entirely on the volume of text processed during each request.

The input rate is set at $0.15 per one million input tokens. This covers the prompt you send to the model, including your system instructions and the story context. Input tokens are consumed every time you make a request, regardless of the response length.

The output rate is $0.50 per one million output tokens. This covers the text the model generates in response. Output tokens can vary significantly based on the complexity of the story and the length of the generated scenes.

Errors and refusals are free, which helps manage costs when testing prompts. However, successful completions incur charges based on the actual token count. Prepaid credit is charged by real token usage, ensuring you only pay for what you use.

Calculating Input Token Costs

Input tokens include your prompt, system instructions, and any conversation history sent with the request. To estimate input costs, count the total tokens in your prompt and divide by one million. Multiply this figure by $0.15 to get the input cost per request.

For example, if your prompt contains 1,000 tokens, the cost is 1,000 divided by 1,000,000, multiplied by $0.15. This results in a very small fraction of a cent per request. However, costs accumulate quickly with high-volume usage.

High-volume story generation often involves sending large context windows. Our API supports a 100,000 token context window. If you send a prompt near this limit, the input cost per request increases proportionally. Always monitor your token usage to avoid unexpected bills.

Input costs are predictable because you control the prompt length. Shorter prompts reduce input costs, but may limit the model's ability to maintain context. Longer prompts improve story continuity but increase the base cost per request.

Estimating Output Token Costs

Output tokens are generated by the model and can vary widely. A single request might produce a few hundred tokens or several thousand, depending on the story length and model behavior. To estimate output costs, track the average token count per response.

Calculate the output cost by dividing the average output token count by one million and multiplying by $0.50. For instance, if your model generates 2,000 tokens per request, the cost is 2,000 divided by 1,000,000, multiplied by $0.50. This gives you the exact cost for that specific response.

Output costs are the primary driver of total expenses. Since the model generates text, longer stories or more detailed responses will incur higher costs. You can control output length by adjusting parameters like max_tokens in your API calls.

Streaming responses allow you to see token usage in real-time. The last chunk of a streaming response includes usage data, helping you track costs as they happen. This feature is useful for debugging and monitoring resource consumption during development.

Concrete Example: 100k-Word Novel

Let's estimate the cost for generating a 100,000-word novel. Assume each word averages 1.3 tokens, resulting in approximately 130,000 tokens for the output. If you generate the entire novel in one request, the output cost is 130,000 divided by 1,000,000, multiplied by $0.50.

This calculation yields a base output cost. However, novels are often generated in chapters. If you split the novel into 100 chapters, each with 1,000 tokens of output, the cost per chapter is 1,000 divided by 1,000,000, multiplied by $0.50. Multiply this by 100 chapters to get the total output cost.

Input costs also add up. If each chapter requires a 500-token prompt, the input cost per chapter is 500 divided by 1,000,000, multiplied by $0.15. Multiply this by 100 chapters to get the total input cost. Summing input and output costs gives you the total project expense.

This example shows how token math works in practice. By breaking down the project into smaller units, you can better predict costs and adjust your budget accordingly. Always verify token counts in your API responses for accurate billing.

When This API Is Not the Right Choice

This API is designed for text generation only. If you need image, audio, video, or embedding generation, this service is not the right choice. It does not support OCR, fine-tuning, or model routing. Focus on text-based projects for the best results.

Developers seeking real-time voice synthesis or video generation should look elsewhere. Our API serves one uncensored open-weight text model. It does not offer multiple model routing or specialized multimodal capabilities. Stick to text workflows for optimal performance.

If you require strict SLA guarantees or enterprise certifications like SOC2 or HIPAA, this independent service may not meet your needs. It does not claim specific uptime percentages or compliance certifications. Verify these requirements against your project's demands before integrating.

For projects needing advanced search or retrieval-augmented generation, this API provides the text generation engine but not the search infrastructure. You must handle data retrieval and context management on your end. Use this API for the generation step within your broader system.

Addressing Community Questions

Reddit threads often discuss the best uncensored models for roleplay and erotic storytelling. Users compare various models for their ability to handle nuanced characters and explicit content. Our API serves an uncensored model suitable for these use cases, allowing for rich, unfiltered narrative generation.

Developers also ask about reliability and availability. Some users report issues with other generators becoming defected or looping. Our API provides a stable endpoint for consistent story generation. Check the vendor's documentation for current status and limits, as third-party tools may change frequently.

Questions about filtering levels are common. Users seek models that are not just less filtered but truly unfiltered for adult content. Our model does not refuse lawful adult, fictional, or controversial topics, making it ideal for uncensored story generation. Always review the hard content limits regarding minors.

Technical users inquire about coding and technical tasks. While our API excels at creative writing, it can also handle structured text generation. For specific coding tasks, verify the model's performance with your preferred language. The API supports JSON mode and function calling for structured outputs.

Integrating and Troubleshooting

Integration is straightforward with the OpenAI-compatible endpoint. Use the base URL https://api.storyuncensored.com/v1 and send POST requests to /v1/chat/completions. Include your API key in the authorization header to authenticate your requests.

Errors are handled with standard HTTP codes. A 401 indicates an invalid key, 402 means no credit is available, and 429 signals a rate limit. Monitor these codes to troubleshoot issues quickly. Prepaid credit never expires, so you can top up as needed.

Rate limits are set at 300 requests per minute per key. If you exceed this limit, you will receive a 429 error. Implement retry logic with exponential backoff to handle rate limits gracefully. This ensures smooth operation during high-volume generation phases.

Parameters like temperature, top_p, and stop sequences allow you to control the model's behavior. Use these to fine-tune the output quality and length. Experiment with different settings to find the optimal configuration for your story generation workflow.

Frequently asked questions

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

Divide the input token count by one million and multiply by $0.15. Divide the output token count by one million and multiply by $0.50. Sum these values to get the total cost for that request.

What happens if I run out of credit?

You will receive a 402 error code. You can top up using crypto, such as USDT on TRC20 or USDC on Base. Credit ranges from $20 to $500, with bonuses available for larger amounts.

Does the API support streaming responses?

Yes, streaming is supported over SSE. Usage data is included in the last chunk of the stream, allowing you to track token consumption in real-time during development.

Can I use this API for image generation?

No, this API serves only text. It does not support image, audio, video, or embedding generation. Use it for text-based story generation and integrate with other tools for multimodal needs.