Skip to main content
Send an image and a question to 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

  1. Create an API key with chat:write access.
  2. Fund the API wallet. It is separate from Studio subscription credits.
  3. Set your key in the terminal where you will run the example:
Keep the key server-side. If another integration uses the same environment variable, use a separate terminal for this example.

Check model capabilities

Read 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.
Install the OpenAI client:
Save as quickstart.py and run python quickstart.py:
Expected result: a text description of the input image, returned in 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’s content with a string:
This uses the same endpoint and response shape. For streaming, tool calls, errors, and compatibility details, continue with the chat guide.

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.