模型定價企業
500+ AI 模型 API,全部整合在一個 API 中。就在 CometAPI
模型 API
開發者
快速入門說明文件API 儀表板
公司
關於我們企業
資源
AI模型部落格更新日誌支援
服務條款隱私政策
© 2026 CometAPI · All rights reserved
Home/Models/Hunyuan/hunyuan-role
H

hunyuan-role

輸入:$0.44576/M
輸出:$0.89152/M
商業用途
概覽
功能
定價
API

Technical Specifications of hunyuan-role

ItemDetails
Model IDhunyuan-role
Provider familyTencent Hunyuan
Model typeRole-playing / character-style conversational language model
Release statusTencent Cloud announced hunyuan-role as a newly added dedicated role-playing model on July 4, 2024.
Primary capabilityChat generation optimized for role-play scenarios and character-driven dialogue.
Training orientationTencent states it is an officially fine-tuned Hunyuan role-playing model additionally trained on role-play scenario datasets.
API styleAvailable through Tencent Hunyuan’s OpenAI-compatible interface pattern for chat completions.
Typical endpoint pattern/v1/chat/completions on the Hunyuan API base URL.
Base URLhttps://api.hunyuan.cloud.tencent.com/v1 for OpenAI-compatible access.
AuthenticationBearer API key.
Request formatChat-style messages array with model set to hunyuan-role. This follows Tencent Hunyuan’s documented chat completions pattern.
Response modeSupports standard chat responses; Hunyuan chat APIs also support streaming via SSE on supported chat interfaces.
API ecosystemPart of the broader Tencent Hunyuan model platform, which includes text, translation, file-chat, embeddings, and image-related APIs.

What is hunyuan-role?

hunyuan-role is Tencent Hunyuan’s dedicated role-playing model, designed specifically for character-based conversation and scenario-driven dialogue. Tencent Cloud describes it as the latest role-play model in the Hunyuan family, officially fine-tuned and further trained on role-playing datasets so it performs better in role-play use cases than general-purpose models.

In practical terms, this means the model is intended for applications where the assistant must maintain persona consistency, speak in a character-appropriate tone, and respond naturally inside fictional, entertainment, companion, or interactive storytelling settings. That positioning is an inference from Tencent’s description of the model as a role-playing-specialized variant built on Hunyuan and optimized for role-play scenarios.

Because Tencent Hunyuan provides an OpenAI-compatible API layer, hunyuan-role can be integrated in the same general way as other chat-completion models: send a messages array to the chat completions endpoint and specify the model name as hunyuan-role.

Main features of hunyuan-role

  • Role-play specialization: hunyuan-role is positioned by Tencent as a dedicated role-playing model rather than a generic chat model, making it better suited for persona-heavy interactions.
  • Official Hunyuan fine-tuning: Tencent states the model is officially fine-tuned and additionally trained on role-playing scenario datasets, which should improve in-character response quality.
  • Character consistency: Its scenario-specific training suggests stronger persona retention across turns, which is especially valuable for AI companions, NPC dialogue, and interactive fiction workflows. This is an inference based on Tencent’s role-play optimization claim.
  • Chat-completions integration: The model fits into Tencent Hunyuan’s chat API workflow, so developers can use familiar message-based prompting patterns.
  • OpenAI-compatible access pattern: Tencent documents OpenAI-compatible usage for Hunyuan APIs, reducing migration effort for teams already using OpenAI-style SDKs and request payloads.
  • Multi-turn conversation support: Hunyuan’s chat interface supports multi-turn dialogue by passing prior messages in the conversation history, which is important for sustained role-play sessions.
  • Streaming-capable API family: Tencent’s chat API documentation notes support for streaming via SSE on supported chat interfaces, which can improve responsiveness in immersive conversational apps.

How to access and integrate hunyuan-role

Step 1: Sign Up for API Key

To access the hunyuan-role API, first sign up for an API key on CometAPI. After registering and creating your key, store it securely and use it in your application requests as a Bearer token.

Step 2: Send Requests to hunyuan-role API

Once you have your API key, send POST requests to the CometAPI chat completions endpoint and set model to hunyuan-role.

curl https://api.cometapi.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $COMETAPI_API_KEY" \
  -d '{
    "model": "hunyuan-role",
    "messages": [
      {
        "role": "system",
        "content": "You are a witty fantasy tavern keeper who always stays in character."
      },
      {
        "role": "user",
        "content": "Introduce your inn to a weary traveler."
      }
    ]
  }'

Step 3: Retrieve and Verify Results

The API will return a structured chat completion response containing the model’s generated message. Parse the output text from the first choice, evaluate whether the character voice and persona consistency match your use case, and iterate on your system prompt, conversation history, and safety controls as needed before deploying to production.

hunyuan-role 的定價

探索 hunyuan-role 的競爭性定價,專為滿足各種預算和使用需求而設計。我們靈活的方案確保您只需為實際使用量付費,讓您能夠隨著需求增長輕鬆擴展。了解 hunyuan-role 如何在保持成本可控的同時提升您的專案效果。
彗星價格 (USD / M Tokens)官方價格 (USD / M Tokens)折扣
輸入:$0.44576/M
輸出:$0.89152/M
輸入:$0.5572/M
輸出:$1.1144/M
-20%

hunyuan-role 的範例程式碼和 API

存取完整的範例程式碼和 API 資源,以簡化您的 hunyuan-role 整合流程。我們詳盡的文件提供逐步指引,協助您在專案中充分發揮 hunyuan-role 的潛力。