# GLM 4.7 - Core.Today AI API > Z.ai's GLM 4.7 served through the OpenRouter aggregator - a flagship text model with enhanced programming capabilities and more stable multi-step reasoning/execution, showing clear gains on complex agent tasks. 200K context, billed at OpenRouter's actual usage cost. - **Provider**: Z.ai - **Model ID**: z-ai/glm-4.7 - **Category**: LLM - **Credits**: 2 per 1K tokens (avg, estimate) - **Speed**: Fast - **Quality**: High ## Model Specifications - **Context Window**: 205K tokens - **Max Output**: 131K tokens - **Training Cutoff**: Not published - **Supported Formats**: text, json, markdown - **Compatible SDK**: OpenAI ### Capabilities - Function Calling - Streaming - JSON Mode - System Prompt ### Token Pricing (per 1M tokens) - **Input Tokens**: 743.2 credits ($0.50) - **Output Tokens**: 3,251.5 credits ($2.17) - **Cached Tokens**: 148.64 credits ($0.10) ## Features - 200K-token context window, up to 128K output tokens - Enhanced programming and stable multi-step reasoning/execution - Text-only input and output; reasoning mode supported - OpenAI-compatible API (chat completions) via /llm/openrouter/v1 - Billed at OpenRouter's actual usage.cost - listed rates are estimates ## Use Cases - Coding assistants and code generation - Multi-step agent task execution with tools - Cost-efficient general chat and reasoning ## API Endpoint Base URL: https://api.core.today Endpoint: POST /llm/openrouter/v1/chat/completions ## Authentication Header: Authorization: Bearer YOUR_API_KEY Note: LLM endpoints use OpenAI-compatible format with Authorization Bearer token. ## Input Parameters ### Required - **model**: string - Model ID in vendor/model form, e.g. "z-ai/glm-4.7". - **messages**: array - Chat messages in OpenAI format (system/user/assistant roles). ### Optional - **temperature**: number (default: 0.7) - Sampling temperature (0-2). - **max_tokens**: integer (default: 2048) - Maximum completion tokens. - **stream**: boolean (default: false) - Stream the response as server-sent events. ## Examples ### Chat completion OpenAI-compatible chat completion request via OpenRouter ```json { "model": "z-ai/glm-4.7", "messages": [ { "role": "user", "content": "Summarize the attached report in 5 bullets." } ], "max_tokens": 1024 } ``` ## Response Format ```json { "id": "chatcmpl-abc123", "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Response text here" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 100, "completion_tokens": 50, "total_tokens": 150 } } ``` ## Tips - Works with the OpenAI SDK - set base_url to https://ai.api.core.today/llm/openrouter/v1 - Charged at OpenRouter's usage.cost x 1,858 credits/USD - the listed rates are estimates and may lag OpenRouter price changes - Text-only and cheaper than GLM 5.2 - a good default for coding and agent loops; step up to GLM 5.2 when you need the 1M context ## Documentation https://openrouter.ai/z-ai/glm-4.7