EN ▾
Get API key

Integrating Uncensored AI API: SDK Setup and Checklist

Developers often ask how to link uncensored AI APIs to agentic workflows or custom frontends for smooth operation. This guide provides a concrete setup process, including SDK configuration and a checklist to ensure reliable text-in, text-out performance.

Developer workspace with laptop showing API code and floating digital tokens

Understanding the Base Configuration

Integrating our API begins with establishing the correct base URL. You must direct your requests to https://api.uncensoredaimodel.top/v1. This endpoint serves the OpenAI-compatible chat-completions interface. It is important to note that this service is independent. We do not claim to be an official partner of any other vendor. Always verify current prices and limits with the vendor's own documentation if you are comparing options.

The model identifier you send in your requests is simply uncensored. This single model handles all text generation tasks. The API is designed for text in, text out operations. It does not support embeddings, image generation, audio, or video. If your workflow requires multimodal inputs, you must handle those steps separately before sending the text to this service.

Context windows are fixed at 100,000 tokens. This limit applies to the sum of your prompt and the completion. You can send large documents or long conversation histories without exceeding this bound. However, you cannot split a single logical request across multiple calls to increase the window size. Each call is independent and bounded by this 100k token limit.

Authentication is handled via API keys. You can generate a key immediately after signing up with Google or email. The key is shown once during signup, so save it securely. Your requests must include this key in the authorization header. Without a valid key, the API returns a 401 error. This ensures that only authorized users can consume credit.

SDK Initialization and Parameters

When initializing the SDK, you must specify the base URL and your API key. Most OpenAI-compatible SDKs allow you to override the default host. Point this host to our endpoint. This ensures that your requests reach the correct uncensored model. You should also set the model name to uncensored in your configuration object. This tells the API which model to invoke for your completion requests.

The API supports several parameters to control generation. You can set the temperature to adjust randomness. The top_p parameter allows for nucleus sampling. You can also define stop sequences to halt generation at specific markers. The seed parameter enables deterministic outputs for testing. These parameters are standard in OpenAI-compatible interfaces, making migration easy for existing users.

Function calling is supported via the tools parameter. You can define function schemas in your request. The model will return structured data that you can parse. This is useful for agentic workflows where the AI needs to trigger specific actions. Ensure your SDK version supports tool calling. If your SDK is outdated, you may need to update it to handle the new response formats correctly.

JSON mode is available for strict output formatting. Set the response format to JSON to ensure the model returns valid JSON. This is critical for parsing responses in automated pipelines. Without this setting, the model might return markdown or natural language text. JSON mode reduces parsing errors and makes integration more reliable. Always validate the output before processing it further in your application.

Streaming and Real-Time Updates

Streaming responses are available via Server-Sent Events (SSE). This allows you to receive tokens as they are generated. The last chunk of the stream includes usage information. This is useful for tracking token consumption in real time. You can display tokens to users as they type, improving the perceived responsiveness of your application.

To enable streaming, set the stream parameter to true in your request. The SDK will handle the SSE connection and emit events for each token. You should handle these events to update your UI or process the text. Be aware that the final chunk contains the total token count. Use this to update your credit balance or log usage for billing purposes.

Streaming is particularly useful for long responses. It reduces the time to first token, making the interaction feel faster. However, it increases the number of network calls. Ensure your infrastructure can handle the increased load. If you are building a chat interface, streaming provides a smoother user experience. For batch processing, non-streaming might be more efficient.

Errors during streaming are handled similarly to non-streaming requests. If the connection drops, you may need to retry the request. The API does not guarantee delivery of every token if the connection is interrupted. Always implement retry logic in your client. This ensures that you do not lose data or leave the user with an incomplete response. Proper error handling is essential for a reliable streaming experience.

Credit Management and Pricing

Pricing is based on token usage. Input tokens cost $0.15 per million tokens. Output tokens cost $0.50 per million tokens. Credit is prepaid and charged by real token usage. Errors and refusals are free, so you do not pay for failed requests. This model is cost-effective for testing and development.

Top-ups are accepted only in crypto. You can pay with USDT on TRC20 or USDC on Base. The minimum top-up amount is $20, and the maximum is $500. If you top up $50 or more, you receive a bonus of 5% to 15%. No cards, PayPal, or bank transfers are accepted. This crypto-only model allows for anonymous and fast transactions.

New accounts start with $0.50 of trial credit. No credit card is needed to start. This allows you to test the API without financial commitment. The credit never expires, so you can use it at your own pace. If you run out of credit, the API returns a 402 error. You must top up to continue using the service.

Monitor your usage through the SDK or API responses. The usage object in the response contains token counts. You can calculate costs using the formula: (tokens divided by 1,000,000) times the per-million price. This helps you budget for your projects. Keep track of your balance to avoid unexpected service interruptions.

Agentic Workflows and Integration

Agentic workflows often require linking APIs to custom frontends. Our API supports this through standard HTTP requests. You can integrate it with tools like Blackbox or other agentic frameworks. The key is to handle the response format correctly. Ensure your agent can parse the text output and make decisions based on it.

Function calling is a powerful feature for agents. You can define tools that the agent can call. The model returns the tool calls, and your agent executes them. This creates a loop where the agent can gather information and take actions. This is essential for complex tasks that require multiple steps.

When integrating with agentic tools, consider the rate limits. Our API allows 300 requests per minute per key. If your agent makes too many requests, it may hit the rate limit. Implement backoff strategies to handle 429 errors. This ensures that your agent does not overwhelm the API and maintains stable performance.

Testing your integration is important. Use the trial credit to test your workflow. Verify that the agent can send requests and receive responses. Check that the function calling works as expected. Once you are satisfied with the performance, you can top up your account to run larger workloads. This iterative testing approach minimizes risks and ensures a smooth integration.

When Our API Is Not the Right Choice

Our API is designed for text-in, text-out operations. If you need image generation, audio synthesis, or video creation, this API is not the right choice. It does not support embeddings, OCR, or fine-tuning. If your project requires these capabilities, you should look for a different provider.

For example, if you are building an image generation application, you might need a model like Flux or Z Image. These models are specialized for visual tasks. Our uncensored model is optimized for text generation. It can describe images, but it cannot create them. Always match the tool to the task to ensure the best results.

Similarly, if you need real-time voice interaction, our text-only API may not suffice. You would need a text-to-speech service to convert the output. This adds complexity to your architecture. Consider whether the additional steps are worth the uncensored nature of the model. If not, a more integrated solution might be better.

Finally, if you need on-premises deployment or strict SLA guarantees, our hosted service may not fit your needs. We do not offer on-prem deployment or SLA percentages. If uptime and data sovereignty are critical, you might need a different provider. Evaluate your requirements carefully before committing to our API.

Community Insights and Common Questions

Users in communities like r/StableDiffusion and r/LocalLLaMA often discuss model selection. They ask about the best uncensored models for specific hardware, such as 12GB or 16GB VRAM. While our API is hosted, the discussion highlights the importance of model capability. Users value models that can handle NSFW content and complex prompts.

Another common question is about linking APIs to agentic workflows. Users want to know how to integrate uncensored APIs with tools like Blackbox. The key is to ensure that the API supports the necessary features, such as function calling and streaming. Our API supports these features, making it suitable for such integrations.

Users also discuss the trade-offs between local and API-based models. Local models offer more control but require more hardware. API-based models offer scalability and ease of use. Our API provides a balance, allowing users to access powerful models without managing hardware. This is particularly useful for developers who want to focus on application logic rather than infrastructure.

Finally, users appreciate the transparency of pricing and credit systems. Our prepaid model with crypto payments is seen as fair and flexible. Users can start with trial credit and scale up as needed. This approach reduces the barrier to entry and allows for easy experimentation. Always check the latest community discussions for updates on model performance and integration tips.

Frequently asked questions

How do I start using the uncensored AI API?

Sign up with Google or email to get an API key immediately. You receive $0.50 of trial credit with no credit card required. Use this credit to test the API before topping up with crypto.

What payment methods are accepted for top-ups?

We accept only USDT on TRC20 or USDC on Base. The minimum top-up is $20, and the maximum is $500. No credit cards, PayPal, or bank transfers are supported.

Does the API support function calling?

Yes, the API supports function calling via the tools parameter. You can define function schemas, and the model will return structured data for your agent to execute.

What happens if I run out of credit?

The API returns a 402 error when you have no credit. You must top up your account with crypto to continue using the service. Errors and refusals are free, so you only pay for successful token usage.