Skip to main content
AI tutorials

RouterHub API Tutorial: Explore Models, Get an API Key, and Migrate from OpenRouter

This tutorial introduces RouterHub through its documentation hub, showing how to browse the model catalogue, obtain an API key, review pricing and model variants, and follow the API quickstart or migration guide for implementation details.

RouterHub API Tutorial: Explore Models, Get an API Key, and Migrate from OpenRouter

What RouterHub Provides

RouterHub is presented as an alternative to OpenRouter, with a live model catalogue and an API access workflow. The repository acts as a documentation hub covering model discovery, API usage, migration, pricing, variants, use cases, safety, and troubleshooting.

The documentation is organized as a sequence of focused guides. You can read them from beginning to end, or jump directly to the topic that matches your task.

Choose the Right Starting Point

Set Up Access

  1. Open the RouterHub registration page and follow the onboarding flow to obtain an API key.
  2. Review the model catalogue documentation to identify the exact model ID and supported protocol for your application.
  3. If you are migrating an existing OpenRouter integration, consult the migration guide for the documented base URL, key handling, and model mapping.
  4. Use the API quickstart to construct and send the first request.

Keep your API key private. Store it in an environment variable or another secret-management system rather than placing it directly in source code.

Find the Correct Model

Model selection is an important part of the RouterHub workflow. The repository specifically provides a catalogue guide covering model families, model IDs, and protocols. Use that guide together with the live model catalogue instead of guessing an identifier.

A practical selection process looks like this:

  1. Define the task, such as coding, agent workflows, research, or writing.
  2. Browse the available model family and variant information.
  3. Copy the exact model ID shown in the catalogue.
  4. Confirm that the model's protocol matches the client or integration you plan to use.
  5. Check the pricing documentation before sending production traffic.

Make a First API Request

The repository directs users to the API quickstart for the first request. Because the exact endpoint and request format are maintained in that guide, use its current values rather than hard-coding an endpoint from a secondary example.

Your request setup will generally require the following documented values:

API key: <your RouterHub API key>
Base URL: <value from the RouterHub API quickstart>
Model ID: <exact ID from the model catalogue>
Protocol: <protocol supported by the selected model>

For a concrete implementation, open API quickstart, copy its request example, set the API key securely, and replace the model value with the exact ID selected from the catalogue.

Migrate an Existing OpenRouter Integration

If your application already uses OpenRouter, follow the repository's Migration guide. The README identifies three migration concerns: changing the base URL, using a RouterHub API key, and mapping model identifiers.

Use this checklist before testing:

  • Update the provider base URL according to the migration documentation.
  • Replace the existing credential with the RouterHub API key.
  • Review each model name and map it to the exact RouterHub model ID.
  • Confirm the protocol expected by the selected model.
  • Send a small test request before moving the integration to production.

For broader context on the reasons to switch, read Why switch, which covers the documentation's topics of prepaid billing, model IDs, and uncensored options.

Review Pricing and Variants

Pricing

The Pricing guide explains per-token examples. Use it to estimate the cost of your intended workload and compare models before scaling requests.

Uncensored and Abliterated Models

The Uncensored and abliterated guide is intended for comparing these variants. Read the repository's Safety guide as well, and use any model lawfully and responsibly.

Explore Practical Use Cases

After the first request works, the Use cases guide covers coding, agents, research, and writing. Use these examples as a way to match a model family and protocol to the kind of application you are building.

For operational questions, consult the Troubleshooting guide. It specifically addresses authentication, model IDs, and protocols. The FAQ provides longer-form answers, while the Glossary explains the terminology used throughout the documentation.

Advanced Tips

  • Prefer exact IDs: Copy model identifiers from the catalogue to avoid failures caused by naming differences.
  • Check protocols early: Validate protocol compatibility before debugging application code.
  • Separate configuration from code: Keep the API key, base URL, and model ID configurable so migration and testing are easier.
  • Estimate costs first: Use the per-token pricing examples before running large workloads.
  • Use the documentation paths: Choose the migration, quickstart, pricing, or troubleshooting guide instead of treating every integration issue as a general API problem.
  • Apply safety review: When evaluating uncensored or abliterated variants, read the safety guidance and restrict usage to lawful purposes.

Conclusion

The RouterHub repository is a structured starting point for evaluating an OpenRouter alternative and integrating with its API. Begin by obtaining an API key, select an exact model ID from the catalogue, verify the protocol, and follow the API quickstart. If you are migrating an existing application, use the dedicated migration guide, then validate pricing, variants, safety, and troubleshooting considerations before deployment.