EN ▾
nsfwwriter.ccUncensored API. Prepaid Tokens.
Get API key

Integrating the Uncensored API for Roleplay

Connecting an uncensored language model to your application requires understanding the specific endpoint structure and token limits. This guide walks you through the integration process for our API, ensuring you can handle text generation efficiently.

Neon server rack with code symbols and floating text tokens representing an uncensored LLM API integration

Understanding the API Endpoint Structure

When integrating a language model for roleplay, the first step is identifying the correct endpoint for your application. Our service provides a hosted, OpenAI-compatible chat-completions API that serves a single uncensored open-weight text model. This design simplifies integration because you can use standard libraries that expect an OpenAI-style interface. The base URL for all requests is https://api.nsfwwriter.cc/v1. You do not need to manage multiple endpoints for different features, as this service focuses solely on text generation.

The primary endpoint you will use is POST /v1/chat/completions. This endpoint handles the core task of sending text in and receiving text out. It supports streaming over Server-Sent Events, which is important for roleplay applications where you want to display text as it is generated rather than waiting for the entire response. Streaming allows you to update the user interface in real-time, providing a smoother experience for users engaging in long conversations.

You must include the model ID "uncensored" in your request payload. This tells the system which model to invoke. Unlike services that route to multiple models, this API serves one specific model. This consistency means you do not need to handle model selection logic in your code. The model does not refuse lawful adult, fictional, or controversial topics, making it suitable for various roleplay scenarios.

It is important to note that this API does not support embeddings, image generation, audio, or video. If your application requires those features, you will need to integrate other services. For now, focus on the text capabilities. The API handles the text input and output, allowing you to build the surrounding logic for your roleplay application without worrying about complex model routing or fine-tuning processes.

Authentication and Key Management

Authentication for this API is straightforward and relies on a single API key. You can sign up using Google or an email and password combination. Once you create an account, the API key is shown immediately. This key is what you will use to authenticate your requests. There is no subscription or monthly fee, so you do not need to manage recurring billing cycles. Instead, you pay for what you use.

The key is shown immediately after signup, which allows you to start testing right away. You can store this key in your application's environment variables. It is important to keep this key secure, as it grants access to your prepaid credit. If the key is invalid, you will receive a 401 error. This error indicates that the key provided does not match any active account or has been revoked.

You do not need to worry about complex OAuth flows or token refreshes for the API key itself. The key remains valid until you delete your account or it is manually revoked. However, you must ensure you have sufficient credit to make requests. If you run out of credit, the API will return a 402 error. This error is free to check, meaning you are not charged for attempts that fail due to lack of funds.

Errors and refusals are also free of charge. This means that if the model refuses a request due to the hard content limit, you are not billed for that attempt. The hard content limit prevents sexual content involving minors. Requests that hit this limit are refused, but you do not lose credit. This feature protects users while allowing for flexible content generation within the allowed boundaries.

Handling Tokens and Pricing

Understanding how tokens are counted and billed is essential for managing your roleplay application's costs. The API charges $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. This pricing model is transparent and based on real token usage. You can calculate the cost of a request by dividing the number of tokens by 1,000,000 and multiplying by the respective rate. This formula helps you estimate costs before making requests.

The context window for this API is 100,000 tokens, which includes both the prompt and the completion. This large context window allows for long conversations and detailed roleplay scenarios without losing context. You can send long prompts and receive long responses within this limit. However, you must monitor the token usage to ensure you stay within the window. If you exceed the context window, the model may drop earlier parts of the conversation.

Prepaid credit is charged by real token usage, and errors and refusals are free. This means you only pay for successful completions. The credit never expires, so you can top up whenever you need. There is no monthly fee, which makes this service cost-effective for developers who do not want to commit to a subscription. You can start with the trial credit and add more as needed.

When estimating costs, focus on the token counts rather than dollar totals. For example, if a request uses 10,000 input tokens and 5,000 output tokens, you can calculate the cost using the per-million rates. This approach gives you a clear picture of how much each interaction costs. It also helps you budget for high-volume usage. The prepaid credit system ensures that you control your spending without unexpected charges.

Top-Up Methods and Credit Limits

Topping up your account requires cryptocurrency, specifically USDT on the TRC20 network or USDC on the Base network. You can top up any whole amount from $20 to $500. This range allows you to add small amounts for testing or larger amounts for heavy usage. The service does not accept credit cards, PayPal, or bank transfers, so you must have a crypto wallet to add funds.

When you top up from $50, you receive bonus credit ranging from 5% to 15%. This bonus increases your available balance, giving you more value for your money. The bonus is added immediately after the top-up is confirmed. This feature is useful for developers who want to maximize their testing capacity or handle higher traffic loads without constantly adding funds.

The top-up process is simple and direct. You send the specified amount of crypto to the provided address, and the credit is added to your account. There is no complex verification process for small amounts, but larger top-ups may require confirmation. The key is to ensure you send the correct network and amount to avoid delays. Once the transaction is confirmed, your credit is available for use.

It is important to note that the top-up limits apply to each transaction. You cannot top up with amounts below $20 or above $500 in a single transaction. If you need more credit, you can make multiple top-ups. The credit never expires, so you can accumulate balance over time. This flexibility allows you to manage your funds according to your usage patterns.

Parameters and Response Handling

The API supports several parameters that allow you to fine-tune the model's behavior. You can set the temperature, top_p, stop sequences, seed, and penalties. These parameters give you control over the creativity and consistency of the generated text. For roleplay, adjusting the temperature can help you achieve the desired level of randomness in the responses. A higher temperature produces more diverse outputs, while a lower temperature keeps the responses more consistent.

Streaming responses are supported over Server-Sent Events. This feature is particularly useful for roleplay applications where you want to display text as it is generated. The usage information is included in the last chunk of the stream, allowing you to track token usage in real-time. This helps you monitor your credit consumption and adjust your application's behavior if needed.

Function calling and JSON mode are also supported. These features allow you to integrate the API with other tools and systems. You can define tools that the model can call, enabling more complex interactions. JSON mode ensures that the output is valid JSON, which is useful for structured data exchange. These features expand the utility of the API beyond simple text generation.

When handling responses, always check for errors such as 401, 402, and 429. A 429 error indicates that you have exceeded the rate limit of 300 requests per minute per key. If you encounter this error, you should slow down your request rate. The API is designed to handle high volumes, but respecting the rate limit ensures smooth operation. You can implement exponential backoff in your code to handle these errors gracefully.

When This API Is Not the Right Choice

While this API is excellent for text-based roleplay, it may not be the right choice for all developers. If your application requires image generation, audio processing, or video creation, you will need to integrate additional services. This API focuses solely on text generation, so it does not handle multimedia content. You must build the logic to combine text outputs with other media sources.

Similarly, if you need embeddings for semantic search or vector databases, this API does not provide that capability. You will need to use a separate embedding service to generate vectors from your text data. The API serves one uncensored text model, so it does not offer a suite of models for different tasks. If you require model routing or fine-tuning, this service may not meet your needs.

Developers looking for a free unlimited tier will also find this service lacking. The API uses a prepaid credit system, so you must pay for usage. There is no free tier beyond the initial trial credit. If you are building a prototype and need to test extensively without cost, you may find the pricing model restrictive. However, the trial credit allows you to test the API without any financial commitment.

Finally, if you need a service with specific SLA guarantees or certifications like SOC2 or HIPAA, this independent service does not claim those attributes. It is a straightforward text API without enterprise-level certifications. For most indie builders and roleplay applications, this is not a limitation, but it is worth considering if you are building a product for a highly regulated industry. The focus is on flexibility and uncensored content rather than enterprise compliance.

Addressing Common Developer Questions

Developers often ask about handling long-context inference and caching to improve performance. Some discussions on Reddit highlight techniques like KV-cache compression and disaggregation to speed up long prompts. While this API does not expose the underlying caching mechanism, you can optimize your requests by managing the context window effectively. Sending shorter prompts and maintaining state in your application can help you stay within the 100,000 token limit.

Another common question is about finding a reliable model for roleplay that does not have rate limit issues. Users often compare different services based on price and availability. This API offers a stable uncensored model with a clear rate limit of 300 requests per minute. By monitoring your usage and implementing backoff strategies, you can avoid hitting the limit frequently. The prepaid credit system also ensures that you have control over your spending.

Some developers inquire about the best model for roleplay that is available on a budget. While this API does not offer a subscription model, the prepaid credit system allows you to start with a small amount and scale up. The bonus credit for top-ups over $50 provides additional value. You can test the API with the trial credit and add funds as you validate your application.

Finally, users often ask about the differences between various models and their performance. This API serves a single uncensored model, so you do not need to choose between different options. The model is designed to handle a wide range of topics without refusing lawful adult or controversial content. This consistency makes it easier to integrate into your application without worrying about model-specific quirks. You can focus on building the roleplay logic rather than managing model selection.

Frequently asked questions

How do I top up my account?

You can top up your account using USDT on the TRC20 network or USDC on the Base network. The minimum amount is $20 and the maximum is $500 per transaction. Credits are added immediately after confirmation.

What happens if I run out of credit?

If you run out of credit, the API will return a 402 error. You are not charged for this error, so you can retry after topping up your account. The trial credit is $0.50 and does not require a card.

Does the API support streaming?

Yes, the API supports streaming over Server-Sent Events. This allows you to display text as it is generated. The usage information is included in the last chunk of the stream, helping you track token consumption.

What is the rate limit?

The rate limit is 300 requests per minute per key. If you exceed this limit, you will receive a 429 error. You can implement exponential backoff in your code to handle these errors gracefully.