@apicity/zaicoding 0.6.4 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +20 -23
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![dependencies](https://img.shields.io/badge/dependencies-1-blue)](package.json)
5
5
  [![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue?logo=typescript&logoColor=white)](tsconfig.json)
6
6
 
7
- Z.ai GLM Coding Plan provider for Apicity — OpenAI-compatible chat completions plus coding-plan usage and quota monitoring.
7
+ Z.ai GLM Coding Plan provider for Apicity — standalone, OpenAI-compatible chat completions plus coding-plan usage/quota monitoring.
8
8
 
9
9
  Runtime dependencies:
10
10
 
@@ -23,48 +23,41 @@ pnpm add @apicity/zaicoding
23
23
  ```typescript
24
24
  import { createZaiCoding } from "@apicity/zaicoding";
25
25
 
26
- const zaicoding = createZaiCoding({
27
- apiKey: process.env.ZAI_CODING_PLAN_API_KEY!,
28
- });
26
+ const zaicoding = createZaiCoding({ apiKey: process.env.ZAI_CODING_PLAN_API_KEY! });
29
27
  ```
30
28
 
31
29
  ## API Reference
32
30
 
33
31
  4 endpoints across 2 groups. Each method mirrors an upstream URL path.
34
32
 
35
- ### post
33
+ ### coding
36
34
 
37
35
  <details>
38
- <summary><code>POST</code> <b><code>zaicoding.post.api.coding.paas.v4.chat.completions</code></b></summary>
36
+ <summary><code>POST</code> <b><code>zaicoding.api.coding.paas.v4.chat.completions</code></b></summary>
39
37
 
40
38
  <code>POST https://api.z.ai/api/coding/paas/v4/chat/completions</code>
41
39
 
42
40
  [Upstream docs ↗](https://docs.z.ai/api-reference/llm/chat-completion)
43
41
 
44
42
  ```typescript
45
- const res = await zaicoding.post.api.coding.paas.v4.chat.completions({
46
- model: "glm-4-flash",
47
- messages: [{ role: "user", content: "Say hello." }],
48
- });
49
- console.log(res.choices[0].message.content);
43
+ const res = await zaicoding.api.coding.paas.v4.chat.completions({ /* ... */ });
50
44
  ```
51
45
 
52
46
  Source: [`packages/provider/zaicoding/src/zaicoding.ts`](src/zaicoding.ts)
53
47
 
54
48
  </details>
55
49
 
56
- ### get
50
+ ### monitor
57
51
 
58
52
  <details>
59
- <summary><code>GET</code> <b><code>zaicoding.get.api.monitor.usage.quota.limit</code></b></summary>
53
+ <summary><code>GET</code> <b><code>zaicoding.api.monitor.usage.modelUsage</code></b></summary>
60
54
 
61
- <code>GET https://api.z.ai/api/monitor/usage/quota/limit</code>
55
+ <code>GET https://api.z.ai/api/monitor/usage/model-usage</code>
62
56
 
63
57
  [Upstream docs ↗](https://docs.z.ai/api-reference/introduction)
64
58
 
65
59
  ```typescript
66
- const res = await zaicoding.get.api.monitor.usage.quota.limit();
67
- console.log(res.data?.level, res.data?.limits);
60
+ const res = await zaicoding.api.monitor.usage.modelUsage({ /* ... */ });
68
61
  ```
69
62
 
70
63
  Source: [`packages/provider/zaicoding/src/zaicoding.ts`](src/zaicoding.ts)
@@ -72,15 +65,14 @@ Source: [`packages/provider/zaicoding/src/zaicoding.ts`](src/zaicoding.ts)
72
65
  </details>
73
66
 
74
67
  <details>
75
- <summary><code>GET</code> <b><code>zaicoding.get.api.monitor.usage.modelUsage</code></b></summary>
68
+ <summary><code>GET</code> <b><code>zaicoding.api.monitor.usage.quota.limit</code></b></summary>
76
69
 
77
- <code>GET https://api.z.ai/api/monitor/usage/model-usage</code>
70
+ <code>GET https://api.z.ai/api/monitor/usage/quota/limit</code>
78
71
 
79
72
  [Upstream docs ↗](https://docs.z.ai/api-reference/introduction)
80
73
 
81
74
  ```typescript
82
- const res = await zaicoding.get.api.monitor.usage.modelUsage();
83
- console.log(res.data?.totalUsage);
75
+ const res = await zaicoding.api.monitor.usage.quota.limit({ /* ... */ });
84
76
  ```
85
77
 
86
78
  Source: [`packages/provider/zaicoding/src/zaicoding.ts`](src/zaicoding.ts)
@@ -88,17 +80,22 @@ Source: [`packages/provider/zaicoding/src/zaicoding.ts`](src/zaicoding.ts)
88
80
  </details>
89
81
 
90
82
  <details>
91
- <summary><code>GET</code> <b><code>zaicoding.get.api.monitor.usage.toolUsage</code></b></summary>
83
+ <summary><code>GET</code> <b><code>zaicoding.api.monitor.usage.toolUsage</code></b></summary>
92
84
 
93
85
  <code>GET https://api.z.ai/api/monitor/usage/tool-usage</code>
94
86
 
95
87
  [Upstream docs ↗](https://docs.z.ai/api-reference/introduction)
96
88
 
97
89
  ```typescript
98
- const res = await zaicoding.get.api.monitor.usage.toolUsage();
99
- console.log(res.data?.totalUsage);
90
+ const res = await zaicoding.api.monitor.usage.toolUsage({ /* ... */ });
100
91
  ```
101
92
 
102
93
  Source: [`packages/provider/zaicoding/src/zaicoding.ts`](src/zaicoding.ts)
103
94
 
104
95
  </details>
96
+
97
+ Part of the [apicity](https://github.com/justintanner/apicity) monorepo.
98
+
99
+ ## License
100
+
101
+ MIT — see [LICENSE](LICENSE).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apicity/zaicoding",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Z.ai GLM Coding Plan provider for Apicity — standalone, OpenAI-compatible chat completions plus coding-plan usage/quota monitoring.",
5
5
  "license": "MIT",
6
6
  "repository": {