EN ▾

Uncensored API. Prepaid. No nonsense.

Get your key

Integrating an Uncensored Text API: A Developer Checklist

Connecting to an uncensored text API requires careful attention to authentication and request structure. This guide provides a tested checklist for developers to integrate our service, ensuring smooth text-in, text-out workflows without unnecessary complexity.

Developer desk with glowing screen showing code and chat interface, surrounded by token symbols

Understanding the API Endpoint

The primary endpoint for interacting with our uncensored text API is POST /v1/chat/completions. This endpoint accepts text input and returns text output, making it ideal for standard conversational AI tasks. When you send a request, you must include the model identifier uncensored to ensure the correct model processes your input. The base URL for all requests is https://api.hereticllmmodels.com/v1, which simplifies integration by providing a consistent entry point for all API calls.

It is important to note that this API serves only text-based interactions. Unlike some other services, it does not support embeddings, image generation, audio processing, or video creation. Therefore, if your application requires multi-modal capabilities, you may need to combine this API with other tools. However, for pure text generation, this endpoint provides a straightforward and efficient solution.

The API follows a standard OpenAI-compatible format, which means you can use familiar SDKs and libraries to interact with it. This compatibility reduces the learning curve for developers who have previously worked with similar APIs. You can send requests using standard HTTP methods and receive responses in JSON format, making it easy to parse and utilize the generated text in your application.

When integrating this API, ensure that your requests include the necessary parameters such as temperature, top_p, and stop sequences. These parameters allow you to control the creativity and format of the output. By understanding the endpoint structure and available parameters, you can tailor the API's behavior to meet your specific application needs.

Authentication and Key Management

Authentication is a critical step in integrating the API. You must include your API key in the Authorization header of each request. The key is generated immediately after signup, whether you choose to continue with Google or use an email and password combination. This immediate availability allows you to start testing and integrating the API without delay.

Keep your API key secure, as it grants access to your prepaid credit. If you lose your key, you may need to generate a new one, which could affect your workflow. The API returns a 401 error if an invalid key is provided, so ensure that your key is correctly formatted and included in every request. Regularly rotating your keys can also enhance security, although this is not a strict requirement.

The API does not require a subscription or monthly fee, which simplifies cost management. You pay only for the tokens used, with prepaid credit that never expires. This model is particularly beneficial for developers who want to avoid recurring charges and only pay for actual usage. Errors and refusals are free, so you can experiment with different parameters without worrying about unexpected costs.

When managing your API key, consider using environment variables or secure storage solutions to prevent accidental exposure. This is especially important if you are sharing your code with others or deploying it to a public repository. By keeping your key secure, you protect your prepaid credit and ensure that only authorized requests are processed by the API.

Request Formatting and Parameters

Formatting your requests correctly is essential for successful integration. The API accepts JSON payloads that include the model identifier, messages, and various parameters. The messages field should contain an array of message objects, each with a role and content. This structure allows you to simulate conversational turns, which is useful for chat applications.

You can control the output using parameters such as temperature, which affects the randomness of the response, and top_p, which controls the diversity of the output. Additionally, you can specify stop sequences to halt generation at specific points, and set a seed for reproducible results. These parameters give you fine-grained control over the API's behavior, allowing you to tailor the output to your needs.

The API also supports function calling, which allows you to define tools that the model can use to perform specific actions. This feature is particularly useful for applications that require the API to interact with external systems or perform complex tasks. By defining functions and passing them in the request, you can enable the model to execute these functions and return the results.

When formatting your requests, ensure that you adhere to the API's schema and include all required fields. Missing or incorrectly formatted fields can result in errors, so it is important to validate your requests before sending them. By following these guidelines, you can ensure that your API calls are processed efficiently and return the expected results.

Streaming and Real-Time Updates

For applications that require real-time updates, the API supports streaming over Server-Sent Events (SSE). This feature allows you to receive the generated text incrementally, rather than waiting for the entire response to be completed. Streaming is particularly useful for chat applications, where users expect immediate feedback as the model generates text.

When using streaming, the API sends usage information in the last chunk of the response. This allows you to track token consumption in real-time, which is helpful for monitoring costs and ensuring that you stay within your prepaid credit limits. By parsing the streaming responses, you can display the text to users as it is generated, creating a more engaging and responsive experience.

To implement streaming, you need to handle the SSE events in your application. This typically involves setting up an event listener that processes each chunk of text as it arrives. You can then append the text to a display area or process it further as needed. Streaming requires careful handling of the response stream, but it provides a significant improvement in user experience for real-time applications.

When using streaming, be aware that the API may have rate limits, such as 300 requests per minute per key. Ensure that your application can handle these limits and implement backoff strategies if necessary. By using streaming, you can create more dynamic and interactive applications that respond quickly to user input.

Token Budgeting and Cost Management

Understanding token usage is important for managing costs with the API. The API charges $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. By monitoring token usage, you can estimate your costs and ensure that you have sufficient prepaid credit. The API provides usage information in the response, allowing you to track how many tokens are consumed by each request.

To budget effectively, calculate the expected token usage for your application. This involves estimating the length of input and output texts and multiplying by the respective per-million prices. For example, if you expect to process 1 million input tokens and 500,000 output tokens, you can estimate the cost using the formula (tokens divided by 1,000,000 times the per-million price). This helps you plan your prepaid credit purchases and avoid unexpected shortfalls.

The API does not charge for errors and refusals, which can help reduce costs. If a request fails or is refused, you are not billed for the tokens used in that request. This feature allows you to experiment with different parameters and configurations without worrying about incurring costs for failed requests. By monitoring token usage and using the free error handling, you can optimize your API usage and minimize expenses.

Regularly review your token usage and adjust your prepaid credit purchases accordingly. The API allows you to top up with crypto, specifically USDT on TRC20 or USDC on Base, in amounts ranging from $20 to $500. By keeping a close eye on your usage, you can ensure that you always have sufficient credit to support your application's needs.

When This API Is Not the Right Choice

While the API is excellent for text-based tasks, it may not be the right choice for applications that require multi-modal capabilities. If your application needs to process images, audio, or video, this API alone will not suffice. You would need to combine it with other tools or services that specialize in those areas. For example, if you are building an application that generates images from text descriptions, you might need to use this API for the text generation and another service for the image generation.

Additionally, if you require advanced features such as fine-tuning or model routing, this API may not meet your needs. The API serves a single uncensored open-weight text model, so you cannot fine-tune it or route requests to different models. If your application requires these features, you may need to consider other providers that offer more flexible model options.

Furthermore, if you need strict SLA guarantees or certifications such as SOC2 or HIPAA, this API may not be the best fit. The API does not claim these certifications, so if your application has specific compliance requirements, you should verify that this API meets those needs. By understanding the limitations of the API, you can determine whether it is the right tool for your specific use case.

Finally, if you are looking for a free unlimited tier, this API may not be suitable. The API requires prepaid credit, and while it offers a trial credit for new accounts, it does not have a free unlimited tier. If cost is a primary concern and you need a completely free option, you may need to explore other providers. By evaluating these factors, you can decide whether this API aligns with your application's requirements.

Addressing Common Developer Questions

Developers often ask about the best uncensored models for specific hardware configurations, such as 12GB or 16GB VRAM. While this API serves a single uncensored model, you can still use its capabilities by integrating it with local models or other tools. For instance, if you are running a local model with limited VRAM, you can use this API for more complex text generation tasks that require a larger context window or more advanced processing.

Another common question is how to handle consistent character generation in applications. While this API does not have built-in character consistency features, you can achieve this by using techniques such as training a LoRA or using specific prompts. By combining this API with other tools, you can create applications that maintain character consistency across multiple interactions.

Developers also inquire about the best uncensored models for local deployment. While this API is hosted, you can still use it in conjunction with local models to enhance your application's capabilities. For example, you can use a local model for initial text generation and this API for refinement or additional processing. This hybrid approach allows you to use the strengths of both local and hosted models.

Finally, developers often ask about the best uncensored models for specific use cases, such as chatbot definitions or site-provided chat services. While this API is not specifically designed for these purposes, it can still be used effectively by integrating it with other tools. By understanding how to combine this API with other solutions, you can create reliable and versatile applications that meet your specific needs.

Frequently asked questions

How do I authenticate with the API?

Include your API key in the Authorization header of each request. The key is generated immediately after signup and is required for all API calls.

What is the cost per token?

The API charges $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. Prepaid credit is charged by real token usage.

Can I stream responses in real-time?

Yes, the API supports streaming over Server-Sent Events (SSE). You can receive generated text incrementally, which is useful for chat applications.

What happens if I run out of credit?

The API returns a 402 error if you have no credit. You can top up with crypto, specifically USDT on TRC20 or USDC on Base, in amounts ranging from $20 to $500.