Package Exports
- @apicity/zaicoding
- @apicity/zaicoding/zod
Readme
@apicity/zaicoding
Z.ai GLM Coding Plan provider for Apicity — standalone, OpenAI-compatible chat completions plus coding-plan usage/quota monitoring.
Runtime dependencies:
zod@^4.4.3— request schemas attached to every POST endpoint as.schema
Installation
npm install @apicity/zaicoding
# or
pnpm add @apicity/zaicodingQuick Start
import { createZaiCoding } from "@apicity/zaicoding";
const zaicoding = createZaiCoding({ apiKey: process.env.ZAI_CODING_PLAN_API_KEY! });API Reference
4 endpoints across 2 groups. Each method mirrors an upstream URL path.
coding
POST zaicoding.api.coding.paas.v4.chat.completions
POST https://api.z.ai/api/coding/paas/v4/chat/completions
const res = await zaicoding.api.coding.paas.v4.chat.completions({ /* ... */ });monitor
GET zaicoding.api.monitor.usage.modelUsage
GET https://api.z.ai/api/monitor/usage/model-usage
const res = await zaicoding.api.monitor.usage.modelUsage({ /* ... */ });GET zaicoding.api.monitor.usage.quota.limit
GET https://api.z.ai/api/monitor/usage/quota/limit
const res = await zaicoding.api.monitor.usage.quota.limit({ /* ... */ });GET zaicoding.api.monitor.usage.toolUsage
GET https://api.z.ai/api/monitor/usage/tool-usage
const res = await zaicoding.api.monitor.usage.toolUsage({ /* ... */ });Part of the apicity monorepo.
License
MIT — see LICENSE.