EN ▾
Try with trial credit

Integrating C.ai API: SDK Settings and Checklist

Developers often struggle to configure OpenAI-compatible clients for uncensored text generation. This guide provides step-by-step integration instructions and a checklist to ensure your pipeline works with our prepaid system.

Developer workstation showing uncensored text API integration with crypto symbols

Understanding the Uncensored Text Model

Our API serves a single, uncensored open-weight text model identified by the string uncensored. This model does not refuse lawful adult, fictional, security-research, or controversial topics. It is designed for developers who need raw text generation without the filters found in many commercial alternatives. The model accepts text input and returns text output, making it suitable for chat applications, roleplay bots, and content generation tools.

Unlike services that offer multiple model routing or specialized embeddings, our service focuses purely on text completion. You send a request to the chat-completions endpoint, and the model responds with generated text. There are no image, audio, or video generation capabilities, nor any OCR or fine-tuning features. This simplicity allows for faster integration and predictable behavior in your applications.

The context window supports up to 100,000 tokens, combining both the prompt and the completion. This allows for long conversations or large document processing within a single request. However, since the context is shared, you must manage your token usage carefully to avoid hitting the limit mid-conversation. The model handles both short queries and extended narratives effectively.

When integrating, remember that the model is uncensored but not illegal. It will refuse requests involving sexual content with minors, but otherwise, it is permissive. This makes it ideal for creative writing, character chat, and niche communities that require less restrictive content filtering. Always design your application to handle the model's output directly, as it may produce varied and unfiltered results.

Base URL and Endpoint Structure

The base URL for our API is https://api.caiapi.cc/v1. All requests must be sent to this domain to ensure proper routing and authentication. The API follows the OpenAI-compatible format, which means you can use standard OpenAI SDKs with minimal configuration. This compatibility reduces the learning curve for developers already familiar with OpenAI's ecosystem.

The primary endpoint for generating text is POST /v1/chat/completions. This endpoint accepts JSON payloads containing the model ID, messages, and various parameters. You can also use POST /v1/responses for specific response formats if needed. To check available models, use GET /v1/models, which will return the uncensored model ID. These endpoints are the core of your integration.

Ensure that your SDK is configured to point to the correct base URL. If you are using a library like openai for Python or openai-node for JavaScript, set the base URL explicitly. This prevents requests from going to the default OpenAI servers and ensures they reach our uncensored model. Incorrect routing is a common mistake that leads to unexpected errors or higher costs.

Keep your API key secure and include it in the Authorization header of each request. The key is shown immediately upon signup, so save it in a secure environment variable. If you lose the key, you will need to generate a new one. The API does not support key rotation or multiple keys per account, so treat the key as your primary credential.

SDK Configuration and Parameters

Configuring your SDK involves setting the model ID to uncensored and defining the parameters for generation. You can control the output using parameters like temperature, top_p, stop, and seed. The temperature parameter controls the randomness of the output, with higher values producing more creative and varied responses. The top_p parameter filters the most likely tokens based on their probability.

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 chat applications where you want to display text as it appears. The usage information, such as token counts, is included in the last chunk of the stream. This helps you track your credit usage in real-time.

Function calling, also known as tool use, is supported, allowing the model to generate structured data or trigger actions in your application. You can define tools in your request, and the model will output JSON that matches the schema. This is powerful for building agents that can interact with external systems or databases. JSON mode is also available for strict output formatting.

Penalties can be applied to discourage certain tokens or phrases in the output. This is useful for maintaining consistency in character voice or avoiding repetitive patterns. Experiment with these parameters to find the right balance between creativity and control for your specific use case. The SDK handles the serialization of these parameters, so you can focus on the logic of your application.

Pricing and Crypto Top-Up System

Pricing is straightforward: $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. Credits are prepaid and charged based on real token usage. Errors and refusals are free, so you only pay for successful generations. There is no subscription or monthly fee, and paid credit never expires. This pay-as-you-go model is ideal for developers with variable usage patterns.

To add funds, you must use cryptocurrency. The only accepted methods are USDT on the TRC20 network or USDC on the Base network. You can top up any whole amount from $20 to $500. If you top up $50 or more, you receive bonus credit ranging from 5% to 15%. This bonus incentivizes larger purchases and provides extra value for your investment.

Payments are processed via crypto only. There is no option for credit cards, PayPal, or bank transfers. This means you need a crypto wallet to make deposits. The process is simple: send the specified amount of USDT or USDC to the provided address, and the credit is added to your account. Check the dashboard for the current deposit address and instructions.

Keep an eye on your balance, as requests will fail if you have insufficient credit. The API returns a 402 error when credit is exhausted. Since credit does not expire, you can top up whenever you need more. This flexibility allows you to manage your budget effectively without worrying about monthly bills or unused subscriptions.

Integration Checklist for Developers

Before going live, run through this checklist to ensure your integration is reliable. First, verify that your SDK is pointing to the correct base URL: https://api.caiapi.cc/v1. Incorrect URLs will lead to connection errors or unexpected behavior. Second, confirm that the model ID is set to uncensored. Using the wrong model ID will result in an error or unexpected output.

Test your integration with the $0.50 trial credit available to every new account. This allows you to verify that requests are successful and responses are as expected without spending real money. Check that streaming works correctly if you are using SSE, and that function calling returns the expected JSON structure. Also, verify that the temperature and top_p parameters are being applied as intended.

Ensure that your application handles errors gracefully. The API returns 401 for invalid keys, 402 for no credit, and 429 for rate limits. Implement retry logic for 429 errors, as they indicate you have exceeded the limit of 300 requests per minute per key. Monitor your token usage to avoid unexpected charges, and set up alerts for low balance.

Finally, test the limits of your application. Send long prompts to verify the 100,000 token context window works as expected. Check that the model handles edge cases, such as empty messages or unusual characters, without crashing. This thorough testing ensures a smooth experience for your users and minimizes support issues.

When This API Is Not the Right Choice

While our API is excellent for uncensored text generation, it may not be the right choice for everyone. If you need image, audio, or video generation, this service does not support those capabilities. It is purely a text-in, text-out API. Similarly, if you require embeddings for vector search, OCR for document processing, or fine-tuning for custom model training, our API does not offer these features.

Developers looking for model routing or access to multiple models will find our service limited, as we serve only one uncensored model. If you need to switch between different models for different tasks, you will need a different provider. Additionally, if you prefer card payments or PayPal, our crypto-only top-up system might be a barrier.

Also, consider the context window. While 100,000 tokens is large, it is shared between prompt and completion. If your application involves extremely long conversations or massive documents, you may need to manage the context carefully. If you need guaranteed uptime or SLA percentages, our service does not offer those guarantees, so plan for potential variability.

Finally, if you are building an application that requires strict content filtering for children or sensitive environments, our uncensored model might produce output that is too raw. You may need to implement your own filtering layer on top of our API. This adds complexity but allows you to tailor the content to your specific audience.

Addressing Common Developer Questions

Developers often ask how to handle the lack of filters in an uncensored API. The key is to design your application to manage content appropriately. Since the model does not refuse controversial topics, you might need to add your own moderation layer if required. This gives you full control over what is displayed to users, rather than relying on the model's internal filters.

Another common question is about the difference between our API and other alternatives like Talkie or Lightshade. While those services offer various features, our API focuses on simplicity and uncensored text generation. We do not have group chat modes or meme generation, but we provide a reliable text API that integrates easily with existing tools. Check the documentation of other vendors for their specific features and pricing.

Users also ask about the reliability of the model for long stories. The 100,000 token context window supports long narratives, but you must manage the context window effectively. Truncate old messages or use summarization techniques to keep the context within limits. This ensures consistent performance and avoids hitting the token cap mid-story.

Finally, developers wonder about the ease of integration. Since our API is OpenAI-compatible, you can use standard SDKs with minimal changes. The main difference is the base URL and model ID. This familiarity reduces the time needed to integrate our service into your existing projects. Test with the trial credit to ensure everything works before scaling up.

Frequently asked questions

How do I top up my account?

You can top up using USDT on TRC20 or USDC on Base. Send any amount between $20 and $500 to the address provided in your dashboard. Credits are added automatically after confirmation.

What is the cost per token?

The price is $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. You only pay for successful generations, and errors are free.

Can I use my credit card?

No, we only accept cryptocurrency. Credit cards, PayPal, and bank transfers are not supported. You must use USDT or USDC for top-ups.

Is there a trial period?

Yes, every new account receives $0.50 of trial credit. This allows you to test the API without needing to top up immediately.