
guide
EvoLink で GLM-5.2 を Coding Agents に使う方法

EvoLink Team
Product Team
2026年6月18日
5 分
このガイドでは、EvoLink 経由で GLM-5.2 を coding agents、リポジトリ Q&A、長文コンテキスト分析、ツール利用アシスタントに使う方法を説明します。ライブ価格とルート詳細は引き続き製品ページが信頼できる情報源です:GLM-5.2 API on EvoLink。
目標は完全な endpoint リファレンスではなく、最初の成功した呼び出しと本番への引き継ぎです。正確なリクエストパラメータは GLM-5.2 API docs を参照してください。
以下の snippets は OpenAI-compatible SDK pattern として扱ってください。本番前に GLM-5.2 API docs で正確な parameter support を確認してください。
最短セットアップ
| 手順 | やること | 理由 |
|---|---|---|
| 1 | EvoLink API key を作成 | 1 つの key で GLM-5.2 を gateway 経由で呼べる |
| 2 | OpenAI 互換クライアントを使う | 既存 SDK や agent tools を再利用しやすい |
| 3 | model を glm-5.2 にする | slug と model ID の混同を避ける |
| 4 | 小さな prompt でテスト | auth、routing、response を確認 |
| 5 | context と tools を段階追加 | cost と debug を制御 |
OpenAI-compatible Python pattern
from openai import OpenAI
client = OpenAI(
api_key="YOUR_EVOLINK_API_KEY",
base_url="https://api.evolink.ai/v1",
)
response = client.chat.completions.create(
model="glm-5.2",
messages=[
{"role": "system", "content": "You are a concise senior software engineer."},
{"role": "user", "content": "Review this function and suggest one safe refactor."},
],
temperature=0.2,
max_tokens=1024,
)
print(response.choices[0].message.content)OpenAI-compatible Node.js pattern
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.EVOLINK_API_KEY,
baseURL: "https://api.evolink.ai/v1",
});
const response = await client.chat.completions.create({
model: "glm-5.2",
messages: [
{ role: "system", content: "You are a concise senior software engineer." },
{ role: "user", content: "Summarize the risks in this pull request." },
],
temperature: 0.2,
max_tokens: 1024,
});
console.log(response.choices[0].message.content);向いているワークフロー
| ワークフロー | 適性 | 本番メモ |
|---|---|---|
| Repo Q&A | 長文 context で chunking を減らせる | 安定した prefix を再利用 |
| Code review | diff の多段分析に使いやすい | output 上限を設定 |
| Tool agents | Function calling が agent loop を支援 | tool schema は小さく検証 |
| 長文ドキュメント分析 | 契約書、仕様書、レポートに適する | 全文 context を送る前に input tokens を把握 |
| Coding CLIs | OpenAI 互換 route で設定が簡単 | coding CLI gateway を参照 |
コスト管理
入力、出力、cache-read tokens で見積もります。本番前に GLM-5.2 product page の live pricing を確認してください。
- 安定した system prompt と repo summary を prompt の先頭に置く。
- prompt caching が適用される場合は長い prefix を再利用する。
- 単純な回答で足りる場合は深い reasoning control を使わない。
- agent loop には明確な
max_tokens上限を設定する。 - call ごとに input、output、cache reads、latency、retry count を記録する。
本番への引き継ぎ
実際の coding-agent トラフィックをルーティングする前に、次を確認してください。
| 確認項目 | 通過条件 |
|---|---|
| Auth | 新しい EvoLink key で正常な response が返る |
| Model ID | request は glm-5.2 を使い、page slug glm-5-2 を使わない |
| Cost | input/output/cache-read usage が billing または logs で見える |
| Tool calls | フル agent オーケストレーションの前に小さな test で tool schemas が動作する |
| Fallback | agent session 失敗時の second model または manual path がある |
FAQ
どの model ID を使いますか?
glm-5.2 を使います。URL は /glm-5-2 ですが request は dot 付き ID です。OpenAI SDK と互換ですか?
はい。EvoLink base URL と OpenAI-compatible Chat Completions route を使います。
価格はどこで確認しますか?
GLM-5.2 page の live pricing を確認してください。
coding agents に向いていますか?
はい。repo Q&A、code review、長文 context、tool agents に適しています。
最初から tool calling を使うべきですか?
いいえ。まず通常の chat call を確認し、その後 tool schema を追加します。
Prompt caching は常に安くなりますか?
安定した prefix が cache read として扱われる場合に効果があります。


