@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,221 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v1.json",
3
+ "id": "stability",
4
+ "protocol_version": "1.5",
5
+ "name": "Stability AI",
6
+ "version": "v1",
7
+ "status": "stable",
8
+ "category": "ai_provider",
9
+ "official_url": "https://platform.stability.ai/docs",
10
+ "support_contact": "https://stability.ai/contact",
11
+ "endpoint": {
12
+ "base_url": "https://api.stability.ai",
13
+ "protocol": "https",
14
+ "timeout_ms": 60000
15
+ },
16
+ "auth": {
17
+ "type": "bearer",
18
+ "token_env": "STABILITY_API_KEY",
19
+ "extra_headers": [
20
+ {
21
+ "name": "Content-Type",
22
+ "value": "application/json"
23
+ },
24
+ {
25
+ "name": "Accept",
26
+ "value": "application/json"
27
+ }
28
+ ],
29
+ "payload_format": "stability_api"
30
+ },
31
+ "api_families": [
32
+ "text_to_image",
33
+ "image_to_image",
34
+ "image_to_image_masking",
35
+ "inpainting",
36
+ "outpainting",
37
+ "image_upscale",
38
+ "video_generation"
39
+ ],
40
+ "default_api_family": "text_to_image",
41
+ "endpoints": {
42
+ "text_to_image": {
43
+ "path": "/v2beta/stable-image/generate/sd3",
44
+ "method": "POST",
45
+ "adapter": "stability"
46
+ },
47
+ "image_to_image": {
48
+ "path": "/v2beta/stable-image/generate/sd3",
49
+ "method": "POST",
50
+ "adapter": "stability"
51
+ },
52
+ "image_edit": {
53
+ "path": "/v2beta/stable-image/edit/erase",
54
+ "method": "POST",
55
+ "adapter": "stability"
56
+ },
57
+ "image_search_and_replace": {
58
+ "path": "/v2beta/stable-image/edit/search-and-replace",
59
+ "method": "POST",
60
+ "adapter": "stability"
61
+ },
62
+ "upscale": {
63
+ "path": "/v2beta/stable-image/upscale/conservative",
64
+ "method": "POST",
65
+ "adapter": "stability"
66
+ }
67
+ },
68
+ "services": {
69
+ "list_models": {
70
+ "path": "/v2beta/models/list",
71
+ "method": "GET",
72
+ "response_binding": "data"
73
+ }
74
+ },
75
+ "termination": {
76
+ "source_field": "finish",
77
+ "mapping": {
78
+ "complete": "completed",
79
+ "failed": "error"
80
+ },
81
+ "notes": [
82
+ "Image generation uses async workflow with job IDs",
83
+ "finish_field indicates completion status"
84
+ ]
85
+ },
86
+ "tooling": {
87
+ "source_model": "unknown",
88
+ "notes": [
89
+ "Stability AI is not designed for text-based tool calling",
90
+ "Focuses on image/video generation workflows"
91
+ ]
92
+ },
93
+ "retry_policy": {
94
+ "strategy": "exponential_backoff",
95
+ "max_retries": 3,
96
+ "min_delay_ms": 1000,
97
+ "max_delay_ms": 10000,
98
+ "jitter": "full",
99
+ "retry_on_http_status": [
100
+ 429,
101
+ 500,
102
+ 502,
103
+ 503
104
+ ],
105
+ "notes": [
106
+ "Image generation can be resource-intensive",
107
+ "502/503 common during high load",
108
+ "429 indicates rate limit exceeded"
109
+ ]
110
+ },
111
+ "error_classification": {
112
+ "by_http_status": {
113
+ "400": "invalid_request",
114
+ "401": "authentication",
115
+ "403": "permission_denied",
116
+ "404": "not_found",
117
+ "429": "rate_limited",
118
+ "500": "server_error",
119
+ "502": "overloaded",
120
+ "503": "overloaded"
121
+ },
122
+ "notes": [
123
+ "502/503 often indicate generation queue or resource constraints",
124
+ "Error messages may include quota information"
125
+ ]
126
+ },
127
+ "parameter_mappings": {
128
+ "prompt": "prompt",
129
+ "negative_prompt": "negative_prompt",
130
+ "aspect_ratio": "aspect_ratio",
131
+ "seed": "seed",
132
+ "steps": "steps",
133
+ "cfg_scale": "cfg_scale",
134
+ "mode": "mode",
135
+ "output_format": "output_format",
136
+ "strength": "strength",
137
+ "image": "image",
138
+ "init_image_mode": "init_image_mode"
139
+ },
140
+ "response_format": "stability_image",
141
+ "response_paths": {
142
+ "content": "image",
143
+ "artifacts": "artifacts",
144
+ "finish_reason": "finish",
145
+ "image_url": "image"
146
+ },
147
+ "streaming": {
148
+ "event_format": "stability_async",
149
+ "decoder": {
150
+ "format": "sse",
151
+ "delimiter": "\n\n",
152
+ "prefix": "data: ",
153
+ "done_signal": "[DONE]"
154
+ },
155
+ "frame_selector": "exists($.id) || exists($.image) || exists($.artifacts)",
156
+ "event_map": [
157
+ {
158
+ "match": "exists($.id) && !exists($.image)",
159
+ "emit": "Metadata",
160
+ "fields": {
161
+ "job_id": "$.id",
162
+ "status": "$.status",
163
+ "timestamp": "$.timestamp"
164
+ }
165
+ },
166
+ {
167
+ "match": "exists($.image)",
168
+ "emit": "FinalCandidate",
169
+ "fields": {
170
+ "image": "$.image",
171
+ "finish_reason": "finish"
172
+ }
173
+ },
174
+ {
175
+ "match": "exists($.artifacts)",
176
+ "emit": "FinalCandidate",
177
+ "fields": {
178
+ "artifacts": "$.artifacts",
179
+ "finish": "$.finish"
180
+ }
181
+ }
182
+ ],
183
+ "stop_condition": "exists($.image) || exists($.artifacts) || exists($.finish) && $.finish == 'complete'",
184
+ "extra_metadata_path": "$.finish"
185
+ },
186
+ "capabilities": {
187
+ "streaming": false,
188
+ "tools": false,
189
+ "vision": true,
190
+ "agentic": false,
191
+ "parallel_tools": false,
192
+ "reasoning": false
193
+ },
194
+ "experimental_features": [
195
+ "async_generation",
196
+ "video_generation",
197
+ "3d_generation",
198
+ "inpainting",
199
+ "outpainting"
200
+ ],
201
+ "connection_vars": {
202
+ "model": "model_id"
203
+ },
204
+ "availability": {
205
+ "required": false,
206
+ "regions": [
207
+ "global"
208
+ ],
209
+ "check": {
210
+ "method": "GET",
211
+ "path": "/v2beta/models/list",
212
+ "expected_status": [
213
+ 200
214
+ ],
215
+ "timeout_ms": 5000
216
+ },
217
+ "notes": [
218
+ "Check models/list endpoint to verify service health"
219
+ ]
220
+ }
221
+ }
@@ -0,0 +1,207 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/ailib-official/ai-protocol/main/schemas/v1.json",
3
+ "id": "tiangong",
4
+ "protocol_version": "1.5",
5
+ "name": "昆仑万维天工 (Kunlun Tiangong)",
6
+ "version": "v1",
7
+ "status": "stable",
8
+ "category": "ai_provider",
9
+ "official_url": "https://model-platform.tiangong.cn/api-reference",
10
+ "support_contact": "https://www.kunlun.com/contact",
11
+ "endpoint": {
12
+ "base_url": "https://sky-api.singularity-ai.com/saas/api/v4",
13
+ "protocol": "https",
14
+ "timeout_ms": 60000
15
+ },
16
+ "auth": {
17
+ "type": "bearer",
18
+ "token_env": "TIANGONG_API_KEY"
19
+ },
20
+ "payload_format": "openai_style",
21
+ "api_families": [
22
+ "chat_completions"
23
+ ],
24
+ "default_api_family": "chat_completions",
25
+ "endpoints": {
26
+ "chat": {
27
+ "path": "/chat/completions",
28
+ "method": "POST",
29
+ "adapter": "openai"
30
+ }
31
+ },
32
+ "services": {
33
+ "list_models": {
34
+ "path": "/models",
35
+ "method": "GET",
36
+ "response_binding": "data"
37
+ }
38
+ },
39
+ "termination": {
40
+ "source_field": "finish_reason",
41
+ "mapping": {
42
+ "stop": "end_turn",
43
+ "length": "max_tokens",
44
+ "tool_calls": "tool_use"
45
+ },
46
+ "notes": [
47
+ "OpenAI-compatible finish_reason.",
48
+ "天工 (Tiangong) is Kunlun's flagship AI assistant."
49
+ ]
50
+ },
51
+ "tooling": {
52
+ "source_model": "openai_tool_calls",
53
+ "tool_use": {
54
+ "id_path": "id",
55
+ "name_path": "function.name",
56
+ "input_path": "function.arguments",
57
+ "input_format": "json_string"
58
+ },
59
+ "notes": [
60
+ "Supports OpenAI-compatible function calling."
61
+ ]
62
+ },
63
+ "retry_policy": {
64
+ "strategy": "exponential_backoff",
65
+ "max_retries": 3,
66
+ "min_delay_ms": 1000,
67
+ "max_delay_ms": 30000,
68
+ "jitter": "full",
69
+ "retry_on_http_status": [
70
+ 429,
71
+ 500,
72
+ 502,
73
+ 503
74
+ ]
75
+ },
76
+ "error_classification": {
77
+ "by_http_status": {
78
+ "400": "invalid_request",
79
+ "401": "authentication",
80
+ "403": "permission_denied",
81
+ "404": "not_found",
82
+ "429": "rate_limited",
83
+ "500": "server_error",
84
+ "503": "overloaded"
85
+ }
86
+ },
87
+ "parameter_mappings": {
88
+ "temperature": "temperature",
89
+ "max_tokens": "max_tokens",
90
+ "stream": "stream",
91
+ "top_p": "top_p",
92
+ "stop_sequences": "stop",
93
+ "tools": "tools",
94
+ "tool_choice": "tool_choice",
95
+ "frequency_penalty": "frequency_penalty",
96
+ "presence_penalty": "presence_penalty"
97
+ },
98
+ "response_format": "openai_style",
99
+ "response_paths": {
100
+ "content": "choices[0].message.content",
101
+ "tool_calls": "choices[0].message.tool_calls",
102
+ "usage": "usage",
103
+ "finish_reason": "choices[0].finish_reason"
104
+ },
105
+ "streaming": {
106
+ "event_format": "data_lines",
107
+ "decoder": {
108
+ "format": "sse",
109
+ "delimiter": "\n\n",
110
+ "prefix": "data: ",
111
+ "done_signal": "[DONE]"
112
+ },
113
+ "content_path": "choices[0].delta.content",
114
+ "tool_call_path": "choices[0].delta.tool_calls",
115
+ "usage_path": "usage",
116
+ "frame_selector": "exists($.choices) || exists($.error)",
117
+ "event_map": [
118
+ {
119
+ "match": "exists($.choices[*].delta.content)",
120
+ "emit": "PartialContentDelta",
121
+ "fields": {
122
+ "content": "$.choices[*].delta.content"
123
+ }
124
+ },
125
+ {
126
+ "match": "exists($.choices[*].delta.tool_calls[*].function.name)",
127
+ "emit": "ToolCallStarted",
128
+ "fields": {
129
+ "tool_call_id": "$.choices[*].delta.tool_calls[*].id",
130
+ "tool_name": "$.choices[*].delta.tool_calls[*].function.name",
131
+ "index": "$.choices[*].delta.tool_calls[*].index"
132
+ }
133
+ },
134
+ {
135
+ "match": "exists($.choices[*].delta.tool_calls[*].function.arguments)",
136
+ "emit": "PartialToolCall",
137
+ "fields": {
138
+ "arguments": "$.choices[*].delta.tool_calls[*].function.arguments",
139
+ "index": "$.choices[*].delta.tool_calls[*].index"
140
+ }
141
+ },
142
+ {
143
+ "match": "exists($.usage)",
144
+ "emit": "Metadata",
145
+ "fields": {
146
+ "usage": "$.usage"
147
+ }
148
+ },
149
+ {
150
+ "match": "exists($.choices[*].finish_reason)",
151
+ "emit": "FinalCandidate",
152
+ "fields": {
153
+ "finish_reason": "$.choices[*].finish_reason"
154
+ }
155
+ }
156
+ ],
157
+ "stop_condition": "$.choices[0].finish_reason != null"
158
+ },
159
+ "features": {
160
+ "multi_candidate": {
161
+ "support_type": "native",
162
+ "param_name": "n"
163
+ },
164
+ "response_mapping": {
165
+ "tool_calls": {
166
+ "path": "choices[0].message.tool_calls",
167
+ "fields": {
168
+ "id": "id",
169
+ "name": "function.name",
170
+ "args": "function.arguments"
171
+ }
172
+ },
173
+ "error": {
174
+ "message_path": "error.message",
175
+ "code_path": "error.code"
176
+ }
177
+ }
178
+ },
179
+ "capabilities": {
180
+ "streaming": true,
181
+ "tools": true,
182
+ "vision": true,
183
+ "agentic": true,
184
+ "parallel_tools": true,
185
+ "reasoning": false
186
+ },
187
+ "availability": {
188
+ "required": false,
189
+ "regions": [
190
+ "cn"
191
+ ],
192
+ "check": {
193
+ "method": "GET",
194
+ "path": "/models",
195
+ "expected_status": [
196
+ 200,
197
+ 401
198
+ ],
199
+ "timeout_ms": 5000
200
+ }
201
+ },
202
+ "experimental_features": [
203
+ "web_search",
204
+ "music_generation",
205
+ "image_generation"
206
+ ]
207
+ }
@@ -0,0 +1,196 @@
1
+ {
2
+ "$schema": "../../schemas/v1.json",
3
+ "protocol_version": "1.5",
4
+ "id": "together",
5
+ "name": "Together AI",
6
+ "status": "stable",
7
+ "category": "model_provider",
8
+ "official_url": "https://www.together.ai/",
9
+ "support_contact": "https://www.together.ai/contact",
10
+ "endpoint": {
11
+ "base_url": "https://api.together.xyz/v1",
12
+ "protocol": "https",
13
+ "timeout_ms": 60000
14
+ },
15
+ "auth": {
16
+ "type": "bearer",
17
+ "token_env": "TOGETHER_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": 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
+ "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
+ "Together AI 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
+ "type_path": "error.type"
156
+ }
157
+ }
158
+ },
159
+ "response_paths": {
160
+ "content": "choices[0].message.content",
161
+ "tool_calls": "choices[0].message.tool_calls",
162
+ "usage": "usage",
163
+ "finish_reason": "choices[0].finish_reason"
164
+ },
165
+ "parameter_mappings": {
166
+ "temperature": "temperature",
167
+ "max_tokens": "max_tokens",
168
+ "stream": "stream",
169
+ "top_p": "top_p",
170
+ "stop_sequences": "stop",
171
+ "tools": "tools",
172
+ "tool_choice": "tool_choice"
173
+ },
174
+ "retry_policy": {
175
+ "max_retries": 3,
176
+ "max_delay_ms": 30000,
177
+ "strategy": "exponential_backoff",
178
+ "min_delay_ms": 1000,
179
+ "jitter": "full",
180
+ "retry_on_http_status": [
181
+ 429,
182
+ 500,
183
+ 502,
184
+ 503
185
+ ]
186
+ },
187
+ "error_classification": {
188
+ "by_http_status": {
189
+ "400": "invalid_request",
190
+ "401": "authentication",
191
+ "429": "rate_limited",
192
+ "500": "server_error",
193
+ "503": "overloaded"
194
+ }
195
+ }
196
+ }