> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kymaapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Hy4 Preview

> Tencent's Hy4 preview, open weights (Apache 2.0): a 770B MoE with 49B active, built for coding agents, complex tool use and productivity work. 1M context, reasoning, tool calling. Preview release.

## Overview

Tencent's Hy4 preview, open weights (Apache 2.0): a 770B MoE with 49B active, built for coding agents, complex tool use and productivity work. 1M context, reasoning, tool calling. Preview release.

## Specs

| Field | Value |
| - | - |
| Model ID | `hy4-preview` |
| Best for | Coding agents and complex tool-use workflows |
| Context window | 1.048576M |
| Max output tokens | 64K |
| Input modalities | Text |
| Output modalities | Text |
| Tool calling | Yes |
| Structured outputs | Yes |
| Prompt caching | No |
| Vision | No |
| Reasoning | Yes |
| Speed | Medium |
| Cost band | Balanced |
| Release stage | Preview |

## Pricing

| | Per 1M tokens |
| - | :-: |
| Input | \$1.1259 |
| Output | \$3.3764 |

## Example

```python theme={null}
from openai import OpenAI

client = OpenAI(base_url="https://kymaapi.com/v1", api_key="kyma-...")

response = client.chat.completions.create(
    model="hy4-preview",
    messages=[{"role": "user", "content": "..."}],
    tools=[...],  # function calling supported
)
```

## Agent query example

Ask the API which models fit, instead of hardcoding an id:

```bash theme={null}
curl "https://kymaapi.com/v1/models?recommended_for=chat&tools=true&quality_tier=frontier-open"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.