GLM: Embedding 3 API Reference

Quick Start

Welcome to Infron AI — your unified gateway to cutting-edge language, reasoning, and multimodal models. This guide will walk you through setting up your environment, making basic API calls, and exploring advanced features.


Setup your API Key

To begin using Infron AI, you first need to create an account and generate your API Key.

Once you have your API key, set it as an environment variable in your runtime environment. This allows your applications to securely access Infron’s API.

export INFRON_KEY="YOUR_API_KEY"

You can verify the variable is set correctly by running:

echo $INFRON_KEY

If it prints your API key, you’re ready to start making requests.


Submit a demo request

You can interact with Infron AI through two primary methods: direct API calls or using the OpenAI SDK.

Basic Request
import requests

response = requests.post(
  "https://llm.onerouter.pro/v1/embeddings",
  headers={
    "Authorization": "Bearer <API_KEY>",
    "Content-Type": "application/json",
  },
  json={
    "model": "z-ai/embedding-3",
    "input": "The quick brown fox jumps over the lazy dog"
  }
)

data = response.json()
print(data)

To generate embeddings, send a POST request to /embeddings with your text input and chosen model.


Batch Processing

You can generate embeddings for multiple texts in a single request by passing an array of strings:

import requests

response = requests.post(
  "https://llm.onerouter.pro/v1/embeddings",
  headers={
    "Authorization": "Bearer <API_KEY>",
    "Content-Type": "application/json",
  },
  json={
    "model": "z-ai/embedding-3",
    "input": [
      "Machine learning is a subset of artificial intelligence",
      "Deep learning uses neural networks with multiple layers",
      "Natural language processing enables computers to understand text"
    ]
  }
)

data = response.json()
print(data)

Infron AI is compatible with a wide range of models covering various domains such as text generation, reasoning, coding, and multimodal processing. Refer to the official model catalog to explore all available options.


Next Steps:

  • Try customizing prompts for your use case.
  • Explore streaming responses for real-time applications.
  • Combine structured outputs and multimodal inputs for rich, dynamic experiences.

Your journey with Infron AI starts here — build smarter, faster, and more capable AI applications today.