Skip to main content
AI tutorials

How to Access Frontier and Uncensored AI Models with RouterHub

Learn how to configure RouterHub, select a current model, and send requests with the OpenAI SDK, Anthropic SDK, or cURL. This tutorial also covers compatible tools, billing, model evaluation, prompt caching, project isolation, and responsible deployment.

How to Access Frontier and Uncensored AI Models with RouterHub

What RouterHub Does

RouterHub is an AI API gateway that provides access to Claude, GPT, Gemini, Grok, DeepSeek, GLM, and Qwen model families through one account, balance, and API key. It supports OpenAI- and Anthropic-compatible interfaces, allowing many existing applications to switch providers by changing their API key, base URL, and model ID.

The catalog includes standard frontier models alongside select uncensored and abliterated variants when available. An uncensored model is a variant designed to refuse fewer requests than a standard release. The model is the engine, while the API is the connection your application uses to reach it.

Important: Reduced refusal behavior is not a guarantee that a model will answer every request. Behavior varies by model, version, prompt, and provider policy. You remain responsible for lawful and ethical use, appropriate guardrails, and human review.

Key Features

  • One account across model families: Use Claude, GPT, Gemini, Grok, DeepSeek, GLM, and Qwen without maintaining a separate integration for each family.
  • OpenAI compatibility: Connect the OpenAI SDK and applications that accept a custom base_url.
  • Anthropic compatibility: Use the Anthropic SDK and Anthropic-style clients such as Claude Code.
  • Select uncensored options: Evaluate uncensored and abliterated variants alongside standard models where available.
  • Usage-based billing: Pay per token without a monthly subscription or seat fee.
  • Prompt caching: Repeated prompt prefixes can be charged at a lower cached-input rate.
  • Project isolation: Create separate API keys to divide projects and monitor usage.
  • Flexible top-ups: Add prepaid credit by card or cryptocurrency.

Choose a Model Family

Your choice should reflect the workload rather than the family name alone. RouterHub lists live model IDs, context limits, prices, and availability in its dashboard.

  • Claude: Long-form reasoning, writing, and coding agents.
  • GPT: General assistants, tool use, and structured output.
  • Gemini: Multimodal workflows, research, and long-context tasks.
  • Grok: Ideation and real-time-style answers.
  • DeepSeek: Coding, reasoning, and cost-efficient agents.
  • GLM: Agent workflows, coding, and bilingual tasks.
  • Qwen: Long-document reading and agent workflows.

Model availability changes as providers publish new versions. Always copy a current model ID from the RouterHub dashboard instead of assuming that an older ID is still active.

Installation and Setup

1. Create an account and API key

Register through the RouterHub onboarding page. The generated API key begins with sk-. The dashboard overview also displays the exact base URL required by your selected interface.

2. Store the credentials as environment variables

Avoid placing credentials directly in source files. Export the key and the OpenAI-compatible base URL in your shell:

export ROUTERHUB_API_KEY="sk-..."
export ROUTERHUB_BASE_URL="https://.../v1"

Copy the actual URL from the dashboard. For Anthropic clients, use the Anthropic-compatible base URL shown there rather than assuming it is identical to the OpenAI-compatible URL.

3. Install the SDK needed by your application

For the OpenAI-compatible Python example, install the OpenAI SDK:

python -m pip install openai

For the Anthropic-compatible example, install the Anthropic SDK:

python -m pip install anthropic

You only need the SDK used by your project. A direct cURL request does not require either Python package.

Basic Usage with the OpenAI SDK

Create an OpenAI client, supply the RouterHub credentials, and replace MODEL_ID with a current ID from the dashboard:

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["ROUTERHUB_API_KEY"],
    base_url=os.environ["ROUTERHUB_BASE_URL"],
)

response = client.chat.completions.create(
    model="MODEL_ID",
    messages=[
        {
            "role": "system",
            "content": "You are a precise, helpful assistant."
        },
        {
            "role": "user",
            "content": "Explain the trade-offs of model routing in two paragraphs."
        },
    ],
)

print(response.choices[0].message.content)

The model field controls which available model handles the request. The system message defines the assistant's general behavior, and the user message contains the task.

Basic Usage with the Anthropic SDK

Use the Anthropic-compatible endpoint from the dashboard when working with the Anthropic SDK:

import os
from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ["ROUTERHUB_API_KEY"],
    base_url=os.environ["ROUTERHUB_BASE_URL"],
)

message = client.messages.create(
    model="MODEL_ID",
    max_tokens=1024,
    messages=[
        {
            "role": "user",
            "content": "Write a concise release note for a developer tool."
        }
    ],
)

print(message.content[0].text)

The Anthropic request uses the Messages API shape and sets max_tokens to limit the generated response. Confirm that your environment variable contains the Anthropic-compatible URL before running this example.

Test the API with cURL

A direct HTTP request is useful for checking credentials and model availability before adding an SDK to a larger application:

curl "$ROUTERHUB_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $ROUTERHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL_ID",
    "messages": [
      {
        "role": "user",
        "content": "Hello from the RouterHub quickstart."
      }
    ]
  }'

If the request fails, verify the API key, base URL, endpoint path, and current model ID. Availability and identifiers can change after upstream model updates.

Connect Existing Developer Tools

RouterHub can work with clients that allow a custom OpenAI- or Anthropic-compatible provider:

  • Claude Code: Point its Anthropic base URL configuration to RouterHub.
  • Cursor: Add RouterHub as a custom OpenAI-compatible provider.
  • Codex CLI: Configure an OpenAI-compatible provider profile.
  • OpenCode: Set a custom provider and a valid model ID.
  • LangChain and LlamaIndex: Use their OpenAI-compatible adapters.
  • Other compatible applications: Replace the base URL and API key, then select a supported model ID.

Follow the repository's client-specific documentation when a tool requires additional environment variables or provider settings.

Advanced Tips

Compare models with a repeatable test set

Do not evaluate a model from one prompt. Build a small test set representing your real tasks, then send the same prompts to several model families. Compare answer quality, refusal behavior, latency, consistency, and token cost before choosing a production model.

Re-test exact model versions

Behavior is version-dependent. A prompt that works with one release may produce different results after an upstream update. Record the model ID used in each evaluation and repeat critical tests whenever you change models or versions.

Use separate API keys

Create different keys for development, testing, production, or individual clients. This isolates projects and makes usage easier to monitor from the shared dashboard. Never commit keys to a repository or expose them in browser code.

Design prompts for caching

Prompt caching can reduce the billed cost of repeated input prefixes. Keep stable instructions or shared context at the beginning of requests when that structure fits your application, while placing changing user content later.

Confirm live pricing and limits

RouterHub uses pay-per-token billing and does not require a subscription. However, provider rates, model availability, and limits can change. Check the dashboard before estimating production costs or depending on a particular model.

Keep application-level safeguards

Uncensored and abliterated variants reduce refusals but do not remove the need for validation. Add guardrails appropriate to your use case, review sensitive outputs, follow provider terms, and comply with applicable laws. This is especially important for autonomous agents and public-facing assistants.

Practical Use Cases

  • Compare policy behavior across versions for AI safety and red-team research.
  • Build creative-writing workflows with fewer mid-scene refusals and a separate editorial review process.
  • Route coding tasks across Claude, GPT, DeepSeek, and GLM from compatible coding clients.
  • Test multilingual prompts across several model families without rebuilding the integration.
  • Create long-context summarization and document-analysis workflows.
  • Power chatbot and assistant backends while centralizing keys, billing, and usage.

Conclusion

RouterHub provides a compatible gateway for testing and using multiple frontier model families through one account. Start by obtaining a key, copying the correct base URL and current model ID, and running a simple SDK or cURL request. Before production deployment, compare models systematically, isolate project keys, verify current pricing, and retain appropriate safety controls and human oversight.