Built from the official docs: openrouter.ai · Hy4 - API Pricing & Benchmarks · checked 20 November 2026
Through OpenRouter
Get an API key
Sign up on OpenRouter and create a key. You will pass it as a Bearer token in the Authorization header on every request.
Call it with a raw HTTP request
Send a POST to the responses endpoint with the model id tencent/hy4. Replace the placeholder with your key.
curl https://openrouter.ai/api/v1/responses \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <OPENROUTER_API_KEY>" \ -d '{ "model": "tencent/hy4", "input": "What is the meaning of life?" }'Or call it with the OpenAI SDK
Point the OpenAI SDK at OpenRouter's base URL and use it as a drop-in replacement, since OpenRouter's API is OpenAI-compatible. Set the model to tencent/hy4.
from openai import OpenAI client = OpenAI( base_url="https://openrouter.ai/api/v1", api_key="<OPENROUTER_API_KEY>", ) response = client.responses.create( model="tencent/hy4", input="What is the meaning of life?" ) print(response.output_text)Or call it with the OpenRouter client SDK
Install the OpenRouter SDK and send a request with the model id tencent/hy4.
pip install openrouter
Check it worked
A successful call returns a JSON response whose status is "completed" and whose output contains a message item with an output_text part holding the model's reply.