Language / MODEL API
GLM-5.2
Input $1 · Output $3 / 1M tokens
OVERVIEW
Model overview
GLM-5.2 marks a substantial leap in long-horizon task capability over its predecessor GLM-5.1 and, for the first time, delivers that capability on a solid 1M-token context. GLM-5.2's new capabilities include: Solid 1M Context: A solid 1M-token context that stably sustains long-horizon work Advanced Coding with Flexible Effort: Stronger coding capabilities with multiple thinking effort levels to balance performance and latency Improved Architecture: We propose IndexShare, which reuses the same indexer across every four sparse attention layers, reducing per-token FLOPs by 2.9× at a 1M context length. We also improve GLM-5.2’s MTP layer for speculative decoding, increasing the acceptance length by up to 20% Pure Open: An MIT open-source license — no regional limits, technical access without borders
Specifications
- Category
- Language
- Input modalities
- text
- Output modalities
- text
MODEL PRICING
Model API pricing
Language
USD per 1M tokens| Model | Input | Output | Cache read |
|---|---|---|---|
| GLM-5.2 | $1 | $3 | $0.2 |
Public platform rates refresh every five minutes. A dash means a rate is not provided; it does not mean free. Check the console for final charges.
BUILT FOR YOUR STACK
API quickstart
Expand connection setup and run the preparation commands first. Then save and run the Python or cURL example.
Connection setup & preparationActual API address, model ID, and environment variables
- API address
https://api.ecohash.com/v1- API model ID
GLM-5.2
Replace YOUR_API_KEY with the full inference API key issued in the console. Run setup in macOS/Linux or a compatible shell. JSON cURL examples use the Python standard library to build the request body.
python -m pip install openai
export GIGACOMMA_API_BASE_URL='https://api.ecohash.com/v1'
export GIGACOMMA_MODEL_ID='GLM-5.2'
export GIGACOMMA_API_KEY="YOUR_API_KEY"GIGACOMMA_API_KEY is the environment variable name. Its value is an inference API key from the console, not an OpenAI API key. Get an API key
import osfrom openai import OpenAIMODEL_ID = os.environ["GIGACOMMA_MODEL_ID"]client = OpenAI( base_url=os.environ["GIGACOMMA_API_BASE_URL"], api_key=os.environ["GIGACOMMA_API_KEY"],)response = client.chat.completions.create( model=MODEL_ID, messages=[{"role": "user", "content": "Hello!"}], max_tokens=256,)print(response.choices[0].message.content)