EN ▾
Uncensored LLM API, prepaid tokens, crypto onlyhttps://api.apipricing.cc/v1
Claim trial key

Integrating Uncensored LLM API with SDKs

Developers often seek uncensored text generation for creative writing, roleplay, or research. This guide explains how to configure OpenAI-compatible SDKs to connect with our service. You will learn the specific settings needed to handle streaming, tools, and context windows effectively.

Developer workspace with holographic text stream and data nodes for uncensored LLM API integration

Understanding the Base URL and Model ID

To begin integration, you must direct your SDK requests to the correct endpoint. Our service uses a standard OpenAI-compatible structure, which means you can use familiar libraries without rewriting your entire codebase. The base URL for our API is https://api.apipricing.cc/v1. This URL serves as the entry point for all chat completions and model interactions.

When initializing your client, you need to specify the model ID. For our uncensored open-weight model, the identifier is simply "uncensored". This tells the API which specific model instance to route your request to. Unlike other providers that might have multiple model versions, we offer this single, consistent model for all text-in, text-out operations.

It is important to note that we do not support embeddings, image generation, or audio processing. Our API is strictly for text completion. If your application requires multimodal capabilities, you will need to handle those separately. This focus allows us to maintain a simple and predictable interface for developers who only need text generation.

By using the standard OpenAI SDK, you can use existing code patterns. You set the base URL and model ID, and the rest of the configuration follows standard practices. This reduces the learning curve and allows you to deploy your uncensored LLM API quickly and efficiently.

Configuring Authentication and API Keys

Authentication for our API is straightforward and relies on a simple API key. You can generate a key immediately after signing up via Google or email. The key is displayed right after registration, so you can copy it directly into your environment variables or configuration files. This key is used to authenticate all subsequent requests to the API.

When making requests, you include the API key in the Authorization header. The format follows the standard Bearer token scheme. This ensures that your requests are securely authenticated and that your prepaid credits are correctly deducted. If the key is invalid, you will receive a 401 error, indicating that you need to check your credentials.

It is important to keep your API key secure. Since we charge by token usage, unauthorized use of your key will result in deductions from your prepaid balance. We recommend storing the key in a secure environment variable rather than hardcoding it in your source code. This practice helps prevent accidental exposure in version control systems.

Our API does not support OAuth flows or complex authentication mechanisms. The API key is the sole method of authentication. This simplicity makes it easy to integrate into various types of applications, from simple scripts to complex web services. Just ensure that your key is valid and has sufficient credit to avoid service interruptions.

Handling Streaming and Real-Time Responses

One of the key features of our API is support for streaming responses over Server-Sent Events (SSE). This allows you to receive text tokens as they are generated, providing a smoother user experience for applications like chat interfaces. Streaming is particularly useful for long-form content generation, where users prefer to see progress in real-time.

To enable streaming, you set the stream parameter to true in your request. The SDK will then emit events as each token is generated. You can listen for these events and update your UI accordingly. The final chunk of the stream includes usage information, such as the number of tokens consumed. This allows you to track costs accurately as the generation proceeds.

It is important to handle stream errors gracefully. Network interruptions or rate limits can cause the stream to fail. Your application should be prepared to retry or notify the user if the stream is interrupted. This ensures a reliable user experience even in less-than-ideal network conditions.

Streaming does not affect the model's behavior or the quality of the generated text. It simply changes how the output is delivered. You can still use all the standard parameters like temperature and top_p to control the generation process. The streaming feature is purely a delivery mechanism for the text output.

Implementing Function Calling and Tools

Our API supports function calling, also known as tools. This feature allows the model to generate structured data that can be used to trigger actions in your application. You define the available functions in your request, and the model will return a JSON object containing the function name and arguments.

To use function calling, you include the tools parameter in your request with the definitions of your functions. The model will then decide whether to call a function based on the context of the conversation. You can then execute the function and pass the result back to the model for further processing.

This feature is particularly useful for applications that need to interact with external systems or perform specific tasks. For example, you might use function calling to extract data from a conversation or to trigger a database query. The model handles the logic of deciding when to call the function, reducing the need for complex parsing logic in your code.

Function calling is supported in both streaming and non-streaming modes. You can choose the mode that best fits your application's needs. The model's ability to call functions is based on its training and the definitions you provide. It is important to define your functions clearly to ensure accurate and reliable results.

Managing Context Windows and Tokens

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 pass extensive amounts of information to the model, enabling more accurate and context-aware responses. It is particularly useful for applications that require long-term memory or extensive document analysis.

When sending requests, you need to ensure that your total token count does not exceed this limit. If the context window is full, the model may truncate earlier parts of the conversation or reject the request. It is important to monitor your token usage to avoid unexpected behavior.

Our API charges based on the number of tokens used. The price is $0.15 per million input tokens and $0.50 per million output tokens. You pay for the actual tokens used, including those in the context window. This means that larger context windows can result in higher costs, so it is important to optimize your prompts for efficiency.

Errors and refusals are free, which can help reduce costs in some scenarios. If a request fails due to a rate limit or invalid key, you are not charged for those tokens. This can be beneficial for testing and debugging your integration. Always check your usage logs to track your token consumption and costs.

When Our API Is Not the Right Choice

While our API is excellent for uncensored text generation, it may not be the right choice for all use cases. If you need multimodal capabilities such as image or audio generation, our service does not support these features. You would need to integrate with a different provider for those specific needs.

Similarly, if you require fine-tuning of the model to adapt it to your specific domain, our API does not offer this capability. Our model is a fixed open-weight model, and you cannot train it on your own data. If fine-tuning is critical for your application, you may need to consider other options.

Our API also does not support OCR or search functionalities. If your application requires extracting text from images or searching through a database, you will need to handle these tasks separately. This simplicity allows us to focus on providing high-quality text generation without the overhead of additional features.

Finally, if you need a service with a specific SLA or certification such as SOC2 or HIPAA, our API may not meet those requirements. We do not claim any specific uptime guarantees or certifications. If these are critical for your business, you should verify our capabilities against your needs before integrating.

Addressing Community Questions on Integration

Developers in communities like r/LocalLLM and r/AI_India often ask about the best models for roleplay and ERP. Our uncensored model is well-suited for these use cases, as it does not refuse lawful adult or controversial topics. Users appreciate the model's ability to handle creative and diverse scenarios without strict filtering.

Another common question involves the reliability of ultra-cheap API proxies. While some providers offer low-cost alternatives, our service provides a stable and predictable pricing model. You pay only for the tokens you use, with no hidden fees or subscriptions. This transparency helps developers budget their API usage more effectively.

Users also discuss the importance of avoiding data leaks when using third-party proxies. Our API is designed to be secure, with simple authentication and clear usage logs. However, it is always good practice to handle your API keys and sensitive data with care. This ensures that your integration remains secure and reliable.

Finally, developers often ask about the best practices for integrating uncensored LLM APIs. Our step-by-step guide and standard SDK compatibility make it easy to get started. By following best practices for authentication, streaming, and token management, you can build reliable applications that use the power of uncensored text generation.

Frequently asked questions

How do I set the base URL for our API?

Set the base URL to https://api.apipricing.cc/v1 in your SDK configuration. This URL is used for all chat completions and model interactions.

What is the model ID for the uncensored model?

The model ID is "uncensored". Use this identifier when initializing your client to ensure you are connecting to our uncensored open-weight model.

Does the API support function calling?

Yes, the API supports function calling. You can define tools in your request and the model will return JSON objects to trigger actions in your application.

How are tokens charged?

Tokens are charged at $0.15 per million input tokens and $0.50 per million output tokens. Errors and refusals are free, and credits are prepaid.