EN ▾
Create key

Compatible AIArticles

How to integrate an open router alternative

Open Router aggregates multiple models, but you often pay for that complexity when you just need one uncensored model via a standard endpoint. Switching to a direct OpenAI-compatible API simplifies your stack by removing routing logic and reducing latency. You keep your existing code, change one base URL, and get transparent per-token pricing without monthly subscriptions.

Last updated

Summary

  1. A drop-in replacement requires only updating the base URL and API key in your SDK.
  2. Pricing is transparent at $0.15 per 1M input tokens and $0.50 per 1M output tokens.
  3. No monthly subscriptions or hidden fees; credit is charged only for real token usage.
  4. Crypto-only top-ups offer bonus credit for larger deposits.

Why switch from Open Router?

Open Router is a powerful aggregator, but it introduces unnecessary abstraction when you only need one specific model. Routing logic adds latency and complexity to your request chain. You pay for the convenience of multiple models, even if you only use one. Direct APIs remove this middle layer, giving you lower latency and predictable costs. Your code stays simple because you are talking directly to the inference server.

Understanding the open router alternative

An OpenAI-compatible endpoint mimics the structure of the official OpenAI API. You send JSON payloads to /v1/chat/completions and receive standard JSON responses. This compatibility means you can swap providers without rewriting your application logic. The base_url changes, but the SDK methods remain identical. This approach is ideal for local-first stacks where you might switch between llama.cpp and vLLM later. You get a consistent interface regardless of the underlying hardware. No complex routing tables to manage. Just a direct line to the model.

Step 1: Obtain your API key

Start by creating an account on the provider's dashboard. You can sign up using your Google account or a simple email and password. No phone number is required, which keeps the process fast and private. Once registered, navigate to the "Get API key" page. The system generates a unique key immediately. Copy this key securely; it authenticates your requests. You only get one active key per account by default. If you lose it, generate a new one to replace it. This key is all you need to start sending requests.

Step 2: Configure the base URL

Locate the configuration section in your application. Find the variable that holds the API base URL. Update it to https://api.compatibleaiopen.com/v1. This URL points directly to the inference endpoint. Ensure you remove any trailing slashes if your SDK does not handle them automatically. This single change redirects all your chat completions to the uncensored model. Your existing code structure remains valid. The API expects standard OpenAI headers. No custom headers are required. This step is critical for ensuring your requests reach the correct server.

Step 3: Update your SDK client

Most modern LLM frameworks support OpenAI-compatible endpoints. Update the client initialization to use your new base URL and API key. Pass the model ID as uncensored. This ID tells the server which specific model to run. You do not need to change the method signatures. The SDK handles the serialization and deserialization of JSON. Streaming and non-streaming modes work exactly as documented. You can keep using familiar tools like LangChain or LlamaIndex. The transition is transparent to your application logic. This reduces testing time significantly.

Step 4: Test with chat completions

Send a simple test request to verify connectivity. Use the messages parameter with a user prompt. The response should contain a content field with the model's answer. Check that the model does not refuse the prompt due to content filters. The uncensored model is tuned for lawful adult and controversial topics. It answers directly without unnecessary hedging. Verify the token usage in the response object. This confirms that the API is processing your request correctly. You can now integrate this into your main workflow.

Step 5: Handle streaming responses

Streaming provides a better user experience for long responses. Enable the stream parameter in your request. The API returns chunks of data via Server-Sent Events (SSE). Each chunk contains a partial delta of the response. Concatenate these deltas to form the complete message. The final chunk includes the total token usage statistics. This allows you to display progress in real-time. Streaming reduces the perceived latency for users. It is essential for chat interfaces. Handle errors gracefully if the connection drops.

Step 6: Monitor token usage

Track your token consumption to manage costs effectively. The API charges $0.15 per 1M input tokens and $0.50 per 1M output tokens. These rates are transparent and apply to all requests. Errors and refusals do not consume credit. Your prepaid balance decreases only when tokens are processed. Monitor the usage field in every response. Set up alerts if your usage exceeds a threshold. This helps you avoid unexpected charges. The credit never expires, so you can top up when needed.

Step 7: Troubleshoot common errors

If you receive a 401 error, check your API key and base URL. A 429 error indicates you have exceeded the rate limit of 300 requests per minute. Ensure you are not sending more than 8 concurrent requests per key. If the response is empty, verify that the model ID is set to uncensored. Check the request body size; it must be under 8 MB. For streaming issues, ensure your client handles SSE correctly. Review the API documentation for specific error codes. Most issues are configuration-related and easy to fix.

Common questions

Is this an official OpenAI service?

No, this is an independent service that provides an OpenAI-compatible endpoint. It serves its own uncensored model, not GPT-4 or GPT-3.5. You can use it with any client that supports the OpenAI API format.

What is the context window size?

The model supports a context window of 100,000 tokens, including both the prompt and the completion. The maximum output per request is 16,000 tokens, or 2,048 tokens if you do not specify a limit.

Can I use this for NSFW content?

Yes, the model is uncensored and does not refuse lawful adult content. It is designed for unrestricted generation of fictional, security-research, or controversial topics. The only hard limit is on sexual content involving minors.

How do I pay for the API?

Payments are accepted via cryptocurrency only, specifically USDT on the TRC20 network or USDC on the Base network. You can top up with any whole amount between $20 and $500. Credit does not expire, and errors are free.

Get your API key in seconds

Register, retrieve your key, update the base URL. That is the complete configuration.

Create key