EN ▾
Get API key

Integrating the Uncensored Text API with Python

Developers often seek uncensored text endpoints to bypass standard safety filters in their applications. This guide walks you through integrating our hosted API using standard Python libraries, ensuring you can send prompts and receive responses without complex configuration.

Visual representation of an uncensored LLM API with data streams and code elements

Understanding the Endpoint Structure

Our service provides a hosted API that mimics the OpenAI chat completions format. This design allows you to use familiar client libraries without rewriting your integration logic. The base URL for all requests is https://api.ollamansfw.top/v1. You will interact primarily with the POST /v1/chat/completions endpoint for standard conversations. This endpoint accepts text input and returns text output, supporting a single uncensored open-weight model identified by the ID "uncensored".

Unlike many providers that offer a suite of models, our API serves one specific model. This simplifies your integration because you do not need to implement model routing logic. You simply specify the model ID in your request payload. The API does not support embeddings, image generation, audio processing, or video creation. It is strictly a text-in, text-out service. This focus ensures consistent performance for conversational tasks and data extraction.

The API also supports a POST /v1/responses endpoint and a GET /v1/models endpoint. The models endpoint allows you to verify the available model configuration dynamically. However, since there is only one model, this call primarily confirms the service is online. You can use this endpoint in your health check routines to ensure the API is reachable before sending heavy payloads.

When integrating, ensure your client library is configured to point to our base URL. Most OpenAI SDKs allow you to override the base URL easily. This override is critical because default configurations often point to the main OpenAI servers. By redirecting the endpoint, you route your requests to our uncensored model without changing the request structure. This compatibility reduces the learning curve for developers already familiar with OpenAI's SDKs.

Authentication and Key Management

Access to the API requires an API key, which serves as your identifier for billing and rate limiting. You can obtain a key by signing up with a Google account or by creating an account with an email and password. The key is displayed immediately after signup, so you must copy it before leaving the screen. This key is required for all API calls and must be included in the Authorization header of your HTTP requests.

Authentication errors are handled with specific status codes. A 401 status indicates an invalid or missing key. If you encounter this error, verify that your key is correctly formatted and included in the header. A 402 status indicates that your account has no remaining credit. Since the service is prepaid, you must top up your account before making further requests. The key never expires, so you do not need to refresh it frequently.

Rate limiting is enforced at 300 requests per minute per key. If you exceed this limit, the API returns a 429 status code. This limit applies to the key, not the user account, so if you generate multiple keys, each key has its own quota. This allows you to distribute load across different keys if your application requires high throughput. However, each key is subject to the same per-minute cap.

Keep your API key secure in your application environment. Avoid hardcoding it in source files that are committed to version control. Use environment variables or a secrets manager to store the key. This practice prevents accidental exposure of your billing credentials. Since the key grants access to your prepaid credit, protecting it is essential for maintaining control over your spending.

Configuring the Python Client

Using the official OpenAI Python library is the most straightforward way to integrate with our API. You can install the library using pip and then configure it to point to our base URL. This approach uses the reliable error handling and request formatting already built into the SDK. You set the API key and the base URL in the client initialization. This setup allows you to use standard methods like chat.completions.create() without modification.

The client supports streaming responses over Server-Sent Events (SSE). This feature is useful for applications that need to display text as it is generated. Streaming allows you to receive usage information in the final chunk, which helps you track token consumption in real-time. You can iterate over the stream to process each token as it arrives. This method reduces the perceived latency for end-users, as they see output immediately.

You can also use JSON mode to force the model to output structured data. This is helpful for extracting specific fields from unstructured text. The API supports parameters like temperature, top_p, stop sequences, and seed. These parameters allow you to control the randomness and determinism of the responses. Setting a seed ensures that the same prompt produces the same output, which is useful for testing and debugging.

The context window for the model is 100,000 tokens, covering both the prompt and the completion. This large window allows you to send extensive context without truncation. However, you must manage the input size to stay within your budget. The API does not support fine-tuning or model routing, so you cannot train the model on your data. You rely on the pre-trained uncensored model for all tasks.

Managing Costs and Token Usage

Billing is based on prepaid credit charged by real token usage. The price is $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. Errors and refusals are free, so you do not pay for failed requests or content that is filtered out. This pricing model is transparent and easy to track. You can monitor your usage through the API responses, which include token counts in the final chunk of a stream.

To top up your account, you must use cryptocurrency. The accepted methods are USDT on the TRC20 network or USDC on the Base network. You can add any whole amount between $20 and $500. There is no option for credit cards, PayPal, or bank transfers. This crypto-only approach ensures fast transactions and lower processing fees. The minimum top-up amount is $20, which helps keep transaction costs reasonable.

If you top up $50 or more, you receive bonus credit ranging from 5% to 15%. This bonus is added to your account immediately after the transaction is confirmed. The bonus credit never expires, so you can use it whenever you need it. This incentive encourages larger top-ups and provides extra value for your usage. You can track your balance and bonus credit in your account dashboard.

Since errors are free, you can experiment with different prompts without worrying about wasting credit. This is particularly useful for testing edge cases or exploring the model's behavior. You can also use the free trial credit of $0.50 to test the API without committing to a purchase. This trial credit requires no card information, making it easy to evaluate the service before spending money.

When Our API Is Not the Right Choice

Our API is designed specifically for uncensored text generation. It does not support image, audio, or video generation. If your application requires multimodal capabilities, such as generating images from text or analyzing audio files, our service is not the right choice. You would need to integrate with a provider that offers those specific features. Our API can handle the text part of your workflow, but you would need a separate service for media generation.

The service also does not offer fine-tuning or model routing. If you need to train a model on your specific dataset or route requests to different models based on complexity, our API cannot fulfill those needs. You must rely on the single uncensored model provided. This is a trade-off for the simplicity and uncensored nature of the service. You cannot customize the model's behavior beyond the standard parameters like temperature and top_p.

Additionally, the API does not provide an SLA or certifications like SOC2 or HIPAA. If your application requires strict compliance with healthcare or financial regulations, you may need a provider with those certifications. Our service is independent and does not claim any specific compliance standards. You should verify that the uncensored nature of the model aligns with your data privacy requirements.

Finally, if you need a free unlimited tier, our service is not the right choice. We require prepaid credit for usage, with a small trial amount for new accounts. There is no free tier for ongoing use. You must top up your account to continue using the API. This model ensures that the service remains sustainable and that you pay for what you use. It is ideal for developers who want predictable costs and uncensored output.

Addressing Community Concerns

Discussions on Reddit often highlight the desire for truly uncensored models that do not impose artificial safety layers. Users frequently ask for recommendations for models that are genuinely unrestricted and free from alignment-based filtering. Many developers find that standard providers overly moderate challenging questions, leading to a desire for models that can handle controversial topics without refusal. Our API addresses this by serving a model that does not refuse lawful adult or controversial topics.

Another common theme in these threads is the search for local models that can run on specific hardware. Users with RTX 4070 Super or Apple M4 chips often look for models that fit their VRAM and RAM constraints. While our API is hosted, it offers a similar experience to running a local model in terms of output quality and lack of censorship. This allows developers to avoid the hardware limitations of local inference while still getting uncensored results.

Developers also discuss the importance of clear context and the ability to start over. Some users note that standard models give massive amounts of explicit censorship instructions, which can be frustrating. Our API provides a clean slate, allowing you to define the context yourself. This flexibility is valuable for applications that require precise control over the model's behavior. You can use system prompts to guide the model without conflicting safety filters.

Finally, users often ask for models that are easy to integrate. Our OpenAI-compatible format simplifies this process. You do not need to learn a new API structure or write custom parsers. This compatibility makes it easy to switch from other providers or integrate with existing tools. The community values this ease of use, as it reduces the time spent on integration and allows developers to focus on their application logic.

Testing and Troubleshooting

When integrating the API, it is important to test your setup thoroughly. Start with a simple prompt to verify that the authentication and endpoint configuration are correct. Check the response status code to ensure it is 200. If you receive a 401 or 402 error, review your key and credit balance. A 429 error indicates that you have exceeded the rate limit. In this case, you can wait for the limit to reset or use a different key.

Use the streaming feature to monitor the response in real-time. This helps you identify any delays or issues with the connection. You can also use the JSON mode to ensure that the output is structured correctly. If the model returns unexpected output, check your parameters like temperature and top_p. Adjusting these values can help you get the desired response format.

Monitor your token usage to avoid unexpected charges. The API provides token counts in the final chunk of a stream. You can use this information to track your spending and ensure that you have enough credit. If you run out of credit, you will receive a 402 error. You can top up your account using crypto to continue using the service.

Finally, keep your API key secure and avoid exposing it in your logs or source code. This prevents unauthorized use of your credit. If you suspect that your key has been compromised, you can generate a new key from your account dashboard. This ensures that your credit is protected and that you can continue using the API without interruption.

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 top-up amount is $20, and the maximum is $500. Bonus credit is available for top-ups of $50 or more.

What happens if I exceed the rate limit?

If you exceed the limit of 300 requests per minute per key, the API returns a 429 status code. You can wait for the limit to reset or use a different key to distribute the load.

Can I use the API for image generation?

No, the API is strictly for text-in, text-out requests. It does not support image, audio, or video generation. You would need a separate service for multimodal tasks.

Is there a free tier?

There is no free unlimited tier. New accounts receive $0.50 of trial credit, but ongoing usage requires prepaid credit. Errors and refusals are free, so you do not pay for failed requests.