EN ▾
Get API key

Troubleshooting Uncensored API Responses

Developers building local agents often worry about validation errors or unexpected model behavior when switching from standard to uncensored endpoints. This guide explains how to handle response formats, manage context limits, and verify API stability using our text-only service.

Holographic display showing text data flow into a neural network node with token counters

Understanding the Text-Only Constraint

When integrating an uncensored LLM API, it is important to understand that this service focuses exclusively on text generation. The model id is simply uncensored, and the API serves one open-weight text model. This means you will not find embeddings, image generation, audio processing, or video capabilities in the endpoint responses. If your agent requires multi-modal inputs, you must handle those separately before sending the text payload to our API.

The base URL for all requests is https://api.uncensoredstory.cc/v1. You will interact with three primary endpoints: POST /v1/chat/completions for standard chat flows, POST /v1/responses for newer response formats, and GET /v1/models to verify available configurations. There is no model routing or fine-tuning available, so every request goes to the same uncensored model. This simplicity reduces integration complexity but requires you to manage any non-text data in your own application layer.

Because the API is text-in, text-out, you should design your agent workflows to convert any multi-modal data into text before sending it to the endpoint. For example, if you are processing an image, use an external OCR or vision model to extract text, then send that text to our uncensored endpoint. This keeps your integration clean and ensures you are using the API exactly as intended without expecting hidden multi-modal features.

This constraint also means that error handling should focus on text parsing and token management rather than multimedia decoding. If a response fails, it is likely due to token limits or authentication issues, not missing image support. By keeping your expectations aligned with the text-only nature of the service, you can avoid common integration pitfalls and build more reliable agents.

Managing Context Window Limits

The context window for this uncensored LLM API is fixed at 100,000 tokens, which includes both the prompt and the completion. This is a generous limit for most agent use cases, but it requires careful management to avoid truncation or errors. When building long-running agents, you must track the total token count of your conversation history and the new input to ensure it stays within this 100,000 token boundary.

If you exceed the context window, the API may return an error or truncate the oldest parts of the conversation, depending on how the model handles overflow. To prevent this, implement a sliding window mechanism in your application that drops older messages when the total token count approaches the limit. This ensures that the most relevant context is always preserved for the model to generate accurate responses.

It is also important to note that the context window limit applies to the combined input and output. If you send a large prompt with many tools or system instructions, you have less room for the model's response. Plan your system prompts carefully to leave enough space for the model to generate comprehensive answers without hitting the token ceiling.

For agents that process large documents or long conversations, consider breaking down tasks into smaller chunks. Instead of sending a entire book to the API, process it in sections and aggregate the results. This approach keeps the token usage within the 100,000 limit and ensures consistent performance across all requests.

Handling Errors and Refusals

Our API returns specific error codes to help you debug integration issues. A 401 error indicates an invalid key, which means you should check your authentication header or regenerate your key if it has been compromised. A 402 error means you have no credit left, and you will need to top up your account with crypto to continue using the service. A 429 error signals that you have hit the rate limit of 300 requests per minute per key, so you should implement exponential backoff in your agent to avoid overwhelming the API.

One key benefit of this service is that errors and refusals are free. If the model refuses a request due to content policies or if the API returns an error, you are not charged for those tokens. This makes it safe to test your agent with various inputs without worrying about burning through your prepaid credit on failed requests. You only pay for successful completions that use tokens.

When troubleshooting, always check the response body for detailed error messages. The API provides clear feedback on why a request failed, whether it is a authentication issue, a rate limit problem, or a content refusal. Use this information to adjust your agent's behavior, such as retrying with a different prompt or waiting before sending more requests.

Remember that the hard content limit only applies to sexual content involving minors. Other controversial or adult topics are allowed, so if your agent is getting unexpected refusals, it might be due to the specific phrasing of your prompt rather than a broad censorship policy. Adjust your prompts to be more specific or less ambiguous to avoid unnecessary refusals.

Verifying API Stability and Validation

Developers often ask if there is a local LLM API spec validator to ensure that their endpoints work correctly. While there are tools available to validate OpenAI-compatible endpoints, it is important to verify that your integration works with our specific uncensored API. You can do this by sending a simple test request to the POST /v1/chat/completions endpoint and checking that the response format matches the expected structure.

If you are running a local agent, you can use tools like LiteLLM to proxy requests and validate the response format. This helps ensure that your agent can handle the responses from our uncensored API without errors. You can also check the GET /v1/models endpoint to confirm that the model id is correctly recognized and that the API is responding as expected.

When testing, focus on the response structure rather than the content quality. Ensure that the API returns the correct JSON format with the expected fields, such as the message content and the token usage. This validation step is important for building reliable agents that can handle various inputs without crashing or producing malformed output.

Additionally, you can test the streaming functionality by enabling SSE (Server-Sent Events) and verifying that the usage information is included in the last chunk. This ensures that your agent can properly track token usage and manage credits effectively. By validating these aspects, you can be confident that your integration is stable and ready for production use.

When This API Is Not the Right Choice

While our uncensored LLM API is excellent for text-based agents, it is not the right choice if you need multi-modal capabilities. If your application requires image generation, audio processing, or video creation, you will need to use a different service that supports those features. This API only handles text input and output, so any multi-modal tasks must be handled externally.

Similarly, if you need fine-tuning or model routing, this service may not meet your needs. The uncensored API serves a single open-weight text model with no option to route between different models or fine-tune the model for specific tasks. If you require these advanced features, consider using a more comprehensive AI platform that offers model management and customization options.

Another scenario where this API might not be ideal is if you need real-time audio or video streaming. Since the API is text-only, you will need to integrate a separate service for media processing. This adds complexity to your architecture but ensures that you are using the right tool for each part of your application.

Finally, if you are looking for a service with extensive SLA guarantees or certifications like SOC2 or HIPAA, this uncensored API may not be the best fit. The service focuses on providing a simple, uncensored text API without the overhead of enterprise-grade compliance. For most indie builders and developers, this trade-off is acceptable, but it is important to consider your specific requirements before integrating.

Integrating with Local Agents

Many developers are building local agents using models like Qwen or Llama and want to integrate them with an uncensored API. The key to successful integration is ensuring that your local agent can send and receive text data in the correct format. Our API uses the standard OpenAI-compatible chat completions format, which is widely supported by local agent frameworks.

When integrating, make sure to set the model id to uncensored in your request headers. This tells the API which model to use for the response. You can also configure parameters like temperature, top_p, and stop sequences to control the behavior of the model. These parameters allow you to fine-tune the output to match the style and tone of your local agent.

It is also important to handle the streaming response correctly. Our API supports streaming over SSE, which allows you to receive the response in chunks as it is generated. This is particularly useful for long responses or real-time applications where you want to display the output as it is being generated. Make sure your agent can handle the streaming data and update the UI accordingly.

Finally, test your integration with various inputs to ensure that the uncensored API handles different types of content correctly. Since the model is uncensored, it may produce more diverse and creative responses than standard models. This can be a feature or a bug depending on your use case, so it is important to monitor the output and adjust your prompts as needed to get the desired results.

Optimizing Token Usage and Costs

Understanding token usage is important for managing costs with our uncensored LLM API. The pricing is $0.15 per 1 million input tokens and $0.50 per 1 million output tokens. Since errors and refusals are free, you can experiment with different prompts without worrying about burning through your credit. However, successful completions will incur charges based on the token count.

To optimize costs, you should monitor the token usage of your agent and adjust your prompts to be more efficient. Use concise prompts and avoid unnecessary repetition to reduce the number of input tokens. Similarly, you can control the output length by setting appropriate stop sequences or maximum token limits in your requests. This helps ensure that you are not paying for excessive output tokens.

It is also important to keep track of your prepaid credit balance. Since the credit never expires, you can top up whenever you need more. The minimum top-up amount is $20, and you can use USDT on TRC20 or USDC on Base. There is no monthly fee or subscription, so you only pay for what you use. This pay-as-you-go model is ideal for developers who want to control their costs and avoid unexpected charges.

Finally, consider using the trial credit of $0.50 to test your integration before committing to a larger top-up. This allows you to verify that your agent works correctly with the uncensored API without spending any of your own money. Once you are confident in the integration, you can top up with the amount that suits your budget and usage patterns.

Frequently asked questions

How do I validate my local LLM API endpoint?

You can use tools like LiteLLM to proxy requests and validate the response format. Send a test request to the POST /v1/chat/completions endpoint and check that the response matches the expected JSON structure.

What happens if I exceed the context window?

If you exceed the 100,000 token limit, the API may return an error or truncate the oldest parts of the conversation. Implement a sliding window mechanism in your agent to drop older messages and stay within the limit.

Is this API suitable for image generation?

No, this API is text-only. If you need image generation, you must use an external service and send the resulting text to our uncensored endpoint. The API does not support multi-modal inputs or outputs.

How do I top up my credit?

You can top up with USDT on TRC20 or USDC on Base. The minimum amount is $20, and you can add up to $500 at a time. Credit never expires, and there are no monthly fees.