@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,253 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v1.json",
3
+ "id": "anthropic",
4
+ "protocol_version": "1.5",
5
+ "name": "Anthropic",
6
+ "version": "v1",
7
+ "status": "stable",
8
+ "category": "ai_provider",
9
+ "official_url": "https://docs.anthropic.com",
10
+ "support_contact": "https://support.anthropic.com",
11
+ "endpoint": {
12
+ "base_url": "https://api.anthropic.com/v1",
13
+ "protocol": "https",
14
+ "timeout_ms": 10000
15
+ },
16
+ "auth": {
17
+ "type": "bearer",
18
+ "token_env": "ANTHROPIC_API_KEY",
19
+ "extra_headers": [
20
+ {
21
+ "name": "anthropic-version",
22
+ "value": "2023-06-01"
23
+ }
24
+ ]
25
+ },
26
+ "payload_format": "anthropic_style",
27
+ "rate_limit_headers": {
28
+ "retry_after": "retry-after",
29
+ "requests_limit": "anthropic-ratelimit-requests-limit",
30
+ "requests_remaining": "anthropic-ratelimit-requests-remaining",
31
+ "requests_reset": "anthropic-ratelimit-requests-reset",
32
+ "tokens_limit": "anthropic-ratelimit-tokens-limit",
33
+ "tokens_remaining": "anthropic-ratelimit-tokens-remaining",
34
+ "tokens_reset": "anthropic-ratelimit-tokens-reset"
35
+ },
36
+ "retry_policy": {
37
+ "strategy": "exponential_backoff",
38
+ "max_retries": 2,
39
+ "max_delay_ms": 60000,
40
+ "min_delay_ms": 1000,
41
+ "jitter": "full",
42
+ "retry_on_http_status": [
43
+ 408,
44
+ 409,
45
+ 429,
46
+ 500,
47
+ 529
48
+ ],
49
+ "notes": [
50
+ "On 429, Anthropic returns a retry-after header (seconds) indicating how long to wait.",
51
+ "SDKs commonly auto-retry certain errors 2 times with a short exponential backoff (429 and >=500 among others)."
52
+ ]
53
+ },
54
+ "error_classification": {
55
+ "by_http_status": {
56
+ "400": "invalid_request",
57
+ "401": "authentication",
58
+ "403": "permission_denied",
59
+ "404": "not_found",
60
+ "413": "request_too_large",
61
+ "429": "rate_limited",
62
+ "500": "server_error",
63
+ "529": "overloaded"
64
+ },
65
+ "notes": [
66
+ "Anthropic uses error.type values (e.g., rate_limit_error, overloaded_error); runtimes SHOULD preserve error.type as raw metadata."
67
+ ]
68
+ },
69
+ "api_families": [
70
+ "messages"
71
+ ],
72
+ "default_api_family": "messages",
73
+ "endpoints": {
74
+ "chat": {
75
+ "path": "/messages",
76
+ "method": "POST",
77
+ "adapter": "anthropic"
78
+ }
79
+ },
80
+ "services": {
81
+ "list_models": {
82
+ "path": "/models",
83
+ "method": "GET",
84
+ "response_binding": "data"
85
+ },
86
+ "get_usage_report": {
87
+ "path": "/organizations/usage_report/messages",
88
+ "method": "POST",
89
+ "headers": {
90
+ "anthropic-beta": "message-batches-2024-09-24"
91
+ }
92
+ }
93
+ },
94
+ "termination": {
95
+ "source_field": "stop_reason",
96
+ "mapping": {
97
+ "end_turn": "end_turn",
98
+ "max_tokens": "max_tokens",
99
+ "stop_sequence": "stop_sequence",
100
+ "tool_use": "tool_use",
101
+ "pause_turn": "pause_turn",
102
+ "refusal": "refusal"
103
+ },
104
+ "notes": [
105
+ "Non-streaming: stop_reason is always non-null.",
106
+ "Streaming: stop_reason is null in message_start, then non-null otherwise."
107
+ ]
108
+ },
109
+ "parameter_mappings": {
110
+ "temperature": "temperature",
111
+ "max_tokens": "max_tokens",
112
+ "stream": "stream",
113
+ "top_p": "top_p",
114
+ "stop_sequences": "stop_sequences",
115
+ "tools": "tools",
116
+ "tool_choice": "tool_choice",
117
+ "system_message": "system",
118
+ "reasoning_effort": "reasoning_effort"
119
+ },
120
+ "response_format": "anthropic_style",
121
+ "response_paths": {
122
+ "content": "content[0].text",
123
+ "tool_calls": "content[0].tool_calls",
124
+ "usage": "usage",
125
+ "stop_reason": "stop_reason"
126
+ },
127
+ "streaming": {
128
+ "event_format": "anthropic_sse",
129
+ "decoder": {
130
+ "format": "anthropic_sse",
131
+ "strategy": "anthropic_event_stream",
132
+ "delimiter": "\n\n",
133
+ "prefix": "data: ",
134
+ "done_signal": "[DONE]"
135
+ },
136
+ "frame_selector": "$.type in ['message_start', 'content_block_start', 'content_block_delta', 'content_block_stop', 'message_delta', 'message_stop', 'ping']",
137
+ "accumulator": {
138
+ "stateful_tool_parsing": true,
139
+ "key_path": "$.delta.partial_json",
140
+ "flush_on": "$.type == 'content_block_stop'"
141
+ },
142
+ "event_map": [
143
+ {
144
+ "match": "$.type == 'content_block_delta' && $.delta.type == 'text_delta'",
145
+ "emit": "PartialContentDelta",
146
+ "fields": {
147
+ "content": "$.delta.text"
148
+ }
149
+ },
150
+ {
151
+ "match": "$.type == 'content_block_delta' && $.delta.type == 'thinking_delta'",
152
+ "emit": "ThinkingDelta",
153
+ "fields": {
154
+ "thinking": "$.delta.thinking"
155
+ }
156
+ },
157
+ {
158
+ "match": "$.type == 'content_block_start' && $.content_block.type == 'tool_use'",
159
+ "emit": "ToolCallStarted",
160
+ "fields": {
161
+ "tool_call_id": "$.content_block.id",
162
+ "tool_name": "$.content_block.name",
163
+ "index": "$.index"
164
+ }
165
+ },
166
+ {
167
+ "match": "$.type == 'content_block_delta' && $.delta.type == 'input_json_delta'",
168
+ "emit": "PartialToolCall",
169
+ "fields": {
170
+ "arguments": "$.delta.partial_json",
171
+ "index": "$.index"
172
+ }
173
+ },
174
+ {
175
+ "match": "$.type == 'content_block_stop'",
176
+ "emit": "ToolCallEnded",
177
+ "fields": {
178
+ "index": "$.index"
179
+ }
180
+ },
181
+ {
182
+ "match": "$.type == 'message_delta'",
183
+ "emit": "Metadata",
184
+ "fields": {
185
+ "stop_reason": "$.delta.stop_reason",
186
+ "usage": "$.usage"
187
+ }
188
+ },
189
+ {
190
+ "match": "$.type == 'message_stop'",
191
+ "emit": "StreamEnd",
192
+ "fields": {
193
+ "finish_reason": "end_turn"
194
+ }
195
+ }
196
+ ],
197
+ "stop_condition": "$.type == 'message_stop'",
198
+ "extra_metadata_path": "$.usage",
199
+ "content_path": "delta.text",
200
+ "tool_call_path": "delta.tool_calls"
201
+ },
202
+ "features": {
203
+ "multi_candidate": {
204
+ "support_type": "simulated",
205
+ "max_concurrent": 4
206
+ },
207
+ "response_mapping": {
208
+ "tool_calls": {
209
+ "path": "content",
210
+ "filter": "type == 'tool_use'",
211
+ "fields": {
212
+ "id": "id",
213
+ "name": "name",
214
+ "args": "input",
215
+ "id_strategy": "path"
216
+ },
217
+ "array_fan_out": true
218
+ },
219
+ "error": {
220
+ "message_path": "error.message",
221
+ "code_path": "error.type",
222
+ "request_id_path": "request_id"
223
+ }
224
+ }
225
+ },
226
+ "capabilities": {
227
+ "streaming": true,
228
+ "tools": true,
229
+ "vision": true,
230
+ "agentic": true,
231
+ "parallel_tools": false,
232
+ "reasoning": true
233
+ },
234
+ "experimental_features": [
235
+ "thinking_blocks",
236
+ "mcp"
237
+ ],
238
+ "availability": {
239
+ "required": false,
240
+ "regions": [
241
+ "global"
242
+ ],
243
+ "check": {
244
+ "method": "GET",
245
+ "path": "/models",
246
+ "expected_status": [
247
+ 200,
248
+ 401
249
+ ],
250
+ "timeout_ms": 3000
251
+ }
252
+ }
253
+ }
@@ -0,0 +1,115 @@
1
+ {
2
+ "$schema": "../../schemas/v1.json",
3
+ "protocol_version": "1.5",
4
+ "id": "anyscale",
5
+ "name": "Anyscale",
6
+ "status": "stable",
7
+ "category": "model_provider",
8
+ "official_url": "https://www.anyscale.com/",
9
+ "support_contact": "https://www.anyscale.com/contact",
10
+ "endpoint": {
11
+ "base_url": "https://api.anyscale.com/v1",
12
+ "protocol": "https",
13
+ "timeout_ms": 60000
14
+ },
15
+ "auth": {
16
+ "type": "bearer",
17
+ "token_env": "ANYSCALE_API_TOKEN",
18
+ "payload_format": "openai_style"
19
+ },
20
+ "services": {
21
+ "list_models": {
22
+ "path": "/models",
23
+ "method": "GET",
24
+ "response_binding": "data"
25
+ }
26
+ },
27
+ "availability": {
28
+ "required": false,
29
+ "regions": [
30
+ "global"
31
+ ],
32
+ "check": {
33
+ "method": "GET",
34
+ "path": "/models",
35
+ "expected_status": [
36
+ 200
37
+ ]
38
+ }
39
+ },
40
+ "capabilities": {
41
+ "streaming": true,
42
+ "tools": true,
43
+ "vision": false,
44
+ "agentic": false,
45
+ "reasoning": false,
46
+ "parallel_tools": false
47
+ },
48
+ "streaming": {
49
+ "event_format": "data_lines",
50
+ "decoder": {
51
+ "format": "sse",
52
+ "delimiter": "\n\n",
53
+ "prefix": "data: ",
54
+ "done_signal": "[DONE]"
55
+ }
56
+ },
57
+ "response_format": "openai_style",
58
+ "response_paths": {
59
+ "content": "choices.0.message.content",
60
+ "finish_reason": "choices.0.finish_reason",
61
+ "model": "model",
62
+ "id": "id",
63
+ "created": "created"
64
+ },
65
+ "error_classification": {
66
+ "by_http_status": {
67
+ "400": "invalid_request",
68
+ "401": "authentication",
69
+ "403": "permission_denied",
70
+ "404": "not_found",
71
+ "409": "conflict",
72
+ "429": "rate_limited",
73
+ "500": "server_error",
74
+ "502": "server_error",
75
+ "503": "server_error",
76
+ "504": "timeout"
77
+ }
78
+ },
79
+ "retry_policy": {
80
+ "max_retries": 3,
81
+ "max_delay_ms": 30000,
82
+ "strategy": "exponential_backoff",
83
+ "min_delay_ms": 1000,
84
+ "jitter": "full",
85
+ "retry_on_http_status": [
86
+ 429,
87
+ 500,
88
+ 502,
89
+ 503
90
+ ]
91
+ },
92
+ "rate_limit_headers": {
93
+ "requests_limit": "x-ratelimit-limit-requests",
94
+ "requests_remaining": "x-ratelimit-remaining-requests",
95
+ "tokens_limit": "x-ratelimit-limit-tokens",
96
+ "tokens_remaining": "x-ratelimit-remaining-tokens"
97
+ },
98
+ "parameter_mappings": {
99
+ "model": "model",
100
+ "messages": "messages",
101
+ "temperature": "temperature",
102
+ "max_tokens": "max_tokens",
103
+ "top_p": "top_p",
104
+ "frequency_penalty": "frequency_penalty",
105
+ "presence_penalty": "presence_penalty",
106
+ "stop": "stop",
107
+ "stream": "stream"
108
+ },
109
+ "notes": [
110
+ "Anyscale provides Ray-based model serving infrastructure",
111
+ "OpenAI-compatible API with multiple model options",
112
+ "Supports various LLMs including Llama, Mistral, and others",
113
+ "Enterprise-grade model serving platform"
114
+ ]
115
+ }
@@ -0,0 +1,188 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v1.json",
3
+ "id": "azure",
4
+ "protocol_version": "1.5",
5
+ "endpoint": {
6
+ "base_url": "https://${AZURE_RESOURCE_NAME}.openai.azure.com/openai/deployments/${AZURE_DEPLOYMENT_ID}",
7
+ "protocol": "https",
8
+ "timeout_ms": 30000
9
+ },
10
+ "availability": {
11
+ "required": true,
12
+ "regions": [
13
+ "global"
14
+ ],
15
+ "check": {
16
+ "method": "GET",
17
+ "path": "/models?api-version=2024-02-01",
18
+ "expected_status": [
19
+ 200
20
+ ]
21
+ }
22
+ },
23
+ "capabilities": {
24
+ "streaming": true,
25
+ "tools": true,
26
+ "vision": true
27
+ },
28
+ "auth": {
29
+ "type": "api_key",
30
+ "key_env": "AZURE_OPENAI_KEY",
31
+ "header_name": "api-key"
32
+ },
33
+ "parameter_mappings": {
34
+ "model": "model",
35
+ "messages": "messages",
36
+ "max_tokens": "max_tokens",
37
+ "temperature": "temperature",
38
+ "stream": "stream",
39
+ "tools": "tools",
40
+ "tool_choice": "tool_choice"
41
+ },
42
+ "streaming": {
43
+ "event_format": "data_lines",
44
+ "decoder": {
45
+ "format": "sse",
46
+ "delimiter": "\n\n",
47
+ "prefix": "data: ",
48
+ "done_signal": "[DONE]"
49
+ },
50
+ "frame_selector": "exists($.choices) || exists($.error)",
51
+ "candidate": {
52
+ "candidate_id_path": "$.choices[*].index",
53
+ "fan_out": true
54
+ },
55
+ "event_map": [
56
+ {
57
+ "match": "exists($.error)",
58
+ "emit": "StreamError",
59
+ "fields": {
60
+ "error": "$.error"
61
+ }
62
+ },
63
+ {
64
+ "match": "exists($.choices[*].delta.content)",
65
+ "emit": "PartialContentDelta",
66
+ "fields": {
67
+ "content": "$.choices[*].delta.content"
68
+ }
69
+ },
70
+ {
71
+ "match": "exists($.choices[*].delta.tool_calls[*].function.name)",
72
+ "emit": "ToolCallStarted",
73
+ "fields": {
74
+ "tool_call_id": "$.choices[*].delta.tool_calls[*].id",
75
+ "tool_name": "$.choices[*].delta.tool_calls[*].function.name",
76
+ "index": "$.choices[*].delta.tool_calls[*].index"
77
+ }
78
+ },
79
+ {
80
+ "match": "exists($.choices[*].delta.tool_calls[*].function.arguments)",
81
+ "emit": "PartialToolCall",
82
+ "fields": {
83
+ "arguments": "$.choices[*].delta.tool_calls[*].function.arguments",
84
+ "index": "$.choices[*].delta.tool_calls[*].index"
85
+ }
86
+ },
87
+ {
88
+ "match": "exists($.usage)",
89
+ "emit": "Metadata",
90
+ "fields": {
91
+ "usage": "$.usage"
92
+ }
93
+ },
94
+ {
95
+ "match": "exists($.choices[*].finish_reason)",
96
+ "emit": "FinalCandidate",
97
+ "fields": {
98
+ "finish_reason": "$.choices[*].finish_reason",
99
+ "candidate_index": "$.choices[*].index"
100
+ }
101
+ }
102
+ ],
103
+ "stop_condition": "$.choices[0].finish_reason != null",
104
+ "extra_metadata_path": "$.usage",
105
+ "content_path": "$.choices[0].delta.content",
106
+ "tool_call_path": "$.choices[0].delta.tool_calls"
107
+ },
108
+ "termination": {
109
+ "source_field": "finish_reason",
110
+ "mapping": {
111
+ "stop": "end_turn",
112
+ "length": "max_tokens",
113
+ "tool_calls": "tool_use",
114
+ "content_filter": "refusal"
115
+ },
116
+ "notes": [
117
+ "finish_reason is reported per candidate."
118
+ ]
119
+ },
120
+ "tooling": {
121
+ "source_model": "openai_tool_calls",
122
+ "tool_use": {
123
+ "id_path": "id",
124
+ "name_path": "function.name",
125
+ "input_path": "function.arguments",
126
+ "input_format": "json_string"
127
+ },
128
+ "notes": [
129
+ "Azure OpenAI tool_calls.function.arguments is typically a JSON string."
130
+ ]
131
+ },
132
+ "features": {
133
+ "multi_candidate": {
134
+ "support_type": "native",
135
+ "param_name": "n"
136
+ },
137
+ "response_mapping": {
138
+ "tool_calls": {
139
+ "path": "choices[0].message.tool_calls",
140
+ "fields": {
141
+ "id": "id",
142
+ "name": "function.name",
143
+ "args": "function.arguments"
144
+ }
145
+ },
146
+ "error": {
147
+ "message_path": "error.message",
148
+ "code_path": "error.code",
149
+ "type_path": "error.type",
150
+ "param_path": "error.param"
151
+ }
152
+ }
153
+ },
154
+ "response_paths": {
155
+ "content": "choices[0].message.content",
156
+ "tool_calls": "choices[0].message.tool_calls",
157
+ "usage": "usage",
158
+ "finish_reason": "choices[0].finish_reason"
159
+ },
160
+ "retry_policy": {
161
+ "max_retries": 3,
162
+ "max_delay_ms": 30000,
163
+ "strategy": "exponential_backoff",
164
+ "min_delay_ms": 1000,
165
+ "jitter": "full",
166
+ "retry_on_http_status": [
167
+ 429,
168
+ 500,
169
+ 502,
170
+ 503
171
+ ]
172
+ },
173
+ "error_classification": {
174
+ "by_http_status": {
175
+ "400": "invalid_request",
176
+ "401": "authentication",
177
+ "403": "permission_denied",
178
+ "404": "not_found",
179
+ "429": "rate_limited",
180
+ "500": "server_error"
181
+ }
182
+ },
183
+ "rate_limit_headers": {
184
+ "requests_limit": "x-ratelimit-limit-requests",
185
+ "requests_remaining": "x-ratelimit-remaining-requests",
186
+ "requests_reset": "x-ratelimit-reset-requests"
187
+ }
188
+ }