@ailib-official/ai-protocol 0.8.4
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.
- package/LICENSE +6 -0
- package/README.md +415 -0
- package/dist/index.json +8 -0
- package/dist/v1/models/ai21.json +140 -0
- package/dist/v1/models/baichuan.json +138 -0
- package/dist/v1/models/cerebras.json +147 -0
- package/dist/v1/models/claude.json +114 -0
- package/dist/v1/models/cohere.json +235 -0
- package/dist/v1/models/deepinfra.json +43 -0
- package/dist/v1/models/deepseek-chat.json +55 -0
- package/dist/v1/models/doubao.json +197 -0
- package/dist/v1/models/ernie.json +223 -0
- package/dist/v1/models/fireworks.json +222 -0
- package/dist/v1/models/gemini.json +58 -0
- package/dist/v1/models/gpt.json +166 -0
- package/dist/v1/models/grok.json +138 -0
- package/dist/v1/models/huggingface.json +183 -0
- package/dist/v1/models/hunyuan.json +255 -0
- package/dist/v1/models/jina.json +139 -0
- package/dist/v1/models/lepton.json +188 -0
- package/dist/v1/models/llama.json +143 -0
- package/dist/v1/models/minimax.json +194 -0
- package/dist/v1/models/mistral.json +177 -0
- package/dist/v1/models/moonshot.json +144 -0
- package/dist/v1/models/nvidia.json +212 -0
- package/dist/v1/models/palmyra.json +103 -0
- package/dist/v1/models/perplexity.json +143 -0
- package/dist/v1/models/qwen.json +49 -0
- package/dist/v1/models/replicate.json +206 -0
- package/dist/v1/models/sensenova.json +144 -0
- package/dist/v1/models/siliconflow.json +44 -0
- package/dist/v1/models/spark.json +173 -0
- package/dist/v1/models/stable-diffusion.json +161 -0
- package/dist/v1/models/tiangong.json +169 -0
- package/dist/v1/models/together.json +43 -0
- package/dist/v1/models/yi.json +199 -0
- package/dist/v1/models/zhipu.json +250 -0
- package/dist/v1/providers/ai21.json +215 -0
- package/dist/v1/providers/anthropic.json +253 -0
- package/dist/v1/providers/anyscale.json +115 -0
- package/dist/v1/providers/azure.json +188 -0
- package/dist/v1/providers/baichuan.json +205 -0
- package/dist/v1/providers/baidu.json +205 -0
- package/dist/v1/providers/cerebras.json +216 -0
- package/dist/v1/providers/cohere.json +209 -0
- package/dist/v1/providers/deepinfra.json +196 -0
- package/dist/v1/providers/deepseek.json +221 -0
- package/dist/v1/providers/doubao.json +209 -0
- package/dist/v1/providers/fireworks.json +227 -0
- package/dist/v1/providers/gemini.json +279 -0
- package/dist/v1/providers/groq.json +218 -0
- package/dist/v1/providers/huggingface.json +181 -0
- package/dist/v1/providers/hunyuan.json +198 -0
- package/dist/v1/providers/jina.json +202 -0
- package/dist/v1/providers/lepton.json +221 -0
- package/dist/v1/providers/minimax.json +209 -0
- package/dist/v1/providers/mistral.json +214 -0
- package/dist/v1/providers/moonshot.json +214 -0
- package/dist/v1/providers/nvidia.json +213 -0
- package/dist/v1/providers/openai.json +267 -0
- package/dist/v1/providers/openrouter.json +220 -0
- package/dist/v1/providers/perplexity.json +172 -0
- package/dist/v1/providers/qwen.json +231 -0
- package/dist/v1/providers/replicate.json +192 -0
- package/dist/v1/providers/sensenova.json +185 -0
- package/dist/v1/providers/siliconflow.json +197 -0
- package/dist/v1/providers/spark.json +204 -0
- package/dist/v1/providers/stability.json +221 -0
- package/dist/v1/providers/tiangong.json +207 -0
- package/dist/v1/providers/together.json +196 -0
- package/dist/v1/providers/writer.json +253 -0
- package/dist/v1/providers/xai.json +238 -0
- package/dist/v1/providers/yi.json +205 -0
- package/dist/v1/providers/zhipu.json +208 -0
- package/dist/v1/spec.json +783 -0
- package/dist/v2/providers/anthropic.json +372 -0
- package/dist/v2/providers/cohere.json +109 -0
- package/dist/v2/providers/deepseek.json +272 -0
- package/dist/v2/providers/doubao.json +260 -0
- package/dist/v2/providers/google.json +388 -0
- package/dist/v2/providers/jina.json +71 -0
- package/dist/v2/providers/moonshot.json +284 -0
- package/dist/v2/providers/openai.json +419 -0
- package/dist/v2/providers/qwen.json +274 -0
- package/dist/v2/providers/zhipu.json +257 -0
- package/dist/v2-alpha/providers/anthropic.json +182 -0
- package/dist/v2-alpha/providers/gemini.json +187 -0
- package/dist/v2-alpha/providers/openai.json +215 -0
- package/dist/v2-alpha/spec.json +644 -0
- package/package.json +61 -0
- package/schemas/spec.json +186 -0
- package/schemas/v1.json +1116 -0
- package/schemas/v2/availability.json +66 -0
- package/schemas/v2/capabilities.json +182 -0
- package/schemas/v2/capability-profile.json +174 -0
- package/schemas/v2/computer-use.json +222 -0
- package/schemas/v2/context-policy.json +148 -0
- package/schemas/v2/endpoint.json +2 -0
- package/schemas/v2/error-codes.yaml +225 -0
- package/schemas/v2/errors.json +250 -0
- package/schemas/v2/execution-metadata.json +59 -0
- package/schemas/v2/mcp.json +225 -0
- package/schemas/v2/message-roles.json +10 -0
- package/schemas/v2/multimodal.json +297 -0
- package/schemas/v2/pricing.json +14 -0
- package/schemas/v2/provider-contract.json +317 -0
- package/schemas/v2/provider.json +203 -0
- package/schemas/v2/regions.json +14 -0
- package/v1/models/ai21.yaml +97 -0
- package/v1/models/baichuan.yaml +95 -0
- package/v1/models/cerebras.yaml +99 -0
- package/v1/models/claude.yaml +59 -0
- package/v1/models/cohere.yaml +165 -0
- package/v1/models/deepinfra.yaml +29 -0
- package/v1/models/deepseek-chat.yaml +32 -0
- package/v1/models/doubao.yaml +129 -0
- package/v1/models/ernie.yaml +146 -0
- package/v1/models/fireworks.yaml +145 -0
- package/v1/models/gemini.yaml +32 -0
- package/v1/models/gpt.yaml +90 -0
- package/v1/models/grok.yaml +74 -0
- package/v1/models/huggingface.yaml +110 -0
- package/v1/models/hunyuan.yaml +164 -0
- package/v1/models/jina.yaml +98 -0
- package/v1/models/lepton.yaml +130 -0
- package/v1/models/llama.yaml +91 -0
- package/v1/models/minimax.yaml +132 -0
- package/v1/models/mistral.yaml +100 -0
- package/v1/models/moonshot.yaml +97 -0
- package/v1/models/nvidia.yaml +118 -0
- package/v1/models/palmyra.yaml +59 -0
- package/v1/models/perplexity.yaml +97 -0
- package/v1/models/qwen.yaml +27 -0
- package/v1/models/replicate.yaml +136 -0
- package/v1/models/sensenova.yaml +97 -0
- package/v1/models/siliconflow.yaml +29 -0
- package/v1/models/spark.yaml +114 -0
- package/v1/models/stable-diffusion.yaml +113 -0
- package/v1/models/tiangong.yaml +114 -0
- package/v1/models/together.yaml +29 -0
- package/v1/models/yi.yaml +132 -0
- package/v1/models/zhipu.yaml +163 -0
- package/v1/providers/ai21.yaml +176 -0
- package/v1/providers/anthropic.yaml +209 -0
- package/v1/providers/anyscale.yaml +106 -0
- package/v1/providers/azure.yaml +155 -0
- package/v1/providers/baichuan.yaml +168 -0
- package/v1/providers/baidu.yaml +173 -0
- package/v1/providers/cerebras.yaml +178 -0
- package/v1/providers/cohere.yaml +175 -0
- package/v1/providers/deepinfra.yaml +156 -0
- package/v1/providers/deepseek.yaml +189 -0
- package/v1/providers/doubao.yaml +172 -0
- package/v1/providers/fireworks.yaml +187 -0
- package/v1/providers/gemini.yaml +229 -0
- package/v1/providers/groq.yaml +181 -0
- package/v1/providers/huggingface.yaml +157 -0
- package/v1/providers/hunyuan.yaml +162 -0
- package/v1/providers/jina.yaml +171 -0
- package/v1/providers/lepton.yaml +183 -0
- package/v1/providers/minimax.yaml +172 -0
- package/v1/providers/mistral.yaml +186 -0
- package/v1/providers/moonshot.yaml +176 -0
- package/v1/providers/nvidia.yaml +172 -0
- package/v1/providers/openai.yaml +224 -0
- package/v1/providers/openrouter.yaml +181 -0
- package/v1/providers/perplexity.yaml +144 -0
- package/v1/providers/qwen.yaml +192 -0
- package/v1/providers/replicate.yaml +159 -0
- package/v1/providers/sensenova.yaml +153 -0
- package/v1/providers/siliconflow.yaml +156 -0
- package/v1/providers/spark.yaml +167 -0
- package/v1/providers/stability.yaml +185 -0
- package/v1/providers/tiangong.yaml +170 -0
- package/v1/providers/together.yaml +156 -0
- package/v1/providers/writer.yaml +212 -0
- package/v1/providers/xai.yaml +206 -0
- package/v1/providers/yi.yaml +168 -0
- package/v1/providers/zhipu.yaml +171 -0
- package/v1/spec.yaml +637 -0
- package/v2/providers/anthropic.yaml +244 -0
- package/v2/providers/cohere.yaml +75 -0
- package/v2/providers/deepseek.yaml +176 -0
- package/v2/providers/doubao.yaml +169 -0
- package/v2/providers/google.yaml +245 -0
- package/v2/providers/jina.yaml +55 -0
- package/v2/providers/moonshot.yaml +186 -0
- package/v2/providers/openai.yaml +266 -0
- package/v2/providers/qwen.yaml +174 -0
- package/v2/providers/zhipu.yaml +176 -0
- package/v2-alpha/providers/anthropic.yaml +134 -0
- package/v2-alpha/providers/gemini.yaml +144 -0
- package/v2-alpha/providers/openai.yaml +154 -0
- package/v2-alpha/spec.yaml +512 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# OpenAI V2 正式提供商清单 — 合并 v2-alpha 结构与最新模型数据
|
|
2
|
+
# AI-Protocol V2 Provider Manifest
|
|
3
|
+
# Provider: OpenAI | Models: GPT-5.x series
|
|
4
|
+
# Last Updated: 2026-02-19
|
|
5
|
+
$schema: "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/provider.json"
|
|
6
|
+
|
|
7
|
+
# === Ring 1: Core Skeleton ===
|
|
8
|
+
id: openai
|
|
9
|
+
protocol_version: "2.0"
|
|
10
|
+
name: "OpenAI"
|
|
11
|
+
version: "5.3.0"
|
|
12
|
+
status: stable
|
|
13
|
+
category: ai_provider
|
|
14
|
+
official_url: "https://platform.openai.com/docs"
|
|
15
|
+
support_contact: "https://help.openai.com"
|
|
16
|
+
|
|
17
|
+
endpoint:
|
|
18
|
+
base_url: "https://api.openai.com/v1"
|
|
19
|
+
chat: "/chat/completions"
|
|
20
|
+
embeddings: "/embeddings"
|
|
21
|
+
stt: "/audio/transcriptions"
|
|
22
|
+
tts: "/audio/speech"
|
|
23
|
+
auth:
|
|
24
|
+
type: "bearer"
|
|
25
|
+
header: "Authorization"
|
|
26
|
+
prefix: "Bearer"
|
|
27
|
+
token_env: "OPENAI_API_KEY"
|
|
28
|
+
|
|
29
|
+
error_classification:
|
|
30
|
+
by_http_status:
|
|
31
|
+
"400": "invalid_request"
|
|
32
|
+
"401": "authentication"
|
|
33
|
+
"403": "permission_denied"
|
|
34
|
+
"404": "not_found"
|
|
35
|
+
"413": "request_too_large"
|
|
36
|
+
"429": "rate_limited"
|
|
37
|
+
"500": "server_error"
|
|
38
|
+
"503": "overloaded"
|
|
39
|
+
by_error_code:
|
|
40
|
+
"invalid_api_key": "authentication"
|
|
41
|
+
"model_not_found": "not_found"
|
|
42
|
+
"context_length_exceeded": "request_too_large"
|
|
43
|
+
"rate_limit_exceeded": "rate_limited"
|
|
44
|
+
"insufficient_quota": "quota_exhausted"
|
|
45
|
+
"server_error": "server_error"
|
|
46
|
+
|
|
47
|
+
# === Ring 2: Capability Mapping ===
|
|
48
|
+
capabilities:
|
|
49
|
+
required:
|
|
50
|
+
- text
|
|
51
|
+
- streaming
|
|
52
|
+
- tools
|
|
53
|
+
optional:
|
|
54
|
+
- vision
|
|
55
|
+
- audio
|
|
56
|
+
- parallel_tools
|
|
57
|
+
- agentic
|
|
58
|
+
- reasoning
|
|
59
|
+
- embeddings
|
|
60
|
+
- structured_output
|
|
61
|
+
- batch
|
|
62
|
+
- image_generation
|
|
63
|
+
- computer_use
|
|
64
|
+
- mcp_client
|
|
65
|
+
- stt
|
|
66
|
+
- tts
|
|
67
|
+
feature_flags:
|
|
68
|
+
structured_output: true
|
|
69
|
+
parallel_tool_calls: true
|
|
70
|
+
extended_thinking: true
|
|
71
|
+
streaming_usage: true
|
|
72
|
+
system_messages: true
|
|
73
|
+
image_generation: true
|
|
74
|
+
|
|
75
|
+
capability_profile:
|
|
76
|
+
phase: "ios_v1"
|
|
77
|
+
inputs:
|
|
78
|
+
modalities: ["text", "image", "audio"]
|
|
79
|
+
outcomes:
|
|
80
|
+
types: ["text_completion", "structured_json", "tool_call_sequence"]
|
|
81
|
+
systems:
|
|
82
|
+
requires: ["mcp", "search"]
|
|
83
|
+
|
|
84
|
+
parameters:
|
|
85
|
+
temperature: { type: float, range: [0.0, 2.0], default: 1.0 }
|
|
86
|
+
max_tokens: { type: integer, min: 1, max: 128000 }
|
|
87
|
+
top_p: { type: float, range: [0.0, 1.0] }
|
|
88
|
+
frequency_penalty: { type: float, range: [-2.0, 2.0] }
|
|
89
|
+
presence_penalty: { type: float, range: [-2.0, 2.0] }
|
|
90
|
+
stream: { type: boolean }
|
|
91
|
+
n: { type: integer, min: 1 }
|
|
92
|
+
response_format: { type: object }
|
|
93
|
+
|
|
94
|
+
streaming:
|
|
95
|
+
decoder:
|
|
96
|
+
format: "sse"
|
|
97
|
+
strategy: "openai_chat"
|
|
98
|
+
done_signal: "[DONE]"
|
|
99
|
+
prefix: "data: "
|
|
100
|
+
event_map:
|
|
101
|
+
- match: "$.choices[0].delta.content"
|
|
102
|
+
emit: "PartialContentDelta"
|
|
103
|
+
extract:
|
|
104
|
+
content: "$.choices[0].delta.content"
|
|
105
|
+
- match: "$.choices[0].delta.tool_calls"
|
|
106
|
+
emit: "PartialToolCall"
|
|
107
|
+
extract:
|
|
108
|
+
tool_calls: "$.choices[0].delta.tool_calls"
|
|
109
|
+
- match: "$.choices[0].finish_reason"
|
|
110
|
+
emit: "StreamEnd"
|
|
111
|
+
extract:
|
|
112
|
+
finish_reason: "$.choices[0].finish_reason"
|
|
113
|
+
- match: "$.usage"
|
|
114
|
+
emit: "UsageReport"
|
|
115
|
+
extract:
|
|
116
|
+
usage: "$.usage"
|
|
117
|
+
candidate:
|
|
118
|
+
candidate_id_path: "$.choices[*].index"
|
|
119
|
+
fan_out: true
|
|
120
|
+
accumulator:
|
|
121
|
+
stateful_tool_parsing: true
|
|
122
|
+
key_path: "$.choices[0].delta.tool_calls[0].function.arguments"
|
|
123
|
+
flush_on: "$.choices[0].finish_reason == 'tool_calls'"
|
|
124
|
+
|
|
125
|
+
multimodal:
|
|
126
|
+
input:
|
|
127
|
+
vision:
|
|
128
|
+
supported: true
|
|
129
|
+
formats: [jpeg, png, gif, webp]
|
|
130
|
+
encoding_methods: [base64_inline, url]
|
|
131
|
+
document_understanding: true
|
|
132
|
+
audio:
|
|
133
|
+
supported: true
|
|
134
|
+
formats: [mp3, wav, flac, m4a, ogg, aac]
|
|
135
|
+
real_time_streaming: true
|
|
136
|
+
speech_recognition: true
|
|
137
|
+
video:
|
|
138
|
+
supported: false
|
|
139
|
+
output:
|
|
140
|
+
text: true
|
|
141
|
+
audio:
|
|
142
|
+
supported: true
|
|
143
|
+
formats: [mp3]
|
|
144
|
+
real_time_tts: true
|
|
145
|
+
natural_voice: true
|
|
146
|
+
voice_selection: true
|
|
147
|
+
image:
|
|
148
|
+
supported: true
|
|
149
|
+
formats: [png]
|
|
150
|
+
|
|
151
|
+
computer_use:
|
|
152
|
+
supported: true
|
|
153
|
+
status: preview
|
|
154
|
+
implementation: screen_based
|
|
155
|
+
actions:
|
|
156
|
+
screenshot:
|
|
157
|
+
supported: true
|
|
158
|
+
formats: [png]
|
|
159
|
+
mouse:
|
|
160
|
+
supported: true
|
|
161
|
+
operations: [click, double_click, drag, scroll]
|
|
162
|
+
keyboard:
|
|
163
|
+
supported: true
|
|
164
|
+
operations: [type, key_press, shortcut]
|
|
165
|
+
browser:
|
|
166
|
+
supported: true
|
|
167
|
+
operations: [navigate, fill_form, click_element]
|
|
168
|
+
safety:
|
|
169
|
+
confirmation_required: true
|
|
170
|
+
sandbox_mode: recommended
|
|
171
|
+
action_logging: true
|
|
172
|
+
domain_allowlist: false
|
|
173
|
+
sensitive_data_protection: true
|
|
174
|
+
environment:
|
|
175
|
+
browser: true
|
|
176
|
+
desktop: true
|
|
177
|
+
provider_mapping:
|
|
178
|
+
tool_type: "computer_use_preview"
|
|
179
|
+
model_requirement: "computer-use-preview"
|
|
180
|
+
api_endpoint: "/v1/responses"
|
|
181
|
+
|
|
182
|
+
mcp:
|
|
183
|
+
client:
|
|
184
|
+
supported: true
|
|
185
|
+
protocol_version: "2025-11-25"
|
|
186
|
+
transports: [streamable_http, sse]
|
|
187
|
+
auth_methods: [bearer, oauth2]
|
|
188
|
+
capabilities:
|
|
189
|
+
tools: true
|
|
190
|
+
resources: false
|
|
191
|
+
prompts: false
|
|
192
|
+
sampling: false
|
|
193
|
+
tool_filtering:
|
|
194
|
+
allowed_tools: true
|
|
195
|
+
denied_tools: false
|
|
196
|
+
approval_modes: [never, always]
|
|
197
|
+
provider_mapping:
|
|
198
|
+
tool_type: "mcp"
|
|
199
|
+
api_endpoint: "/v1/responses"
|
|
200
|
+
config_method: tool_parameter
|
|
201
|
+
|
|
202
|
+
# === Ring 3: Advanced Extensions ===
|
|
203
|
+
api_families: ["chat_completions", "completions", "embeddings", "assistants", "realtime"]
|
|
204
|
+
default_api_family: "chat_completions"
|
|
205
|
+
|
|
206
|
+
endpoints:
|
|
207
|
+
chat:
|
|
208
|
+
path: "/chat/completions"
|
|
209
|
+
method: "POST"
|
|
210
|
+
adapter: "openai"
|
|
211
|
+
embeddings:
|
|
212
|
+
path: "/embeddings"
|
|
213
|
+
method: "POST"
|
|
214
|
+
adapter: "openai"
|
|
215
|
+
|
|
216
|
+
services:
|
|
217
|
+
list_models:
|
|
218
|
+
path: "/models"
|
|
219
|
+
method: "GET"
|
|
220
|
+
response_binding: "data"
|
|
221
|
+
|
|
222
|
+
rate_limit_headers:
|
|
223
|
+
requests_limit: "x-ratelimit-limit-requests"
|
|
224
|
+
requests_remaining: "x-ratelimit-remaining-requests"
|
|
225
|
+
tokens_limit: "x-ratelimit-limit-tokens"
|
|
226
|
+
tokens_remaining: "x-ratelimit-remaining-tokens"
|
|
227
|
+
retry_after: "retry-after"
|
|
228
|
+
|
|
229
|
+
retry_policy:
|
|
230
|
+
strategy: "exponential_backoff"
|
|
231
|
+
max_retries: 3
|
|
232
|
+
min_delay_ms: 1000
|
|
233
|
+
max_delay_ms: 60000
|
|
234
|
+
jitter: "full"
|
|
235
|
+
retry_on_http_status: [429, 500, 502, 503]
|
|
236
|
+
|
|
237
|
+
termination:
|
|
238
|
+
source_field: "finish_reason"
|
|
239
|
+
mapping:
|
|
240
|
+
stop: "end_turn"
|
|
241
|
+
length: "max_tokens"
|
|
242
|
+
content_filter: "refusal"
|
|
243
|
+
tool_calls: "tool_use"
|
|
244
|
+
function_call: "tool_use"
|
|
245
|
+
|
|
246
|
+
metadata:
|
|
247
|
+
models:
|
|
248
|
+
gpt-5.2:
|
|
249
|
+
context_window: 400000
|
|
250
|
+
max_output_tokens: 16384
|
|
251
|
+
release_date: "2025-12-10"
|
|
252
|
+
pricing: { input_per_1m: 1.75, output_per_1m: 14.00 }
|
|
253
|
+
gpt-5.3-codex:
|
|
254
|
+
context_window: 400000
|
|
255
|
+
max_output_tokens: 16384
|
|
256
|
+
release_date: "2026-02-05"
|
|
257
|
+
pricing: { input_per_1m: 1.25, output_per_1m: 10.00 }
|
|
258
|
+
gpt-5.3-codex-spark:
|
|
259
|
+
context_window: 128000
|
|
260
|
+
max_output_tokens: 16384
|
|
261
|
+
release_date: "2026-02-12"
|
|
262
|
+
status: research_preview
|
|
263
|
+
sdk:
|
|
264
|
+
python: openai
|
|
265
|
+
typescript: openai
|
|
266
|
+
go: "github.com/openai/openai-go"
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Qwen V2 provider manifest — P0 multimodal generative coverage
|
|
2
|
+
$schema: "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/provider.json"
|
|
3
|
+
|
|
4
|
+
id: qwen
|
|
5
|
+
protocol_version: "2.0"
|
|
6
|
+
name: "Qwen (DashScope)"
|
|
7
|
+
version: "3.0.0"
|
|
8
|
+
status: stable
|
|
9
|
+
category: ai_provider
|
|
10
|
+
official_url: "https://help.aliyun.com/zh/model-studio"
|
|
11
|
+
support_contact: "https://help.aliyun.com"
|
|
12
|
+
|
|
13
|
+
endpoint:
|
|
14
|
+
base_url: "https://dashscope.aliyuncs.com/compatible-mode/v1"
|
|
15
|
+
chat: "/chat/completions"
|
|
16
|
+
auth:
|
|
17
|
+
type: "bearer"
|
|
18
|
+
header: "Authorization"
|
|
19
|
+
prefix: "Bearer"
|
|
20
|
+
token_env: "QWEN_API_KEY"
|
|
21
|
+
|
|
22
|
+
error_classification:
|
|
23
|
+
by_http_status:
|
|
24
|
+
"400": "invalid_request"
|
|
25
|
+
"401": "authentication"
|
|
26
|
+
"403": "permission_denied"
|
|
27
|
+
"404": "not_found"
|
|
28
|
+
"429": "rate_limited"
|
|
29
|
+
"500": "server_error"
|
|
30
|
+
"503": "overloaded"
|
|
31
|
+
|
|
32
|
+
capabilities:
|
|
33
|
+
required:
|
|
34
|
+
- text
|
|
35
|
+
- streaming
|
|
36
|
+
- tools
|
|
37
|
+
optional:
|
|
38
|
+
- vision
|
|
39
|
+
- audio
|
|
40
|
+
- video
|
|
41
|
+
- parallel_tools
|
|
42
|
+
- reasoning
|
|
43
|
+
- structured_output
|
|
44
|
+
- image_generation
|
|
45
|
+
- stt
|
|
46
|
+
- tts
|
|
47
|
+
feature_flags:
|
|
48
|
+
structured_output: true
|
|
49
|
+
parallel_tool_calls: true
|
|
50
|
+
streaming_usage: true
|
|
51
|
+
system_messages: true
|
|
52
|
+
image_generation: true
|
|
53
|
+
|
|
54
|
+
capability_profile:
|
|
55
|
+
phase: "ios_v1"
|
|
56
|
+
inputs:
|
|
57
|
+
modalities: ["text", "image", "audio"]
|
|
58
|
+
outcomes:
|
|
59
|
+
types: ["text_completion", "structured_json", "tool_call_sequence"]
|
|
60
|
+
systems:
|
|
61
|
+
requires: ["mcp", "search"]
|
|
62
|
+
|
|
63
|
+
parameters:
|
|
64
|
+
temperature: { type: float, range: [0.0, 2.0], default: 1.0 }
|
|
65
|
+
max_tokens: { type: integer, min: 1, max: 32000 }
|
|
66
|
+
top_p: { type: float, range: [0.0, 1.0] }
|
|
67
|
+
stream: { type: boolean }
|
|
68
|
+
|
|
69
|
+
parameter_mappings:
|
|
70
|
+
temperature: "temperature"
|
|
71
|
+
max_tokens: "max_tokens"
|
|
72
|
+
stream: "stream"
|
|
73
|
+
top_p: "top_p"
|
|
74
|
+
tools: "tools"
|
|
75
|
+
tool_choice: "tool_choice"
|
|
76
|
+
|
|
77
|
+
streaming:
|
|
78
|
+
decoder:
|
|
79
|
+
format: "sse"
|
|
80
|
+
strategy: "openai_chat"
|
|
81
|
+
done_signal: "[DONE]"
|
|
82
|
+
prefix: "data: "
|
|
83
|
+
content_path: "$.choices[0].delta.content"
|
|
84
|
+
tool_call_path: "$.choices[0].delta.tool_calls"
|
|
85
|
+
usage_path: "$.usage"
|
|
86
|
+
event_map:
|
|
87
|
+
- match: "exists($.choices[*].delta.content)"
|
|
88
|
+
emit: "PartialContentDelta"
|
|
89
|
+
fields:
|
|
90
|
+
content: "$.choices[*].delta.content"
|
|
91
|
+
- match: "exists($.choices[*].delta.tool_calls)"
|
|
92
|
+
emit: "PartialToolCall"
|
|
93
|
+
fields:
|
|
94
|
+
tool_calls: "$.choices[*].delta.tool_calls"
|
|
95
|
+
- match: "exists($.usage)"
|
|
96
|
+
emit: "Metadata"
|
|
97
|
+
fields:
|
|
98
|
+
usage: "$.usage"
|
|
99
|
+
- match: "$.choices[*].finish_reason != null"
|
|
100
|
+
emit: "StreamEnd"
|
|
101
|
+
fields:
|
|
102
|
+
finish_reason: "$.choices[*].finish_reason"
|
|
103
|
+
stop_condition: "$.choices[0].finish_reason != null"
|
|
104
|
+
|
|
105
|
+
multimodal:
|
|
106
|
+
input:
|
|
107
|
+
vision:
|
|
108
|
+
supported: true
|
|
109
|
+
formats: [jpeg, png, gif, webp]
|
|
110
|
+
encoding_methods: [base64_inline, url]
|
|
111
|
+
document_understanding: true
|
|
112
|
+
audio:
|
|
113
|
+
supported: true
|
|
114
|
+
formats: [mp3, wav, flac, ogg, aac]
|
|
115
|
+
speech_recognition: true
|
|
116
|
+
real_time_streaming: true
|
|
117
|
+
video:
|
|
118
|
+
supported: true
|
|
119
|
+
formats: [mp4, mov, avi, webm]
|
|
120
|
+
frame_extraction: automatic
|
|
121
|
+
audio_track: true
|
|
122
|
+
temporal_reasoning: true
|
|
123
|
+
output:
|
|
124
|
+
text: true
|
|
125
|
+
audio:
|
|
126
|
+
supported: true
|
|
127
|
+
formats: [wav, mp3, opus]
|
|
128
|
+
real_time_tts: true
|
|
129
|
+
natural_voice: true
|
|
130
|
+
voice_selection: true
|
|
131
|
+
image:
|
|
132
|
+
supported: true
|
|
133
|
+
formats: [png, jpeg, webp]
|
|
134
|
+
video:
|
|
135
|
+
supported: false
|
|
136
|
+
|
|
137
|
+
api_families: ["chat_completions", "completions"]
|
|
138
|
+
default_api_family: "chat_completions"
|
|
139
|
+
|
|
140
|
+
endpoints:
|
|
141
|
+
chat:
|
|
142
|
+
path: "/chat/completions"
|
|
143
|
+
method: "POST"
|
|
144
|
+
adapter: "openai"
|
|
145
|
+
|
|
146
|
+
services:
|
|
147
|
+
list_models:
|
|
148
|
+
path: "/models"
|
|
149
|
+
method: "GET"
|
|
150
|
+
response_binding: "data"
|
|
151
|
+
|
|
152
|
+
retry_policy:
|
|
153
|
+
strategy: "exponential_backoff"
|
|
154
|
+
max_retries: 2
|
|
155
|
+
min_delay_ms: 1000
|
|
156
|
+
max_delay_ms: 8000
|
|
157
|
+
jitter: "full"
|
|
158
|
+
retry_on_http_status: [408, 409, 429, 500, 503]
|
|
159
|
+
|
|
160
|
+
termination:
|
|
161
|
+
source_field: "finish_reason"
|
|
162
|
+
mapping:
|
|
163
|
+
stop: "end_turn"
|
|
164
|
+
length: "max_tokens"
|
|
165
|
+
tool_calls: "tool_use"
|
|
166
|
+
content_filter: "refusal"
|
|
167
|
+
|
|
168
|
+
metadata:
|
|
169
|
+
api_compatibility: openai
|
|
170
|
+
regional:
|
|
171
|
+
primary: china
|
|
172
|
+
sdk:
|
|
173
|
+
python: openai
|
|
174
|
+
typescript: openai
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# 智谱 GLM-5 V2 正式提供商清单 — SOTA 开源编码模型,OpenAI 兼容 API
|
|
2
|
+
# AI-Protocol V2 Provider Manifest
|
|
3
|
+
# Provider: Zhipu AI (智谱AI) | Models: GLM-5
|
|
4
|
+
# Last Updated: 2026-02-16
|
|
5
|
+
$schema: "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v2/provider.json"
|
|
6
|
+
|
|
7
|
+
# === Ring 1: Core Skeleton ===
|
|
8
|
+
id: zhipu
|
|
9
|
+
protocol_version: "2.0"
|
|
10
|
+
name: "Zhipu AI"
|
|
11
|
+
version: "5.0.0"
|
|
12
|
+
status: stable
|
|
13
|
+
category: ai_provider
|
|
14
|
+
official_url: "https://open.bigmodel.cn/dev/api"
|
|
15
|
+
support_contact: "https://open.bigmodel.cn/"
|
|
16
|
+
|
|
17
|
+
endpoint:
|
|
18
|
+
base_url: "https://open.bigmodel.cn/api/paas/v4"
|
|
19
|
+
chat: "/chat/completions"
|
|
20
|
+
auth:
|
|
21
|
+
type: "bearer"
|
|
22
|
+
header: "Authorization"
|
|
23
|
+
prefix: "Bearer"
|
|
24
|
+
token_env: "ZHIPU_API_KEY"
|
|
25
|
+
|
|
26
|
+
error_classification:
|
|
27
|
+
by_http_status:
|
|
28
|
+
"400": "invalid_request"
|
|
29
|
+
"401": "authentication"
|
|
30
|
+
"403": "permission_denied"
|
|
31
|
+
"404": "not_found"
|
|
32
|
+
"429": "rate_limited"
|
|
33
|
+
"500": "server_error"
|
|
34
|
+
"503": "overloaded"
|
|
35
|
+
by_error_code:
|
|
36
|
+
"context_length_exceeded": "request_too_large"
|
|
37
|
+
"model_not_found": "not_found"
|
|
38
|
+
"rate_limit_exceeded": "rate_limited"
|
|
39
|
+
"insufficient_quota": "quota_exhausted"
|
|
40
|
+
|
|
41
|
+
# === Ring 2: Capability Mapping ===
|
|
42
|
+
capabilities:
|
|
43
|
+
required:
|
|
44
|
+
- text
|
|
45
|
+
- streaming
|
|
46
|
+
- tools
|
|
47
|
+
optional:
|
|
48
|
+
- parallel_tools
|
|
49
|
+
- agentic
|
|
50
|
+
- reasoning
|
|
51
|
+
- structured_output
|
|
52
|
+
feature_flags:
|
|
53
|
+
structured_output: true
|
|
54
|
+
parallel_tool_calls: true
|
|
55
|
+
streaming_usage: true
|
|
56
|
+
system_messages: true
|
|
57
|
+
|
|
58
|
+
capability_profile:
|
|
59
|
+
phase: "ios_v1"
|
|
60
|
+
inputs:
|
|
61
|
+
modalities: ["text", "image"]
|
|
62
|
+
outcomes:
|
|
63
|
+
types: ["text_completion", "structured_json", "tool_call_sequence"]
|
|
64
|
+
systems:
|
|
65
|
+
requires: ["mcp", "search"]
|
|
66
|
+
|
|
67
|
+
parameters:
|
|
68
|
+
temperature: { type: float, range: [0.0, 2.0], default: 1.0 }
|
|
69
|
+
max_tokens: { type: integer, min: 1, max: 128000 }
|
|
70
|
+
top_p: { type: float, range: [0.0, 1.0] }
|
|
71
|
+
stream: { type: boolean }
|
|
72
|
+
|
|
73
|
+
parameter_mappings:
|
|
74
|
+
temperature: "temperature"
|
|
75
|
+
max_tokens: "max_tokens"
|
|
76
|
+
stream: "stream"
|
|
77
|
+
top_p: "top_p"
|
|
78
|
+
tools: "tools"
|
|
79
|
+
tool_choice: "tool_choice"
|
|
80
|
+
|
|
81
|
+
streaming:
|
|
82
|
+
decoder:
|
|
83
|
+
format: "sse"
|
|
84
|
+
strategy: "openai_chat"
|
|
85
|
+
done_signal: "[DONE]"
|
|
86
|
+
prefix: "data: "
|
|
87
|
+
content_path: "$.choices[0].delta.content"
|
|
88
|
+
tool_call_path: "$.choices[0].delta.tool_calls"
|
|
89
|
+
usage_path: "$.usage"
|
|
90
|
+
event_map:
|
|
91
|
+
- match: "exists($.choices[*].delta.content)"
|
|
92
|
+
emit: "PartialContentDelta"
|
|
93
|
+
fields:
|
|
94
|
+
content: "$.choices[*].delta.content"
|
|
95
|
+
- match: "exists($.choices[*].delta.tool_calls)"
|
|
96
|
+
emit: "PartialToolCall"
|
|
97
|
+
fields:
|
|
98
|
+
tool_calls: "$.choices[*].delta.tool_calls"
|
|
99
|
+
- match: "exists($.usage)"
|
|
100
|
+
emit: "Metadata"
|
|
101
|
+
fields:
|
|
102
|
+
usage: "$.usage"
|
|
103
|
+
- match: "$.choices[*].finish_reason != null"
|
|
104
|
+
emit: "StreamEnd"
|
|
105
|
+
fields:
|
|
106
|
+
finish_reason: "$.choices[*].finish_reason"
|
|
107
|
+
stop_condition: "$.choices[0].finish_reason != null"
|
|
108
|
+
|
|
109
|
+
multimodal:
|
|
110
|
+
input:
|
|
111
|
+
vision:
|
|
112
|
+
supported: false
|
|
113
|
+
audio:
|
|
114
|
+
supported: false
|
|
115
|
+
video:
|
|
116
|
+
supported: false
|
|
117
|
+
output:
|
|
118
|
+
text: true
|
|
119
|
+
audio:
|
|
120
|
+
supported: false
|
|
121
|
+
image:
|
|
122
|
+
supported: false
|
|
123
|
+
|
|
124
|
+
# === Ring 3: Advanced Extensions ===
|
|
125
|
+
api_families: ["chat_completions"]
|
|
126
|
+
default_api_family: "chat_completions"
|
|
127
|
+
|
|
128
|
+
endpoints:
|
|
129
|
+
chat:
|
|
130
|
+
path: "/chat/completions"
|
|
131
|
+
method: "POST"
|
|
132
|
+
adapter: "openai"
|
|
133
|
+
|
|
134
|
+
services:
|
|
135
|
+
list_models:
|
|
136
|
+
path: "/models"
|
|
137
|
+
method: "GET"
|
|
138
|
+
|
|
139
|
+
retry_policy:
|
|
140
|
+
strategy: "exponential_backoff"
|
|
141
|
+
max_retries: 3
|
|
142
|
+
min_delay_ms: 1000
|
|
143
|
+
max_delay_ms: 30000
|
|
144
|
+
jitter: "full"
|
|
145
|
+
retry_on_http_status: [429, 500, 502, 503]
|
|
146
|
+
|
|
147
|
+
termination:
|
|
148
|
+
source_field: "finish_reason"
|
|
149
|
+
mapping:
|
|
150
|
+
stop: "end_turn"
|
|
151
|
+
length: "max_tokens"
|
|
152
|
+
tool_calls: "tool_use"
|
|
153
|
+
|
|
154
|
+
metadata:
|
|
155
|
+
api_compatibility: openai
|
|
156
|
+
open_source:
|
|
157
|
+
license: MIT
|
|
158
|
+
hugging_face: "https://huggingface.co/zhipuai/glm-5"
|
|
159
|
+
agentic_engineering:
|
|
160
|
+
supported: true
|
|
161
|
+
capabilities: [long_horizon_planning, multi_step_workflows, autonomous_debugging]
|
|
162
|
+
models:
|
|
163
|
+
glm-5:
|
|
164
|
+
context_window: 200000
|
|
165
|
+
max_output_tokens: 128000
|
|
166
|
+
release_date: "2026-02-11"
|
|
167
|
+
architecture: { type: moe, total: "744B", active: "40B" }
|
|
168
|
+
pricing: { input_per_1m: 1.00, output_per_1m: 3.20 }
|
|
169
|
+
regional:
|
|
170
|
+
primary: china
|
|
171
|
+
alternative_base: "https://api.z.ai/v1"
|
|
172
|
+
international_partners: [aimlapi]
|
|
173
|
+
sdk:
|
|
174
|
+
note: "OpenAI-compatible — use openai SDK with base_url override"
|
|
175
|
+
python: openai
|
|
176
|
+
typescript: openai
|