EN ▾
Get API key

Connecting to minimaxnsfw.com: API Integration Checklist

Integrating an uncensored text model into your application requires precise configuration of endpoints and authentication. This checklist covers the essential steps to connect to our API, ensuring smooth text-in, text-out functionality for your chat applications or scripts.

Developer desk with laptop and digital tokens illustrating API integration

Understanding the API Base URL and Endpoints

The foundation of any integration is the correct base URL. For our service, the base URL is https://api.minimaxnsfw.com/v1. This URL serves as the entry point for all API requests. It is important to use this exact URL to ensure compatibility with our OpenAI-compatible chat-completions endpoint. The endpoint for generating text is POST /v1/chat/completions. This endpoint accepts text input and returns text output, making it ideal for chat applications.

Another available endpoint is POST /v1/responses, which may be useful for specific response formats. Additionally, you can use GET /v1/models to retrieve information about the available models. The model ID you need to send is "uncensored". This model is an open-weight text model that does not refuse lawful adult, fictional, security-research, or controversial topics. It is important to note that we do not offer embeddings, image, audio, or video generation, so your integration should focus solely on text processing.

When configuring your client, ensure that the base URL is correctly set in your API client library. This prevents common connection errors and ensures that your requests are routed to the correct server. The OpenAI-compatible format means that you can use existing OpenAI SDKs with minimal modifications. This compatibility simplifies the integration process for developers who are already familiar with OpenAI's API structure.

Remember that our API is an independent service. We do not claim to be an official partner or reseller of any other company. When discussing other vendors, refer to their documentation for current prices and limits. Our focus is on providing a reliable uncensored text model with a simple and straightforward API structure.

Authentication and API Key Management

Authentication is handled using an API key. You can obtain your key by signing up with Google or using an email and password. The key is shown immediately after signup, so make sure to copy it securely. This key must be included in the Authorization header of your requests. The format is typically Bearer . This method ensures that only authorized users can access the API and consume your prepaid credit.

It is essential to keep your API key secure. Avoid hardcoding it in your source code if possible. Instead, use environment variables or a secure configuration file. If your key is compromised, you should regenerate it to prevent unauthorized access. Our API checks the validity of the key with every request. An invalid key will result in a 401 error, indicating that the key is missing or incorrect.

You can have multiple API keys, but each key is tied to your account's prepaid credit. The credit is charged based on real token usage. Errors and refusals are free, so you do not lose credit for failed requests. This billing model is transparent and fair, allowing you to manage your costs effectively. Keep track of your key usage to avoid unexpected charges.

When integrating with third-party tools, ensure that the API key is passed correctly. Some tools may require specific header formats. Refer to the tool's documentation for details. Our API supports standard authentication methods, making it easy to integrate with various client applications. Always test your authentication setup before deploying to production.

Configuring Request Parameters and Options

Our API supports a variety of request parameters to customize the text generation. You can set the temperature to control the randomness of the output. A higher temperature results in more creative and varied responses, while a lower temperature produces more focused and deterministic outputs. The top_p parameter allows you to control the diversity of the output by filtering tokens based on their probability. This is useful for balancing creativity and coherence.

You can also specify stop sequences to halt the generation when a specific string is encountered. This is helpful for controlling the length of the response or stopping at a specific marker. The seed parameter allows you to set a random seed for reproducible results. This is useful for testing and debugging your application. Additionally, you can set penalties to discourage certain tokens from appearing in the output.

Streaming is supported over Server-Sent Events (SSE). This allows you to receive the response in chunks as it is generated. The usage information is included in the last chunk, so you can track token consumption in real-time. This is particularly useful for chat applications where you want to display the response as it is being typed. Function calling and JSON mode are also supported, enabling more complex interactions with your application.

When configuring these parameters, consider the specific needs of your application. For example, if you are building a chatbot, you might want to use a lower temperature for more consistent responses. If you are generating creative content, a higher temperature might be more appropriate. Experiment with different settings to find the best balance for your use case.

Handling Errors and Rate Limits

Understanding error codes is important for a smooth integration. A 401 error indicates an invalid or missing API key. Ensure that your key is correct and properly formatted. A 402 error means that you have no credit left in your account. You will need to top up your credit to continue using the API. A 429 error indicates that you have exceeded the rate limit of 300 requests per minute per key. This limit is designed to prevent abuse and ensure fair usage.

When you encounter a 429 error, you should implement exponential backoff in your application. This means that you wait for a short period before retrying the request, and then double the wait time for each subsequent retry. This helps to avoid overwhelming the server and reduces the likelihood of further rate limit errors. It is also a good practice to log these errors for debugging purposes.

Errors and refusals are free, so you do not lose credit for failed requests. This includes cases where the model refuses to generate a response due to content policies. The only hard content limit is that there is no sexual content involving minors. Requests involving such content are refused. This policy is enforced by the model and is not configurable via the API.

It is important to handle these errors gracefully in your application. Display appropriate messages to the user and provide options for retrying or contacting support. By understanding and handling errors effectively, you can ensure a better user experience and reduce frustration. Always test your error handling logic with different scenarios to ensure robustness.

Pricing and Payment Methods

Our API uses a prepaid credit model based on token usage. The price is $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. This pricing is transparent and straightforward, allowing you to estimate costs based on your expected usage. There is no subscription or monthly fee, and paid credit never expires. This model is ideal for developers who want to pay only for what they use.

To add credit, you can top up using cryptocurrency. We accept USDT on the TRC20 network or USDC on the Base network. The minimum top-up amount is $20, and the maximum is $500. You can top up any whole amount within this range. Additionally, there is a bonus credit offer for top-ups of $50 or more, ranging from +5% to +15%. This bonus credit is added to your account immediately after the top-up is confirmed.

Payment methods are limited to crypto only. We do not accept credit cards, PayPal, or bank transfers. This simplifies the payment process and reduces transaction fees. When you top up, ensure that you send the correct amount to the correct address. The bonus credit is automatically applied, so you do not need to enter a code. Keep track of your balance to ensure you have sufficient credit for your requests.

New accounts receive $0.50 of trial credit, so you can test the API without needing to add credit immediately. This trial credit allows you to explore the API and verify your integration before committing to a top-up. It is a great way to get started and see how the API performs with your specific use case.

When Our API Is Not the Right Choice

While our API is excellent for uncensored text generation, it may not be the right choice for all applications. If you need image, audio, or video generation, our API does not support these features. You would need to use a different service for those capabilities. Similarly, if you require embeddings for semantic search or vector databases, our API does not provide this functionality. You would need to integrate a separate embedding service.

Our API also does not support fine-tuning. If you need to train a custom model on your specific dataset, you would need to use a service that offers fine-tuning capabilities. Additionally, if you require model routing to switch between different models based on the task, our API does not support this feature. You would need to manage the routing logic in your application.

Another limitation is that we do not offer OCR (Optical Character Recognition) or search capabilities. If your application requires extracting text from images or searching through a database of documents, you would need to use additional tools. Our API is focused solely on text-in, text-out functionality. It is designed to be a reliable and uncensored text generation engine.

Finally, if you need a service with specific SLA guarantees or certifications like SOC2 or HIPAA, our API may not meet those requirements. We are an independent service and do not claim these certifications. If these are critical for your application, you should evaluate other options. Our API is best suited for developers who prioritize uncensored content and simplicity over extensive feature sets.

Addressing Common Questions from Developers

Developers often ask about the reliability and performance of our API. Many users are concerned about rate limits and how to handle high traffic. Our API supports 300 requests per minute per key, which is sufficient for most applications. If you need higher throughput, you can use multiple API keys to distribute the load. This is a common strategy for scaling your integration.

Another common question is about the quality of the uncensored model. Users appreciate that the model does not refuse lawful adult or controversial topics. However, it is important to note that the model is still subject to basic content policies, such as the prohibition of sexual content involving minors. This policy is enforced by the model and is not configurable. Users should be aware of this limitation when integrating the API.

Developers also ask about the ease of integration. Since our API is OpenAI-compatible, it is easy to integrate with existing clients. You can use the same SDKs and libraries that you would use for OpenAI. This reduces the learning curve and makes it easier to switch between different API providers. Many users have successfully integrated our API into their chat applications and scripts with minimal effort.

Finally, users often inquire about the bonus credit system. The bonus credit is a great way to get more value from your top-ups. It is automatically applied when you top up $50 or more. This feature is popular among developers who want to maximize their credit. It is a simple and effective way to incentivize larger top-ups and provide additional value to users.

Frequently asked questions

How do I get an API key?

You can get an API key by signing up with Google or using an email and password. The key is shown immediately after signup. Make sure to copy it securely and include it in the Authorization header of your requests.

What is the base URL for the API?

The base URL for the API is https://api.minimaxnsfw.com/v1. Use this URL for all your API requests to ensure compatibility with our OpenAI-compatible endpoints.

How much does the API cost?

The API costs $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. There is no subscription fee, and paid credit never expires. You can top up with crypto starting at $20.

Does the API support streaming?

Yes, the API supports streaming over Server-Sent Events (SSE). You can receive the response in chunks as it is generated. The usage information is included in the last chunk, allowing you to track token consumption in real-time.