Introduction to TokenHub
Understand TokenHub model routing, supported protocols, console modules, and operating principles.
TokenHub is an AI model routing service. It provides one API endpoint, one credential model, and several compatible protocols so an application can call multiple models without maintaining a separate integration for each provider.
What TokenHub does
TokenHub accepts a request, selects the configured model route, forwards the request to the upstream provider, and returns a compatible response. You can switch models by changing the model ID while keeping the same endpoint and authentication method.
Supported protocols
| Protocol | Endpoint | Best for |
|---|---|---|
| OpenAI Chat Completions | /v1/chat/completions | General chat, tools, and JSON response formats. |
| OpenAI Responses | /v1/responses | GPT-series models that use the Responses API. |
| Anthropic Messages | /v1/messages | Claude models and Claude-compatible agent tools. |
| Gemini native | /v1beta/models/{model}:generateContent | Gemini-compatible SDKs and tools. |
| Image generation | /v1/images/generations | Text-to-image and image editing workflows. |
| Video tasks | Model-specific task paths | Asynchronous image-to-video and text-to-video generation. |
Always call GET /v1/models before adding a new model ID to production code. Model availability and model IDs can change.
Console modules
- Overview: balance, current consumption, cumulative consumption, and usage trends.
- Model marketplace: model list, model capability, and pricing information.
- API keys: create keys and control the scope of each key.
- Model monitoring: request volume, latency, success rate, and upstream health.
- Task center: status and results for asynchronous generation tasks.
- Usage logs: query requests by time, model, and result.
Operating principles
Use one stable integration layer and keep model selection in configuration. For production traffic, record the request ID and usage from each response, add timeouts, and retry only idempotent read operations automatically. Generative operations can consume resources even when the result is not suitable for your business, so validate inputs before sending them.
Send your first TokenHub request · Use the TokenHub console · Call models and check usage
Last updated on