EN ▾

Uncensored text API for music pipelines

Get API key

Budgeting Your MusicGen API Spend: A Cost Estimation Guide

Developers often ask how to predict monthly costs for AI music generation to avoid unexpected bills. This guide teaches you to calculate token usage and apply the MusicGen pricing structure to estimate your specific project expenses.

Developer workspace with laptop showing code and token counter, surrounded by musical notes and crypto symbols

Understanding the Pricing Structure

The foundation of your budget starts with the specific token rates. Our API charges $0.15 per one million input tokens and $0.50 per one million output tokens. These rates apply to the text model you send to the uncensored endpoint. You pay only for real token usage, meaning errors and refusals are free. This structure allows you to predict costs based on the volume of text you process.

It is important to note that this is a prepaid credit system. You top up using crypto, specifically USDT on TRC20 or USDC on Base. The minimum top-up amount is $20, and the maximum is $500. You can choose any whole amount within this range. Bonus credit is available for purchases of $50 or more, ranging from +5% to +15% extra credit.

There is no monthly subscription fee or recurring charge. Your paid credit never expires, which means you do not lose money if you do not use it in a given month. This flexibility is useful for projects with variable traffic. You can top up as needed, ensuring you always have funds for your development cycles.

When you start, every new account receives $0.50 of trial credit. No credit card is needed to access this trial. This allows you to test the API and verify your integration before committing to a larger crypto payment. The trial credit is charged by real token usage, just like the prepaid balance.

Estimating Token Usage for Music Generation

To estimate your costs, you must first understand how tokens are counted. The context window is 100,000 tokens, which includes both the prompt and the completion together. When you send a request to generate song lyrics, the input tokens include your prompt and any system instructions. The output tokens are the lyrics generated by the model.

For example, if you send a prompt that is 500 tokens long and the model returns 1,000 tokens of lyrics, you are charged for 1,500 tokens in total. You can estimate the cost by dividing the total tokens by one million and multiplying by the respective rates. The input cost is calculated using the $0.15 rate, and the output cost uses the $0.50 rate.

Streaming responses do not change the token count. The usage is reported in the last chunk of the stream, but the total tokens consumed remain the same. You can use the streaming feature to deliver results faster to your users, but your billing is based on the full token count. This means you can optimize for speed without increasing your token bill.

Keep in mind that the model is uncensored and does not refuse lawful adult or controversial topics. This can lead to longer responses if the model elaborates on complex themes. You can control the length by setting parameters like temperature and top_p. Lower values can reduce the token count by making the output more concise.

Calculating Monthly Expenses

Once you know your token usage, you can calculate your monthly expenses. Start by tracking the number of requests and the average token count per request. If you expect 10,000 requests per month with an average of 1,000 input tokens and 500 output tokens per request, you can estimate the total tokens. Multiply the number of requests by the average tokens to get the total monthly usage.

Then, apply the pricing formula. Divide the total input tokens by one million and multiply by $0.15. Do the same for output tokens using $0.50. Add these two values to get your estimated monthly cost. This method gives you a clear picture of your budget requirements. You can adjust your estimates based on different usage scenarios.

Remember that the API has a rate limit of 300 requests per minute per key. If your project spikes in traffic, you might hit this limit. Exceeding the limit results in a 429 error, which does not consume tokens. However, you may need to implement retry logic in your application. This can affect how quickly you process requests but does not increase your token bill.

Errors also do not consume tokens. If you send a request with an invalid key, you get a 401 error. If you have no credit, you get a 402 error. These errors are free, so they do not add to your token usage. This is helpful for debugging and testing your integration without worrying about costs.

Managing Crypto Payments and Credits

Our API accepts only crypto payments. You can top up using USDT on the TRC20 network or USDC on the Base network. The minimum amount is $20, and the maximum is $500. You cannot pay with credit cards, PayPal, or bank transfers. This restriction simplifies the billing process but requires you to have a crypto wallet.

When you top up, you receive credit that is charged by real token usage. The credit never expires, so you can use it whenever you need it. This is beneficial for long-term projects that do not have a fixed release date. You can top up once and use the credit over several months.

Bonus credit is available for top-ups of $50 or more. The bonus ranges from +5% to +15% of the top-up amount. This extra credit gives you more tokens to work with, which can reduce your effective cost per token. It is a good idea to top up in larger amounts to maximize the bonus.

Keep track of your credit balance in your dashboard. You can see your remaining credit and usage history. This helps you plan your top-ups and avoid running out of credits during critical development phases. If you run out, you get a 402 error, and your requests will fail until you top up.

When This API Is Not the Right Choice

It is important to know when our API is not the right choice for your project. Our service is a hosted, OpenAI-compatible chat-completions API that serves one uncensored open-weight text model. It is text in, text out. If you need image generation, audio generation, video generation, or OCR, our API does not provide these features.

We do not offer embeddings, fine-tuning, or model routing. If your project requires these capabilities, you should look for a different provider. Our API is designed for developers who need a reliable text model for tasks like song lyric generation, chatbots, or content creation.

Also, consider the payment method. If your business model requires credit card payments or invoices, our crypto-only top-up system might not fit your workflow. You need to handle crypto payments yourself. This is a trade-off for the flexibility and lack of monthly fees.

Finally, if you need strict content filtering beyond the hard limit on sexual content involving minors, our uncensored model might not be suitable. The model does not refuse lawful adult or controversial topics. If you need a more controlled environment, you might need to implement your own filtering layer on top of our API.

Addressing Reddit Discussions on Costs

Threads on r/Music and r/technology often discuss the costs and legal implications of AI music generators. Users talk about how companies like Suno are facing copyright infringement cases. They discuss the scraping of music and podcasts to train AI models. While these discussions focus on legal issues, they also highlight the importance of understanding costs for developers building similar tools.

People on Reddit ask how to predict monthly costs to avoid unexpected bills. They want to know how to estimate token usage and apply pricing structures. This guide helps you answer those questions by providing a clear method for calculation. You can use the same logic to estimate costs for your own projects.

The discussions also mention the exploitation of artists and the use of copyrighted material. While our API is text-only, the principles of cost estimation remain the same. You need to know your token usage and the per-token rates to budget effectively. This knowledge helps you build sustainable applications.

By understanding the pricing structure and token usage, you can make informed decisions about your project. You can avoid unexpected bills and ensure that your application is cost-effective. This is especially important for indie builders who need to manage their resources carefully.

Integration and Troubleshooting Tips

When integrating our API, use the standard OpenAI-compatible endpoints. Send POST requests to /v1/chat/completions or /v1/responses. You can also use GET /v1/models to check available models. The base URL is https://api.musicgen.cc/v1. Make sure to include your API key in the authorization header.

Use the parameters temperature, top_p, stop, and seed to control the model's behavior. You can also set JSON mode for structured output. These parameters help you get the desired results and can affect the token count. For example, using the stop parameter can limit the output length.

Handle errors gracefully. A 401 error means your key is invalid. A 402 error means you have no credit. A 429 error means you have hit the rate limit. Implement retry logic for 429 errors to ensure your application continues to work during high traffic.

Sign up using Google or email and password. Your API key is shown immediately. Keep your key secure and do not expose it in public code repositories. You can generate new keys if needed. This helps you manage access and security for your application.

Frequently asked questions

How do I calculate the cost of a request?

Divide the total input tokens by one million and multiply by $0.15. Do the same for output tokens using $0.50. Add these two values to get the total cost for that request.

What happens if I run out of credit?

You will receive a 402 error, and your requests will fail. You need to top up your credit using crypto to resume using the API.

Can I use a credit card to pay?

No, we only accept USDT on TRC20 or USDC on Base. You cannot pay with credit cards, PayPal, or bank transfers.

Does the trial credit expire?

The trial credit is charged by real token usage. It does not have a specific expiration date, but you must use it before you top up or it may be used up by default.