- glm/glm-5-2
glm/glm-5.2
- context · $0.8400 / M input tokens · $2.6400 / M output tokens
GLM 5.2 is a GLM model route on OurToken for developers evaluating hosted API access, coding workflows, long-context tasks, pricing, and production assistant workloads.
Pricing
Pay-per-use
No upfront costs, pay only for what you use
API Usage
API Access Guide
Code examples
Use the OurToken API endpoint for this model. The examples below use direct HTTP requests and the recommended endpoint for the model family.
curl https://api.ourtoken.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "glm-5.2",
"messages": [
{
"role": "user",
"content": "Hello!"
}
],
"max_tokens": 256
}'Chat Completions API Reference
Create a chat response with the OpenAI Chat Completions-compatible endpoint. Use https://api.ourtoken.ai/v1 as the SDK Base URL and POST /chat/completions as the endpoint.
Authorization
| Content-Type | application/json |
| Authorization | Bearer YOUR_API_KEY |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Model ID to call. |
| messages | array<object> | Required | Conversation messages sent to the model. |
| max_tokens | integer | Optional | Maximum number of output tokens. |
| temperature | number | Optional | Sampling temperature. |
| top_p | number | Optional | Nucleus sampling parameter. |
| stream | boolean | Optional | Whether to return a streaming response. |
| stream_options | object | Optional | Additional options for streaming responses. |
| tools | array<object> | Optional | Tools available to the model. |
| tool_choice | string | object | Optional | Controls how the model selects tools. |
| response_format | object | Optional | Controls structured output, such as JSON object responses. |
Response Body
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | Required | Unique chat completion identifier. |
| object | "chat.completion" | Required | Object type returned by the Chat Completions API. |
| created | integer | Required | Unix timestamp when the response was created. |
| model | string | Required | Model that produced the response. |
| choices | array<object> | Required | Candidate responses returned by the model. |
| choices[].message.role | string | Required | Role of the returned chat message. |
| choices[].message.content | string | Optional | Text content in the returned chat message. |
| choices[].finish_reason | string | Optional | Reason generation stopped. |
| usage | object | Optional | Token usage information for the chat completion. |
| usage.prompt_tokens | integer | Optional | Input token count. |
| usage.completion_tokens | integer | Optional | Output token count. |
| usage.total_tokens | integer | Optional | Total token count. |
| usage.prompt_tokens_details | object | Optional | Breakdown of input token usage. |
| usage.prompt_tokens_details.cached_tokens | integer | Optional | Tokens served from cache. |
Model Introduction
GLM glm-5.2
GLM 5.2 is a GLM model route on OurToken for developers evaluating hosted API access, coding workflows, long-context tasks, pricing, and production assistant workloads.
GLM 5.2 builds on the GLM 5.1 line with a focus on coding capability, long-horizon work, and 1M-context evaluation according to supplied launch material. Use glm 5.2 api through OurToken when you want one endpoint for model testing, pricing review, API keys, usage logs, and production integration.
Why It Looks Great
- 60% of the official GLM 5.2 reference price for input, output, and cache read tokens.
- OpenAI-compatible API setup through the same OurToken endpoint used by other supported models.
- Useful for evaluating GLM coding, agent workflows, long-context sessions, and OpenCode-style development tasks.
- Supplied launch material mentions 1M-context support and GLM Coding Plan availability, while independent benchmark coverage should be reviewed separately.
- Dashboard logs and usage visibility help teams compare request cost after launch.
Key Features
- Model ID: glm-5.2
- Input price: $0.8400 per 1M tokens on OurToken
- Output price: $2.6400 per 1M tokens on OurToken
- Cache read price: $0.1560 per 1M tokens on OurToken
- Cache write price: $0 per 1M tokens on OurToken
- Provider: GLM
Specifications
glm 5.2 api Features for Developers
Use glm 5.2 api for unified GLM access, glm 5.2 pricing visibility, coding evaluation, long-context planning, and production workflow testing.
Unified Access
Call glm 5.2 api through the OurToken unified endpoint instead of wiring a separate GLM provider integration. Developers can create one API key, use glm-5.2 as the model ID, and keep OpenAI-compatible request patterns across testing and production.
Pricing Visibility
Review glm 5.2 pricing before routing traffic. OurToken lists $0.8400 input, $2.6400 output, and $0.1560 cache read per 1M tokens, with cache write listed at $0 for teams estimating prompt and agent workload costs.
Coding Workflows
Evaluate GLM 5.2 model behavior on repository tasks, coding agents, tool-use loops, and planning-heavy development prompts. Supplied launch material positions the model for long-horizon coding, but teams should confirm quality with their own acceptance tests.
Benchmark Context
Use glm 5.2 benchmark searches as discovery signals, not final procurement proof. User-supplied notes include Pac-Man and coding-plan evaluations, while launch coverage says independent benchmark results may still need third-party verification.
OpenCode Testing
Test opencode glm 5.2 workflows by sending realistic multi-step coding prompts through OurToken and reviewing tool behavior, latency, token usage, and output quality. Keep prompts, model ID, and budget assumptions consistent across comparison runs.
Provider Comparison
Compare hosted OurToken access with searches such as glm 5.2 openrouter when evaluating provider choice. OurToken focuses on API keys, usage logs, pricing visibility, and a unified endpoint rather than separate provider-specific setup.
How to Use glm 5.2 api on OurToken
Create an API key, copy glm-5.2, compare glm 5.2 pricing, call the unified endpoint, and test coding workflows.
Create API Key
Create an OurToken API key from the dashboard and store it in a secure server-side environment variable. This gives your backend access to glm 5.2 api without exposing credentials in browser code, notebooks, or public repositories.
01Copy Model ID
Use glm-5.2 as the model value in your request body. Keeping the exact GLM 5.2 model ID in configuration helps developers avoid naming mistakes when comparing local tests, staging traffic, and production routes.
02Call Endpoint
Send chat completion requests to the OurToken unified API endpoint with your API key, model ID, and prompt payload. Existing OpenAI-compatible request patterns can usually be reused after changing the base URL, credential, and model value.
03Compare Pricing
Compare glm 5.2 pricing before scaling traffic: OurToken lists $0.8400 input, $2.6400 output, and $0.1560 cache read per 1M tokens. Cache write is listed at $0, so separate cached prompts from normal input and output.
04Test Coding
Run your own glm 5.2 coding plan with repository tasks, one-shot application builds, OpenCode-style agent sessions, and regression prompts. Public anecdotes can inspire test cases, but production routing should depend on your latency, quality, and cost data.
05Monitor Usage
After launch, review request counts, input tokens, output tokens, cache read tokens, and spend in history logs. This helps teams compare glm 5.2 model performance against actual traffic rather than relying only on benchmark posts or provider listings.
06glm 5.2 api FAQ
Answers about glm 5.2 api access, glm-5.2 model ID, pricing, benchmark interpretation, OpenCode testing, and OpenRouter comparisons.