EN ▾
Start now

Integrating Uncensored AI API: A Step-by-Step Checklist

Connecting to an uncensored text API requires careful attention to authentication and error handling. This guide provides a practical checklist for developers to ensure smooth integration without common pitfalls.

Illustration of a secure API gateway with glowing data streams for AI integration

Understanding the API Architecture

The foundation of a reliable integration starts with understanding the core architecture of the service. Our API is designed as a hosted, OpenAI-compatible endpoint that serves a single uncensored open-weight text model. This means you interact with it using standard chat-completions protocols, but with a specific model identifier. The model ID you must send in your requests is simply "uncensored". This simplicity reduces configuration overhead while ensuring consistent behavior across different client libraries.

It is important to note that this service focuses exclusively on text processing. You will not find embeddings, image generation, audio processing, video creation, or optical character recognition (OCR) capabilities here. There is also no fine-tuning or model routing available. The interface is strictly text in, text out. This focused scope allows for predictable performance and clear pricing structures without the complexity of multi-modal processing.

The base URL for all your requests is https://api.cheapki.com/v1. From this base, you will interact with three primary endpoints. The POST /v1/chat/completions endpoint handles standard conversational flows. The POST /v1/responses endpoint offers an alternative response format. The GET /v1/models endpoint allows you to verify available models, though only the uncensored text model is currently served. Keeping these endpoints distinct helps in debugging and structuring your application logic.

When integrating, ensure your client library is configured to handle JSON payloads and responses. The API adheres to standard HTTP methods and status codes, making it compatible with most modern development environments. By sticking to the specified endpoints and model ID, you avoid unnecessary complexity. This approach ensures that your application remains stable and easy to maintain as you scale your usage.

Authentication and Key Management

Authentication is the first step in any API integration. Our service supports two methods for signing up: you can continue with Google or use an email and password combination. Once you create an account, your API key is shown immediately. This immediate visibility allows you to start testing your integration without delay. The key is the primary credential you will use to authenticate all subsequent requests to the API.

It is important to manage your API key securely. Since the key is displayed immediately upon signup, ensure you store it in a secure environment variable or secret manager within your application. Avoid hardcoding the key directly in your source code, especially if you are working with version control systems. This practice prevents accidental exposure of your credentials in public repositories.

When you send requests, include the API key in the authorization header. The API expects a valid key to process your requests. If the key is invalid or missing, you will receive a 401 error. This error indicates that the key provided is either incorrect or has been revoked. Checking for this error code helps you diagnose authentication issues quickly.

Additionally, keep an eye on your credit balance. If you run out of prepaid credit, the API will return a 402 error. This error signifies that you have no remaining credit to cover the request. Since errors and refusals are free, you can experiment freely without worrying about unexpected charges. However, successful completions will consume credit, so monitoring your usage is essential for cost management.

Configuring Parameters and Features

The API supports a range of parameters that allow you to fine-tune the model's behavior. You can control the randomness of the output using the temperature parameter. Lower values make the output more deterministic, while higher values introduce more creativity. The top_p parameter allows you to control the nucleus sampling, ensuring that the model considers only the most probable tokens. These parameters give you precise control over the quality and style of the generated text.

Function calling is another powerful feature available in this API. You can define tools and functions that the model can invoke during the conversation. This is particularly useful for building agents that need to interact with external systems or perform specific tasks. The API supports streaming over Server-Sent Events (SSE), allowing you to receive usage information in the last chunk of the response. This feature is ideal for real-time applications where immediate feedback is required.

JSON mode is also supported, which forces the model to output valid JSON. This is essential for applications that need to parse the response programmatically. You can also set stop sequences to halt the generation at specific points. The seed parameter allows you to reproduce the same output for a given input, which is useful for testing and debugging. These features collectively enhance the versatility of the API for various use cases.

Penalties can be applied to discourage certain tokens from being selected. This helps in steering the model's output towards desired topics or styles. By combining these parameters, you can create a highly customized experience for your users. Experiment with different settings to find the optimal configuration for your specific application needs.

Handling Errors and Rate Limits

Errors are an inevitable part of API integration, and knowing how to handle them is important for a reliable application. The API returns specific error codes to help you diagnose issues. A 401 error indicates an invalid API key, while a 402 error means you have no remaining credit. A 429 error signals that you have exceeded the rate limit. Understanding these codes allows you to implement appropriate error handling strategies in your code.

The rate limit for this API is 300 requests per minute per key. If you exceed this limit, you will receive a 429 error. To avoid hitting the rate limit, consider implementing exponential backoff in your application. This strategy involves waiting for increasing intervals between retries, which helps prevent overwhelming the API during peak usage. Monitoring your request volume can also help you stay within the limits.

Errors and refusals are free, which means you can test your integration extensively without incurring costs. This is particularly useful when debugging issues or experimenting with different parameters. However, successful completions will consume credit, so it is important to track your usage. You can monitor your credit balance through your account dashboard to ensure you have sufficient funds for your requests.

When handling errors, it is good practice to log them for later analysis. This helps in identifying patterns and potential issues with your integration. For example, if you notice a high frequency of 401 errors, it might indicate that your API key is being rotated or exposed. By addressing these issues proactively, you can ensure a smoother integration experience.

Crypto Payments and Credit Management

Our service operates on a prepaid credit model, which means you pay for what you use. The pricing is straightforward: $0.15 per million input tokens and $0.50 per million output tokens. This model ensures that you only pay for the actual usage of the API, without any hidden fees or subscription costs. The prepaid credit never expires, allowing you to use it at your own pace.

Top-ups can be made using cryptocurrency, specifically USDT on the TRC20 network or USDC on the Base network. You can top up any whole amount between $20 and $500. Additionally, there is a bonus credit program for top-ups of $50 or more, which offers a bonus ranging from 5% to 15%. This bonus provides extra value for larger purchases, making it more cost-effective for high-volume users.

It is important to note that we do not accept credit cards, PayPal, or bank transfers. All payments must be made using the specified cryptocurrencies. This method of payment ensures fast and secure transactions without the need for intermediaries. You can check the current exchange rates and network fees before making a purchase to ensure you have sufficient funds.

Managing your credit effectively is key to avoiding service interruptions. Keep an eye on your balance and top up before it runs low. Since errors and refusals are free, you can continue to test your application even if you are low on credit. However, successful completions will consume credit, so it is important to monitor your usage to ensure a smooth experience.

When This API Is Not the Right Choice

While our API is powerful for text generation, it may not be the right choice for every project. If your application requires embeddings, image generation, audio processing, or video creation, this service may not meet your needs. The API is strictly text-based, so if you need multi-modal capabilities, you might need to look for a different solution.

Additionally, if you require fine-tuning or model routing, this API does not support these features. The model is fixed, and you cannot train it on your own data or route requests to different models. For projects that need these advanced features, you might need to consider a more comprehensive AI platform.

Another consideration is the payment method. Since we only accept cryptocurrency for top-ups, this might not be suitable for users who prefer traditional payment methods like credit cards or PayPal. If your team or organization has strict policies about crypto payments, this could be a limiting factor.

Finally, if you need a service with a service level agreement (SLA) or certifications like SOC2, HIPAA, or ISO, our API does not currently offer these. For enterprises with strict compliance requirements, you might need to evaluate other options. However, for developers and indie builders who need a reliable, uncensored text API, this service offers a compelling alternative.

Addressing Common Developer Questions

Developers often ask about the security of API keys and how to prevent them from being exposed in public repositories. One common concern is the risk of keys being committed to GitHub. To mitigate this, it is recommended to use environment variables or secret managers to store your API key. This prevents the key from being hard-coded in your source code and reduces the risk of accidental exposure.

Another frequent question is about the cost of using the API. Since the pricing is based on token usage, it is important to estimate your token consumption accurately. You can use the formula (tokens divided by 1,000,000 times the per-million price) to calculate the cost. This helps in budgeting and avoiding unexpected charges. Additionally, since errors and refusals are free, you can test your integration without incurring costs.

Users also inquire about the trial credit available for new accounts. Every new account receives $0.50 of trial credit, which allows you to test the API without making a payment. This is a great way to evaluate the service before committing to a purchase. The trial credit is sufficient for basic testing and experimentation.

Finally, developers often ask about the supported parameters and features. The API supports streaming, function calling, JSON mode, and various parameters like temperature and top_p. These features provide flexibility and control over the model's behavior. By understanding these capabilities, you can design your application to use the full potential of the API.

Frequently asked questions

How do I start using the uncensored AI API?

Sign up with Google or email to receive your API key immediately. Then, configure your SDK with the base URL and send requests to the chat-completions endpoint using the model ID 'uncensored'.

What payment methods are accepted?

We accept only cryptocurrency for top-ups: USDT on TRC20 or USDC on Base. Credit cards, PayPal, and bank transfers are not supported.

Is there a free trial available?

Yes, every new account receives $0.50 of trial credit with no card required. This allows you to test the API before making a purchase.

What happens if I exceed the rate limit?

If you exceed 300 requests per minute, you will receive a 429 error. Implement exponential backoff in your application to handle this gracefully.