Text model
Hy4
tencent/hy4
tencent/hy4 is a language model from Tencent you can call on the OceanToken API, with a 1.05M-token context window and up to 66K output tokens; it supports reasoning, tool calling, image input.
At a glance
| Model ID | tencent/hy4 |
|---|---|
| Type | Text |
| Publisher | Tencent |
| Context window | 1,048,576 tokens |
| Max output | 65,536 tokens |
| Price | On oceantoken.ai |
| Capabilities | reasoning, tool calling, image input |
| Endpoint | /v1/chat/completions, /v1/responses |
| API shape | OpenAI-compatible |
| In the catalog since | 2026-11-04 |
API
POST /v1/chat/completions (also /v1/responses and /v1/messages). Base URL https://api.oceantoken.ai, your OceanToken key as the bearer token. The OpenAI SDKs work unchanged; see the Quickstart.
Download this spec (JSON) · llms.txt for AI assistants
Basic
- curl
- Python
- JavaScript
curl https://api.oceantoken.ai/v1/chat/completions \
-H "Authorization: Bearer $OCEANTOKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tencent/hy4",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}'
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.oceantoken.ai/v1", api_key=os.environ["OCEANTOKEN_API_KEY"])
response = client.chat.completions.create(
model="tencent/hy4",
messages=[
{
"role": "user",
"content": "Write a haiku about the ocean.",
},
],
)
print(response.choices[0].message.content)
import OpenAI from 'openai';
const client = new OpenAI({baseURL: 'https://api.oceantoken.ai/v1', apiKey: process.env.OCEANTOKEN_API_KEY});
const response = await client.chat.completions.create({
"model": "tencent/hy4",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
});
console.log(response.choices[0].message.content);
Image input
- curl
- Python
- JavaScript
curl https://api.oceantoken.ai/v1/chat/completions \
-H "Authorization: Bearer $OCEANTOKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tencent/hy4",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is in this image?"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/photo.jpg"
}
}
]
}
]
}'
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.oceantoken.ai/v1", api_key=os.environ["OCEANTOKEN_API_KEY"])
response = client.chat.completions.create(
model="tencent/hy4",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "What is in this image?"},
{
"type": "image_url",
"image_url": {"url": "https://example.com/photo.jpg"},
},
],
},
],
)
print(response.choices[0].message.content)
import OpenAI from 'openai';
const client = new OpenAI({baseURL: 'https://api.oceantoken.ai/v1', apiKey: process.env.OCEANTOKEN_API_KEY});
const response = await client.chat.completions.create({
"model": "tencent/hy4",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is in this image?"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/photo.jpg"
}
}
]
}
]
});
console.log(response.choices[0].message.content);
Request parameters
Only what this model takes. Anything else in the request is left out before it reaches the model.
| Parameter | Type | Description |
|---|---|---|
modelrequired | string | This model's ID. |
messagesrequired | array | The conversation so far: objects with a role (system, user, assistant or tool) and a content, a string or a list of content parts: text, and images, video, audio or files on models that take them. |
stream | boolean default false | Send the answer as server-sent events as it is written. |
stream_options | object | With stream: {"include_usage": true} adds a last event with the token counts. |
max_tokens | integer 1 to 65536 | The most tokens to write, reasoning included. max_completion_tokens is accepted as the same thing. |
temperature | number 0 to 2 | Randomness: lower is more focused, higher more varied. |
stop | string or array | Up to 4 strings; the answer ends before any of them. |
response_format | object json_object, json_schema | {"type": "json_object"} for JSON output, or {"type": "json_schema", "json_schema": {"name": ..., "schema": {...}}} for output that matches your schema. |
tools | array | Functions the model may call: {"type": "function", "function": {"name", "description", "parameters"}}. |
tool_choice | string or object | auto (default), none, required, or {"type": "function", "function": {"name": ...}}. |
parallel_tool_calls | boolean | false asks for at most one tool call per turn. |
user | string | Your own ID for the end user, for your records. |
Message content
Besides a plain string, a message's content can be a list of parts:
image_url
An image, as a public https:// URL or a data URL.
| Field | Type | Description |
|---|---|---|
image_url.urlrequired | string | https:// URL or data:image/...;base64,.... |
{
"type": "image_url",
"image_url": {
"url": "https://example.com/photo.jpg"
}
}
Response
| Field | Type | Description |
|---|---|---|
id | string | The request's ID. |
choices[].message.content | string | The answer. |
choices[].message.reasoning_content | string | The model's reasoning, on models that return it. |
choices[].message.tool_calls | array | The tools the model wants called, with JSON arguments. |
choices[].finish_reason | string | stop, length (hit max_tokens), tool_calls or content_filter. |
usage.prompt_tokens | integer | Input tokens, media included. |
usage.completion_tokens | integer | Output tokens, reasoning included. |
usage.prompt_tokens_details.cached_tokens | integer | Input tokens read from the prompt cache. |
usage.completion_tokens_details.reasoning_tokens | integer | Output tokens spent reasoning. |
With stream: true, chat.completion.chunk events carry choices[].delta; the stream ends with data: [DONE].
Example response
{
"id": "chatcmpl-...",
"object": "chat.completion",
"created": 1792000000,
"model": "tencent/hy4",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "...",
"reasoning_content": null,
"tool_calls": null
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 20,
"total_tokens": 32,
"prompt_tokens_details": {
"cached_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0
}
}
}
More examples and how errors and billing work: Text generation.
Compared with similar models
Text models on OceanToken in the same price range as tencent/hy4. Compare their prices on oceantoken.ai.
| Model | Publisher | Context |
|---|---|---|
Hy4tencent/hy4 | Tencent | 1,048,576 |
Nova 2 Lite V1amazon/nova-2-lite-v1 | Amazon | 1M |
Seed-2 1 Turbobytedance-seed/seed-2-1-turbo | ByteDance Seed | 262K |
Gemini 2.5 Flashgoogle/gemini-2.5-flash | 1.05M |
More from Tencent
- Hunyuan A13B Instruct
tencent/hunyuan-a13b-instruct - Hy Mt2 1.8b
tencent/hy-mt2-1.8b - Hy Mt2 30B A3B
tencent/hy-mt2-30b-a3b - Hy Mt2 7B
tencent/hy-mt2-7b - Hy3
tencent/hy3 - Hy3 Preview
tencent/hy3-preview - Hy4 Preview
tencent/hy4-preview
All Tencent models on OceanToken
Use it
Create an account Price on oceantoken.ai
The facts on this page were read from the live OceanToken catalog on 2026-11-14 (UTC), when the documentation was built. Prices are published on oceantoken.ai.