Model API

Glm 4 Air API

Glm 4 Air routed by the Aiduct API gateway.

Model ID

glm-4-air

Provider

zenmux

Capability

chat

Status

Available

Pricing and limits

Pricing is not published for this model yet. Use the model catalog and dashboard usage records for current availability.

Use this model

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.AIDUCT_API_KEY,
  baseURL: "https://api.aiduct.ai/v1",
});

const response = await client.chat.completions.create({
  model: "glm-4-air",
  messages: [{ role: "user", content: "Say hello in one sentence." }],
});

Supported parameters

messagestemperaturetop_pmax_tokensstreamstoptoolstool_choiceresponse_formatuser

What is Glm 4 Air?

Glm 4 Air is a text-to-text language model optimized for chat applications, routed through the Aiduct API gateway and provided by zenmux. It's designed as a lightweight, efficient option for conversational AI workloads where speed and cost-effectiveness matter. The "Air" designation typically indicates a model variant that prioritizes lower latency and reduced computational overhead compared to larger flagship models, making it suitable for high-throughput production environments.

As a chat-focused model, Glm 4 Air excels at multi-turn conversations, instruction following, and general-purpose text generation tasks. It processes text input and returns text output, fitting naturally into standard LLM application patterns. When accessed through Aiduct, you get the benefit of a unified API surface that works identically across dozens of models, eliminating the integration overhead of working with multiple provider-specific SDKs.

Who Should Use Glm 4 Air?

Glm 4 Air is best suited for engineering teams that need:

High-volume conversational applications where response time and throughput are critical. If you're building customer support chatbots, interactive assistants, or real-time dialogue systems that handle thousands of requests per hour, the efficiency profile of an "Air" class model can deliver significant infrastructure savings.

Cost-conscious production deployments that still require solid reasoning and instruction-following capabilities. Teams looking to optimize their LLM spend without sacrificing too much capability often find that lighter models like Glm 4 Air hit a sweet spot for many everyday tasks.

Multi-model architectures that route different request types to different models based on complexity. Glm 4 Air can serve as your default or fallback model for simpler queries, while you reserve larger, more expensive models for complex reasoning tasks. Aiduct's unified interface makes this routing pattern straightforward to implement.

Developers evaluating alternatives to mainstream providers. If you're exploring models beyond OpenAI and Anthropic to reduce vendor lock-in or to compare performance characteristics, Glm 4 Air offers another data point in your evaluation matrix.

How to Access Glm 4 Air via Aiduct

Aiduct exposes Glm 4 Air through an OpenAI-compatible endpoint at https://api.aiduct.ai/v1. You can use the standard OpenAI SDK, any OpenAI-compatible library, or raw HTTP calls. The model identifier you'll pass is glm-4-air.

Python Example with OpenAI SDK

from openai import OpenAI

client = OpenAI(
    api_key="your-aiduct-api-key",
    base_url="https://api.aiduct.ai/v1"
)

response = client.chat.completions.create(
    model="glm-4-air",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Explain the CAP theorem in two sentences."}
    ],
    temperature=0.7,
    max_tokens=150
)

print(response.choices[0].message.content)

This code works identically to how you'd call gpt-3.5-turbo or gpt-4 through OpenAI's API, except you point base_url at Aiduct and specify glm-4-air as the model. No new SDK to learn, no new authentication flow, no schema differences to handle.

cURL Example

curl https://api.aiduct.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-aiduct-api-key" \
  -d '{
    "model": "glm-4-air",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "What are the trade-offs of using a CDN?"}
    ],
    "temperature": 0.7,
    "max_tokens": 200
  }'

The response structure matches the OpenAI ChatCompletion format, so any tooling or logging infrastructure you've built around OpenAI's API will work without modification.

Key Features and Capabilities

Chat-optimized architecture: Glm 4 Air is purpose-built for conversational use cases. It maintains context across multi-turn dialogues and follows system instructions effectively, making it suitable for assistant-style applications.

Text-only modality: This model processes and generates text exclusively. If you need vision, audio, or other modalities, you'll want to look at multimodal alternatives in the Aiduct catalog.

OpenAI-compatible interface: Because Aiduct normalizes the API surface, you interact with Glm 4 Air using the same ChatCompletion schema you'd use for GPT models. This compatibility extends to streaming responses, function calling (if supported by the underlying model), and standard parameters like temperature, max_tokens, and top_p.

Unified billing and observability: All your Aiduct usage—whether you're calling Glm 4 Air, Claude, GPT-4, or any other model—appears on a single invoice and flows through a single set of logs and metrics. This simplifies cost tracking and performance monitoring in multi-model deployments.

Pricing and Cost Considerations

Aiduct's pricing for Glm 4 Air is usage-based and billed per token, following the standard pattern for LLM APIs. Because pricing can change and may vary by volume tier or contract terms, always check the /pricing page for current rates.

In general, "Air" or "lite" model variants are positioned as cost-effective options relative to flagship models. When evaluating whether Glm 4 Air fits your budget, consider:

  • Input vs. output token costs: Most providers charge different rates for prompt tokens and completion tokens. Minimizing output length where possible can reduce costs.
  • Batch vs. real-time: If your use case allows for asynchronous processing, batching requests can sometimes unlock lower effective rates.
  • Model routing logic: Implementing a tiered routing strategy—using Glm 4 Air for simpler queries and reserving more capable (and expensive) models for complex tasks—can significantly reduce overall spend.

Visit /pricing for the latest Glm 4 Air token rates and to compare against other models in the Aiduct catalog.

Aiduct vs. Direct Provider Access

If zenmux or the upstream provider offers a direct API for Glm 4 Air, why use Aiduct as an intermediary?

Single integration point: Instead of maintaining separate SDKs, API keys, and retry logic for each provider, you write one integration against Aiduct's OpenAI-compatible endpoint and gain access to dozens of models.

Unified observability: Aiduct aggregates logs, latency metrics, and error rates across all models in one place. This makes it easier to compare performance, debug issues, and optimize your model selection over time.

Simplified billing: One invoice, one payment method, one set of usage reports. You avoid the overhead of managing billing relationships with multiple AI providers.

Fallback and routing flexibility: Aiduct's gateway architecture makes it straightforward to implement fallback logic (if Glm 4 Air is unavailable, route to another model) or A/B testing (send 10% of traffic to Glm 4 Air, 90% to another model) without changing application code.

Consistent schema: Even if the upstream provider uses a different request/response format, Aiduct normalizes everything to OpenAI's ChatCompletion schema. This consistency reduces the surface area for bugs and simplifies testing.

The trade-off is an additional network hop and a small amount of latency overhead. For most applications, this overhead is negligible compared to model inference time, but latency-critical use cases should benchmark end-to-end response times.

Common Gotchas and Best Practices

Model availability: Glm 4 Air is routed through Aiduct's gateway, which means availability depends on both Aiduct's infrastructure and the upstream provider's status. Monitor Aiduct's status page and implement retry logic with exponential backoff in your application code.

Context window limits: Every model has a maximum context length (the sum of input and output tokens). If you're building a multi-turn chat application, be mindful of how quickly conversation history can consume your token budget. Implement context trimming or summarization strategies for long conversations.

Temperature and sampling parameters: Lower temperature values (e.g., 0.2–0.4) produce more deterministic, focused outputs, while higher values (0.8–1.0) increase creativity and variation. For production chatbots, start with a temperature around 0.7 and adjust based on user feedback.

Streaming responses: If your application benefits from showing partial results as they're generated (e.g., a chat UI that types out responses word-by-word), enable streaming by setting stream=True in the OpenAI SDK. Aiduct supports streaming for models that offer it.

Rate limits: Aiduct enforces rate limits to ensure fair usage and system stability. If you anticipate high traffic, reach out to Aiduct support to discuss custom rate limits or dedicated capacity.

Error handling: Always wrap API calls in try-except blocks and handle transient errors gracefully. The OpenAI SDK raises specific exception types (e.g., RateLimitError, APIConnectionError) that you can catch and retry appropriately.

Getting Started

To start using Glm 4 Air via Aiduct:

  1. Sign up for an Aiduct account and generate an API key from the dashboard.
  2. Install the OpenAI Python SDK (pip install openai) or use any OpenAI-compatible HTTP client.
  3. Set your base_url to https://api.aiduct.ai/v1 and your api_key to your Aiduct key.
  4. Specify "model": "glm-4-air" in your chat completion requests.
  5. Monitor usage and performance in the Aiduct dashboard, and iterate on your prompt engineering and model selection as needed.

Glm 4 Air's combination of efficiency, chat-focused design, and Aiduct's unified API makes it a pragmatic choice for teams building conversational AI at scale. Whether you're prototyping a new assistant, optimizing costs in an existing deployment, or exploring alternatives to incumbent providers, Glm 4 Air offers a solid foundation for text-based chat applications.

FAQ

Can I use the OpenAI Python SDK to call Glm 4 Air?+

Yes. Point the SDK's base_url to https://api.aiduct.ai/v1, use your Aiduct API key, and set model to 'glm-4-air'. The interface is fully OpenAI-compatible.

Does Glm 4 Air support function calling or tool use?+

Function calling support depends on the upstream model's capabilities. Check the Aiduct dashboard or docs for the latest feature availability for Glm 4 Air.

How does Glm 4 Air's latency compare to GPT-3.5 Turbo?+

Latency varies by model size, provider infrastructure, and request complexity. Benchmark both models with your typical workload to compare end-to-end response times.

What is the maximum context window for Glm 4 Air?+

Context window size is model-specific. Refer to the upstream provider's documentation or the Aiduct model catalog for Glm 4 Air's token limit.

Can I switch from Glm 4 Air to another model without code changes?+

Yes. Because Aiduct uses a unified OpenAI-compatible schema, you can switch models by changing the 'model' parameter in your request. No SDK or schema changes required.

Where can I find current pricing for Glm 4 Air?+

Visit the /pricing page on Aiduct for up-to-date token rates. Pricing is usage-based and may vary by volume tier or contract terms.

Last refreshed Jul 9, 2026