---
title: Hy4 flash API – Pricing & Playground | ModelsLab
description: Hy4 flash API by Tencent, 1M context. $0.04375/1M input, $0.175625/1M output tokens. API & playground on ModelsLab.
url: https://modelslab.com/models/tencent/tencent-hy4-flash.md
canonical: https://modelslab.com/models/tencent/tencent-hy4-flash
type: product
component: Playground/LLM/Index
generated_at: 2026-11-17T20:42:22.882633Z
---

Tencent: Hy4 flash
---

 [LLMs.txt](https://modelslab.com/models/tencent/tencent-hy4-flash/llms.txt) [.md](https://modelslab.com/models/tencent/tencent-hy4-flash.md)

Tencent: Hy4 flash
---

Choose a prompt below to get started or type your own message

 Explain quantum computing in simple terms

 Write a Python function to sort a list

 Create a marketing email for a SaaS product

 Compare REST vs GraphQL APIs

images and text files

Send

### Tencent: Hy4 flash

tencent tencent-hy4-flash

Copy model ID

PricingInput $0.04375 / 1M tokens

Output $0.175625 / 1M tokens

API EndpointsOpenAI Compatible

`https://modelslab.com/api/v7/llm/chat/completions`Endpoint

Anthropic Compatible

`https://modelslab.com/api/v7/llm/v1/messages`Messages

`https://modelslab.com/api/v7/llm/v1/messages/count_tokens`Count Tokens

`https://modelslab.com/api/v7/llm/v1/models`Models

Use with Claude Code

cURL Example

ParametersSystem MessageYou are a helpful AI assistant specialized in providing accurate and detailed responses.

Temperature0.7

Max Tokens4000

Top P0.9

Frequency Penalty0

Presence Penalty0

Thinkinglow

lowmediumhigh

Deeper thinking spends more of the Max Tokens budget before the answer starts.

Model Info

Support

Looking for something different?
---

Models that trade off differently against the one you are viewing

### Better quality

Newer flagship models that generally produce stronger results.

![GPT 5.1 API](https://images.modelslab.sh/?Image=https://assets.modelslab.ai/generations/fad83520-47a8-4059-b4b9-b32adf4d0be7.png)

[OpenAI](/models/openai)

 [GPT 5.1](/models/openai/gpt5.1)

![GPT-5.1-Codex-Max API](https://images.modelslab.sh/?Image=https://assets.modelslab.ai/generations/06356c4c-df09-4ccb-a5c0-629da670f75b.png)

[OpenAI](/models/openai)

 [GPT-5.1-Codex-Max](/models/openai/gpt-5.1-codex-max)

### Lower cost per run

Open-source models we host, unlimited on the $149/month plan.

![gpt-oss-20b API](https://images.modelslab.sh/?Image=https://assets.modelslab.ai/generations/8b2f0440-52cc-4f41-93eb-d31006ad71e2.webp)

[OpenAI](/models/openai)

 [gpt-oss-20b](/models/openai/openai-gpt-oss-20b)

![Qwen3 30B A3b API](https://images.modelslab.sh/?Image=https://assets.modelslab.ai/generations/e893c08b-9506-4b2e-a5e9-f0f2b3def135.png)

[Qwen](/models/open_router)

 [Qwen3 30B A3b](/models/qwen/qwen-qwen3-30b-a3b)

[Qwen](/models/open_router)

 [Qwen: Qwen3.7 Flash](/models/qwen/qwen-qwen3.7-flash)

[Qwen](/models/open_router)

 [Qwen3 14B](/models/qwen/qwen-qwen3-14b)

[Z.ai](/models/open_router)

 [Z.ai: GLM Flash Latest](/models/z-ai/z-ai-glm-flash-latest)

[OpenAI](/models/open_router)

 [OpenAI: gpt-oss-20b](/models/openai/openai-gpt-oss-20b)

Related Models
---

Discover similar models you might be interested in

 [View all LLM Models](https://modelslab.com/models?feature=llmaster)

[#### Qwen/Qwen: Qwen3.5-9B

qwen-qwen3.5-9b

From $0.2625/M tokens](/models/qwen/qwen-qwen3.5-9b)

[#### Reka AI/Reka Edge

rekaai-reka-edge

From $0.125/M tokens](/models/rekaai/rekaai-reka-edge)

[#### Qwen/Qwen: Qwen3.8 Max Prime

qwen-qwen3.8-max-prime

From $10.00/M tokens](/models/qwen/qwen-qwen3.8-max-prime)

[#### Anthropic/Anthropic: Claude Opus 4.1

anthropic-claude-opus-4.1

From $56.25/M tokens](/models/anthropic/anthropic-claude-opus-4.1)

[#### Qwen/Qwen2-VL (72B) Instruct

Qwen-Qwen2-VL-72B-Instruct

From $1.50/M tokens](/models/qwen/qwen-qwen2-vl-72b-instruct)

[#### OpenAI/OpenAI: GPT-4o-mini (2024-07-18)

openai-gpt-4o-mini-2024-07-18

From $0.46875/M tokens](/models/openai/openai-gpt-4o-mini-2024-07-18)

[#### OpenAI/OpenAI: GPT-6.1 Terra Pro

openai-gpt-6.1-terra-pro

From $3.75/M tokens](/models/openai/openai-gpt-6.1-terra-pro)

[#### OpenAI/OpenAI: GPT-6.1 Terra

openai-gpt-6.1-terra

From $3.75/M tokens](/models/openai/openai-gpt-6.1-terra)

[#### Google/Google: Nano Banana Pro (Gemini 3 Pro Image Preview)

google-gemini-3-pro-image-preview

From $8.75/M tokens](/models/google/google-gemini-3-pro-image-preview)

[#### Xiaomi/Xiaomi: MiMo-V2.6-Pro

xiaomi-mimo-v2.6-pro

From $0.815625/M tokens](/models/xiaomi/xiaomi-mimo-v2.6-pro)

[#### Gryphe/MythoMax 13B

gryphe-mythomax-l2-13b

From $0.11875/M tokens](/models/gryphe/gryphe-mythomax-l2-13b)

[#### MiniMax/MiniMax: MiniMax M3

minimax-minimax-m3

From $0.9375/M tokens](/models/minimax/minimax-minimax-m3)

[#### NVIDIA/NVIDIA: Nemotron 3.5 Super VL

nvidia-nemotron-3.5-super-vl

From $0.40625/M tokens](/models/nvidia/nvidia-nemotron-3.5-super-vl)

[#### DeepSeek/DeepSeek: DeepSeek Pro Latest

deepseek-deepseek-pro-latest

From $5.06244/M tokens](/models/deepseek/deepseek-deepseek-pro-latest)

[#### OpenAI/OpenAI: GPT-5 Mini

openai-gpt-5-mini

From $1.40625/M tokens](/models/openai/openai-gpt-5-mini)

[#### DeepSeek/DeepSeek: DeepSeek V4 Flash Latest

deepseek-deepseek-v4-flash-latest

From $0.214625/M tokens](/models/deepseek/deepseek-deepseek-v4-flash-latest)

[#### Typesafe/TypeSafe: Jev Router

typesafe-jev-router

Free](/models/typesafe/typesafe-jev-router)

[#### Qwen/Qwen: Qwen3.5-Flash

qwen-qwen3.5-flash-02-23

From $0.203125/M tokens](/models/qwen/qwen-qwen3.5-flash-02-23)

About Tencent: Hy4 Flash
---

Hy4 flash is a cost-efficient variant of \[Hy4\](https://openrouter.ai/tencent/hy4) from Tencent, served with roughly a quarter of the flagship's parameter count for lower latency and cost. It targets code assistance, agent...

### Tencent: Hy4 Flash facts

ProviderTencent

Input price$0.04375 per 1M tokens

Output price$0.175625 per 1M tokens

Context length1,048,576 tokens

Max output65,536 tokens

Input / outputtext, image → text

Added to ModelsLabNovember 16, 2026

Model IDtencent-hy4-flash

### Key Features

- Chat completion and multi-turn conversation API
- Streaming response with token-by-token output
- Function calling and tool use support
- System prompts and role-based messaging
- JSON mode and structured output

### Quick Start

Integrate Tencent: Hy4 Flash into your application with a single API call. Get your API key from the [pricing page](https://modelslab.com/pricing) to get started.

PythonJavaScriptcURLPHP

```
<div>import requests</div>
<div>import json</div>
<div>
</div>
<div>url = "https://modelslab.com/api/v7/llm/chat/completions"</div>
<div>
</div>
<div>headers = {</div>
<div>    "Content-Type": "application/json"</div>
<div>}</div>
<div>
</div>
<div>data = {</div>
<div>        "model_id": "tencent-hy4-flash",</div>
<div>        "messages": [</div>
<div>            {</div>
<div>                "role": "user",</div>
<div>                "content": "Hello!"</div>
<div>            }</div>
<div>        ],</div>
<div>        "max_tokens": 1000,</div>
<div>        "key": "YOUR_API_KEY"</div>
<div>    }</div>
<div>
</div>
<div>try:</div>
<div>    response = requests.post(url, headers=headers, json=data)</div>
<div>    response.raise_for_status()  # Raises an HTTPError for bad responses (4XX or 5XX)</div>
<div>    result = response.json()</div>
<div>    print("API Response:")</div>
<div>    print(json.dumps(result, indent=2))</div>
<div>except requests.exceptions.HTTPError as http_err:</div>
<div>    print(f"HTTP error occurred: {http_err} - {response.text}")</div>
<div>except Exception as err:</div>
<div>    print(f"Other error occurred: {err}")</div>
```

const requestBody = {

 "model_id": "tencent-hy4-flash",

 "messages": [

 {

 "role": "user",

 "content": "Hello!"

 }

 ],

 "max_tokens": 1000,

 "key": "YOUR_API_KEY"

 };

async function makeApiRequest() {

 try {

 const response = await fetch(endpointUrl, {

 method: 'POST',

 headers: {

 'Content-Type': 'application/json',

 },

 body: JSON.stringify(requestBody)

 });

 if (!response.ok) {

 let errorResult;

 try {

 errorResult = await response.json();

 } catch (e) {

 errorResult = { error: { message: await response.text() } };

 }

 throw new Error(`API Error (${response.status}): ${errorResult.error?.message || response.statusText || 'Unknown error'}`);

 }

 const result = await response.json();

 console.log('API Response:', result);

 return result;

 } catch (error) {

 console.error('Error making API request:', error.message);

 throw error;

 }

}

makeApiRequest();

 -H "Content-Type: application/json" \

 -d '{

 "model_id": "tencent-hy4-flash",

 "messages": [

 {

 "role": "user",

 "content": "Hello!"

 }

 ],

 "max_tokens": 1000,

 "key": "YOUR_API_KEY"

}'

$url = 'https://modelslab.com/api/v7/llm/chat/completions';

$headers = [

 'Content-Type: application/json'

];

$data = [

 'model_id' => 'tencent-hy4-flash',

 'messages' => [{"role":"user","content":"Hello!"}],

 'max_tokens' => 1000,

 'key' => 'YOUR_API_KEY',

];

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_POST, true);

curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_TIMEOUT, 30);

$response = curl_exec($ch);

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

$curlError = curl_error($ch);

if ($curlError) {

 echo 'Curl error: ' . $curlError;

} else {

 echo "HTTP Status Code: " . $httpCode . "\n";

 $result = json_decode($response, true);

 if (json_last_error() !== JSON_ERROR_NONE) {

 echo "Error decoding JSON: " . json_last_error_msg() . "\n";

 echo "Raw response: " . $response . "\n";

 } else {

 echo "API Response:\n";

 print_r($result);

 }

}

?>

### Pricing

Tencent: Hy4 Flash API costs $0.088 per million tokens. Plans start at $21/month, and open-source models are unlimited on the $149/month plan. [View pricing plans](https://modelslab.com/pricing)

### Use Cases

- AI chatbots and virtual assistants
- Code generation and developer tools
- Content writing and copywriting automation
- Data analysis, summarization, and extraction

### More from Tencent

- [Tencent: Hy3 API](/models/tencent/tencent-hy3)
- [Tencent: Hy-MT2-1.8B API](/models/tencent/tencent-hy-mt2-1.8b)
- [Tencent: Hy-MT2-30B-A3B API](/models/tencent/tencent-hy-mt2-30b-a3b)
- [Tencent: Hy4 API](/models/tencent/tencent-hy4)
- [Tencent: Hy-MT2-7B API](/models/tencent/tencent-hy-mt2-7b)
- [Tencent: Hy4 preview API](/models/tencent/tencent-hy4-preview)

[All Tencent models](/models/tencent)

[Browse LLM Models](https://modelslab.com/models?feature=llmaster) [View Pricing](https://modelslab.com/pricing)

Tencent: Hy4 Flash FAQ
---

### What is Tencent: Hy4 Flash?

Hy4 flash is a cost-efficient variant of [Hy4](https://openrouter.ai/tencent/hy4) from Tencent, served with roughly a quarter of the flagship's parameter count for lower latency and cost. It targets code assistance, agent...

### How do I use the Tencent: Hy4 Flash API?

You can integrate Tencent: Hy4 Flash into your application with a single API call. Sign up on ModelsLab to get your API key, then use the model ID "tencent-hy4-flash" in your API requests. We provide SDKs for Python, JavaScript, and cURL examples in the API documentation.

### How much does Tencent: Hy4 Flash cost?

Tencent: Hy4 Flash costs $0.04375/1M input, $0.175625/1M output tokens. ModelsLab plans start at $21/month (Basic), and the $149/month Open Source plan includes unlimited generation on open-source models.

### What is the Tencent: Hy4 Flash model ID?

The model ID for Tencent: Hy4 Flash is "tencent-hy4-flash". Use this ID in your API requests to specify this model.

### Do I need a paid plan to use Tencent: Hy4 Flash?

Yes. ModelsLab is subscription-based with no free tier — plans start at $21/month (Basic, 3,250 API calls). The $149/month Open Source Unlimited plan includes unlimited generation across open-source models; premium third-party models are billed per call from your wallet.

---

*This markdown version is optimized for AI agents and LLMs.*

**Links:**
- [Website](https://modelslab.com)
- [API Documentation](https://docs.modelslab.com)
- [Blog](https://modelslab.com/blog)

---
*Generated by ModelsLab - 2026-11-18*