Integrating Gemma Uncensored API with SDKs
Developers often ask how to connect standard SDKs to our specific uncensored endpoint. This guide walks you through the configuration steps, from setting up authentication headers to handling streaming responses. We focus on the core text-in, text-out functionality that our API provides.

Setting Up the Base URL and Model
Integrating with our API begins with pointing your SDK to the correct base URL. Unlike standard OpenAI endpoints, our service resides at a distinct domain. You must update your client configuration to use https://api.gemmauncensored.cc/v1 as the base URL. This ensures that all requests are routed to our uncensored model infrastructure rather than the default provider.
Once the base URL is set, you need to specify the model identifier. Our API serves a single uncensored open-weight text model. You should set the model parameter to uncensored in your requests. This tells the server which specific model to invoke for your text generation tasks. Using any other model ID may result in errors or unexpected behavior.
It is important to note that this API is designed specifically for text generation. It does not support image, audio, or video generation. If your application requires multimodal capabilities, you may need to combine this text API with other services. However, for pure text-based interactions, this configuration is sufficient and reliable.
Always verify your base URL and model ID before making live requests. A misconfigured endpoint can lead to connection errors or silent failures. Double-check these settings in your SDK initialization code to ensure a smooth integration process.
Authentication and API Keys
Authentication for our API is straightforward and relies on API keys. You can sign up using Google or an email and password combination. Upon signup, your API key is displayed immediately, allowing you to start using the service without delay. This key is essential for authenticating your requests and tracking your usage.
When making requests, you must include your API key in the authorization header. Most OpenAI-compatible SDKs support this standard header format. Ensure that your key is kept secure and is not exposed in public repositories. The key is shown immediately after signup, so copy it to a secure location right away.
If your key is invalid or missing, the API will return a 401 error. This indicates that the key is either incorrect or has not been provided. Check your configuration to ensure the key is correctly formatted and included in every request. A valid key is required to access the uncensored model and generate text.
Remember that your API key is tied to your account and prepaid credit. If you run out of credit, you will receive a 402 error. You can top up your credit using crypto, but the key itself remains valid for authentication. Keep your key secure to prevent unauthorized usage of your account.
Handling Streaming and JSON Mode
Our API supports streaming responses over Server-Sent Events (SSE). This allows you to receive text chunks as they are generated, providing a smoother user experience for chat applications. You can enable streaming in your SDK by setting the appropriate flag. The usage information is included in the last chunk of the stream, allowing you to track token consumption in real-time.
In addition to streaming, the API supports JSON mode. This is useful for applications that require structured output from the model. You can enforce JSON mode in your requests to ensure that the model returns valid JSON data. This feature is particularly helpful for building tools that parse model output programmatically.
Function calling is also supported, allowing you to define tools that the model can invoke. This enables more complex interactions where the model can trigger specific actions based on the conversation. You can define tools in your request and receive tool calls in the response, enabling a wide range of application architectures.
When using streaming or JSON mode, ensure that your SDK is configured to handle these features correctly. Test your integration thoroughly to ensure that streams are received and parsed accurately. Proper handling of these features is essential for building reliable and responsive applications.
Parameters and Configuration Options
Our API supports a variety of parameters to customize the behavior of the model. You can adjust the temperature, top_p, stop sequences, and seed to control the randomness and output of the model. These parameters allow you to fine-tune the model's responses to better fit your application's needs.
The temperature parameter controls the randomness of the output. A higher temperature results in more diverse and creative responses, while a lower temperature produces more focused and deterministic outputs. You can experiment with different temperature values to find the right balance for your use case.
Top_p and stop sequences allow you to control the diversity of the output and define stopping conditions. The seed parameter enables reproducibility by setting a random seed for the model. These parameters give you precise control over the generation process, allowing you to optimize the model's performance for specific tasks.
Penalties are also supported, allowing you to discourage certain tokens or patterns in the output. This can be useful for preventing repetitive or unwanted content in the generated text. Experiment with these parameters to achieve the desired behavior for your application.
Pricing and Credit Management
Our API uses a prepaid credit system based on real token usage. There is no monthly subscription or fee, and your credit never expires. You are charged $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. Errors and refusals are free, so you only pay for successful generations.
You can top up your credit using cryptocurrency, specifically 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 credit ranging from 5% to 15%. This bonus credit provides additional value for larger purchases.
New accounts receive $0.50 of trial credit, allowing you to test the API without any initial investment. This trial credit is a great way to explore the API's capabilities and ensure it meets your needs before committing to a larger purchase. You can start using the API immediately after signing up.
Keep track of your token usage to manage your budget effectively. You can monitor your usage through the API responses, which include token counts. This allows you to predict costs and avoid unexpected charges. Regularly check your balance to ensure you have sufficient credit for your applications.
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 project. If your application requires image, audio, or video generation, our API will not suffice. We focus solely on text-in, text-out functionality, so you may need to combine our API with other services for multimodal applications.
Additionally, if you need fine-tuning capabilities, our API does not currently support it. You can use our API for inference, but you will need to handle fine-tuning separately. This is an important consideration if you need to customize the model's behavior for specific domains or tasks.
Model routing is also not supported. Our API serves a single uncensored model, so you cannot switch between different models dynamically. If you need to route requests to multiple models based on specific criteria, you may need to build that logic into your application.
Finally, if you require embeddings or OCR capabilities, our API does not provide these features. You may need to use additional tools or services to handle these tasks. Consider your application's requirements carefully to ensure that our API meets your needs.
Testing and Troubleshooting Checklist
To ensure a reliable integration, follow this tested checklist. First, verify that your base URL and model ID are correct. Next, confirm that your API key is valid and included in the authorization header. Then, test a basic text generation request to ensure the API responds correctly.
Check that streaming and JSON mode are working as expected. Send a request with streaming enabled and verify that you receive chunks of text. Similarly, test JSON mode to ensure that the output is valid JSON. These tests help identify any configuration issues early in the development process.
Monitor your token usage and credit balance to avoid unexpected charges. Ensure that you have sufficient credit for your tests. If you encounter errors, check the error codes: 401 for invalid keys, 402 for no credit, and 429 for rate limits. These codes help you diagnose and resolve issues quickly.
Finally, review your application's error handling and logging. Ensure that you capture and log errors from the API to facilitate debugging. A reliable error handling strategy is essential for maintaining a reliable integration. Regularly test your integration to ensure it continues to function correctly as your application evolves.
Frequently asked questions
How do I authenticate with the Gemma Uncensored API?
You authenticate by including your API key in the authorization header of your requests. You can obtain your key immediately after signing up with Google or email.
What is the pricing for the API?
The API charges $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. Errors and refusals are free, and credit never expires.
Can I use streaming with this API?
Yes, the API supports streaming over Server-Sent Events (SSE). You can enable streaming in your SDK to receive text chunks as they are generated.
What happens if I run out of credit?
If you run out of credit, you will receive a 402 error. You can top up your credit using USDT on TRC20 or USDC on Base, with amounts between $20 and $500.