EN ▾
Get your key

Integrating Uncensored Text API via SDK

Developers often need a reliable way to access an uncensored language model without complex infrastructure. This guide walks you through connecting to our API using a standard SDK, ensuring you can send requests and process text outputs efficiently.

Developer workspace with laptop showing uncensored LLM API code and neural network visualization

Setting Up Your Development Environment

Before you can send any requests, you need to establish a connection to our service. The first step is to obtain an API key, which serves as your authentication credential. You can create an account by continuing with Google or by using an email and password combination. Once you sign up, your API key is displayed immediately on the screen, so make sure to copy it securely.

Our API follows the OpenAI compatibility standard, which means you can likely use existing SDKs from major providers without significant code changes. The base URL for all requests is https://api.apiranking.cc/v1. When you initialize your SDK client, point it to this base URL. This ensures that your requests are routed correctly to our uncensored model.

It is important to note that this service is independent. We do not claim to be an official partner of any other company. While our API mimics the structure of popular providers, it is a distinct service. Always verify the specific configuration details in your chosen SDK documentation to ensure you are using the correct headers and parameters.

Once your environment is set up, you should test the connection by listing available models. This simple check confirms that your key is valid and that you can reach our servers. The endpoint for this is GET /v1/models. If you receive a response, you are ready to start sending text.

Authentication and Key Management

Authentication is handled via the API key you received during signup. You must include this key in the Authorization header of every request you send. The format is typically Bearer followed by your key. Without a valid key, the API will return a 401 error, indicating that your credentials are invalid or missing.

Your API key is tied to your prepaid credit balance. Unlike subscription-based services, we do not charge monthly fees. Instead, you top up your account 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 choose any whole amount within this range.

When you add funds, you receive credit immediately. Errors and refusals do not consume your credit, which is a significant advantage for developers testing their prompts. However, actual token usage is charged based on real consumption. If your balance runs out, you will receive a 402 error until you top up again.

Keep your API key secure. Since the key is shown immediately upon signup, ensure you store it in an environment variable or a secure configuration file. Avoid hardcoding it directly into your source code, especially if you are sharing your project with others. This practice helps prevent unauthorized usage of your credit.

Sending Requests to the Chat Endpoint

The core functionality of our API is the chat completions endpoint. You send a POST request to /v1/chat/completions to generate text. The input is a JSON object containing your message history and various parameters. This endpoint is text-in, text-out, meaning it does not handle images, audio, or video generation.

When constructing your request, you must specify the model ID as "uncensored". This tells the API which model to use for the response. You can also include parameters like temperature, top_p, stop sequences, and seed to control the randomness and output format. These parameters allow you to fine-tune the behavior of the model for your specific use case.

Our model supports a context window of 100,000 tokens, which includes both the prompt and the completion. This large window allows you to send extensive context or long conversations without losing information. However, keep in mind that the context window is a shared resource between your input and the model's output.

You can also use the /v1/responses endpoint for a different interaction pattern. Both endpoints are part of the OpenAI-compatible interface, so you can switch between them depending on your application's needs. Just ensure that your SDK is configured to handle the specific response format of each endpoint.

Handling Streaming and JSON Modes

For applications that require real-time feedback, our API supports streaming over Server-Sent Events (SSE). When you enable streaming, the API sends chunks of text as they are generated. This is ideal for chat interfaces where you want to display text to the user as it appears. The final chunk of the stream includes usage information, such as the number of tokens consumed.

If you need structured output, you can enable JSON mode. This forces the model to return a valid JSON object instead of free-form text. This is particularly useful for applications that need to parse the response programmatically. You can also specify stop sequences to halt generation at a specific point, which helps in controlling the length and structure of the output.

When working with streaming, it is important to handle the data correctly. You should process each chunk as it arrives and update your user interface accordingly. This requires a solid understanding of asynchronous programming in your chosen language. Most modern SDKs handle this automatically, but you should verify the behavior in your specific environment.

Remember that streaming does not change the pricing. You are still charged based on the total number of tokens generated. The only difference is how the data is delivered to your application. Choose streaming when you need immediate feedback, and non-streaming when you prefer to wait for the complete response.

Pricing and Credit Management

Our pricing model is straightforward and based on token usage. You pay $0.15 per one million input tokens and $0.50 per one million output tokens. This means that the cost of a request depends on the length of your prompt and the length of the generated text. Longer conversations or complex prompts will cost more, but the rate remains constant.

Errors and refusals are free, which means you do not lose credit if the API returns an error or if the model refuses to answer a request. This is beneficial for testing and debugging, as you can experiment with different prompts without worrying about wasting credit. However, actual token usage is always charged.

You can top up your account with USDT on TRC20 or USDC on Base. The minimum top-up is $20, and the maximum is $500. There is no monthly subscription fee, and your prepaid credit never expires. This flexibility allows you to manage your budget according to your usage patterns.

Keep an eye on your balance, especially if you are running high-volume tests. If your credit runs low, you will receive a 402 error. You can top up immediately to resume service. Since there are no bank transfers or credit card options, ensure you have the necessary cryptocurrency ready before you start your project.

When This API Is Not the Right Choice

While our API is powerful for text generation, it is not suitable for every use case. If you need image, audio, or video generation, this service will not meet your needs. We focus solely on text input and output. Similarly, if you require embedding models for vector search, OCR for document processing, or fine-tuning capabilities, our API does not offer these features.

Our model is uncensored, which means it does not refuse lawful adult, fictional, security-research, or controversial topics. However, there is a hard limit: requests involving sexual content with minors are refused. If your application requires strict content filtering for all types of media, you may need to implement additional layers of moderation.

Additionally, if you need a service with a guaranteed Service Level Agreement (SLA) or specific certifications like SOC2 or HIPAA, our API may not be the best fit. We are an independent service and do not claim these certifications. For enterprises requiring strict compliance, you should evaluate our service against your specific legal and operational requirements.

Finally, if you need model routing or the ability to switch between different models dynamically, our API serves only one uncensored open-weight model. You cannot route requests to multiple models or switch vendors on the fly. If your architecture requires multi-model support, you may need to build that logic into your application.

Addressing Common Developer Questions

Developers often ask about the best models for role-playing or creative writing. Our uncensored model is well-suited for these tasks because it does not impose strict content filters on lawful adult or fictional topics. Users have found that it handles complex narratives and character interactions effectively, making it a popular choice for developers building chatbots or interactive stories.

Another common question is how to handle errors and rate limits. Our API returns a 429 error if you exceed 300 requests per minute per key. This limit helps maintain service stability for all users. If you encounter this error, you should implement exponential backoff in your code to retry the request after a short delay.

Users also inquire about the difference between our service and others. While many providers offer uncensored models, our service is distinct in its pricing and payment methods. We accept crypto only, which appeals to users who prefer anonymity or decentralized payments. Always check the documentation of other vendors for their specific limits and features.

Finally, developers often wonder about the context window. Our model supports 100,000 tokens, which is quite large. This allows you to send long prompts or maintain long conversations without losing context. However, keep in mind that the context window includes both input and output, so plan your token usage accordingly to avoid unexpected costs.

Frequently asked questions

How do I get an API key?

You can obtain an API key by signing up with Google or email and password. The key is displayed immediately after signup, so copy it securely for use in your SDK.

What payment methods are accepted?

We accept only cryptocurrency: USDT on the TRC20 network or USDC on the Base network. Credit cards, PayPal, and bank transfers are not supported.

Does the API support streaming?

Yes, the API supports streaming over Server-Sent Events (SSE). You can enable this in your SDK to receive text chunks in real-time as they are generated.

What happens if I run out of credit?

If your balance is insufficient, you will receive a 402 error. You can top up your account with USDT or USDC to resume service. Errors and refusals do not consume credit.