EN ▾
Get API key

Integrating Uncensored AI Model Hosted API: Step-by-Step

Connecting to an uncensored AI model API requires precise configuration of endpoints and parameters. This guide walks you through the essential steps for agentic workflows, from authentication to handling streaming responses.

Server rack with glowing blue circuit boards and fiber optic cables representing AI model hosting

Understanding the Base URL and Endpoints

The foundation of any integration begins with correctly identifying the base URL for your requests. For our service, the base URL is https://api.uncensoredaimodel.cc/v1. This URL serves as the entry point for all API interactions, ensuring that your requests are routed to the correct infrastructure. It is important to verify this URL in your configuration files to avoid connection errors during development.

Our API supports specific endpoints that cater to different interaction modes. The primary endpoint for standard chat completions is POST /v1/chat/completions. This endpoint handles text-in, text-out interactions, making it ideal for most agentic workflows where you need to send a prompt and receive a coherent response. Additionally, the POST /v1/responses endpoint offers an alternative structure for responses, which might be useful depending on your application's architecture.

For model information, you can use the GET /v1/models endpoint. This allows you to programmatically verify the available models, though our service currently hosts a single uncensored open-weight text model. Knowing the model ID, which is simply "uncensored", is essential for constructing your API calls correctly. This simplicity reduces the complexity of model routing logic in your code.

It is important to note that our API does not support embeddings, image generation, audio processing, or video generation. If your agentic workflow requires multimodal capabilities, you may need to integrate additional services. However, for pure text-based interactions, our API provides a reliable and straightforward solution. Always refer to the official documentation for the most current endpoint structures and parameter requirements.

Authentication and Key Management

Authentication is handled through API keys, which you receive immediately upon signup. You can create an account using Google or by providing an email and password. Once registered, your API key is displayed on the screen, so ensure you copy it securely. This key must be included in the Authorization header of every request you make to the API.

When making requests, you must include your API key in the header. If the key is invalid or missing, the API will return a 401 error. This indicates that your authentication credentials are incorrect. It is a good practice to store your API key in environment variables rather than hardcoding it in your source code to enhance security.

If you attempt to make a request without sufficient prepaid credit, the API will return a 402 error. This means you need to top up your account before proceeding. Our pricing model is prepaid, so you must ensure your balance is sufficient for the token usage of your agentic tasks. Errors and refusals do not consume credit, which is a significant advantage for testing and debugging.

You can 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 also receive bonus credit for larger top-ups, ranging from 5% to 15% bonus for amounts of $50 or more. This crypto-only payment method ensures fast and secure transactions without the need for traditional banking channels.

Configuring Parameters for Agentic Workflows

Agentic workflows often require fine-tuned control over the model's output. Our API supports several parameters that allow you to adjust the behavior of the uncensored model. You can set the temperature to control the randomness of the output. A higher temperature results in more creative and varied responses, while a lower temperature produces more deterministic and focused outputs.

The top_p parameter allows you to control the nucleus sampling, which limits the model's attention to the most probable tokens. This is useful for balancing creativity and coherence in your agentic tasks. You can also specify stop sequences to halt the generation when certain tokens are encountered, which is helpful for structured output formats.

Additionally, you can set a seed to ensure reproducibility of your results. This is particularly useful for debugging and testing your agentic workflows. The penalty parameters allow you to adjust the frequency and presence penalties, giving you more control over the diversity and repetition of the generated text.

JSON mode is also supported, which ensures that the model's output is valid JSON. This is essential for agentic workflows that rely on parsing structured data from the model. By enabling JSON mode, you can smoothly integrate the model's output into your application's data pipeline without additional parsing logic.

Handling Streaming Responses

Streaming is a critical feature for agentic workflows that require real-time feedback. Our API supports streaming over Server-Sent Events (SSE). This allows you to receive tokens as they are generated, providing a smoother user experience and faster response times. Streaming is particularly useful for long-running tasks or when you need to display progress to the user.

When using streaming, the usage information is included in the last chunk of the response. This means you can track token consumption in real-time, which is helpful for monitoring costs and performance. You can parse the streaming response to extract the generated text and update your application's interface accordingly.

To implement streaming, you need to set the appropriate headers in your request. This tells the API to return a streaming response instead of a complete response. You then need to handle the incoming chunks of data and process them as they arrive. This requires a reliable event handling mechanism in your code to ensure that no data is lost or misinterpreted.

Streaming also helps in managing context window limits. Since our API has a context window of 100,000 tokens, streaming allows you to process large inputs and outputs efficiently. You can stream the input and output simultaneously, reducing the latency and improving the overall performance of your agentic workflow.

Managing Context Window and Token Limits

Understanding the context window is important for effective integration. Our API has a context window of 100,000 tokens, which includes both the prompt and the completion. This large context window allows you to handle complex agentic tasks that require extensive context. However, it is important to manage this window efficiently to avoid exceeding the limit.

When designing your agentic workflow, consider how you structure your prompts. You can include previous conversation history, tool outputs, and other relevant information within the context window. This helps the model maintain coherence and relevance in its responses. However, be mindful of the token usage, as each token contributes to the context window limit.

If you exceed the context window, the API may truncate the input or return an error. It is a good practice to monitor token usage and implement logic to manage the context window dynamically. You can truncate older messages or summarize previous interactions to free up space for new inputs.

The pricing for token usage is based on the number of tokens processed. Input tokens cost $0.15 per million tokens, while output tokens cost $0.50 per million tokens. By optimizing your prompts and managing the context window effectively, you can reduce costs and improve the efficiency of your agentic workflow.

When Our API Is Not the Right Choice

While our API is powerful for text-based agentic workflows, it may not be the right choice for all use cases. If your application requires multimodal capabilities, such as image generation, audio processing, or video analysis, our API alone may not suffice. You would need to integrate additional services to handle these modalities.

Similarly, if you need advanced features like fine-tuning or model routing, our API does not currently support these capabilities. Fine-tuning allows you to customize the model for specific tasks, while model routing enables you to select different models based on the input. If these features are critical to your workflow, you may need to consider other options.

Our API is also limited to text input and output. If your agentic workflow involves complex data structures or non-textual data, you may need to preprocess or postprocess the data using other tools. This adds an extra layer of complexity to your integration, which may not be ideal for all developers.

Finally, if you require a free unlimited tier or specific SLA guarantees, our prepaid crypto-based model may not align with your needs. Our service offers a trial credit of $0.50, but ongoing usage requires prepaid credit. If you prefer a subscription-based model or need guaranteed uptime, you might want to explore other providers.

Addressing Community Questions on Integration

Developers often ask about the best uncensored models for roleplay and agentic workflows. Threads on r/LocalLLM and r/AIJailbreak discuss various models, but our API provides a single, consistent uncensored model that is optimized for these tasks. This simplifies the integration process, as you do not need to manage multiple model versions.

Another common question is how to link uncensored AI APIs to tools like Blackbox for agentic workflows. Our API can be easily integrated with various frontends and tools. By using the standard OpenAI-compatible endpoints, you can connect our API to a wide range of agentic frameworks without significant modifications.

Users also inquire about the limits of free tiers and the quality of uncensored models. While our trial credit is limited, the prepaid model ensures that you always have access to the uncensored model without the constraints of a free tier. The quality of the model is high, making it suitable for coding, roleplay, and other complex tasks.

Finally, developers often ask about the performance of uncensored models on different hardware. Our hosted API eliminates the need for local GPU resources, allowing you to run agentic workflows on any device with an internet connection. This accessibility is a significant advantage for developers who do not have access to high-end hardware.

Frequently asked questions

How do I authenticate with the uncensored AI model API?

You authenticate using an API key, which is displayed immediately after signup. Include this key in the Authorization header of your requests. If the key is invalid, you will receive a 401 error.

What is the context window size for the uncensored model?

The context window is 100,000 tokens, including both the prompt and the completion. This allows for handling large inputs and outputs in agentic workflows.

Can I use streaming with the uncensored AI model API?

Yes, the API supports streaming over Server-Sent Events (SSE). This allows you to receive tokens in real-time, which is useful for agentic workflows and user interfaces.

How do I top up my credit for the uncensored AI model?

You can top up using USDT on TRC20 or USDC on Base. The minimum amount is $20, and the maximum is $500. Bonus credit is available for top-ups of $50 or more.

per 1M input tokens
$0.15
Output tokens / 1M
$0.50
token context
100,000
trial credit
$0.50
requests per minute
300