Hy4 API

tencent/hy4
Tencent presents Hy4, an advanced model featuring enhanced reasoning capabilities and support for long-horizon tasks.
Context
1M tokens
Input
$0.882372 / 1M tokens
Output
$2.646058 / 1M tokens
Released
Nov 4, 2026

Overview

What Is Hy4 API?

Hy4 is the latest model developed by Tencent, built to succeed the previous preview version with significant upgrades to its agentic capabilities.

Designed for versatility, the model handles both text and image inputs while providing users with control over its reasoning effort.

What Hy4 Brings to the Table

Large Context Window

The model supports a context window of 1M tokens to handle extensive information.

Configurable Reasoning

Users can adjust the reasoning effort to suit the specific demands of their tasks.

Multimodal Input

Hy4 processes both text and image inputs to generate comprehensive text responses.

Tool Integration

The model includes support for tools, streaming, and structured output generation.

Use cases

Automating complex, long-horizon productivity tasks.

Analyzing visual data alongside textual information.

Generating structured outputs for data processing workflows.

Executing multi-step agentic reasoning processes.

How to use Hy4 API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to tencent/hy4.
import requests

r = requests.post(
    "https://api.aimlapi.com/v1/chat/completions",
    headers={"Authorization": "Bearer " + AIMLAPI_KEY},
    json={
      "model": "tencent/hy4",
      "messages": [
        {
          "role": "user",
          "content": "Hello!"
        }
      ]
    },
)
print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "tencent/hy4",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }),
});
console.log(await r.json());
curl -X POST https://api.aimlapi.com/v1/chat/completions \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"tencent/hy4","messages":[{"role":"user","content":"Hello!"}]}'

OpenAI-compatible — swap the base URL and it works with your existing SDK.

Hy4 API Pricing

TypePrice
Input
$0.882372 / 1M tokens
Output
$2.646058 / 1M tokens
Cached input
$0.044436 / 1M tokens

Billed per token: $0.882372 / 1M input tokens, $0.044436 / 1M cached input tokens and $2.646058 / 1M output tokens. Reasoning tokens are billed as output.

Use cases

Automating complex, long-horizon productivity tasks.

Analyzing visual data alongside textual information.

Generating structured outputs for data processing workflows.

Executing multi-step agentic reasoning processes.

Hy4 vs other models

ModelInputOutputContextBest for
Hy4
This page
$0.882372 / 1M tokens
$2.646058 / 1M tokens
1M tokens
Complex agentic tasks and multimodal productivity.
$0.882372 / 1M tokens
$2.646058 / 1M tokens
1M tokens
Long-horizon coding + agentic works
$0.2116 / 1M tokens
$0.8464 / 1M tokens
256K tokens
Reasoning + agents
$0.078292 / 1M tokens
$0.31211 / 1M tokens
8K tokens
High-accuracy translation
$1.058 / 1M tokens
$2.8566 / 1M tokens
1M tokens
Agentic workflows and structured output

Frequently asked questions

Hy4 costs $0.882372 / 1M tokens for input and $2.646058 / 1M tokens for output on AI/ML API. Cached input is billed at $0.044436 / 1M tokens.

Hy4 accepts both text and image inputs.

The model features a 1M-token context window.

Yes, Hy4 allows for configurable reasoning effort.

The model supports a maximum output of 65,536 tokens.

Start building with Hy4

Get API Key
1000+ models, one API.