Tokenhub API Reference โ
Base URL: https://tokenhub-intl.tencentcloudmaas.comAuthentication: Tokenhub API Key / Bearer
This page covers the authentication, request methods, and result handling specifications required for image and video generation. Model-specific parameters and examples are available in the model documents below.
Call Specification โ
API Keys and Authentication โ
Issue a key under API Key Management in the Tokenhub console. Pass the same key in the Authorization header of every generation and query request.
Authorization: Bearer $TOKENHUB_API_KEY
Content-Type: application/jsonManage API keys as server-side environment variables. In the JSON body, pass only the fields defined in the model-specific documents.
Endpoints and Regions โ
All examples use the international gateway tokenhub-intl.tencentcloudmaas.com. Because the URL path varies by generation method, use the path given in the model-specific document. Do not pass a separate Region parameter.
The example reference files are stored in Singapore COS (ap-singapore). Download result files from the URL returned in the API response.
API List and Request Parameters โ
For the generation and query API and input fields of each model, see the documents in the engine catalog below. The task ID and result fields may differ from engine to engine.
Responses and Execution Flow โ
Synchronous Requests โ
Hy Image and Seedream Image return the result in the response to the generation request. The response fields and the image delivery format follow the response specification of each model.
Asynchronous Tasks โ
- Send the generation request and store the returned task ID.
- Check the status through the query path of that model.
- Once the status is complete, read the result URL and download the file.
The task ID field and the completion status differ by model. When handling query responses, distinguish between the values below.
| Model | Task ID in the generation response | Success status in the query response |
|---|---|---|
| WAND-Vega-Image | task_id | status=completed |
| WAND-Vega-Video | id | status=succeeded |
| Vidu Image | task_id | state=success |
| PixVerse Video | Resp.video_id | Resp.status=1 |
| Kling Video | data.id | data.status=succeeded |
| MiniMax Video | task_id | task.status=succeeded |
| Hy Video | task_id | status=succeeded |
The polling interval and failure statuses follow the query specification of each model. Once a generation request has been accepted, do not resubmit the same request โ query the result by task ID instead.
Errors and Call Limits โ
Error Handling โ
| HTTP status | What to check |
|---|---|
400 | Model ID, required fields, parameter format, and input limits |
401 | Whether the API key is valid, and the Authorization: Bearer header |
429 | Call frequency and usage quota |
5xx | Service error. If you already received an asynchronous task ID, query the task status first |
Use the request identifier and error code in the error response to diagnose the problem. For the error structure of each model, see the error code section of the corresponding document.
Request Examples โ
Use the request example for the model or protocol you are calling. Do not mix authentication methods and request fields from different paths in one request. Review the engine documents below together with the parameters for each protocol.
Results and Resource Management โ
Reference Files and Result Storage โ
Reference URLs must be reachable by the API server. File format, size, and count limits, as well as video duration limits, follow the input conditions of each model. Download and store signed result URLs within their validity period.
Engine Catalog and Related Documents โ
Image โ
| Model | Model ID | Call method |
|---|---|---|
| Hy | hy-image-v3.5-preview / hy-image-v3 | Synchronous |
| WAND-Vega-Image | wand-vega-image-pro / wand-vega-image-flash / wand-vega-image-lite | Asynchronous |
| Vidu | vidu-image-q2 | Asynchronous |
| Seedream | seedream-image-v5.0-pro / seedream-image-v5.0-lite | Synchronous |
Video โ
| Model | Model ID | Call method |
|---|---|---|
| WAND-Vega-Video | wand-vega-video-1.5-pro / wand-vega-video-1.0-pro / wand-vega-video-1.0-lite | Asynchronous |
| PixVerse | pixverse-video-v6.0 / pixverse-video-c1 | Asynchronous |
| Kling | kling-video-v3 / kling-video-v3-omni / kling-video-v3-turbo | Asynchronous |
| MiniMax | minimax-video-h3 / minimax-video-h3-max | Asynchronous |
| Hy | hy-video-v1.5 | Asynchronous |
Pricing and Official Guides โ
Tokenhub model pricing / API error codes
| Category | Official guide |
|---|---|
| Image | Overview / Vega / Hy / Vidu / Seedream |
| Video | Overview / PixVerse / Kling / MiniMax / Hy |