openany-cli-dev 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +472 -2
- package/bin/openany.js +3 -0
- package/package.json +27 -4
- package/skills/openany/SKILL.md +353 -0
- package/skills/openany/SKILL.zh-CN.md +496 -0
- package/skills/openany-provider/SKILL.md +26 -0
- package/skills/openany-provider/SKILL.zh-CN.md +26 -0
- package/skills/openany-provider/references/apis.md +60 -0
- package/skills/openany-provider/references/apis.zh-CN.md +55 -0
- package/skills/openany-provider/references/application.md +49 -0
- package/skills/openany-provider/references/application.zh-CN.md +51 -0
- package/skills/openany-provider/references/auth.md +3 -0
- package/skills/openany-provider/references/auth.zh-CN.md +3 -0
- package/skills/openany-provider/references/connections.md +36 -0
- package/skills/openany-provider/references/connections.zh-CN.md +36 -0
- package/skills/openany-provider/references/imports.md +57 -0
- package/skills/openany-provider/references/imports.zh-CN.md +57 -0
- package/skills/openany-provider/references/listing.md +29 -0
- package/skills/openany-provider/references/listing.zh-CN.md +11 -0
- package/skills/openany-provider/references/login.md +57 -0
- package/skills/openany-provider/references/login.zh-CN.md +57 -0
- package/skills/openany-provider/references/model-import.md +11 -0
- package/skills/openany-provider/references/model-import.zh-CN.md +11 -0
- package/skills/openany-provider/references/models.md +107 -0
- package/skills/openany-provider/references/models.zh-CN.md +68 -0
- package/skills/openany-provider/references/publishing.md +40 -0
- package/skills/openany-provider/references/publishing.zh-CN.md +40 -0
- package/skills/openany-provider/references/reviews.md +22 -0
- package/skills/openany-provider/references/reviews.zh-CN.md +20 -0
- package/skills/openany-provider/templates/api-metadata.json +27 -0
- package/skills/openany-provider/templates/bindings.json +1 -0
- package/skills/openany-provider/templates/models-v2.json +545 -0
- package/skills/openany-provider/templates/models.json +10 -0
- package/skills/openany-provider/templates/provider-agent-api-template.json +697 -0
- package/skills/openany-provider/templates/seller-agent-api-import-template.json +822 -0
- package/skills/openany-provider/templates/seller-registration.json +26 -0
- package/src/auth-recovery.js +179 -0
- package/src/auth.js +1001 -0
- package/src/catalog.js +306 -0
- package/src/cli.js +605 -0
- package/src/config.js +260 -0
- package/src/errors.js +53 -0
- package/src/http.js +238 -0
- package/src/model-curl.js +359 -0
- package/src/model-materials.js +58 -0
- package/src/model-request.js +402 -0
- package/src/model-validation.js +56 -0
- package/src/models.js +188 -0
- package/src/native/config-acl.ps1 +34 -0
- package/src/native/connection-macos.js +109 -0
- package/src/native/connection-windows.ps1 +98 -0
- package/src/native/setup-macos.js +72 -0
- package/src/native/setup-windows.ps1 +83 -0
- package/src/native-prompt.js +85 -0
- package/src/payment-signing.js +362 -0
- package/src/prompt.js +69 -0
- package/src/provider-api-import-v2.js +72 -0
- package/src/provider-apis.js +3 -0
- package/src/provider-client.js +153 -0
- package/src/provider-connections.js +152 -0
- package/src/provider-import-format.js +289 -0
- package/src/provider-imports.js +402 -0
- package/src/provider-json.js +49 -0
- package/src/provider-model-import-v2.js +61 -0
- package/src/provider-models.js +253 -0
- package/src/provider-profile.js +65 -0
- package/src/provider-reviews.js +61 -0
- package/src/provider-state.js +176 -0
- package/src/provider.js +75 -0
- package/src/setup.js +201 -0
- package/src/tasks.js +53 -0
- package/src/topups.js +845 -0
- package/src/vendor/provider-apply/market-taxonomy.mjs +22 -0
- package/src/vendor/provider-apply/provenance.json +8 -0
- package/src/vendor/provider-apply/registration.mjs +151 -0
- package/src/vendor/provider-import/api-categories.json +29 -0
- package/src/vendor/provider-import/api-fields.json +33 -0
- package/src/vendor/provider-import/model-fields.json +44 -0
- package/src/wallet.js +213 -0
- package/src/windows-permissions.js +22 -0
|
@@ -0,0 +1,697 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "provider-agent-api-v2",
|
|
3
|
+
"description": "Place the API configurations you fill in under apis. templateGuide and fieldGuide are instructions and are not submitted as API configurations.",
|
|
4
|
+
"templateGuide": {
|
|
5
|
+
"title": "API Import Template",
|
|
6
|
+
"status": "Fill in the API configurations under apis before importing. Legacy provider-agent-api-v1 files are also supported.",
|
|
7
|
+
"howToFill": [
|
|
8
|
+
"Read fieldGuide first, then edit the example configuration under apis.",
|
|
9
|
+
"Choose one billing method according to templateGuide.billingInstructions. The two configurations in billingOptions are provided only as examples to copy.",
|
|
10
|
+
"templateGuide and fieldGuide are instructions and are not submitted as API configurations.",
|
|
11
|
+
"Keep field names unchanged and edit only field values. Put strings in double quotes; do not quote numbers or booleans.",
|
|
12
|
+
"Keep only the APIs you need to import. Replace example paths and prices with actual values.",
|
|
13
|
+
"Set the connection URL and authentication credentials in the connection configuration, not in this template.",
|
|
14
|
+
"apiDescription must contain at least 150 Unicode characters after trimming, covering core capabilities, how to call the API, and use cases. Incomplete drafts can be previewed and edited; this requirement must be met before importing and saving."
|
|
15
|
+
],
|
|
16
|
+
"pricingExample": "1,000 micro-USD per call, equivalent to USD 0.001.",
|
|
17
|
+
"billingInstructions": "Each API must use exactly one billing method: fixed (per call) or usage (based on consumption). The example under apis uses fixed by default. For usage billing, replace config.billing in its entirety with billingOptions.usage.billing, then update the usage field and response example to match the actual response. Do not mix fields from the two billing methods or add both options from the guide to apis.",
|
|
18
|
+
"billingOptions": {
|
|
19
|
+
"fixed": {
|
|
20
|
+
"description": "Fixed billing: 1,000 micro-USD per call, equivalent to USD 0.001. Fill in only the four fields in this configuration; do not add usage fields.",
|
|
21
|
+
"billing": {
|
|
22
|
+
"mode": "fixed",
|
|
23
|
+
"currency": "USD",
|
|
24
|
+
"unit": "call",
|
|
25
|
+
"pricePerBillingUnitMicroUsd": "1000"
|
|
26
|
+
},
|
|
27
|
+
"responseBodyExample": {
|
|
28
|
+
"result": "Hello"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"usage": {
|
|
32
|
+
"description": "Usage billing: 1,000 micro-USD per 1,000 tokens, equivalent to USD 0.001. The example response returns 100 tokens at /usage/count. Set responseUsageJsonPointer if your response uses a different path.",
|
|
33
|
+
"billing": {
|
|
34
|
+
"mode": "usage",
|
|
35
|
+
"currency": "USD",
|
|
36
|
+
"unit": "token",
|
|
37
|
+
"pricePerBillingUnitMicroUsd": "1000",
|
|
38
|
+
"usageDecimalPlaces": 0,
|
|
39
|
+
"usageQuantityPerBillingUnit": "1000",
|
|
40
|
+
"costRoundingMode": "ceil"
|
|
41
|
+
},
|
|
42
|
+
"responseBodyExample": {
|
|
43
|
+
"result": "Hello",
|
|
44
|
+
"usage": {
|
|
45
|
+
"count": 100
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"fieldGuide": {
|
|
52
|
+
"schemaVersion": {
|
|
53
|
+
"label": "Template version",
|
|
54
|
+
"type": "string",
|
|
55
|
+
"required": true,
|
|
56
|
+
"description": "Identifies the template format. Do not change it.",
|
|
57
|
+
"constraints": "Must be provider-agent-api-v2. Do not change it.",
|
|
58
|
+
"example": "provider-agent-api-v2"
|
|
59
|
+
},
|
|
60
|
+
"apis": {
|
|
61
|
+
"label": "List of APIs to import",
|
|
62
|
+
"type": "array",
|
|
63
|
+
"required": true,
|
|
64
|
+
"description": "Each object represents one API. Copy the object to configure multiple APIs.",
|
|
65
|
+
"constraints": "Each template includes one example. You may copy the API object; apis must contain 1 to 100 items. The file must not exceed 8 MiB.",
|
|
66
|
+
"example": []
|
|
67
|
+
},
|
|
68
|
+
"apis[].apiName": {
|
|
69
|
+
"label": "API name",
|
|
70
|
+
"type": "string",
|
|
71
|
+
"required": true,
|
|
72
|
+
"description": "Enter an API name that callers can understand.",
|
|
73
|
+
"constraints": "Must not be empty.",
|
|
74
|
+
"example": "Text Processing"
|
|
75
|
+
},
|
|
76
|
+
"apis[].apiDescription": {
|
|
77
|
+
"label": "API purpose and usage",
|
|
78
|
+
"type": "string",
|
|
79
|
+
"required": true,
|
|
80
|
+
"description": "Describe the core capability, how to call the API, and use cases. At least 150 characters are required after trimming leading and trailing whitespace.",
|
|
81
|
+
"constraints": "apiDescription must contain at least 150 Unicode characters after trimming, covering core capabilities, how to call the API, and use cases. Incomplete drafts can be previewed and edited; this requirement must be met before importing and saving.",
|
|
82
|
+
"example": "This API accepts text submitted by a caller, processes it, and returns structured results. It can be used to organize content, extract information, and automate business workflows. Send a POST request to the configured API path with a text field in the JSON request body, and authenticate with an API key. Handle success or failure according to the returned status code and result field. This API is suitable for customer support ticket classification, internal document organization, and batch text analysis."
|
|
83
|
+
},
|
|
84
|
+
"apis[].overviewHtml": {
|
|
85
|
+
"label": "Overview",
|
|
86
|
+
"type": "string",
|
|
87
|
+
"required": false,
|
|
88
|
+
"description": "Optional rich-text overview as an HTML string.",
|
|
89
|
+
"constraints": "At most 32 KiB. Use supported HTML tags and links. Omit the field or leave it empty for no overview.",
|
|
90
|
+
"example": ""
|
|
91
|
+
},
|
|
92
|
+
"apis[].httpMethod": {
|
|
93
|
+
"label": "HTTP method",
|
|
94
|
+
"type": "string",
|
|
95
|
+
"required": true,
|
|
96
|
+
"description": "Enter the HTTP method actually used by the API.",
|
|
97
|
+
"constraints": "Only GET / POST / PUT / PATCH / DELETE, in uppercase.",
|
|
98
|
+
"example": "POST"
|
|
99
|
+
},
|
|
100
|
+
"apis[].publicPath": {
|
|
101
|
+
"label": "Upstream API relative path",
|
|
102
|
+
"type": "string",
|
|
103
|
+
"required": true,
|
|
104
|
+
"description": "Enter the upstream API's relative path. The public path is the same as the upstream path; the selected connection supplies the domain.",
|
|
105
|
+
"constraints": "Required; must start with /; at most 2048 characters; use {parameterName} for path parameters.",
|
|
106
|
+
"example": "/v1/text/process"
|
|
107
|
+
},
|
|
108
|
+
"apis[].requestContentType": {
|
|
109
|
+
"label": "Request body format",
|
|
110
|
+
"type": "string",
|
|
111
|
+
"required": true,
|
|
112
|
+
"description": "Enter the request body encoding accepted by the upstream API.",
|
|
113
|
+
"constraints": "Only none / application/json / application/x-www-form-urlencoded.",
|
|
114
|
+
"example": "application/json"
|
|
115
|
+
},
|
|
116
|
+
"apis[].categories": {
|
|
117
|
+
"label": "API categories",
|
|
118
|
+
"type": "array<string>",
|
|
119
|
+
"required": false,
|
|
120
|
+
"description": "Choose applicable existing system categories and enter their IDs from allowedValues. options provides the corresponding names and groups.",
|
|
121
|
+
"constraints": "Only values from allowedValues are permitted. Use an array of strings, not localized names, display names, or custom categories. At most 16 distinct items.",
|
|
122
|
+
"example": [
|
|
123
|
+
"ai-generation"
|
|
124
|
+
],
|
|
125
|
+
"allowedValues": [
|
|
126
|
+
"social-media",
|
|
127
|
+
"lead-generation",
|
|
128
|
+
"search-research",
|
|
129
|
+
"news",
|
|
130
|
+
"e-commerce",
|
|
131
|
+
"travel",
|
|
132
|
+
"crypto-defi",
|
|
133
|
+
"finance",
|
|
134
|
+
"ai-generation",
|
|
135
|
+
"compute-storage",
|
|
136
|
+
"email-communication",
|
|
137
|
+
"phone-messaging",
|
|
138
|
+
"web-tools",
|
|
139
|
+
"data",
|
|
140
|
+
"scrapers",
|
|
141
|
+
"developer",
|
|
142
|
+
"other",
|
|
143
|
+
"enrichment",
|
|
144
|
+
"seo-aeo",
|
|
145
|
+
"advertising",
|
|
146
|
+
"reviews-apps",
|
|
147
|
+
"community",
|
|
148
|
+
"market-data",
|
|
149
|
+
"document",
|
|
150
|
+
"media",
|
|
151
|
+
"tools",
|
|
152
|
+
"web"
|
|
153
|
+
],
|
|
154
|
+
"options": [
|
|
155
|
+
{
|
|
156
|
+
"value": "social-media",
|
|
157
|
+
"label": "Social Media"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"value": "lead-generation",
|
|
161
|
+
"label": "Lead Generation"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"value": "search-research",
|
|
165
|
+
"label": "Search & Research"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"value": "news",
|
|
169
|
+
"label": "News"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"value": "e-commerce",
|
|
173
|
+
"label": "E-commerce"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"value": "travel",
|
|
177
|
+
"label": "Travel"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"value": "crypto-defi",
|
|
181
|
+
"label": "Crypto & DeFi"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"value": "finance",
|
|
185
|
+
"label": "Finance"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"value": "ai-generation",
|
|
189
|
+
"label": "AI Generation"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"value": "compute-storage",
|
|
193
|
+
"label": "Compute & Storage"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"value": "email-communication",
|
|
197
|
+
"label": "Email & Communication"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"value": "phone-messaging",
|
|
201
|
+
"label": "Phone & Messaging"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"value": "web-tools",
|
|
205
|
+
"label": "Web Tools"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"value": "data",
|
|
209
|
+
"label": "Data"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"value": "scrapers",
|
|
213
|
+
"label": "Scrapers"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"value": "developer",
|
|
217
|
+
"label": "Developer"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"value": "other",
|
|
221
|
+
"label": "Other"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"value": "enrichment",
|
|
225
|
+
"label": "Enrichment"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"value": "seo-aeo",
|
|
229
|
+
"label": "SEO/AEO"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"value": "advertising",
|
|
233
|
+
"label": "Advertising"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"value": "reviews-apps",
|
|
237
|
+
"label": "Reviews & Apps"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"value": "community",
|
|
241
|
+
"label": "Community"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"value": "market-data",
|
|
245
|
+
"label": "Market Data"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"value": "document",
|
|
249
|
+
"label": "Documents"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"value": "media",
|
|
253
|
+
"label": "Media"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"value": "tools",
|
|
257
|
+
"label": "Tools"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"value": "web",
|
|
261
|
+
"label": "Web"
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
},
|
|
265
|
+
"apis[].config": {
|
|
266
|
+
"label": "API invocation and billing configuration",
|
|
267
|
+
"type": "object",
|
|
268
|
+
"required": true,
|
|
269
|
+
"description": "Configure request parameters, forwarding rules, limits, billing, and invocation examples.",
|
|
270
|
+
"constraints": "Use the fields described below.",
|
|
271
|
+
"example": {}
|
|
272
|
+
},
|
|
273
|
+
"apis[].config.requestParameters": {
|
|
274
|
+
"label": "Caller request parameters",
|
|
275
|
+
"type": "array<object>",
|
|
276
|
+
"required": true,
|
|
277
|
+
"description": "Declare the parameters that callers are allowed to send when invoking the API.",
|
|
278
|
+
"constraints": "Use [] when there are no parameters. With reject enabled, undeclared query/body parameters are rejected.",
|
|
279
|
+
"example": []
|
|
280
|
+
},
|
|
281
|
+
"apis[].config.parameterMappings": {
|
|
282
|
+
"label": "Upstream parameter mappings",
|
|
283
|
+
"type": "array<object>",
|
|
284
|
+
"required": true,
|
|
285
|
+
"description": "Forward caller parameters to specified upstream locations.",
|
|
286
|
+
"constraints": "source references a declared parameter; target specifies an upstream location.",
|
|
287
|
+
"example": []
|
|
288
|
+
},
|
|
289
|
+
"apis[].config.fixedHeaders": {
|
|
290
|
+
"label": "Fixed upstream request headers",
|
|
291
|
+
"type": "object",
|
|
292
|
+
"required": false,
|
|
293
|
+
"description": "Enter non-sensitive headers added to every forwarded upstream request.",
|
|
294
|
+
"constraints": "Values must be strings. Do not include credentials such as Authorization or Cookie, or reserved headers. Use {} if none.",
|
|
295
|
+
"example": {}
|
|
296
|
+
},
|
|
297
|
+
"apis[].config.fixedBody": {
|
|
298
|
+
"label": "Fixed upstream request body fields",
|
|
299
|
+
"type": "object",
|
|
300
|
+
"required": false,
|
|
301
|
+
"description": "Enter JSON fields added to every forwarded upstream request.",
|
|
302
|
+
"constraints": "Enter a JSON object without secrets. Use {} if none.",
|
|
303
|
+
"example": {}
|
|
304
|
+
},
|
|
305
|
+
"apis[].config.crossFieldRules": {
|
|
306
|
+
"label": "Cross-field validation rules",
|
|
307
|
+
"type": "array<object>",
|
|
308
|
+
"required": false,
|
|
309
|
+
"description": "Advanced configuration for joint validation of multiple parameters.",
|
|
310
|
+
"constraints": "Use [] if there are no rules. Each rule contains op and fields. op can be one_of (exactly one), mutually_exclusive (at most one), or requires (when the first parameter is present, all remaining parameters must also be present). fields contains 2 to 16 references to declared parameters, such as body:/text.",
|
|
311
|
+
"example": []
|
|
312
|
+
},
|
|
313
|
+
"apis[].config.undeclaredParameterPolicy": {
|
|
314
|
+
"label": "Undeclared parameter policy",
|
|
315
|
+
"type": "string",
|
|
316
|
+
"required": false,
|
|
317
|
+
"description": "Controls how undeclared query/body parameters are handled.",
|
|
318
|
+
"constraints": "reject: reject the request; ignore: discard without forwarding. This example explicitly uses reject.",
|
|
319
|
+
"example": "reject"
|
|
320
|
+
},
|
|
321
|
+
"apis[].config.timeoutMs": {
|
|
322
|
+
"label": "Request timeout (milliseconds)",
|
|
323
|
+
"type": "integer",
|
|
324
|
+
"required": false,
|
|
325
|
+
"description": "Enter how long the request may wait.",
|
|
326
|
+
"constraints": "100 to 120000; 2000 milliseconds = 2 seconds.",
|
|
327
|
+
"example": 2000
|
|
328
|
+
},
|
|
329
|
+
"apis[].config.maxRequestBytes": {
|
|
330
|
+
"label": "Maximum request body size (bytes)",
|
|
331
|
+
"type": "integer",
|
|
332
|
+
"required": false,
|
|
333
|
+
"description": "Enter the maximum allowed request body size in bytes.",
|
|
334
|
+
"constraints": "1 to 1048576; 4096 bytes = 4 KiB.",
|
|
335
|
+
"example": 4096
|
|
336
|
+
},
|
|
337
|
+
"apis[].config.maxResponseBytes": {
|
|
338
|
+
"label": "Maximum response body size (bytes)",
|
|
339
|
+
"type": "integer",
|
|
340
|
+
"required": false,
|
|
341
|
+
"description": "Enter the maximum allowed response body size in bytes.",
|
|
342
|
+
"constraints": "1 to 8388608; 65536 bytes = 64 KiB.",
|
|
343
|
+
"example": 65536
|
|
344
|
+
},
|
|
345
|
+
"apis[].config.billingSuccessCondition": {
|
|
346
|
+
"label": "Billable success condition",
|
|
347
|
+
"type": "object|null",
|
|
348
|
+
"required": false,
|
|
349
|
+
"description": "Specify the condition under which the API response is successful and billable.",
|
|
350
|
+
"constraints": "null uses the default success condition of HTTP 200 to 299. You may also provide a single condition object, such as {\"source\":\"body\",\"pointer\":\"/success\",\"op\":\"eq\",\"value\":true}. Nested all/any conditions are not supported.",
|
|
351
|
+
"example": null
|
|
352
|
+
},
|
|
353
|
+
"apis[].config.billing": {
|
|
354
|
+
"label": "Billing configuration",
|
|
355
|
+
"type": "object",
|
|
356
|
+
"required": true,
|
|
357
|
+
"description": "Set fixed or usage billing rules.",
|
|
358
|
+
"constraints": "The two modes use different fields; do not mix them.",
|
|
359
|
+
"example": {}
|
|
360
|
+
},
|
|
361
|
+
"apis[].config.requestResponseExamples": {
|
|
362
|
+
"label": "Request and response examples",
|
|
363
|
+
"type": "array<object>",
|
|
364
|
+
"required": false,
|
|
365
|
+
"description": "Provide sample requests and responses for callers.",
|
|
366
|
+
"constraints": "Examples must match the declared parameters and contain no credentials or private data.",
|
|
367
|
+
"example": []
|
|
368
|
+
},
|
|
369
|
+
"apis[].config.requestParameters[].name": {
|
|
370
|
+
"label": "Parameter name",
|
|
371
|
+
"type": "string",
|
|
372
|
+
"required": true,
|
|
373
|
+
"description": "Enter the parameter's business name.",
|
|
374
|
+
"constraints": "Must not be empty. For path/query/header parameters, use the corresponding actual name.",
|
|
375
|
+
"example": "text"
|
|
376
|
+
},
|
|
377
|
+
"apis[].config.requestParameters[].location": {
|
|
378
|
+
"label": "Parameter location",
|
|
379
|
+
"type": "string",
|
|
380
|
+
"required": true,
|
|
381
|
+
"description": "Specify where the caller supplies the parameter.",
|
|
382
|
+
"constraints": "Only path / query / header / body.",
|
|
383
|
+
"example": "body"
|
|
384
|
+
},
|
|
385
|
+
"apis[].config.requestParameters[].pointer": {
|
|
386
|
+
"label": "Request body field location",
|
|
387
|
+
"type": "string",
|
|
388
|
+
"required": "Required when location is body",
|
|
389
|
+
"description": "Locate the field in the JSON request body.",
|
|
390
|
+
"constraints": "For body parameters, enter a JSON Pointer. /text corresponds to {\"text\":\"Hello\"}. Use /object/field for nested fields. Escape ~ and / in key names as ~0 and ~1, respectively.",
|
|
391
|
+
"example": "/text"
|
|
392
|
+
},
|
|
393
|
+
"apis[].config.requestParameters[].type": {
|
|
394
|
+
"label": "Parameter data type",
|
|
395
|
+
"type": "string",
|
|
396
|
+
"required": true,
|
|
397
|
+
"description": "Specify the allowed data type.",
|
|
398
|
+
"constraints": "Only string / integer / number / boolean / object / array. Advanced types such as arrays also require their respective detailed constraints.",
|
|
399
|
+
"example": "string"
|
|
400
|
+
},
|
|
401
|
+
"apis[].config.requestParameters[].required": {
|
|
402
|
+
"label": "Whether the parameter is required",
|
|
403
|
+
"type": "boolean",
|
|
404
|
+
"required": true,
|
|
405
|
+
"description": "true means the parameter must be provided when calling the API.",
|
|
406
|
+
"constraints": "Only true / false, without quotes; independent of nullable.",
|
|
407
|
+
"example": true
|
|
408
|
+
},
|
|
409
|
+
"apis[].config.requestParameters[].nullable": {
|
|
410
|
+
"label": "Whether the parameter may be null",
|
|
411
|
+
"type": "boolean",
|
|
412
|
+
"required": true,
|
|
413
|
+
"description": "true means the parameter value may be JSON null.",
|
|
414
|
+
"constraints": "Only true / false; an empty string is not null.",
|
|
415
|
+
"example": false
|
|
416
|
+
},
|
|
417
|
+
"apis[].config.requestParameters[].description": {
|
|
418
|
+
"label": "Parameter instructions",
|
|
419
|
+
"type": "string",
|
|
420
|
+
"required": true,
|
|
421
|
+
"description": "Explain what the parameter means and what to enter.",
|
|
422
|
+
"constraints": "Describe its purpose clearly rather than just repeating its name.",
|
|
423
|
+
"example": "Enter the text to process, for example: Hello."
|
|
424
|
+
},
|
|
425
|
+
"apis[].config.parameterMappings[].source": {
|
|
426
|
+
"label": "Caller parameter source",
|
|
427
|
+
"type": "string",
|
|
428
|
+
"required": true,
|
|
429
|
+
"description": "Enter a reference to a declared caller parameter.",
|
|
430
|
+
"constraints": "For example, body:/text refers to the /text field in the JSON request body. An identical source and target forwards it without changing its location.",
|
|
431
|
+
"example": "body:/text"
|
|
432
|
+
},
|
|
433
|
+
"apis[].config.parameterMappings[].target": {
|
|
434
|
+
"label": "Upstream parameter target",
|
|
435
|
+
"type": "string",
|
|
436
|
+
"required": true,
|
|
437
|
+
"description": "Enter where the upstream API receives the parameter.",
|
|
438
|
+
"constraints": "For example, body:/text refers to the /text field in the JSON request body. An identical source and target forwards it without changing its location.",
|
|
439
|
+
"example": "body:/text"
|
|
440
|
+
},
|
|
441
|
+
"apis[].config.billing.mode": {
|
|
442
|
+
"label": "Billing mode",
|
|
443
|
+
"type": "string",
|
|
444
|
+
"required": true,
|
|
445
|
+
"description": "Choose fixed or usage billing.",
|
|
446
|
+
"constraints": "fixed: per call; usage: based on actual usage in the response.",
|
|
447
|
+
"example": "usage"
|
|
448
|
+
},
|
|
449
|
+
"apis[].config.billing.currency": {
|
|
450
|
+
"label": "Billing currency",
|
|
451
|
+
"type": "string",
|
|
452
|
+
"required": true,
|
|
453
|
+
"description": "Enter the currency used for the price.",
|
|
454
|
+
"constraints": "Currently only USD.",
|
|
455
|
+
"example": "USD"
|
|
456
|
+
},
|
|
457
|
+
"apis[].config.billing.unit": {
|
|
458
|
+
"label": "Usage unit name",
|
|
459
|
+
"type": "string",
|
|
460
|
+
"required": true,
|
|
461
|
+
"description": "Describe the business unit being measured.",
|
|
462
|
+
"constraints": "fixed must use call; usage requires a nonempty unit such as token, at most 64 characters.",
|
|
463
|
+
"example": "token"
|
|
464
|
+
},
|
|
465
|
+
"apis[].config.billing.pricePerBillingUnitMicroUsd": {
|
|
466
|
+
"label": "Price per billing unit (micro-USD)",
|
|
467
|
+
"type": "string",
|
|
468
|
+
"required": true,
|
|
469
|
+
"description": "For fixed, the price per call; for usage, the price per usageQuantityPerBillingUnit usage units.",
|
|
470
|
+
"constraints": "An integer string from 0 to 9007199254740991. No decimals, minus sign, leading zeros, or scientific notation. USD 1 = 1000000 micro-USD.",
|
|
471
|
+
"example": "1000"
|
|
472
|
+
},
|
|
473
|
+
"apis[].config.billing.responseUsageJsonPointer": {
|
|
474
|
+
"label": "Usage JSON Pointer",
|
|
475
|
+
"description": "Use the path to the billable quantity in the JSON response. Omit this field to use /usage/count.",
|
|
476
|
+
"example": "/metrics/total"
|
|
477
|
+
},
|
|
478
|
+
"apis[].config.billing.usageDecimalPlaces": {
|
|
479
|
+
"label": "Maximum usage decimal places",
|
|
480
|
+
"type": "integer",
|
|
481
|
+
"required": "Required for usage; prohibited for fixed",
|
|
482
|
+
"description": "Limit the decimal places in the response usage and usage quantity per billing unit.",
|
|
483
|
+
"constraints": "0 to 6; 0 means an integer. Excess precision is treated as invalid usage and is not truncated automatically.",
|
|
484
|
+
"example": 0
|
|
485
|
+
},
|
|
486
|
+
"apis[].config.billing.usageQuantityPerBillingUnit": {
|
|
487
|
+
"label": "Usage quantity per billing unit",
|
|
488
|
+
"type": "string",
|
|
489
|
+
"required": "Required for usage; prohibited for fixed",
|
|
490
|
+
"description": "Enter how many usage units the current price covers.",
|
|
491
|
+
"constraints": "Must be a positive decimal number string with no more decimal places than usageDecimalPlaces.",
|
|
492
|
+
"example": "1000"
|
|
493
|
+
},
|
|
494
|
+
"apis[].config.billing.costRoundingMode": {
|
|
495
|
+
"label": "Final cost rounding mode",
|
|
496
|
+
"type": "string",
|
|
497
|
+
"required": "Required for usage; prohibited for fixed",
|
|
498
|
+
"description": "Round the final calculated cost to micro-USD without rounding the usage itself.",
|
|
499
|
+
"constraints": "ceil: round up; floor: round down; half_up: round to nearest, with ties rounded up.",
|
|
500
|
+
"example": "ceil"
|
|
501
|
+
},
|
|
502
|
+
"apis[].config.requestResponseExamples[].name": {
|
|
503
|
+
"label": "Example name",
|
|
504
|
+
"type": "string",
|
|
505
|
+
"required": true,
|
|
506
|
+
"description": "Name this request and response example.",
|
|
507
|
+
"constraints": "Enter a string.",
|
|
508
|
+
"example": "Basic invocation example"
|
|
509
|
+
},
|
|
510
|
+
"apis[].config.requestResponseExamples[].request": {
|
|
511
|
+
"label": "Example request",
|
|
512
|
+
"type": "object",
|
|
513
|
+
"required": true,
|
|
514
|
+
"description": "Enter the parameters sent by the caller.",
|
|
515
|
+
"constraints": "Include path, query, headers, and body.",
|
|
516
|
+
"example": {
|
|
517
|
+
"path": {},
|
|
518
|
+
"query": {},
|
|
519
|
+
"headers": {},
|
|
520
|
+
"body": {
|
|
521
|
+
"text": "Hello"
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
"apis[].config.requestResponseExamples[].request.path": {
|
|
526
|
+
"label": "Example path parameters",
|
|
527
|
+
"type": "object",
|
|
528
|
+
"required": true,
|
|
529
|
+
"description": "Enter path placeholders and their corresponding values.",
|
|
530
|
+
"constraints": "Use {} when there are no path parameters.",
|
|
531
|
+
"example": {}
|
|
532
|
+
},
|
|
533
|
+
"apis[].config.requestResponseExamples[].request.query": {
|
|
534
|
+
"label": "Example query parameters",
|
|
535
|
+
"type": "object",
|
|
536
|
+
"required": true,
|
|
537
|
+
"description": "Enter URL query parameters.",
|
|
538
|
+
"constraints": "Use {} when there are no query parameters.",
|
|
539
|
+
"example": {}
|
|
540
|
+
},
|
|
541
|
+
"apis[].config.requestResponseExamples[].request.headers": {
|
|
542
|
+
"label": "Example request headers",
|
|
543
|
+
"type": "object",
|
|
544
|
+
"required": true,
|
|
545
|
+
"description": "Enter non-sensitive request headers.",
|
|
546
|
+
"constraints": "Do not include authentication credentials. Use {} if there are no extra headers.",
|
|
547
|
+
"example": {}
|
|
548
|
+
},
|
|
549
|
+
"apis[].config.requestResponseExamples[].request.body": {
|
|
550
|
+
"label": "Example request body",
|
|
551
|
+
"type": "JSON",
|
|
552
|
+
"required": true,
|
|
553
|
+
"description": "Enter a request body that matches requestParameters.",
|
|
554
|
+
"constraints": "This example is a JSON object; text is required and cannot be null.",
|
|
555
|
+
"example": {
|
|
556
|
+
"text": "Hello"
|
|
557
|
+
}
|
|
558
|
+
},
|
|
559
|
+
"apis[].config.requestResponseExamples[].httpStatus": {
|
|
560
|
+
"label": "Example response status code",
|
|
561
|
+
"type": "integer",
|
|
562
|
+
"required": true,
|
|
563
|
+
"description": "Enter the HTTP status code returned by this example.",
|
|
564
|
+
"constraints": "Enter a valid HTTP status code, such as 200.",
|
|
565
|
+
"example": 200
|
|
566
|
+
},
|
|
567
|
+
"apis[].config.requestResponseExamples[].responseBody": {
|
|
568
|
+
"label": "Example response body",
|
|
569
|
+
"type": "JSON",
|
|
570
|
+
"required": true,
|
|
571
|
+
"description": "Enter an example response from this API.",
|
|
572
|
+
"constraints": "In usage mode, the example response must include a valid billable quantity at the configured JSON Pointer.",
|
|
573
|
+
"example": {
|
|
574
|
+
"result": "Hello",
|
|
575
|
+
"usage": {
|
|
576
|
+
"count": 100
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
"apis[].config.billingSuccessCondition.source": {
|
|
581
|
+
"label": "Success condition data source",
|
|
582
|
+
"type": "string",
|
|
583
|
+
"required": true,
|
|
584
|
+
"description": "Choose the HTTP status code or a response body field.",
|
|
585
|
+
"constraints": "Only http_status / body.",
|
|
586
|
+
"example": "body"
|
|
587
|
+
},
|
|
588
|
+
"apis[].config.billingSuccessCondition.pointer": {
|
|
589
|
+
"label": "Success condition field location",
|
|
590
|
+
"type": "string",
|
|
591
|
+
"required": "Required when source=body; prohibited when source=http_status",
|
|
592
|
+
"description": "Locate the field in the JSON response used to determine success.",
|
|
593
|
+
"constraints": "A JSON Pointer starting with /, at most 512 characters.",
|
|
594
|
+
"example": "/success"
|
|
595
|
+
},
|
|
596
|
+
"apis[].config.billingSuccessCondition.op": {
|
|
597
|
+
"label": "Success condition operator",
|
|
598
|
+
"type": "string",
|
|
599
|
+
"required": true,
|
|
600
|
+
"description": "Specify how to determine whether the response is successful.",
|
|
601
|
+
"constraints": "eq: equals; in: belongs to a list; exists: field exists (body only); http_200_non_empty_string: HTTP 200 and the specified response body field is a nonempty string (body only).",
|
|
602
|
+
"example": "eq"
|
|
603
|
+
},
|
|
604
|
+
"apis[].config.billingSuccessCondition.value": {
|
|
605
|
+
"label": "Success condition comparison value",
|
|
606
|
+
"type": "JSON",
|
|
607
|
+
"required": "Required for eq/in; prohibited for exists/http_200_non_empty_string",
|
|
608
|
+
"description": "Enter a comparison value with the same type as the actual response value.",
|
|
609
|
+
"constraints": "eq accepts a string, number, boolean, or null; in accepts an array of 1 to 128 scalars of the same type; http_status values must be integers from 100 to 599.",
|
|
610
|
+
"example": true
|
|
611
|
+
},
|
|
612
|
+
"apis[].includedContentHtml": {
|
|
613
|
+
"type": "string (HTML)",
|
|
614
|
+
"required": false,
|
|
615
|
+
"description": "Optional for standard APIs. Delivery list, preparation, scope and limitations in allowed HTML, up to 32 KiB. Omit or leave empty if unused.",
|
|
616
|
+
"example": "<h2>Included</h2><ul><li>A structured result.</li></ul>"
|
|
617
|
+
},
|
|
618
|
+
"apis[].usageInstructionsHtml": {
|
|
619
|
+
"type": "string (HTML)",
|
|
620
|
+
"required": false,
|
|
621
|
+
"description": "Optional for standard APIs. Seller-authored usage instructions in allowed HTML, up to 32 KiB. Leave empty to omit the instructions.",
|
|
622
|
+
"example": "<h2>Quick start</h2><ol><li>Prepare the input.</li><li>Run the task and retrieve its result.</li></ol>"
|
|
623
|
+
},
|
|
624
|
+
"apis[].effectContentHtml": {
|
|
625
|
+
"type": "string (HTML)",
|
|
626
|
+
"required": false,
|
|
627
|
+
"description": "Optional for standard APIs. Provide public effect examples in allowed HTML, up to 32 KiB. Include an example title, input and result. API request and response samples are configured separately.",
|
|
628
|
+
"example": "<h2>Process a short text sample</h2><h3>Example input</h3><p>Process the text: Hello.</p><h3>Example result</h3><p>The agent returns the processed text in the result field.</p>"
|
|
629
|
+
}
|
|
630
|
+
},
|
|
631
|
+
"apis": [
|
|
632
|
+
{
|
|
633
|
+
"apiName": "Text Processing (Fixed Billing)",
|
|
634
|
+
"apiDescription": "This API accepts text submitted by a caller, processes it, and returns structured results. It can be used to organize content, extract information, and automate business workflows. Send a POST request to the configured API path with a text field in the JSON request body, and authenticate with an API key. Handle success or failure according to the returned status code and result field. This API is suitable for customer support ticket classification, internal document organization, and batch text analysis.",
|
|
635
|
+
"overviewHtml": "",
|
|
636
|
+
"httpMethod": "POST",
|
|
637
|
+
"publicPath": "/v1/text/process",
|
|
638
|
+
"requestContentType": "application/json",
|
|
639
|
+
"categories": [
|
|
640
|
+
"ai-generation"
|
|
641
|
+
],
|
|
642
|
+
"config": {
|
|
643
|
+
"requestParameters": [
|
|
644
|
+
{
|
|
645
|
+
"name": "text",
|
|
646
|
+
"location": "body",
|
|
647
|
+
"pointer": "/text",
|
|
648
|
+
"type": "string",
|
|
649
|
+
"required": true,
|
|
650
|
+
"nullable": false,
|
|
651
|
+
"description": "Enter the text to process, for example: Hello."
|
|
652
|
+
}
|
|
653
|
+
],
|
|
654
|
+
"parameterMappings": [
|
|
655
|
+
{
|
|
656
|
+
"source": "body:/text",
|
|
657
|
+
"target": "body:/text"
|
|
658
|
+
}
|
|
659
|
+
],
|
|
660
|
+
"fixedHeaders": {},
|
|
661
|
+
"fixedBody": {},
|
|
662
|
+
"crossFieldRules": [],
|
|
663
|
+
"undeclaredParameterPolicy": "reject",
|
|
664
|
+
"timeoutMs": 2000,
|
|
665
|
+
"maxRequestBytes": 4096,
|
|
666
|
+
"maxResponseBytes": 65536,
|
|
667
|
+
"billing": {
|
|
668
|
+
"mode": "fixed",
|
|
669
|
+
"currency": "USD",
|
|
670
|
+
"unit": "call",
|
|
671
|
+
"pricePerBillingUnitMicroUsd": "1000"
|
|
672
|
+
},
|
|
673
|
+
"billingSuccessCondition": null,
|
|
674
|
+
"requestResponseExamples": [
|
|
675
|
+
{
|
|
676
|
+
"name": "Basic invocation example",
|
|
677
|
+
"request": {
|
|
678
|
+
"path": {},
|
|
679
|
+
"query": {},
|
|
680
|
+
"headers": {},
|
|
681
|
+
"body": {
|
|
682
|
+
"text": "Hello"
|
|
683
|
+
}
|
|
684
|
+
},
|
|
685
|
+
"httpStatus": 200,
|
|
686
|
+
"responseBody": {
|
|
687
|
+
"result": "Hello"
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
]
|
|
691
|
+
},
|
|
692
|
+
"includedContentHtml": "",
|
|
693
|
+
"usageInstructionsHtml": "",
|
|
694
|
+
"effectContentHtml": ""
|
|
695
|
+
}
|
|
696
|
+
]
|
|
697
|
+
}
|