EN ▾
Get API key

Integrating Uncensored LLM API with OpenAI Clients

Many developers seek to replace restrictive moderation layers with an uncensored alternative without rewriting their entire codebase. This guide provides a practical checklist for connecting any OpenAI-compatible client to our uncensored endpoint using standard SDK settings.

Developer workspace with laptop and API network nodes

Understanding the Uncensored Model Approach

Developers often find that standard commercial models apply heavy safety filters to lawful but controversial topics. Our service offers a single uncensored open-weight text model identified by the ID uncensored. This model does not refuse requests involving adult, fictional, security-research, or controversial subjects, provided they do not involve sexual content with minors.

The primary advantage for developers is the ability to retain familiar client libraries while changing the backend behavior. You can send text in and receive text out without managing complex model routing or fine-tuning pipelines. The API is designed to be a drop-in replacement for existing OpenAI-compatible integrations.

When you switch to this endpoint, you are not getting a multi-modal service. There are no embeddings, image generation, audio processing, or OCR capabilities. The focus is strictly on text generation with a large context window of 100,000 tokens for both prompt and completion combined.

This approach allows you to test how your application handles unfiltered responses. You can adjust parameters like temperature and top_p to control creativity and randomness. The model responds to standard chat completion formats, making it easy to integrate into existing workflows.

Connecting via Standard OpenAI SDK

To integrate our API, you need to update the base URL in your OpenAI SDK configuration. The base URL for this service is https://api.glmapi.cc/v1. This allows you to use the same code structure you would use for other OpenAI-compatible services. You only need to change the endpoint URL and provide your API key.

Authentication is handled via a simple API key. You can sign up using Google or an email and password combination. Once registered, your key is shown immediately. This key is used for all requests to the /v1/chat/completions endpoint. If the key is invalid, you will receive a 401 error.

The SDK supports both synchronous and asynchronous requests. You can use the standard openai package in Python or the equivalent packages in other languages. The request format follows the standard OpenAI chat completion schema. You send a list of messages and receive a response in the same format.

Streaming is supported over Server-Sent Events (SSE). This allows you to receive tokens as they are generated, which is useful for real-time applications. The usage information is included in the last chunk of the stream. This feature works smoothly with standard SDK streaming implementations.

Pricing and Credit Management

Our pricing model is straightforward and based on actual token usage. You pay $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. There is no monthly subscription fee or flat rate. You only pay for the tokens you consume. Errors and refusals are free, so you do not pay for failed requests.

Prepaid credit is charged based on real token usage. The credit never expires, so you can use it whenever you need it. There is no need to worry about monthly renewals or unused credits expiring. This model is ideal for developers who want predictable costs without recurring bills.

To add credit, you can use cryptocurrency. We accept USDT on the TRC20 network or USDC on the Base network. You can top up any whole amount between $20 and $500. If you top up from $50, you receive a bonus credit ranging from 5% to 15%. This bonus is added to your account immediately.

When your credit runs out, you will receive a 402 error. You can then top up again to continue using the service. The system tracks your usage in real-time, so you always know how much credit you have left. This transparency helps you manage your budget effectively.

When This API Is Not the Right Choice

While our API is excellent for text generation, it is not a complete AI solution. If you need image generation, audio processing, or video creation, this service will not meet your needs. The model only handles text input and text output. There are no multimodal capabilities built into the endpoint.

If you require embeddings for vector search or semantic analysis, you will need a different service. Our API does not support embedding generation. Similarly, if you need OCR for scanning documents or fine-tuning models for specific tasks, this service does not offer those features.

Developers looking for a single endpoint that handles all AI tasks should consider other providers. Our service is specialized for high-volume, uncensored text generation. If you need a comprehensive AI platform with multiple modalities, this API is only one part of the solution.

Additionally, if you need strict SLA guarantees or enterprise certifications like SOC2 or HIPAA, this service may not be the best fit. We do not claim specific uptime percentages or certifications. The focus is on providing a reliable, uncensored text model with transparent pricing.

Addressing Community Questions on Moderation

Developers often discuss the need for uncensored models in online communities. Many users feel that standard providers apply too much moderation, ignoring challenging questions or controversial topics. They seek models that can handle a wider range of inputs without immediate refusal.

Threads on r/LocalLLM highlight the desire for models that are genuinely unrestricted. Users often look for models with specific keywords like uncensored, heretic, or aggressive in their names. They want to avoid alignment-based filtering that can limit the model's ability to respond to diverse prompts.

Some users report that clear system prompts can help achieve uncensored behavior even with standard models. However, others prefer a dedicated uncensored model to avoid the overhead of prompt engineering. Our API provides a dedicated model that does not require complex prompt adjustments to bypass filters.

The community also discusses the trade-offs between local and cloud models. Local models offer privacy but require significant hardware. Cloud models offer scalability but may have moderation layers. Our service offers a middle ground with a cloud-based uncensored model that is easy to integrate and scale.

Advanced Features: Tools and JSON Mode

Our API supports function calling, also known as tools. This allows the model to generate structured data that can be used to trigger actions in your application. You can define tools in your request, and the model will return the appropriate function calls. This is useful for building agents that can interact with external systems.

JSON mode is also supported, ensuring that the model returns valid JSON output. This is particularly useful for applications that require structured data. You can specify the format in your request, and the model will adhere to it. This reduces the need for post-processing to parse the response.

You can control the model's behavior using parameters like temperature, top_p, stop sequences, and seed. The temperature controls the randomness of the output, while top_p controls the diversity of the tokens. Stop sequences allow you to define specific strings that terminate the response.

The seed parameter allows you to reproduce results by setting a specific starting point. This is useful for testing and debugging. You can also set penalties to discourage certain tokens from appearing in the output. These parameters give you fine-grained control over the model's responses.

Troubleshooting Common Errors

When integrating the API, you may encounter several common errors. A 401 error indicates an invalid API key. This usually happens if the key is incorrect or has been revoked. You should check your key in the dashboard and ensure it is correctly copied into your SDK configuration.

A 402 error means you have no credit left. You will need to top up your account using cryptocurrency to continue using the service. The system does not allow requests without sufficient credit, so this error will block all subsequent requests until you add funds.

A 429 error indicates that you have exceeded the rate limit of 300 requests per minute per key. If you see this error, you should implement exponential backoff in your code to wait before retrying. This helps prevent overwhelming the server and ensures smooth operation.

Other errors may occur if the request format is incorrect. Ensure that you are using the correct endpoint and sending the required fields. The API is compatible with the standard OpenAI chat completion format, so most existing code should work with minimal changes. Always check the response body for detailed error messages.

Frequently asked questions

How do I get started with the uncensored API?

Sign up with Google or email to receive an API key immediately. You will get $0.50 of trial credit with no card required. You can then use the key to make requests to the /v1/chat/completions endpoint.

What models are available?

The service serves one uncensored open-weight text model. You send the model ID uncensored in your requests. There are no other models or variants available at this time.

Can I use streaming with this API?

Yes, the API supports streaming over Server-Sent Events (SSE). You can receive tokens as they are generated, and the usage information is included in the last chunk of the stream.

What happens if I exceed the rate limit?

If you exceed 300 requests per minute per key, you will receive a 429 error. You should implement exponential backoff in your code to wait before retrying the request.