Introduction
Send text and image messages in the OpenAI chat format and read back text, tool calls or JSON. Set max_tokens high enough to cover both reasoning and the answer.
| Field | Value |
|---|---|
| Input | Text |
| Output | Text |
| Input context | 1,000,000 tokens |
| Maximum input | 960K tokens |
| max_tokens ceiling | 64000 |
| Inputs | text / images |
Key features & highlights
Keep the evidence beside the request
Hy4 accepts up to 960,000 input tokens across 1 to 256 messages. Put a specification and its supporting notes in the conversation, label the sections, and ask each finding to cite the passage that supports it. Review those citations alongside the proposed conclusions.
Allocate thinking within the reply
Choose none, low, medium, high, or xhigh for reasoning effort. Separately set a reply allowance from 1 to 64,000 tokens, with 4,096 as the default. Reasoning uses that allowance too, so a request for detailed analysis and a lengthy deliverable needs room for both.
Separate a proposed call from execution
Declare up to 128 tools and decide whether a call is optional with auto or required by the task with required. Give each definition a clear purpose and check the proposed arguments in your application. A tool definition describes an available action; your code still needs to carry it out.
Define the record your code expects
The response_format object lets you request a JSON object or a JSON schema. Use it for a catalog record, a requirements list, or an issue report with named fields. Define missing-value handling in the instruction and validate the returned data before saving it.
Request parameters
| Parameter | Required | Description |
|---|---|---|
messages | Yes | The Hy4 conversation, oldest first. User messages can mix text with |
max_tokens | No | Hy4 reply budget from 1 to 64000, default 4096. Reasoning tokens are counted here, and a 400-token cap on a long prompt ended with no text, so allow a few thousand. |
reasoning_effort | No | Hy4 thinking level: none, low, medium, high or xhigh. With none, our test reply used no reasoning tokens. |
stop | No | One sequence or up to four. at least 1 characters · at least 1 items · at most 4 items |
temperature | No | Hy4 sampling temperature from 0 to 2. |
top_p | No | Hy4 nucleus sampling threshold from 0.01 to 1. |
tools | No | Functions Hy4 may ask to call. Check each proposed call in your application before running it. at most 128 items |
tool_choice | No | Set auto to let Hy4 decide whether to call a function, or required to make it call one. |
response_format | No | Ask Hy4 for JSON with |
seed | No | Integer seed for Hy4 sampling, from 0 to 2147483647. Identical results across runs are not guaranteed. |
Pricing
Input $0.5838 / Output $1.7502 per 1 million tokens
Use cases
Requirements review for engineering
Provide a labeled specification in messages and ask for conflicting requirements with supporting passages. The 960,000-token input allowance gives room for a substantial source set, while the review criteria make each proposed finding checkable.
Software change planning
Describe the current system, intended behavior, and checks needed for completion. Choose reasoning effort and a reply budget for an ordered implementation plan, then have an engineer verify its assumptions.
Catalog data preparation
Ask for product attributes from supplied descriptions using response_format. Define the record shape and how missing values should be represented, then validate each returned record against the source.
Inventory lookup in a business app
Declare an inventory lookup function in tools and describe when it should be used. Set tool_choice to required when the workflow needs a lookup, and inspect the proposed item identifiers before your application runs it.
Follow-up analysis across a project
Keep relevant decisions and revised requirements in chronological messages. Request a change log grounded in those messages, while respecting the message-count and input-token limits as the conversation grows.
Prompt guide & pro tips
Arrange the source conversation
Place the instructions, source passages, and follow-up request in chronological messages. Stay within 256 messages and 960,000 input tokens, and give source sections stable labels for checking citations.
Plan the reply allowance
Set
max_tokensfor the reasoning and the visible answer together, within the 64,000-token ceiling. Select a reasoning effort that suits the task, then judge the returned work against a clear completion requirement.Choose data or a tool action
Use
response_formatwhen your application needs a JSON object or a JSON schema. For a function workflow, supply tools and choose auto or required according to whether a tool call is optional for the task.Check before using the result
Compare quoted evidence with the supplied material, validate structured data, and inspect proposed tool arguments. Save the messages and settings so a later revision can change one variable at a time.
A conversation with a defined deliverable
Tencent Hy4 chat accepts an ordered conversation for text work that may need reasoning, structured records, or a proposed tool call. Give it the relevant material and state how a complete answer should be checked: quoted clauses for a requirements review, named fields for a catalog record, or acceptance checks for a software change plan.
The request accepts up to 960,000 input tokens and 256 messages. Keep material relevant, label sections, and require evidence for conclusions that depend on a particular passage.
Parameters and request boundaries
Use messages to carry the task and conversation history. The remaining fields let you adjust the reply allowance, reasoning effort, tool behavior, formatting, and sampling.
| Parameter | Type and requirement | Range or purpose |
|---|---|---|
| messages | Required array | 1 to 256 messages in chronological order; up to 960,000 input tokens |
max_tokens | Optional integer | 1 to 64,000; default 4,096; reasoning counts toward this reply allowance |
reasoning_effort | Optional string | none, low, medium, high, xhigh |
| tools | Optional array | Up to 128 definitions of tools the model may call |
tool_choice | Optional string | auto lets the model decide; required asks for a tool call |
response_format | Optional object | Requested format, such as a JSON object or a JSON schema |
| stop | Optional string or array | Nonempty string or 1 to 4 nonempty sequences; a match ends the reply and is omitted |
| temperature | Optional number | 0 to 2 |
top_p | Optional number | 0.01 to 1 |
| seed | Optional integer | 0 to 2,147,483,647; identical results are not guaranteed |
Reasoning and answer length share a budget
Set max_tokens with both reasoning and the deliverable in mind. A request for a long report leaves less of that allowance available for reasoning than a brief answer would. Select reasoning_effort separately, then assess whether the answer meets your criteria.
Structured data and tool calls serve different needs
Use response_format when you want the answer organized as data. Name the expected fields in the instruction, describe how absent information should be represented, and validate returned data against your application requirements. A requested format does not remove the need to check whether values agree with the supplied source.
Use tools when the next step calls for a function. Explain what each definition does and what its arguments mean. Choose auto when a direct answer may be sufficient, or required when the workflow needs a call. Your application should inspect the function name and arguments before execution; declaring a tool does not itself perform the action.
Write input that can be checked
Organize a substantial brief around stable section labels. Describe the task after identifying the source material, and specify the output you need. For an engineering review, ask for the conflicting passages, the practical consequence, and a proposed resolution. For product records, separate source wording from the requested field names and state how uncertainty should appear.
Keep revisions easy to compare
Preserve relevant earlier messages when asking a follow-up and put them in chronological order. Check both the message count and the input-token allowance as the conversation grows. When revising a request, change a single instruction or setting and use the same review criteria. A constant seed keeps comparisons tidy when you change a single setting, yet replies can still vary.
Choose stop markers that will not collide with useful source text. A marker that also appears in a quoted clause or catalog entry can end the reply before the material you wanted is complete. The matched sequence is omitted, so account for that when parsing the answer.
Price and request planning
Use the price currently displayed on this page; its unit is 1,000 tokens. Estimate a task around the source conversation and the requested reply allowance, remembering that reasoning occupies part of the reply budget. Compare the displayed price with the expected scope of your own workflow before choosing a long report or repeated revision cycle.
Limits and related choices
Respect the input allowance, message count, reply ceiling, tool count, and stop-sequence constraints together.
When to evaluate another family
Consider Kimi K3.1 Pro or GLM 5.3 when you are selecting a model for an existing application or assessing a different balance of price and task fit. Review each related family's current fields and displayed price, then evaluate a representative source set with the same completion checks. Compare the answers for completeness, traceable source references, and usable structure before deciding which family fits your application.
API quick start
curl --fail-with-body -sN https://api.spicyapi.ai/v1/chat/completions \
-H "Authorization: Bearer $SPICY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "tencent/hy4/chat",
"messages": [
{
"role": "user",
"content": "Summarise the following release notes into three bullet points."
}
],
"stream": true
}' \
| jq --unbuffered -Rrj 'select(startswith("data: ")) | .[6:] | select(. != "[DONE]") | fromjson | if .error then "\n[error] \(.error.message)\n" else (.choices[0].delta.content? // empty) end'
See the API reference for authentication, the complete schema, polling, and error handling.

