@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,209 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v1.json",
3
+ "id": "cohere",
4
+ "protocol_version": "1.5",
5
+ "name": "Cohere",
6
+ "version": "v2",
7
+ "status": "stable",
8
+ "category": "ai_provider",
9
+ "official_url": "https://docs.cohere.com",
10
+ "support_contact": "https://cohere.com/contact",
11
+ "endpoint": {
12
+ "base_url": "https://api.cohere.com/v2",
13
+ "protocol": "https",
14
+ "timeout_ms": 60000
15
+ },
16
+ "auth": {
17
+ "type": "bearer",
18
+ "token_env": "COHERE_API_KEY"
19
+ },
20
+ "payload_format": "cohere_v2",
21
+ "api_families": [
22
+ "chat"
23
+ ],
24
+ "default_api_family": "chat",
25
+ "endpoints": {
26
+ "chat": {
27
+ "path": "/chat",
28
+ "method": "POST",
29
+ "adapter": "cohere_v2"
30
+ }
31
+ },
32
+ "services": {
33
+ "list_models": {
34
+ "path": "/models",
35
+ "method": "GET",
36
+ "response_binding": "models"
37
+ }
38
+ },
39
+ "termination": {
40
+ "source_field": "finish_reason",
41
+ "mapping": {
42
+ "COMPLETE": "end_turn",
43
+ "MAX_TOKENS": "max_tokens",
44
+ "STOP_SEQUENCE": "stop_sequence",
45
+ "TOOL_CALL": "tool_use",
46
+ "ERROR": "error"
47
+ },
48
+ "notes": [
49
+ "Cohere uses uppercase finish reasons.",
50
+ "Known for Command R+ and enterprise-grade RAG capabilities."
51
+ ]
52
+ },
53
+ "tooling": {
54
+ "source_model": "openai_tool_calls",
55
+ "tool_use": {
56
+ "id_path": "id",
57
+ "name_path": "name",
58
+ "input_path": "parameters",
59
+ "input_format": "json_object"
60
+ },
61
+ "notes": [
62
+ "Cohere V2 uses 'tools' array similar to OpenAI."
63
+ ]
64
+ },
65
+ "rate_limit_headers": {
66
+ "requests_limit": "x-ratelimit-limit",
67
+ "requests_remaining": "x-ratelimit-remaining",
68
+ "requests_reset": "x-ratelimit-reset"
69
+ },
70
+ "retry_policy": {
71
+ "strategy": "exponential_backoff",
72
+ "max_retries": 3,
73
+ "min_delay_ms": 500,
74
+ "max_delay_ms": 30000,
75
+ "jitter": "full",
76
+ "retry_on_http_status": [
77
+ 429,
78
+ 500,
79
+ 502,
80
+ 503
81
+ ]
82
+ },
83
+ "error_classification": {
84
+ "by_http_status": {
85
+ "400": "invalid_request",
86
+ "401": "authentication",
87
+ "403": "permission_denied",
88
+ "404": "not_found",
89
+ "422": "invalid_request",
90
+ "429": "rate_limited",
91
+ "500": "server_error",
92
+ "503": "overloaded"
93
+ }
94
+ },
95
+ "parameter_mappings": {
96
+ "temperature": "temperature",
97
+ "max_tokens": "max_tokens",
98
+ "stream": "stream",
99
+ "top_p": "p",
100
+ "top_k": "k",
101
+ "stop_sequences": "stop_sequences",
102
+ "tools": "tools",
103
+ "frequency_penalty": "frequency_penalty",
104
+ "presence_penalty": "presence_penalty",
105
+ "seed": "seed"
106
+ },
107
+ "response_format": "cohere_v2",
108
+ "response_paths": {
109
+ "content": "message.content[0].text",
110
+ "tool_calls": "message.tool_calls",
111
+ "usage": "usage",
112
+ "finish_reason": "finish_reason"
113
+ },
114
+ "streaming": {
115
+ "event_format": "sse",
116
+ "decoder": {
117
+ "format": "sse",
118
+ "delimiter": "\n",
119
+ "prefix": "data: ",
120
+ "done_signal": ""
121
+ },
122
+ "content_path": "delta.message.content.text",
123
+ "tool_call_path": "delta.message.tool_calls",
124
+ "usage_path": "usage",
125
+ "frame_selector": "exists($.type)",
126
+ "event_map": [
127
+ {
128
+ "match": "$.type == 'content-delta'",
129
+ "emit": "PartialContentDelta",
130
+ "fields": {
131
+ "content": "$.delta.message.content.text"
132
+ }
133
+ },
134
+ {
135
+ "match": "$.type == 'tool-call-start'",
136
+ "emit": "ToolCallStarted",
137
+ "fields": {
138
+ "tool_call_id": "$.delta.message.tool_calls.id",
139
+ "tool_name": "$.delta.message.tool_calls.name"
140
+ }
141
+ },
142
+ {
143
+ "match": "$.type == 'tool-call-delta'",
144
+ "emit": "PartialToolCall",
145
+ "fields": {
146
+ "arguments": "$.delta.message.tool_calls.parameters"
147
+ }
148
+ },
149
+ {
150
+ "match": "$.type == 'message-end'",
151
+ "emit": "FinalCandidate",
152
+ "fields": {
153
+ "finish_reason": "$.delta.finish_reason",
154
+ "usage": "$.delta.usage"
155
+ }
156
+ }
157
+ ],
158
+ "stop_condition": "$.type == 'message-end'"
159
+ },
160
+ "features": {
161
+ "multi_candidate": {
162
+ "support_type": "simulated",
163
+ "max_concurrent": 1
164
+ },
165
+ "response_mapping": {
166
+ "tool_calls": {
167
+ "path": "message.tool_calls",
168
+ "fields": {
169
+ "id": "id",
170
+ "name": "name",
171
+ "args": "parameters"
172
+ }
173
+ },
174
+ "error": {
175
+ "message_path": "message",
176
+ "code_path": "code"
177
+ }
178
+ }
179
+ },
180
+ "capabilities": {
181
+ "streaming": true,
182
+ "tools": true,
183
+ "vision": false,
184
+ "agentic": true,
185
+ "parallel_tools": false,
186
+ "reasoning": false
187
+ },
188
+ "availability": {
189
+ "required": false,
190
+ "regions": [
191
+ "global"
192
+ ],
193
+ "check": {
194
+ "method": "GET",
195
+ "path": "/models",
196
+ "expected_status": [
197
+ 200,
198
+ 401
199
+ ],
200
+ "timeout_ms": 5000
201
+ }
202
+ },
203
+ "experimental_features": [
204
+ "rag",
205
+ "connectors",
206
+ "rerank",
207
+ "embed"
208
+ ]
209
+ }
@@ -0,0 +1,196 @@
1
+ {
2
+ "$schema": "../../schemas/v1.json",
3
+ "protocol_version": "1.5",
4
+ "id": "deepinfra",
5
+ "name": "DeepInfra",
6
+ "status": "stable",
7
+ "category": "model_provider",
8
+ "official_url": "https://deepinfra.com/",
9
+ "support_contact": "https://deepinfra.com/support",
10
+ "endpoint": {
11
+ "base_url": "https://api.deepinfra.com/v1/openai",
12
+ "protocol": "https",
13
+ "timeout_ms": 60000
14
+ },
15
+ "auth": {
16
+ "type": "bearer",
17
+ "token_env": "DEEPINFRA_API_KEY"
18
+ },
19
+ "payload_format": "openai_style",
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": true,
44
+ "agentic": false,
45
+ "reasoning": false,
46
+ "parallel_tools": true
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
+ "frame_selector": "exists($.choices) || exists($.error)",
57
+ "candidate": {
58
+ "candidate_id_path": "$.choices[*].index",
59
+ "fan_out": true
60
+ },
61
+ "event_map": [
62
+ {
63
+ "match": "exists($.error)",
64
+ "emit": "StreamError",
65
+ "fields": {
66
+ "error": "$.error"
67
+ }
68
+ },
69
+ {
70
+ "match": "exists($.choices[*].delta.content)",
71
+ "emit": "PartialContentDelta",
72
+ "fields": {
73
+ "content": "$.choices[*].delta.content"
74
+ }
75
+ },
76
+ {
77
+ "match": "exists($.choices[*].delta.tool_calls[*].function.name)",
78
+ "emit": "ToolCallStarted",
79
+ "fields": {
80
+ "tool_call_id": "$.choices[*].delta.tool_calls[*].id",
81
+ "tool_name": "$.choices[*].delta.tool_calls[*].function.name",
82
+ "index": "$.choices[*].delta.tool_calls[*].index"
83
+ }
84
+ },
85
+ {
86
+ "match": "exists($.choices[*].delta.tool_calls[*].function.arguments)",
87
+ "emit": "PartialToolCall",
88
+ "fields": {
89
+ "arguments": "$.choices[*].delta.tool_calls[*].function.arguments",
90
+ "index": "$.choices[*].delta.tool_calls[*].index"
91
+ }
92
+ },
93
+ {
94
+ "match": "exists($.usage)",
95
+ "emit": "Metadata",
96
+ "fields": {
97
+ "usage": "$.usage"
98
+ }
99
+ },
100
+ {
101
+ "match": "exists($.choices[*].finish_reason)",
102
+ "emit": "FinalCandidate",
103
+ "fields": {
104
+ "finish_reason": "$.choices[*].finish_reason",
105
+ "candidate_index": "$.choices[*].index"
106
+ }
107
+ }
108
+ ],
109
+ "stop_condition": "$.choices[0].finish_reason != null",
110
+ "extra_metadata_path": "$.usage",
111
+ "content_path": "$.choices[0].delta.content",
112
+ "tool_call_path": "$.choices[0].delta.tool_calls"
113
+ },
114
+ "termination": {
115
+ "source_field": "finish_reason",
116
+ "mapping": {
117
+ "stop": "end_turn",
118
+ "length": "max_tokens",
119
+ "tool_calls": "tool_use",
120
+ "content_filter": "refusal"
121
+ },
122
+ "notes": [
123
+ "finish_reason is reported per candidate."
124
+ ]
125
+ },
126
+ "tooling": {
127
+ "source_model": "openai_tool_calls",
128
+ "tool_use": {
129
+ "id_path": "id",
130
+ "name_path": "function.name",
131
+ "input_path": "function.arguments",
132
+ "input_format": "json_string"
133
+ },
134
+ "notes": [
135
+ "DeepInfra tool_calls.function.arguments is typically a JSON string."
136
+ ]
137
+ },
138
+ "features": {
139
+ "multi_candidate": {
140
+ "support_type": "native",
141
+ "param_name": "n"
142
+ },
143
+ "response_mapping": {
144
+ "tool_calls": {
145
+ "path": "choices[0].message.tool_calls",
146
+ "fields": {
147
+ "id": "id",
148
+ "name": "function.name",
149
+ "args": "function.arguments"
150
+ }
151
+ },
152
+ "error": {
153
+ "message_path": "error.message",
154
+ "code_path": "error.code"
155
+ }
156
+ }
157
+ },
158
+ "response_paths": {
159
+ "content": "choices[0].message.content",
160
+ "tool_calls": "choices[0].message.tool_calls",
161
+ "usage": "usage",
162
+ "finish_reason": "choices[0].finish_reason"
163
+ },
164
+ "parameter_mappings": {
165
+ "temperature": "temperature",
166
+ "max_tokens": "max_tokens",
167
+ "stream": "stream",
168
+ "top_p": "top_p",
169
+ "stop_sequences": "stop",
170
+ "tools": "tools",
171
+ "tool_choice": "tool_choice"
172
+ },
173
+ "retry_policy": {
174
+ "max_retries": 3,
175
+ "max_delay_ms": 30000,
176
+ "strategy": "exponential_backoff",
177
+ "min_delay_ms": 1000,
178
+ "jitter": "full",
179
+ "retry_on_http_status": [
180
+ 429,
181
+ 500,
182
+ 502,
183
+ 503
184
+ ]
185
+ },
186
+ "error_classification": {
187
+ "by_http_status": {
188
+ "400": "invalid_request",
189
+ "401": "authentication",
190
+ "422": "invalid_request",
191
+ "429": "rate_limited",
192
+ "500": "server_error",
193
+ "503": "overloaded"
194
+ }
195
+ }
196
+ }
@@ -0,0 +1,221 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v1.json",
3
+ "id": "deepseek",
4
+ "provider_id": "deepseek",
5
+ "protocol_version": "1.5",
6
+ "name": "DeepSeek",
7
+ "version": "v1",
8
+ "status": "stable",
9
+ "category": "ai_provider",
10
+ "official_url": "https://platform.deepseek.com/docs",
11
+ "support_contact": "https://support.deepseek.com",
12
+ "endpoint": {
13
+ "base_url": "https://api.deepseek.com/v1",
14
+ "protocol": "https",
15
+ "timeout_ms": 10000
16
+ },
17
+ "auth": {
18
+ "type": "bearer",
19
+ "token_env": "DEEPSEEK_API_KEY"
20
+ },
21
+ "payload_format": "openai_style",
22
+ "endpoints": {
23
+ "chat": {
24
+ "path": "/chat/completions",
25
+ "method": "POST",
26
+ "adapter": "openai"
27
+ },
28
+ "completions": {
29
+ "path": "/completions",
30
+ "method": "POST",
31
+ "adapter": "openai"
32
+ }
33
+ },
34
+ "services": {
35
+ "list_models": {
36
+ "path": "/models",
37
+ "method": "GET",
38
+ "response_binding": "data"
39
+ },
40
+ "get_balance": {
41
+ "path": "/user/balance",
42
+ "method": "GET"
43
+ }
44
+ },
45
+ "api_families": [
46
+ "chat_completions"
47
+ ],
48
+ "default_api_family": "chat_completions",
49
+ "termination": {
50
+ "source_field": "finish_reason",
51
+ "mapping": {
52
+ "stop": "end_turn",
53
+ "length": "max_tokens",
54
+ "tool_calls": "tool_use",
55
+ "content_filter": "refusal"
56
+ }
57
+ },
58
+ "tooling": {
59
+ "source_model": "openai_tool_calls",
60
+ "tool_use": {
61
+ "id_path": "id",
62
+ "name_path": "function.name",
63
+ "input_path": "function.arguments",
64
+ "input_format": "json_string"
65
+ }
66
+ },
67
+ "retry_policy": {
68
+ "strategy": "exponential_backoff",
69
+ "max_retries": 2,
70
+ "min_delay_ms": 1000,
71
+ "max_delay_ms": 8000,
72
+ "jitter": "full",
73
+ "retry_on_http_status": [
74
+ 429,
75
+ 500,
76
+ 502,
77
+ 503
78
+ ]
79
+ },
80
+ "rate_limit_headers": {
81
+ "requests_limit": "x-ratelimit-limit-requests",
82
+ "requests_remaining": "x-ratelimit-remaining-requests",
83
+ "requests_reset": "x-ratelimit-reset-requests",
84
+ "tokens_limit": "x-ratelimit-limit-tokens",
85
+ "tokens_remaining": "x-ratelimit-remaining-tokens",
86
+ "tokens_reset": "x-ratelimit-reset-tokens",
87
+ "retry_after": "retry-after"
88
+ },
89
+ "error_classification": {
90
+ "by_http_status": {
91
+ "400": "invalid_request",
92
+ "401": "authentication",
93
+ "402": "quota_exhausted",
94
+ "422": "invalid_request",
95
+ "429": "rate_limited",
96
+ "500": "server_error",
97
+ "503": "overloaded"
98
+ }
99
+ },
100
+ "parameter_mappings": {
101
+ "temperature": "temperature",
102
+ "max_tokens": "max_tokens",
103
+ "stream": "stream",
104
+ "top_p": "top_p",
105
+ "stop_sequences": "stop",
106
+ "tools": "tools",
107
+ "tool_choice": "tool_choice"
108
+ },
109
+ "response_format": "openai_style",
110
+ "response_paths": {
111
+ "content": "choices[0].message.content",
112
+ "reasoning_content": "choices[0].message.reasoning_content",
113
+ "tool_calls": "choices[0].message.tool_calls",
114
+ "usage": "usage",
115
+ "finish_reason": "choices[0].finish_reason"
116
+ },
117
+ "streaming": {
118
+ "event_format": "data_lines",
119
+ "decoder": {
120
+ "format": "sse",
121
+ "delimiter": "\n\n",
122
+ "prefix": "data: ",
123
+ "done_signal": "[DONE]",
124
+ "strategy": "sse_ignore_comments"
125
+ },
126
+ "content_path": "choices[0].delta.content",
127
+ "tool_call_path": "choices[0].delta.tool_calls",
128
+ "usage_path": "usage",
129
+ "frame_selector": "exists($.choices) || exists($.error)",
130
+ "event_map": [
131
+ {
132
+ "match": "exists($.choices[*].delta.content)",
133
+ "emit": "PartialContentDelta",
134
+ "fields": {
135
+ "content": "$.choices[*].delta.content"
136
+ }
137
+ },
138
+ {
139
+ "match": "exists($.choices[*].delta.tool_calls[*].function.name)",
140
+ "emit": "ToolCallStarted",
141
+ "fields": {
142
+ "tool_call_id": "$.choices[*].delta.tool_calls[*].id",
143
+ "tool_name": "$.choices[*].delta.tool_calls[*].function.name",
144
+ "index": "$.choices[*].delta.tool_calls[*].index"
145
+ }
146
+ },
147
+ {
148
+ "match": "exists($.choices[*].delta.tool_calls[*].function.arguments)",
149
+ "emit": "PartialToolCall",
150
+ "fields": {
151
+ "arguments": "$.choices[*].delta.tool_calls[*].function.arguments",
152
+ "index": "$.choices[*].delta.tool_calls[*].index"
153
+ }
154
+ },
155
+ {
156
+ "match": "exists($.usage)",
157
+ "emit": "Metadata",
158
+ "fields": {
159
+ "usage": "$.usage"
160
+ }
161
+ },
162
+ {
163
+ "match": "$.choices[*].finish_reason != null",
164
+ "emit": "StreamEnd",
165
+ "fields": {
166
+ "finish_reason": "$.choices[*].finish_reason"
167
+ }
168
+ }
169
+ ],
170
+ "stop_condition": "$.choices[0].finish_reason != null"
171
+ },
172
+ "features": {
173
+ "multi_candidate": {
174
+ "support_type": "native",
175
+ "param_name": "n"
176
+ },
177
+ "response_mapping": {
178
+ "tool_calls": {
179
+ "path": "choices[0].message.tool_calls",
180
+ "fields": {
181
+ "id": "id",
182
+ "name": "function.name",
183
+ "args": "function.arguments"
184
+ }
185
+ },
186
+ "error": {
187
+ "message_path": "error.message",
188
+ "code_path": "error.code",
189
+ "type_path": "error.type",
190
+ "param_path": "error.param"
191
+ }
192
+ }
193
+ },
194
+ "capabilities": {
195
+ "streaming": true,
196
+ "tools": true,
197
+ "vision": false,
198
+ "agentic": true,
199
+ "parallel_tools": false,
200
+ "reasoning": true
201
+ },
202
+ "availability": {
203
+ "required": false,
204
+ "regions": [
205
+ "cn",
206
+ "global"
207
+ ],
208
+ "check": {
209
+ "method": "GET",
210
+ "path": "/models",
211
+ "expected_status": [
212
+ 200,
213
+ 401
214
+ ],
215
+ "timeout_ms": 3000
216
+ }
217
+ },
218
+ "experimental_features": [
219
+ "deep_thinking"
220
+ ]
221
+ }