@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.
Files changed (194) hide show
  1. package/LICENSE +6 -0
  2. package/README.md +415 -0
  3. package/dist/index.json +8 -0
  4. package/dist/v1/models/ai21.json +140 -0
  5. package/dist/v1/models/baichuan.json +138 -0
  6. package/dist/v1/models/cerebras.json +147 -0
  7. package/dist/v1/models/claude.json +114 -0
  8. package/dist/v1/models/cohere.json +235 -0
  9. package/dist/v1/models/deepinfra.json +43 -0
  10. package/dist/v1/models/deepseek-chat.json +55 -0
  11. package/dist/v1/models/doubao.json +197 -0
  12. package/dist/v1/models/ernie.json +223 -0
  13. package/dist/v1/models/fireworks.json +222 -0
  14. package/dist/v1/models/gemini.json +58 -0
  15. package/dist/v1/models/gpt.json +166 -0
  16. package/dist/v1/models/grok.json +138 -0
  17. package/dist/v1/models/huggingface.json +183 -0
  18. package/dist/v1/models/hunyuan.json +255 -0
  19. package/dist/v1/models/jina.json +139 -0
  20. package/dist/v1/models/lepton.json +188 -0
  21. package/dist/v1/models/llama.json +143 -0
  22. package/dist/v1/models/minimax.json +194 -0
  23. package/dist/v1/models/mistral.json +177 -0
  24. package/dist/v1/models/moonshot.json +144 -0
  25. package/dist/v1/models/nvidia.json +212 -0
  26. package/dist/v1/models/palmyra.json +103 -0
  27. package/dist/v1/models/perplexity.json +143 -0
  28. package/dist/v1/models/qwen.json +49 -0
  29. package/dist/v1/models/replicate.json +206 -0
  30. package/dist/v1/models/sensenova.json +144 -0
  31. package/dist/v1/models/siliconflow.json +44 -0
  32. package/dist/v1/models/spark.json +173 -0
  33. package/dist/v1/models/stable-diffusion.json +161 -0
  34. package/dist/v1/models/tiangong.json +169 -0
  35. package/dist/v1/models/together.json +43 -0
  36. package/dist/v1/models/yi.json +199 -0
  37. package/dist/v1/models/zhipu.json +250 -0
  38. package/dist/v1/providers/ai21.json +215 -0
  39. package/dist/v1/providers/anthropic.json +253 -0
  40. package/dist/v1/providers/anyscale.json +115 -0
  41. package/dist/v1/providers/azure.json +188 -0
  42. package/dist/v1/providers/baichuan.json +205 -0
  43. package/dist/v1/providers/baidu.json +205 -0
  44. package/dist/v1/providers/cerebras.json +216 -0
  45. package/dist/v1/providers/cohere.json +209 -0
  46. package/dist/v1/providers/deepinfra.json +196 -0
  47. package/dist/v1/providers/deepseek.json +221 -0
  48. package/dist/v1/providers/doubao.json +209 -0
  49. package/dist/v1/providers/fireworks.json +227 -0
  50. package/dist/v1/providers/gemini.json +279 -0
  51. package/dist/v1/providers/groq.json +218 -0
  52. package/dist/v1/providers/huggingface.json +181 -0
  53. package/dist/v1/providers/hunyuan.json +198 -0
  54. package/dist/v1/providers/jina.json +202 -0
  55. package/dist/v1/providers/lepton.json +221 -0
  56. package/dist/v1/providers/minimax.json +209 -0
  57. package/dist/v1/providers/mistral.json +214 -0
  58. package/dist/v1/providers/moonshot.json +214 -0
  59. package/dist/v1/providers/nvidia.json +213 -0
  60. package/dist/v1/providers/openai.json +267 -0
  61. package/dist/v1/providers/openrouter.json +220 -0
  62. package/dist/v1/providers/perplexity.json +172 -0
  63. package/dist/v1/providers/qwen.json +231 -0
  64. package/dist/v1/providers/replicate.json +192 -0
  65. package/dist/v1/providers/sensenova.json +185 -0
  66. package/dist/v1/providers/siliconflow.json +197 -0
  67. package/dist/v1/providers/spark.json +204 -0
  68. package/dist/v1/providers/stability.json +221 -0
  69. package/dist/v1/providers/tiangong.json +207 -0
  70. package/dist/v1/providers/together.json +196 -0
  71. package/dist/v1/providers/writer.json +253 -0
  72. package/dist/v1/providers/xai.json +238 -0
  73. package/dist/v1/providers/yi.json +205 -0
  74. package/dist/v1/providers/zhipu.json +208 -0
  75. package/dist/v1/spec.json +783 -0
  76. package/dist/v2/providers/anthropic.json +372 -0
  77. package/dist/v2/providers/cohere.json +109 -0
  78. package/dist/v2/providers/deepseek.json +272 -0
  79. package/dist/v2/providers/doubao.json +260 -0
  80. package/dist/v2/providers/google.json +388 -0
  81. package/dist/v2/providers/jina.json +71 -0
  82. package/dist/v2/providers/moonshot.json +284 -0
  83. package/dist/v2/providers/openai.json +419 -0
  84. package/dist/v2/providers/qwen.json +274 -0
  85. package/dist/v2/providers/zhipu.json +257 -0
  86. package/dist/v2-alpha/providers/anthropic.json +182 -0
  87. package/dist/v2-alpha/providers/gemini.json +187 -0
  88. package/dist/v2-alpha/providers/openai.json +215 -0
  89. package/dist/v2-alpha/spec.json +644 -0
  90. package/package.json +61 -0
  91. package/schemas/spec.json +186 -0
  92. package/schemas/v1.json +1116 -0
  93. package/schemas/v2/availability.json +66 -0
  94. package/schemas/v2/capabilities.json +182 -0
  95. package/schemas/v2/capability-profile.json +174 -0
  96. package/schemas/v2/computer-use.json +222 -0
  97. package/schemas/v2/context-policy.json +148 -0
  98. package/schemas/v2/endpoint.json +2 -0
  99. package/schemas/v2/error-codes.yaml +225 -0
  100. package/schemas/v2/errors.json +250 -0
  101. package/schemas/v2/execution-metadata.json +59 -0
  102. package/schemas/v2/mcp.json +225 -0
  103. package/schemas/v2/message-roles.json +10 -0
  104. package/schemas/v2/multimodal.json +297 -0
  105. package/schemas/v2/pricing.json +14 -0
  106. package/schemas/v2/provider-contract.json +317 -0
  107. package/schemas/v2/provider.json +203 -0
  108. package/schemas/v2/regions.json +14 -0
  109. package/v1/models/ai21.yaml +97 -0
  110. package/v1/models/baichuan.yaml +95 -0
  111. package/v1/models/cerebras.yaml +99 -0
  112. package/v1/models/claude.yaml +59 -0
  113. package/v1/models/cohere.yaml +165 -0
  114. package/v1/models/deepinfra.yaml +29 -0
  115. package/v1/models/deepseek-chat.yaml +32 -0
  116. package/v1/models/doubao.yaml +129 -0
  117. package/v1/models/ernie.yaml +146 -0
  118. package/v1/models/fireworks.yaml +145 -0
  119. package/v1/models/gemini.yaml +32 -0
  120. package/v1/models/gpt.yaml +90 -0
  121. package/v1/models/grok.yaml +74 -0
  122. package/v1/models/huggingface.yaml +110 -0
  123. package/v1/models/hunyuan.yaml +164 -0
  124. package/v1/models/jina.yaml +98 -0
  125. package/v1/models/lepton.yaml +130 -0
  126. package/v1/models/llama.yaml +91 -0
  127. package/v1/models/minimax.yaml +132 -0
  128. package/v1/models/mistral.yaml +100 -0
  129. package/v1/models/moonshot.yaml +97 -0
  130. package/v1/models/nvidia.yaml +118 -0
  131. package/v1/models/palmyra.yaml +59 -0
  132. package/v1/models/perplexity.yaml +97 -0
  133. package/v1/models/qwen.yaml +27 -0
  134. package/v1/models/replicate.yaml +136 -0
  135. package/v1/models/sensenova.yaml +97 -0
  136. package/v1/models/siliconflow.yaml +29 -0
  137. package/v1/models/spark.yaml +114 -0
  138. package/v1/models/stable-diffusion.yaml +113 -0
  139. package/v1/models/tiangong.yaml +114 -0
  140. package/v1/models/together.yaml +29 -0
  141. package/v1/models/yi.yaml +132 -0
  142. package/v1/models/zhipu.yaml +163 -0
  143. package/v1/providers/ai21.yaml +176 -0
  144. package/v1/providers/anthropic.yaml +209 -0
  145. package/v1/providers/anyscale.yaml +106 -0
  146. package/v1/providers/azure.yaml +155 -0
  147. package/v1/providers/baichuan.yaml +168 -0
  148. package/v1/providers/baidu.yaml +173 -0
  149. package/v1/providers/cerebras.yaml +178 -0
  150. package/v1/providers/cohere.yaml +175 -0
  151. package/v1/providers/deepinfra.yaml +156 -0
  152. package/v1/providers/deepseek.yaml +189 -0
  153. package/v1/providers/doubao.yaml +172 -0
  154. package/v1/providers/fireworks.yaml +187 -0
  155. package/v1/providers/gemini.yaml +229 -0
  156. package/v1/providers/groq.yaml +181 -0
  157. package/v1/providers/huggingface.yaml +157 -0
  158. package/v1/providers/hunyuan.yaml +162 -0
  159. package/v1/providers/jina.yaml +171 -0
  160. package/v1/providers/lepton.yaml +183 -0
  161. package/v1/providers/minimax.yaml +172 -0
  162. package/v1/providers/mistral.yaml +186 -0
  163. package/v1/providers/moonshot.yaml +176 -0
  164. package/v1/providers/nvidia.yaml +172 -0
  165. package/v1/providers/openai.yaml +224 -0
  166. package/v1/providers/openrouter.yaml +181 -0
  167. package/v1/providers/perplexity.yaml +144 -0
  168. package/v1/providers/qwen.yaml +192 -0
  169. package/v1/providers/replicate.yaml +159 -0
  170. package/v1/providers/sensenova.yaml +153 -0
  171. package/v1/providers/siliconflow.yaml +156 -0
  172. package/v1/providers/spark.yaml +167 -0
  173. package/v1/providers/stability.yaml +185 -0
  174. package/v1/providers/tiangong.yaml +170 -0
  175. package/v1/providers/together.yaml +156 -0
  176. package/v1/providers/writer.yaml +212 -0
  177. package/v1/providers/xai.yaml +206 -0
  178. package/v1/providers/yi.yaml +168 -0
  179. package/v1/providers/zhipu.yaml +171 -0
  180. package/v1/spec.yaml +637 -0
  181. package/v2/providers/anthropic.yaml +244 -0
  182. package/v2/providers/cohere.yaml +75 -0
  183. package/v2/providers/deepseek.yaml +176 -0
  184. package/v2/providers/doubao.yaml +169 -0
  185. package/v2/providers/google.yaml +245 -0
  186. package/v2/providers/jina.yaml +55 -0
  187. package/v2/providers/moonshot.yaml +186 -0
  188. package/v2/providers/openai.yaml +266 -0
  189. package/v2/providers/qwen.yaml +174 -0
  190. package/v2/providers/zhipu.yaml +176 -0
  191. package/v2-alpha/providers/anthropic.yaml +134 -0
  192. package/v2-alpha/providers/gemini.yaml +144 -0
  193. package/v2-alpha/providers/openai.yaml +154 -0
  194. package/v2-alpha/spec.yaml +512 -0
@@ -0,0 +1,1116 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v1.json",
4
+ "title": "AI-Protocol v1.1 Specification",
5
+ "description": "JSON Schema for AI-Protocol v1.1 provider and model specifications",
6
+ "type": "object",
7
+ "properties": {
8
+ "$schema": {
9
+ "type": "string",
10
+ "anyOf": [
11
+ {
12
+ "enum": [
13
+ "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v1.json"
14
+ ]
15
+ },
16
+ {
17
+ "pattern": "^(https://raw\\.githubusercontent\\.com/ailib-official/ai-protocol/(main|master|v\\d+\\.\\d+)/schemas/v1\\.json|\\.\\./schemas/v1\\.json)$"
18
+ }
19
+ ],
20
+ "description": "Schema reference: GitHub raw URL (preferred) or relative path (for local development)"
21
+ },
22
+ "id": {
23
+ "type": "string",
24
+ "description": "Unique identifier for the provider"
25
+ },
26
+ "provider_id": {
27
+ "type": "string",
28
+ "description": "Optional provider identifier used for auth key lookup and compatibility aliases."
29
+ },
30
+ "protocol_version": {
31
+ "type": "string",
32
+ "enum": [
33
+ "1.1",
34
+ "1.5"
35
+ ],
36
+ "description": "AI-Protocol version this specification conforms to"
37
+ },
38
+ "version": {
39
+ "type": "string",
40
+ "description": "Provider API version"
41
+ },
42
+ "name": {
43
+ "type": "string",
44
+ "description": "Human-readable provider name"
45
+ },
46
+ "status": {
47
+ "type": "string",
48
+ "enum": [
49
+ "stable",
50
+ "beta",
51
+ "deprecated"
52
+ ],
53
+ "description": "Provider status"
54
+ },
55
+ "category": {
56
+ "type": "string",
57
+ "enum": [
58
+ "ai_provider",
59
+ "model_provider",
60
+ "third_party_aggregator"
61
+ ],
62
+ "description": "Provider category"
63
+ },
64
+ "official_url": {
65
+ "type": "string",
66
+ "format": "uri",
67
+ "description": "Official documentation website"
68
+ },
69
+ "support_contact": {
70
+ "type": "string",
71
+ "format": "uri",
72
+ "description": "Support or feedback link"
73
+ },
74
+ "endpoint": {
75
+ "type": "object",
76
+ "description": "Structured endpoint definition (v1.1+ extension)",
77
+ "properties": {
78
+ "base_url": {
79
+ "type": "string",
80
+ "format": "uri",
81
+ "description": "Absolute base URL of the provider API"
82
+ },
83
+ "protocol": {
84
+ "type": "string",
85
+ "enum": [
86
+ "https",
87
+ "http",
88
+ "ws",
89
+ "wss"
90
+ ],
91
+ "description": "Protocol used for communication"
92
+ },
93
+ "timeout_ms": {
94
+ "type": "integer",
95
+ "minimum": 100,
96
+ "description": "Default timeout for requests in milliseconds"
97
+ }
98
+ },
99
+ "required": [
100
+ "base_url"
101
+ ],
102
+ "additionalProperties": false
103
+ },
104
+ "availability": {
105
+ "type": "object",
106
+ "description": "Provider availability configuration and health check (v1.1+ extension)",
107
+ "properties": {
108
+ "required": {
109
+ "type": "boolean",
110
+ "description": "Whether the provider must be reachable at runtime startup"
111
+ },
112
+ "regions": {
113
+ "type": "array",
114
+ "minItems": 1,
115
+ "items": {
116
+ "type": "string",
117
+ "enum": [
118
+ "cn",
119
+ "global",
120
+ "us",
121
+ "eu"
122
+ ]
123
+ },
124
+ "uniqueItems": true,
125
+ "description": "Geographic regions where the provider is available"
126
+ },
127
+ "check": {
128
+ "type": "object",
129
+ "properties": {
130
+ "method": {
131
+ "type": "string",
132
+ "enum": [
133
+ "HEAD",
134
+ "GET"
135
+ ],
136
+ "description": "HTTP method for health check"
137
+ },
138
+ "path": {
139
+ "type": "string",
140
+ "pattern": "^/",
141
+ "description": "Path relative to base_url for health check"
142
+ },
143
+ "expected_status": {
144
+ "type": "array",
145
+ "minItems": 1,
146
+ "items": {
147
+ "type": "integer",
148
+ "minimum": 100,
149
+ "maximum": 599
150
+ },
151
+ "description": "HTTP status codes that indicate healthy state"
152
+ },
153
+ "timeout_ms": {
154
+ "type": "integer",
155
+ "minimum": 100,
156
+ "description": "Timeout for health check in milliseconds"
157
+ }
158
+ },
159
+ "required": [
160
+ "method",
161
+ "path",
162
+ "expected_status"
163
+ ],
164
+ "additionalProperties": false
165
+ },
166
+ "notes": {
167
+ "type": "array",
168
+ "items": { "type": "string" },
169
+ "description": "Human-readable notes about availability configuration"
170
+ }
171
+ },
172
+ "required": [
173
+ "required",
174
+ "regions",
175
+ "check"
176
+ ],
177
+ "additionalProperties": false
178
+ },
179
+ "base_url_template": {
180
+ "type": "string",
181
+ "description": "Template for dynamic base URL construction"
182
+ },
183
+ "auth": {
184
+ "type": "object",
185
+ "properties": {
186
+ "type": {
187
+ "type": "string",
188
+ "enum": [
189
+ "bearer",
190
+ "api_key",
191
+ "query_param"
192
+ ]
193
+ },
194
+ "token_env": {
195
+ "type": "string",
196
+ "description": "Environment variable containing the token"
197
+ },
198
+ "param_name": {
199
+ "type": "string",
200
+ "description": "Query parameter name for auth"
201
+ },
202
+ "key_env": {
203
+ "type": "string",
204
+ "description": "Environment variable for API key"
205
+ },
206
+ "header_name": {
207
+ "type": "string",
208
+ "description": "Custom header name for API key"
209
+ },
210
+ "extra_headers": {
211
+ "type": "array",
212
+ "items": {
213
+ "type": "object",
214
+ "properties": {
215
+ "name": {
216
+ "type": "string"
217
+ },
218
+ "value": {
219
+ "type": "string"
220
+ }
221
+ },
222
+ "required": [
223
+ "name",
224
+ "value"
225
+ ]
226
+ }
227
+ }
228
+ },
229
+ "required": [
230
+ "type"
231
+ ]
232
+ },
233
+ "payload_format": {
234
+ "type": "string",
235
+ "description": "Format identifier for request payload structure"
236
+ },
237
+ "parameter_mappings": {
238
+ "type": "object",
239
+ "description": "Mapping from standard parameters to provider-specific parameters",
240
+ "propertyNames": {
241
+ "enum": [
242
+ "temperature",
243
+ "max_tokens",
244
+ "stream",
245
+ "top_p",
246
+ "stop_sequences",
247
+ "frequency_penalty",
248
+ "presence_penalty",
249
+ "top_k",
250
+ "logprobs",
251
+ "top_logprobs",
252
+ "seed",
253
+ "tools",
254
+ "tool_choice",
255
+ "system_message",
256
+ "response_format_mode",
257
+ "response_format",
258
+ "reasoning_effort",
259
+ "messages",
260
+ "input",
261
+ "inputs",
262
+ "prompt",
263
+ "stop",
264
+ "metadata",
265
+ "logit_bias",
266
+ "model",
267
+ "random_seed",
268
+ "n",
269
+ "parallel_tool_calls",
270
+ "safe_prompt",
271
+ "prompt_mode",
272
+ "prediction",
273
+ "tool_accumulation_strategy",
274
+ "max_tool_calls_per_turn",
275
+ "repetition_penalty",
276
+ "encoding_format",
277
+ "dimensions",
278
+ "top_n",
279
+ "query",
280
+ "documents",
281
+ "return_documents",
282
+ "url",
283
+ "question",
284
+ "negative_prompt",
285
+ "aspect_ratio",
286
+ "steps",
287
+ "cfg_scale",
288
+ "mode",
289
+ "output_format",
290
+ "strength",
291
+ "image",
292
+ "init_image_mode",
293
+ "contents"
294
+ ]
295
+ },
296
+ "additionalProperties": {
297
+ "type": "string"
298
+ }
299
+ },
300
+ "response_format": {
301
+ "type": "string",
302
+ "description": "Format identifier for response structure"
303
+ },
304
+ "response_paths": {
305
+ "type": "object",
306
+ "description": "JSON paths for extracting response data",
307
+ "additionalProperties": {
308
+ "type": "string"
309
+ }
310
+ },
311
+ "streaming": {
312
+ "type": "object",
313
+ "properties": {
314
+ "event_format": {
315
+ "type": "string",
316
+ "description": "Streaming event format identifier"
317
+ },
318
+ "decoder": {
319
+ "type": "object",
320
+ "properties": {
321
+ "format": {
322
+ "type": "string",
323
+ "enum": [
324
+ "sse",
325
+ "openai_sse",
326
+ "anthropic_sse",
327
+ "gemini_json",
328
+ "cohere_native"
329
+ ]
330
+ },
331
+ "strategy": {
332
+ "type": "string",
333
+ "description": "Specific decoding strategy"
334
+ },
335
+ "delimiter": {
336
+ "type": "string"
337
+ },
338
+ "prefix": {
339
+ "type": "string"
340
+ },
341
+ "done_signal": {
342
+ "type": "string"
343
+ }
344
+ }
345
+ },
346
+ "frame_selector": {
347
+ "type": "string",
348
+ "description": "JSONPath expression to identify valid frames"
349
+ },
350
+ "candidate": {
351
+ "type": "object",
352
+ "properties": {
353
+ "candidate_id_path": {
354
+ "type": "string"
355
+ },
356
+ "fan_out": {
357
+ "type": "boolean"
358
+ }
359
+ }
360
+ },
361
+ "accumulator": {
362
+ "type": "object",
363
+ "properties": {
364
+ "stateful_tool_parsing": {
365
+ "type": "boolean"
366
+ },
367
+ "key_path": {
368
+ "type": "string"
369
+ },
370
+ "flush_on": {
371
+ "type": "string"
372
+ }
373
+ }
374
+ },
375
+ "event_map": {
376
+ "type": "array",
377
+ "items": {
378
+ "type": "object",
379
+ "properties": {
380
+ "match": {
381
+ "type": "string"
382
+ },
383
+ "emit": {
384
+ "type": "string",
385
+ "enum": [
386
+ "PartialContentDelta",
387
+ "ThinkingDelta",
388
+ "PartialToolCall",
389
+ "ToolCallStarted",
390
+ "ToolCallEnded",
391
+ "Metadata",
392
+ "FinalCandidate",
393
+ "StreamEnd",
394
+ "StreamError"
395
+ ]
396
+ },
397
+ "fields": {
398
+ "type": "object",
399
+ "additionalProperties": {
400
+ "type": "string"
401
+ }
402
+ },
403
+ "extract": {
404
+ "type": "object",
405
+ "additionalProperties": {
406
+ "type": "string"
407
+ }
408
+ }
409
+ },
410
+ "required": [
411
+ "match",
412
+ "emit"
413
+ ]
414
+ }
415
+ },
416
+ "stop_condition": {
417
+ "type": "string"
418
+ },
419
+ "extra_metadata_path": {
420
+ "type": "string"
421
+ },
422
+ "content_path": {
423
+ "type": "string"
424
+ },
425
+ "tool_call_path": {
426
+ "type": "string"
427
+ },
428
+ "usage_path": {
429
+ "type": "string"
430
+ }
431
+ }
432
+ },
433
+ "features": {
434
+ "type": "object",
435
+ "properties": {
436
+ "multi_candidate": {
437
+ "type": "object",
438
+ "properties": {
439
+ "support_type": {
440
+ "type": "string",
441
+ "enum": [
442
+ "native",
443
+ "simulated"
444
+ ]
445
+ },
446
+ "param_name": {
447
+ "type": "string"
448
+ },
449
+ "max_concurrent": {
450
+ "type": "integer"
451
+ }
452
+ },
453
+ "required": [
454
+ "support_type"
455
+ ]
456
+ },
457
+ "response_mapping": {
458
+ "type": "object",
459
+ "properties": {
460
+ "tool_calls": {
461
+ "type": "object",
462
+ "properties": {
463
+ "path": {
464
+ "type": "string"
465
+ },
466
+ "filter": {
467
+ "type": "string"
468
+ },
469
+ "fields": {
470
+ "type": "object",
471
+ "additionalProperties": {
472
+ "type": "string"
473
+ }
474
+ },
475
+ "array_fan_out": {
476
+ "type": "boolean"
477
+ },
478
+ "id_strategy": {
479
+ "type": "string"
480
+ }
481
+ }
482
+ },
483
+ "error": {
484
+ "type": "object",
485
+ "properties": {
486
+ "message_path": {
487
+ "type": "string"
488
+ },
489
+ "code_path": {
490
+ "type": "string"
491
+ },
492
+ "type_path": {
493
+ "type": "string"
494
+ },
495
+ "param_path": {
496
+ "type": "string"
497
+ },
498
+ "request_id_path": {
499
+ "type": "string"
500
+ },
501
+ "status_path": {
502
+ "type": "string"
503
+ },
504
+ "errors_path": {
505
+ "type": "string"
506
+ },
507
+ "details_path": {
508
+ "type": "string"
509
+ }
510
+ }
511
+ }
512
+ }
513
+ }
514
+ }
515
+ },
516
+ "capabilities": {
517
+ "type": "object",
518
+ "description": "Provider capability definitions",
519
+ "required": [
520
+ "streaming",
521
+ "tools",
522
+ "vision"
523
+ ],
524
+ "properties": {
525
+ "streaming": {
526
+ "type": "boolean",
527
+ "description": "Supports streaming responses"
528
+ },
529
+ "tools": {
530
+ "type": "boolean",
531
+ "description": "Supports tool / function calling"
532
+ },
533
+ "vision": {
534
+ "type": "boolean",
535
+ "description": "Supports image or multimodal inputs"
536
+ },
537
+ "agentic": {
538
+ "type": "boolean",
539
+ "default": false,
540
+ "description": "Supports agentic reasoning and multi-turn tool sequences"
541
+ },
542
+ "reasoning": {
543
+ "type": "boolean",
544
+ "default": false,
545
+ "description": "Supports extended reasoning / thinking blocks"
546
+ },
547
+ "parallel_tools": {
548
+ "type": "boolean",
549
+ "default": false,
550
+ "description": "Supports parallel tool invocations"
551
+ },
552
+ "chat": {
553
+ "type": "boolean",
554
+ "description": "Supports chat completions"
555
+ },
556
+ "multimodal": {
557
+ "type": "boolean",
558
+ "description": "Supports multimodal inputs (images, audio, etc.)"
559
+ },
560
+ "embeddings": {
561
+ "type": "boolean",
562
+ "description": "Supports text embeddings"
563
+ },
564
+ "reranking": {
565
+ "type": "boolean",
566
+ "description": "Supports document reranking"
567
+ },
568
+ "image_generation": {
569
+ "type": "boolean",
570
+ "description": "Supports image generation"
571
+ }
572
+ },
573
+ "additionalProperties": false
574
+ },
575
+ "experimental_features": {
576
+ "type": "array",
577
+ "items": {
578
+ "type": "string"
579
+ }
580
+ },
581
+ "connection_vars": {
582
+ "type": "object",
583
+ "description": "Template variables for dynamic URL construction",
584
+ "additionalProperties": {
585
+ "type": "string"
586
+ }
587
+ },
588
+ "api_families": {
589
+ "type": "array",
590
+ "description": "Declares which API families are supported by this provider configuration (helps avoid mixing incompatible request/response models).",
591
+ "items": {
592
+ "type": "string"
593
+ }
594
+ },
595
+ "default_api_family": {
596
+ "type": "string",
597
+ "description": "The default API family to use when the runtime does not specify one explicitly."
598
+ },
599
+ "endpoints": {
600
+ "type": "object",
601
+ "description": "Named capability endpoints (e.g., chat, embed, vision).",
602
+ "additionalProperties": {
603
+ "oneOf": [
604
+ {
605
+ "type": "string",
606
+ "format": "uri",
607
+ "description": "Absolute URL for non-HTTP endpoints (e.g., WebSocket)"
608
+ },
609
+ {
610
+ "type": "object",
611
+ "properties": {
612
+ "path": {
613
+ "type": "string"
614
+ },
615
+ "method": {
616
+ "type": "string",
617
+ "default": "POST"
618
+ },
619
+ "adapter": {
620
+ "type": "string"
621
+ }
622
+ },
623
+ "required": [
624
+ "path"
625
+ ]
626
+ }
627
+ ]
628
+ }
629
+ },
630
+ "services": {
631
+ "type": "object",
632
+ "description": "Management service endpoints (e.g., list_models, billing).",
633
+ "additionalProperties": {
634
+ "type": "object",
635
+ "properties": {
636
+ "path": {
637
+ "type": "string"
638
+ },
639
+ "method": {
640
+ "type": "string",
641
+ "default": "GET"
642
+ },
643
+ "headers": {
644
+ "type": "object",
645
+ "additionalProperties": {
646
+ "type": "string"
647
+ }
648
+ },
649
+ "query_params": {
650
+ "type": "object",
651
+ "additionalProperties": {
652
+ "type": "string"
653
+ }
654
+ },
655
+ "response_binding": {
656
+ "type": "string"
657
+ }
658
+ },
659
+ "required": [
660
+ "path"
661
+ ]
662
+ }
663
+ },
664
+ "termination": {
665
+ "type": "object",
666
+ "description": "Provider-specific termination fields and mapping guidance.",
667
+ "properties": {
668
+ "source_field": {
669
+ "type": "string",
670
+ "description": "Field name or JSON path where provider reports termination reason (e.g., finish_reason, stop_reason)."
671
+ },
672
+ "mapping": {
673
+ "type": "object",
674
+ "description": "Optional mapping from provider-specific reasons to ai-protocol standard termination reasons.",
675
+ "additionalProperties": {
676
+ "type": "string"
677
+ }
678
+ },
679
+ "notes": {
680
+ "type": "array",
681
+ "items": {
682
+ "type": "string"
683
+ },
684
+ "description": "Optional human-readable notes about streaming/non-streaming behavior."
685
+ }
686
+ },
687
+ "required": [
688
+ "source_field"
689
+ ],
690
+ "additionalProperties": false
691
+ },
692
+ "tooling": {
693
+ "type": "object",
694
+ "description": "Provider-specific tool invocation representation and normalization hints.",
695
+ "properties": {
696
+ "source_model": {
697
+ "type": "string",
698
+ "description": "How the provider represents tool invocations in responses/streams.",
699
+ "enum": [
700
+ "openai_tool_calls",
701
+ "anthropic_content_blocks",
702
+ "gemini_function_call",
703
+ "unknown"
704
+ ]
705
+ },
706
+ "tool_use": {
707
+ "type": "object",
708
+ "description": "Field mapping hints for normalizing tool invocation to standard_schema.content_blocks.tool_use.",
709
+ "properties": {
710
+ "id_path": {
711
+ "type": "string"
712
+ },
713
+ "index_path": {
714
+ "type": "string",
715
+ "description": "Optional path for tool-call index in streaming deltas when id is not present on every frame."
716
+ },
717
+ "name_path": {
718
+ "type": "string"
719
+ },
720
+ "input_path": {
721
+ "type": "string"
722
+ },
723
+ "input_format": {
724
+ "type": "string",
725
+ "enum": [
726
+ "json_string",
727
+ "json_object",
728
+ "unknown"
729
+ ]
730
+ },
731
+ "arguments_path": {
732
+ "type": "string",
733
+ "description": "Path to tool call arguments field"
734
+ }
735
+ },
736
+ "additionalProperties": false
737
+ },
738
+ "tool_result": {
739
+ "type": "object",
740
+ "description": "Field mapping hints for normalizing tool results to standard_schema.content_blocks.tool_result.",
741
+ "properties": {
742
+ "id_path": {
743
+ "type": "string"
744
+ },
745
+ "name_path": {
746
+ "type": "string"
747
+ },
748
+ "response_path": {
749
+ "type": "string"
750
+ },
751
+ "output_path": {
752
+ "type": "string"
753
+ },
754
+ "error_path": {
755
+ "type": "string"
756
+ },
757
+ "format": {
758
+ "type": "string",
759
+ "enum": [
760
+ "json_object",
761
+ "unknown"
762
+ ]
763
+ }
764
+ },
765
+ "additionalProperties": false
766
+ },
767
+ "notes": {
768
+ "type": "array",
769
+ "items": {
770
+ "type": "string"
771
+ }
772
+ }
773
+ },
774
+ "required": [
775
+ "source_model"
776
+ ],
777
+ "additionalProperties": false
778
+ },
779
+ "rate_limit_headers": {
780
+ "type": "object",
781
+ "description": "Provider-specific HTTP response headers that expose rate limit information.",
782
+ "properties": {
783
+ "requests_limit": {
784
+ "type": "string"
785
+ },
786
+ "requests_remaining": {
787
+ "type": "string"
788
+ },
789
+ "requests_reset": {
790
+ "type": "string"
791
+ },
792
+ "tokens_limit": {
793
+ "type": "string"
794
+ },
795
+ "tokens_remaining": {
796
+ "type": "string"
797
+ },
798
+ "tokens_reset": {
799
+ "type": "string"
800
+ },
801
+ "retry_after": {
802
+ "type": "string",
803
+ "description": "Header indicating seconds until retry allowed, if provided by the API."
804
+ }
805
+ },
806
+ "additionalProperties": false
807
+ },
808
+ "retry_policy": {
809
+ "type": "object",
810
+ "description": "Provider-specific retry guidance that runtimes can apply consistently.",
811
+ "properties": {
812
+ "strategy": {
813
+ "type": "string",
814
+ "enum": [
815
+ "none",
816
+ "exponential_backoff"
817
+ ],
818
+ "description": "Retry strategy to apply for retryable errors."
819
+ },
820
+ "max_retries": {
821
+ "type": "integer",
822
+ "minimum": 0,
823
+ "description": "Maximum number of retries (not counting the initial attempt)."
824
+ },
825
+ "min_delay_ms": {
826
+ "type": "integer",
827
+ "minimum": 1,
828
+ "description": "Minimum delay before the first retry."
829
+ },
830
+ "max_delay_ms": {
831
+ "type": "integer",
832
+ "minimum": 0,
833
+ "description": "Maximum delay cap for exponential backoff."
834
+ },
835
+ "jitter": {
836
+ "type": "string",
837
+ "enum": [
838
+ "none",
839
+ "full",
840
+ "equal"
841
+ ],
842
+ "description": "Optional jitter mode for backoff."
843
+ },
844
+ "retry_on_http_status": {
845
+ "type": "array",
846
+ "items": {
847
+ "type": "integer"
848
+ },
849
+ "description": "HTTP status codes that are considered retryable."
850
+ },
851
+ "retry_on_error_status": {
852
+ "type": "array",
853
+ "items": {
854
+ "type": "string"
855
+ },
856
+ "description": "Canonical provider error status strings considered retryable (e.g., RESOURCE_EXHAUSTED)."
857
+ },
858
+ "notes": {
859
+ "type": "array",
860
+ "items": {
861
+ "type": "string"
862
+ }
863
+ }
864
+ },
865
+ "required": [
866
+ "strategy"
867
+ ],
868
+ "additionalProperties": false
869
+ },
870
+ "error_classification": {
871
+ "type": "object",
872
+ "description": "Provider-specific hints for mapping errors into standard_schema.error_handling.error_classes.",
873
+ "properties": {
874
+ "by_http_status": {
875
+ "type": "object",
876
+ "description": "Map HTTP status codes (as strings) to standard error_class ids. Values MUST be one of: invalid_request, authentication, permission_denied, not_found, quota_exhausted, rate_limited, request_too_large, timeout, conflict, cancelled, server_error, overloaded, other.",
877
+ "additionalProperties": {
878
+ "type": "string",
879
+ "enum": [
880
+ "invalid_request",
881
+ "authentication",
882
+ "permission_denied",
883
+ "not_found",
884
+ "quota_exhausted",
885
+ "rate_limited",
886
+ "request_too_large",
887
+ "timeout",
888
+ "conflict",
889
+ "cancelled",
890
+ "server_error",
891
+ "overloaded",
892
+ "other"
893
+ ]
894
+ }
895
+ },
896
+ "by_error_status": {
897
+ "type": "object",
898
+ "description": "Map provider error status strings (e.g., Google canonical status) to standard error_class ids. Values MUST be one of: invalid_request, authentication, permission_denied, not_found, quota_exhausted, rate_limited, request_too_large, timeout, conflict, cancelled, server_error, overloaded, other.",
899
+ "additionalProperties": {
900
+ "type": "string",
901
+ "enum": [
902
+ "invalid_request",
903
+ "authentication",
904
+ "permission_denied",
905
+ "not_found",
906
+ "quota_exhausted",
907
+ "rate_limited",
908
+ "request_too_large",
909
+ "timeout",
910
+ "conflict",
911
+ "cancelled",
912
+ "server_error",
913
+ "overloaded",
914
+ "other"
915
+ ]
916
+ }
917
+ },
918
+ "by_message_contains": {
919
+ "type": "object",
920
+ "description": "Map error message substrings to standard error_class ids.",
921
+ "additionalProperties": {
922
+ "type": "string",
923
+ "enum": [
924
+ "invalid_request",
925
+ "authentication",
926
+ "permission_denied",
927
+ "not_found",
928
+ "quota_exhausted",
929
+ "rate_limited",
930
+ "request_too_large",
931
+ "timeout",
932
+ "conflict",
933
+ "cancelled",
934
+ "server_error",
935
+ "overloaded",
936
+ "other"
937
+ ]
938
+ }
939
+ },
940
+ "notes": {
941
+ "type": "array",
942
+ "items": {
943
+ "type": "string"
944
+ }
945
+ }
946
+ },
947
+ "additionalProperties": false
948
+ },
949
+ "non_streaming": {
950
+ "type": "object",
951
+ "description": "Non-streaming request/response configuration",
952
+ "additionalProperties": true
953
+ },
954
+ "multimodal": {
955
+ "type": "object",
956
+ "description": "Multimodal input configuration",
957
+ "additionalProperties": true
958
+ },
959
+ "content_block_schema": {
960
+ "type": "object",
961
+ "description": "Content block schema definition",
962
+ "additionalProperties": true
963
+ },
964
+ "response_mapping": {
965
+ "type": "object",
966
+ "description": "Response field mapping configuration",
967
+ "additionalProperties": true
968
+ },
969
+ "usage_patterns": {
970
+ "type": "object",
971
+ "description": "Common usage patterns and examples",
972
+ "additionalProperties": true
973
+ },
974
+ "best_practices": {
975
+ "type": "array",
976
+ "items": { "type": "string" },
977
+ "description": "Best practices and recommendations"
978
+ },
979
+ "tips": {
980
+ "type": "array",
981
+ "items": { "type": "string" },
982
+ "description": "Tips for using this configuration"
983
+ },
984
+ "examples": {
985
+ "type": "array",
986
+ "description": "Example requests/responses",
987
+ "items": { "type": "object" }
988
+ },
989
+ "notes": {
990
+ "type": "array",
991
+ "items": { "type": "string" },
992
+ "description": "Human-readable notes about this configuration"
993
+ },
994
+ "models": {
995
+ "type": "object",
996
+ "description": "Static model definitions (v1.1 extension).",
997
+ "propertyNames": {
998
+ "type": "string",
999
+ "pattern": "^[a-zA-Z0-9-_\\./]+$"
1000
+ },
1001
+ "patternProperties": {
1002
+ "^.*$": {
1003
+ "type": "object",
1004
+ "properties": {
1005
+ "provider": {
1006
+ "type": "string"
1007
+ },
1008
+ "model_id": {
1009
+ "type": "string"
1010
+ },
1011
+ "display_name": {
1012
+ "type": "string"
1013
+ },
1014
+ "name": {
1015
+ "type": "string",
1016
+ "description": "Optional short name for the model (alias for display_name)."
1017
+ },
1018
+ "context_window": {
1019
+ "type": "integer"
1020
+ },
1021
+ "capabilities": {
1022
+ "type": "array",
1023
+ "items": {
1024
+ "type": "string"
1025
+ }
1026
+ },
1027
+ "status": {
1028
+ "type": "string"
1029
+ },
1030
+ "tags": {
1031
+ "type": "array",
1032
+ "items": {
1033
+ "type": "string"
1034
+ }
1035
+ },
1036
+ "verification": {
1037
+ "type": "object",
1038
+ "description": "Fact-check metadata for this registry entry.",
1039
+ "properties": {
1040
+ "status": {
1041
+ "type": "string",
1042
+ "enum": ["verified", "unverified"]
1043
+ },
1044
+ "verified_at": {
1045
+ "type": "string",
1046
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
1047
+ },
1048
+ "source": {
1049
+ "type": "string"
1050
+ },
1051
+ "notes": {
1052
+ "type": "string"
1053
+ }
1054
+ },
1055
+ "required": ["status"],
1056
+ "additionalProperties": true
1057
+ },
1058
+ "pricing": {
1059
+ "type": "object",
1060
+ "description": "Pricing information (per-token costs).",
1061
+ "properties": {
1062
+ "input_per_token": {
1063
+ "type": ["number", "null"]
1064
+ },
1065
+ "output_per_token": {
1066
+ "type": ["number", "null"]
1067
+ }
1068
+ },
1069
+ "additionalProperties": true
1070
+ },
1071
+ "modality": {
1072
+ "type": "string",
1073
+ "description": "Model modality (e.g., text, code, image, embedding)"
1074
+ },
1075
+ "dimensions": {
1076
+ "type": "integer",
1077
+ "description": "Output embedding dimensions (for embedding models)"
1078
+ },
1079
+ "agentic_capabilities": {
1080
+ "type": "object",
1081
+ "description": "Agentic / reasoning capability hints.",
1082
+ "additionalProperties": true
1083
+ }
1084
+ },
1085
+ "required": [
1086
+ "provider",
1087
+ "model_id",
1088
+ "verification"
1089
+ ],
1090
+ "additionalProperties": false
1091
+ }
1092
+ },
1093
+ "additionalProperties": false
1094
+ }
1095
+ },
1096
+ "oneOf": [
1097
+ {
1098
+ "description": "Provider Configuration",
1099
+ "required": [
1100
+ "id",
1101
+ "protocol_version",
1102
+ "endpoint",
1103
+ "availability",
1104
+ "capabilities"
1105
+ ]
1106
+ },
1107
+ {
1108
+ "description": "Model Registry Configuration",
1109
+ "required": [
1110
+ "protocol_version",
1111
+ "models"
1112
+ ]
1113
+ }
1114
+ ],
1115
+ "additionalProperties": false
1116
+ }