Skip to main content
The API reference describes the RESTful APIs you can use to interact with the Z.AI platform.
Z.AI provides standard HTTP API interfaces that support multiple programming languages and development environments, with SDKs also available.

API Endpoint

Z.ai Platform’s general API endpoint is as follows:
When using GLM Coding Plan, please follow the tutorial to configure your dedicated endpoint.

Authentication

The Z.AI API uses the standard HTTP Bearer for authentication. An API key is required, which you can create or manage on the API Keys Page. API keys should be provided via HTTP Bearer Authentication in HTTP Request Headers.

Playground

The API Playground allows developers to quickly try out API calls. Simply click Try it on the API details page to get started.
  • On the API details page, there are many interactive options, such as switching input types, switching tabs, and adding new content.
  • You can click Add an item or Add new property to add more properties the API need.
  • Note that when switching the tabs, the previous properties value you need re-input or re-switch.

API Usage Bundle Billing Rules

If you purchase an API usage bundle for a model, we will prioritize consuming the included usage quota from that bundle. Once the bundle is exhausted, your API access remains fully unaffected — you can continue making calls as usual with no service interruption whatsoever. The only change is that, going forward, each API call will be billed at the standard pay-as-you-go rate, with the corresponding charges deducted directly from your account.

Call Examples