glm

Solid

Call the GLM API (glm-5.2, glm-5.1, glm-5-turbo, glm-5, glm-4.7, glm-4.6, glm-4.5, glm-4.5-air) through RunAPI using the official OpenAI SDK or compatible clients. Use when the user asks for GLM chat, streaming completions, Anthropic or Gemini protocol compatibility, or when they want to point an existing OpenAI SDK setup at RunAPI as the base URL.

AI & Automation 0 stars 0 forks Updated 5 days ago Apache-2.0

Install

View on GitHub

Quality Score: 78/100

Stars 20%
0
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# GLM on RunAPI Use the official **OpenAI SDK** or any OpenAI-compatible HTTP client and switch the base URL to `https://runapi.ai/v1`. The primary endpoint is Chat Completions (`POST /v1/chat/completions`). ## Setup ```dotenv OPENAI_API_KEY=YOUR_RUNAPI_TOKEN OPENAI_BASE_URL=https://runapi.ai/v1 ``` Get a RunAPI API Key at <https://runapi.ai/api_keys>. ## Core recipe - Chat Completions ```python from openai import OpenAI client = OpenAI( api_key="YOUR_RUNAPI_TOKEN", base_url="https://runapi.ai/v1", ) response = client.chat.completions.create( model="glm-5.2", messages=[{"role": "user", "content": "Summarize this design review."}], ) print(response.choices[0].message.content) print(response.usage) ``` ```typescript import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_RUNAPI_TOKEN", baseURL: "https://runapi.ai/v1", }); const response = await client.chat.completions.create({ model: "glm-5.2", messages: [{ role: "user", content: "Summarize this design review." }], }); ``` ```bash curl -X POST "https://runapi.ai/v1/chat/completions" \ -H "Authorization: Bearer YOUR_RUNAPI_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "model": "glm-5.2", "messages": [{"role": "user", "content": "Hello, GLM!"}] }' ``` ## Streaming ```python stream = client.chat.completions.create( model="glm-5-turbo", messages=[{"role": "user", "content": "Write a short implementation plan."}], stream=True, ) for chunk in stre...

Details

Author
runapi-ai
Repository
runapi-ai/glm
Created
1 months ago
Last Updated
5 days ago
Language
N/A
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category