Built from the official docs: openrouter.ai · GLM 5.3 Flash - API Pricing & Benchmarks · checked 27 November 2026
Through OpenRouter
Get an OpenRouter API key
Sign up on OpenRouter and create an API key; you will pass it as a Bearer token on every request.
Export your key
Store the key in an environment variable so the examples can read it.
export OPENROUTER_API_KEY=<your-openrouter-api-key>Call it with curl
Send a POST request to the OpenRouter responses endpoint using the model slug z-ai/glm-5.3-flash.
curl https://openrouter.ai/api/v1/responses \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OPENROUTER_API_KEY" \ -d '{ "model": "z-ai/glm-5.3-flash", "input": "What is the meaning of life?" }'Or call it with the OpenAI SDK
Point the OpenAI SDK at the OpenRouter base URL as a drop-in replacement and set the model to z-ai/glm-5.3-flash.
from openai import OpenAI client = OpenAI( base_url="https://openrouter.ai/api/v1", api_key="<your-openrouter-api-key>", ) response = client.responses.create( model="z-ai/glm-5.3-flash", input="What is the meaning of life?" ) print(response.output_text)Or install and use the OpenRouter Python SDK
Install the openrouter package, then send a request with the responses method.
pip install openrouter
Check it worked
You get back a JSON response whose output contains a message with output_text, or the SDK prints the model's text with no error.