Integrating Uncensored LLM API with Python SDK
Developers often need a reliable way to integrate an uncensored language model into their custom applications. This guide provides a tested checklist for configuring the Python SDK, managing authentication, and handling text-in, text-out responses. We focus on practical steps to get your integration running smoothly.

Understanding the API Structure
Before writing any code, it is essential to understand the structure of the API endpoint. Our service uses a standard OpenAI-compatible format for chat completions. This means you can use familiar libraries and patterns if you have experience with similar services. The base URL for our API is https://api.grokunfiltered.cc/v1. You will send POST requests to /v1/chat/completions to generate text. This endpoint accepts a JSON payload containing your messages and model parameters.
The model you must specify is uncensored. This identifier tells the server which model to use for the request. Unlike other services that might offer multiple models, our API serves one uncensored open-weight text model. Text goes in, and text comes out. There are no embeddings, images, or audio generated. Keeping this scope clear helps you design your application around text-only interactions.
You should also be aware of the context window. Our API supports a context window of 100,000 tokens. This includes both the prompt and the completion. This large window allows you to send extensive prompts or maintain long conversations without losing context. However, you must manage the tokens carefully to stay within your budget and rate limits.
Finally, note that the API does not support fine-tuning or model routing. You cannot train a custom model or switch between different versions. The service is designed for consistent, uncensored text generation. This simplicity can be an advantage for developers who want a straightforward integration without complex configuration options. Focus your efforts on building the logic that processes the text responses.
Authentication and Setup
Authentication is the first step in any API integration. Our API uses API keys for authentication. You can sign up using Google or an email and password. Once you create an account, your API key is shown immediately. You must include this key in every request to the API. Without a valid key, you will receive a 401 error indicating an invalid key.
To set up authentication in Python, you typically include the API key in the headers of your HTTP requests. The header name is usually Authorization, and the value is Bearer followed by your key. This standard method ensures that your requests are identified and authenticated correctly. Make sure to store your key securely and avoid hardcoding it in your source code if possible.
It is also important to understand the pricing structure. Our API charges $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. You pay for real token usage, and errors or refusals are free. There is no monthly subscription fee, and prepaid credit never expires. This model allows you to pay only for what you use, which can be cost-effective for intermittent usage.
You can top up your credit using cryptocurrency. The accepted methods are USDT on TRC20 or USDC on Base. The minimum top-up amount is $20, and the maximum is $500. You can also receive bonus credit for larger top-ups. Credit cards, PayPal, and bank transfers are not accepted. Ensure you have sufficient credit before making requests to avoid 402 errors due to no credit.
Making Your First Request
Now that you have your API key and understand the structure, you can make your first request. Use a Python HTTP library like requests or httpx to send a POST request to the /v1/chat/completions endpoint. The payload should include the model id uncensored, your messages, and any desired parameters. The messages should be a list of dictionaries with roles and content.
For example, you might send a simple prompt to test the connection. The API will respond with a JSON object containing the generated text. You can parse this response to extract the completion. This basic interaction confirms that your authentication and request format are correct. It is a good practice to handle exceptions and errors gracefully in your code.
You can also enable streaming for real-time output. Streaming allows you to receive the response in chunks as it is generated. This can improve the user experience in applications where immediate feedback is valuable. The streaming response includes usage information in the last chunk, which helps you track token consumption. This feature is supported by our API and can be enabled by setting the stream parameter to true.
When making requests, be mindful of the rate limits. Our API allows 300 requests per minute per key. If you exceed this limit, you will receive a 429 error. You should implement retry logic with exponential backoff in your application to handle rate limits effectively. This ensures that your integration remains reliable even during periods of high traffic.
Handling Parameters and Options
The API supports various parameters to customize the generation process. You can control the randomness using the temperature parameter. A higher temperature results in more creative and diverse outputs, while a lower temperature produces more deterministic and focused responses. The top_p parameter allows you to control the nucleus sampling, which limits the vocabulary to the most probable tokens.
You can also specify stop sequences to halt generation when certain strings are encountered. This is useful for controlling the length of the output or stopping at specific markers. The seed parameter allows you to set a random seed for reproducible results. This can be helpful for debugging and testing your integration. Additionally, you can adjust penalties to influence the likelihood of certain tokens.
JSON mode is another useful feature. You can request the output in JSON format, which is helpful for structured data extraction. This ensures that the response is well-formed and easy to parse in your application. Function calling is also supported, allowing you to define tools that the model can use. This enables more complex interactions where the model can trigger specific actions based on the input.
Understanding these parameters allows you to fine-tune the behavior of the API to match your application's needs. Experiment with different values to find the best balance between creativity and control. Document your findings to help others on your team understand the configuration choices. This approach ensures that your integration is both flexible and reliable.
When Our API Is Not the Right Choice
While our API is powerful for text generation, it may not be the right choice for every use case. If you need image, audio, or video generation, our service does not support these capabilities. The API is text-only, so you will need to use a different service for multimodal outputs. Similarly, if you require embeddings for vector search, our API does not provide this feature. You would need to integrate a separate embedding service.
OCR (Optical Character Recognition) is another capability that our API does not offer. If your application involves extracting text from images, you will need a dedicated OCR solution. Fine-tuning is also not available, so you cannot train a custom model on your specific data. If you need a model that adapts to your domain, you might need to look for a service that supports fine-tuning.
Model routing is not supported either. You cannot switch between different models or versions dynamically. If your application requires A/B testing of different models, our API may not be suitable. Additionally, if you need on-premises deployment for data privacy reasons, our hosted service might not meet your requirements. Consider these limitations when deciding if our API fits your project.
Finally, if you need real-time speech synthesis or translation, our text-only API may not be sufficient. These features require specialized models and infrastructure. By understanding these limitations, you can make an informed decision about whether our API is the best fit for your application. It is always better to choose a service that aligns with your specific needs.
Addressing Community Questions
Developers in online communities often ask about the best uncensored models for role-playing and creative writing. Many users seek models that can handle diverse topics without strict content filters. Our API serves an uncensored open-weight model that does not refuse lawful adult, fictional, or controversial topics. This makes it suitable for applications where creative freedom is prioritized.
Some users also look for unfiltered LLMs that are not specifically marketed as spicy or character-based. They want a model that tells the truth without being politically correct. Our API provides a general-purpose uncensored model that can be used for various types of content. It is not limited to role-playing but can be adapted for different use cases.
Questions about the best models for coding and technical tasks are also common. While our API is primarily text-based, it can be used for code generation and explanation. The uncensored nature of the model allows it to generate code without unnecessary restrictions. Users can experiment with different prompts to get the desired output for their coding projects.
When discussing these topics, it is important to note that other vendors may offer different models with varying features. For example, some services might provide image generation or fine-tuning. If you are comparing options, check the documentation of other vendors for current prices, limits, and features. Our API focuses on uncensored text generation, which is its core strength.
Best Practices for Integration
To ensure a smooth integration, follow best practices for handling API requests. Always use HTTPS to secure your communications. Store your API key securely and avoid exposing it in your code or logs. Use environment variables to manage sensitive information. This helps prevent accidental leaks and enhances the security of your application.
Implement error handling to manage potential issues. Our API returns specific error codes for different scenarios. A 401 error indicates an invalid key, a 402 error means no credit, and a 429 error signals a rate limit. Handle these errors appropriately by retrying requests or notifying the user. This improves the reliability of your integration.
Monitor your token usage to manage costs. Our API charges based on token consumption, so tracking usage is essential. You can use the streaming response to get usage information in the last chunk. This helps you stay within your budget and avoid unexpected charges. Set up alerts for high usage to proactively manage your credit.
Finally, test your integration thoroughly before deploying it to production. Use the trial credit to experiment with different parameters and scenarios. This helps you identify any issues early and optimize your integration. By following these best practices, you can build a reliable and efficient application using our uncensored LLM API.
Frequently asked questions
How do I authenticate with the API?
Include your API key in the Authorization header of your requests. You can get your key after signing up with Google or email.
What is the model ID to use?
The model ID is uncensored. This is the only model available for text generation.
Can I stream responses?
Yes, set the stream parameter to true to receive responses in chunks. Usage information is included in the last chunk.
What payment methods are accepted?
We accept USDT on TRC20 and USDC on Base. Credit cards and PayPal are not supported.