EN ▾
Get API key

Integrating Uncensored Text API: SDK Setup

Connecting to an uncensored text API requires precise configuration of authentication and request parameters. This guide outlines the essential steps for setting up your development environment and making your first API call.

Futuristic developer workspace with holographic code interface and chat bubble

Understanding the API Foundation

Before diving into code, it is essential to understand the foundation of the service you are integrating. This API provides a hosted, OpenAI-compatible endpoint for a single uncensored open-weight text model. The model identifier you must use is uncensored. The base URL for all requests is https://api.abliteratedmodels.top/v1. This means you can use standard SDKs that expect OpenAI-compatible endpoints, but you must point them to this specific base URL.

The API supports standard chat-completions and responses endpoints. You will interact with POST /v1/chat/completions and POST /v1/responses for generating text. Additionally, you can use GET /v1/models to verify available models, though only the uncensored model is currently offered. The service is designed for text-in, text-out workflows, meaning it does not handle images, audio, video, or embeddings.

It is important to note that this is an independent service. It is not an official product of any major tech company. When you integrate this API, you are connecting directly to this service. The uncensored nature of the model means it does not refuse lawful adult, fictional, security-research, or controversial topics. However, it does have a hard content limit regarding sexual content involving minors, which will be refused.

Understanding these basics ensures you configure your SDK correctly. You do not need to worry about complex model routing or fine-tuning, as the service focuses on a single, powerful text model. This simplicity allows for faster integration and fewer points of failure in your application.

Setting Up Your API Key

The first step in integration is obtaining your API key. You can sign up using Google or an email and password. Upon signup, your API key is shown immediately, so make sure to copy it securely. This key is required for all authenticated requests to the API. Without a valid key, you will receive a 401 invalid key error.

Once you have your key, you need to configure your SDK. Most OpenAI-compatible SDKs allow you to set the API key and base URL. Set the base URL to https://api.abliteratedmodels.top/v1 and your API key to the one you received. This ensures that all requests are routed correctly to the uncensored model.

It is important to keep your API key secure. Do not expose it in public repositories or client-side code. The key is tied to your account and usage. If you lose your key, you may need to generate a new one from your dashboard. The service does not offer a free unlimited tier, so your key is tied to your prepaid credit.

Remember that the service uses prepaid credit charged by real token usage. Errors and refusals are free, so you do not lose credit for invalid requests. However, you must have sufficient credit to make successful requests. If you run out of credit, you will receive a 402 no credit error. You can top up using crypto only, with amounts ranging from $20 to $500.

Formatting Requests for Text Output

When making requests to the API, you must format them according to the OpenAI-compatible standard. The primary endpoint for text generation is POST /v1/chat/completions. You need to send a JSON payload that includes the model name, messages, and optional parameters. The model name should be set to uncensored.

The messages array should contain your prompt and any conversation history. Each message should have a role (user, assistant, or system) and content. The API supports a context window of 100,000 tokens, which includes both the prompt and the completion. This allows for long conversations or large documents to be processed in a single request.

You can also use the POST /v1/responses endpoint for similar functionality. This endpoint may offer additional features or formatting options, so it is worth exploring if you need more control over the response. Both endpoints return text output, which you can then process in your application.

When formatting your requests, ensure that you include all necessary parameters. The API supports temperature, top_p, stop sequences, seed, and penalties. These parameters allow you to control the creativity and determinism of the model's output. For example, setting a lower temperature will make the output more focused and predictable.

Handling Responses and Streaming

Once you send a request, the API will return a response. You can handle this response in two ways: standard blocking or streaming. Streaming is supported over Server-Sent Events (SSE), which allows you to receive the response in chunks as it is generated. This is useful for real-time applications where you want to display text as it is being generated.

In streaming mode, the usage information (token counts) is included in the last chunk of the response. This allows you to track your token usage in real-time. The API charges $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. You can calculate the cost by dividing the token count by 1,000,000 and multiplying by the respective price.

If you are not using streaming, the API will return the full response in a single JSON object. This object will include the generated text, the model used, and the token usage. You can parse this JSON to extract the text and process it further in your application.

It is important to handle errors appropriately. The API returns specific error codes for different issues. A 401 error indicates an invalid key, a 402 error means you have no credit, and a 429 error indicates that you have exceeded the rate limit. Make sure to implement error handling in your code to manage these scenarios gracefully.

Rate Limits and Error Handling

The API has a rate limit of 300 requests per minute per key. If you exceed this limit, you will receive a 429 rate limit error. This limit is designed to ensure fair usage and prevent abuse. If you need to make more requests, you may need to implement backoff strategies in your code.

Backoff strategies involve waiting for a certain period before retrying a request. This helps to avoid overwhelming the API and ensures that your application remains responsive. You can implement exponential backoff, where the wait time increases with each retry, to handle rate limits effectively.

In addition to rate limits, you should handle other errors such as 401 and 402. A 401 error indicates that your API key is invalid or missing. A 402 error means that you have run out of credit. In both cases, you should prompt the user to resolve the issue, such as by updating their key or topping up their credit.

It is also important to monitor your token usage. The API charges based on real token usage, so you want to ensure that you are not wasting credit on unnecessary requests. You can use the usage information returned in the response to track your spending and adjust your usage accordingly.

When This API Is Not the Right Choice

While this API is powerful for text generation, it may not be the right choice for every use case. If you need image, audio, video, or embedding generation, this API does not support those features. It is strictly a text-in, text-out service. If your application requires multimodal capabilities, you may need to look for a different solution.

Similarly, if you need fine-tuning or model routing, this API does not offer those features. It serves a single uncensored open-weight text model. If you need to switch between different models or fine-tune a model for specific tasks, this API may not meet your needs.

Additionally, if you require an SLA or certifications like SOC2, HIPAA, or ISO, this service does not claim to offer those. It is an independent service focused on providing uncensored text generation. If you need enterprise-grade guarantees, you may need to consider other options.

Finally, if you need to pay with credit cards, PayPal, or bank transfers, this service only accepts crypto. Top-ups are available in USDT on TRC20 or USDC on Base, with amounts ranging from $20 to $500. If you prefer traditional payment methods, this API may not be the best fit for your workflow.

Addressing Community Concerns

Developers often discuss the implications of uncensored AI in online communities. Threads on r/PromptEngineering and r/OpenAI highlight concerns about truth and control. Users argue that an AI without restrictions is a human right, allowing for unfiltered access to information. This aligns with the service's goal of providing a model that does not refuse controversial or adult topics.

However, some users worry about the potential for misuse, such as generating pornographic content. The service addresses this by refusing sexual content involving minors, while allowing other lawful adult content. This balance ensures that the API is versatile while maintaining ethical standards.

Another concern raised in threads on r/CriticalState is the role of government oversight. Some users suggest that AI models should be approved by government bodies and moralists. This service takes a different approach by offering an uncensored model that operates independently of such oversight. This appeals to developers who value freedom and control over their AI interactions.

Overall, the community values the ability to use AI without restrictions. This service provides that freedom, allowing developers to explore new possibilities in text generation. By understanding these concerns, you can better appreciate the value this API offers to your projects.

Frequently asked questions

How do I get an API key?

You can sign up using Google or an email and password. Your API key is shown immediately after signup, so copy it securely.

What is the base URL for the API?

The base URL is https://api.abliteratedmodels.top/v1. You must set this in your SDK configuration to route requests correctly.

What models are available?

The API serves one uncensored open-weight text model. The model ID you must use is 'uncensored'.

How is pricing calculated?

Pricing is $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. Credit is charged by real usage, and errors are free.