Built from the official docs: openrouter.ai · Hy4 flash - API Pricing & Benchmarks · checked 27 November 2026
Through OpenRouter
Get an API key
Sign up at OpenRouter and create an API key from your dashboard. You will use it as the bearer token in every request.
Export your key
Store the key in an environment variable so the examples below can read it.
export OPENROUTER_API_KEY=<your-key>Call the model with curl
Send a POST request to the OpenRouter endpoint, setting the model to tencent/hy4-flash. The HTTP-Referer and title headers are optional and only affect leaderboard attribution.
curl https://openrouter.ai/api/v1/responses \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OPENROUTER_API_KEY" \ -d '{ "model": "tencent/hy4-flash", "input": "What is the meaning of life?" }'Or call it from Python
The same request works via HTTP in Python. Replace the input with your own prompt.
import requests import json response = requests.post( url="https://openrouter.ai/api/v1/responses", headers={ "Authorization": "Bearer <your-key>", }, data=json.dumps({ "model": "tencent/hy4-flash", "input": "What is the meaning of life?" }) ) print(response.json())Or use the OpenAI SDK pointed at OpenRouter
OpenRouter is OpenAI-compatible, so you can use the OpenAI SDK by swapping the base URL and key.
from openai import OpenAI client = OpenAI( base_url="https://openrouter.ai/api/v1", api_key="<your-key>", ) response = client.responses.create( model="tencent/hy4-flash", input="What is the meaning of life?" ) print(response.output_text)
Check it worked
You get a completed response containing the model's generated text instead of an authentication or model-not-found error.