POST /v3/chat/completions and read the model’s
answer directly from the response. This example uses glm-5.3 for scene
understanding. For image, video, and speech generation, use the separate
asynchronous model-job quickstart.
Create a key and fund your wallet
- Create an API key with
chat:writeaccess. - Fund the API wallet. It is separate from Studio subscription credits.
- Set your key in the terminal where you will run the example:
Check model capabilities
chat.input_modalities, chat.max_images_per_request, input_schema, and
chat.pricing. GLM-5.3 accepts text and image inputs; model limits and availability
can change. The image URL must be accessible to the service. This example uses a
public robot-lab image; replace it with an HTTPS image URL you want to analyze.
Understand a scene
Each example makes a billable request and prints the answer. It uses low reasoning effort and a 4,096-token output budget. Reasoning tokens count toward this budget.- Python
- TypeScript
- cURL
Install the OpenAI client:Save as
quickstart.py and run python quickstart.py:choices[0].message.content. The wording can vary. Check finish_reason; a
length result can mean reasoning exhausted the output budget. See
reasoning and output budgets.
A model’s description is an interpretation of the image, not a measurement of the scene.
Reason over observations
For a text-only task, replace the message’scontent with a string:
Choose the next step
Choose a model
Compare supported inputs, limits, and pricing.
Run a model job
Submit, poll, and download image, video, or audio outputs.
Platform and availability
Understand managed inference, World Model Runtime, and research previews.
Connect an AI client
Use the tools exposed by the Hedra MCP server.