Hunyuan Hy4

Tencent's Hunyuan Hy4 reasoning model for agents, coding and long documents: text and image input and a 1M-token context.

Hunyuan Hy4 (Tencent) is Tencent's Hy4, the release of Hunyuan Hy4 Preview, a reasoning model for agents, coding and long documents. Send a prompt, or a chat history in messages, and get a text answer; images go in messages as image_url parts. Through the OpenAI-compatible Chat Completions endpoint it also calls your function tools and takes their results back.

Function tools work through the OpenAI-compatible Chat Completions endpoint; leave tool_choice at auto, since a named or a required one finds no endpoint. Set reasoning_effort to none, low or high (high when you send none); system_prompt and max_tokens work as usual. Set private_mode to true to keep the prompt and the answer out of FlyMyAI storage and logs (synchronous calls only).

Price per 1M tokens: $0.834 input, $0.042 cached input, $2.501 output. Reasoning counts as output. It answers in text only: use the image, video and audio models to create media.

Price: $0.834 per 1M input tokens, $2.501 per 1M output tokens, cached input $0.042 per 1M.

Run Hunyuan Hy4 via API

curl -X POST https://api.flymy.ai/api/v1/flymyai/hy4/predict \
  -H "X-API-KEY: $FLYMYAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"Explain in two sentences why the sky is blue."}'

OpenAI-compatible API

Hunyuan Hy4 also speaks the OpenAI Chat Completions protocol: use the official OpenAI SDK with base URL https://api.flymy.ai/api/v1/flymyai/hy4/openai/v1 and your FlyMy.AI API key.

import os
from openai import OpenAI

client = OpenAI(base_url="https://api.flymy.ai/api/v1/flymyai/hy4/openai/v1", api_key=os.environ["FLYMYAI_API_KEY"])
response = client.chat.completions.create(
    model="flymyai/hy4",
    messages=[{"role": "user", "content": "What is a vector database?"}],
)
print(response.choices[0].message.content)

OpenAI-compatible API docs

API documentation · Create a free account · Pricing

Related models