@spicyapi/sdk 0.2.0 → 0.3.0
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 +68 -3
- package/contracts/openapi.yaml +226 -10
- package/dist/src/docs/index.js +1 -1
- package/dist/src/docs/index.js.map +1 -1
- package/dist/src/generated/openapi.d.ts +255 -8
- package/dist/src/generated/openapi.d.ts.map +1 -1
- package/dist/src/generated/package-version.d.ts +2 -0
- package/dist/src/generated/package-version.d.ts.map +1 -0
- package/dist/src/generated/package-version.js +3 -0
- package/dist/src/generated/package-version.js.map +1 -0
- package/dist/src/sdk/base64.d.ts +6 -0
- package/dist/src/sdk/base64.d.ts.map +1 -0
- package/dist/src/sdk/base64.js +47 -0
- package/dist/src/sdk/base64.js.map +1 -0
- package/dist/src/sdk/client.d.ts +6 -1
- package/dist/src/sdk/client.d.ts.map +1 -1
- package/dist/src/sdk/client.js +161 -22
- package/dist/src/sdk/client.js.map +1 -1
- package/dist/src/sdk/types.d.ts +32 -0
- package/dist/src/sdk/types.d.ts.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -16,9 +16,31 @@ const models = await client.listModels({ includeSchema: true });
|
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
Set `SPICY_API_KEY` with your process secret manager. Task creation and retry may reserve funds; use
|
|
19
|
-
stable idempotency keys and explicit user confirmation.
|
|
20
|
-
|
|
21
|
-
unchanged input, `quoteId` and `expectedCost`.
|
|
19
|
+
stable idempotency keys and explicit user confirmation. When a caller needs an exact price
|
|
20
|
+
confirmation, call `quoteTask` with the request, display its `estimatedCost`, `maxCharge` and
|
|
21
|
+
`expiresAt`, then pass unchanged input, `quoteId` and `expectedCost` to `createTask` or `run`.
|
|
22
|
+
Pre-authorized server workflows can submit directly at current pricing; separate health, balance and
|
|
23
|
+
quote requests are not mandatory API steps.
|
|
24
|
+
|
|
25
|
+
## Submit and wait
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
const model = process.env.SPICY_MODEL;
|
|
29
|
+
const operationId = process.env.SPICY_IDEMPOTENCY_KEY;
|
|
30
|
+
if (!model || !operationId) throw new Error("Set a model and a persisted operation key");
|
|
31
|
+
const task = await client.run(
|
|
32
|
+
{ model, input: { prompt: "A quiet mountain lake" } },
|
|
33
|
+
{ idempotencyKey: operationId, onAccepted: ({ taskId }) => console.log({ taskId }) },
|
|
34
|
+
);
|
|
35
|
+
if (task.state === "succeeded") {
|
|
36
|
+
console.log(task.output?.assets?.[0]?.url);
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Use a model and input supported by its current schema. `run` submits once and handles adaptive
|
|
41
|
+
polling, including pending media transfer. Its local timeout includes submission and waiting; timing
|
|
42
|
+
out or aborting does not cancel the accepted task. Resume with the saved task ID. Use a webhook for
|
|
43
|
+
background jobs to avoid polling entirely.
|
|
22
44
|
|
|
23
45
|
Documentation: <https://spicyapi.ai/en/docs>
|
|
24
46
|
|
|
@@ -80,3 +102,46 @@ explicit type extension in the official client. Reasoning tokens are already inc
|
|
|
80
102
|
|
|
81
103
|
[Complete compatibility guide](https://spicyapi.ai/en/docs/quotes-and-compatibility) ·
|
|
82
104
|
[Official JavaScript client](https://github.com/openai/openai-node)
|
|
105
|
+
|
|
106
|
+
## Media inputs and results
|
|
107
|
+
|
|
108
|
+
Pass a publicly accessible HTTPS image, video, or audio URL directly in the field specified by the
|
|
109
|
+
model schema. Uploading is optional: local files use `createUploadUrl` → PUT → `commitUploadedFile`,
|
|
110
|
+
then the returned account-bound `spicy://` URI (valid for one day). `uploadFile` wraps these steps;
|
|
111
|
+
`uploadBase64` also accepts a Data URI or raw standard Base64 with an explicit `contentType`. Small
|
|
112
|
+
schema-declared image fields can accept Data URIs directly in `input` (1 MiB decoded per image, 2
|
|
113
|
+
MiB total JSON body, with documented pixel limits). The upload helper is separate and supports
|
|
114
|
+
larger files within upload and model limits. See the
|
|
115
|
+
[media guide](https://docs.spicyapi.ai/en/docs/media).
|
|
116
|
+
|
|
117
|
+
`getTask` and `waitForTask` return ready media in `output.assets`, including `url`, `expiresAt`,
|
|
118
|
+
MIME, and available dimensions, duration, and byte count. Download `asset.url` directly without
|
|
119
|
+
forwarding `SPICY_API_KEY`; no separate `createDownloadUrl` call is required. `pending` assets need
|
|
120
|
+
another poll. URLs normally last 20 minutes, within the 14-day result retention window. Poll again
|
|
121
|
+
to refresh a URL; `createDownloadUrl` remains available for older integrations.
|
|
122
|
+
|
|
123
|
+
V2 webhooks use the same result fields. A retry keeps the business event and `request_id`, but
|
|
124
|
+
refreshes `url` and `expiresAt`. Verify the signature against the exact received body and
|
|
125
|
+
deduplicate using `request_id`, not a full-body hash. V1 payloads remain unchanged.
|
|
126
|
+
|
|
127
|
+
## Task history
|
|
128
|
+
|
|
129
|
+
`listTasks` reads one page of metadata for the current API key. It does not fetch each task's
|
|
130
|
+
inputs, results, or media URLs. Keep the UTC dates fixed while paging and pass the returned cursor
|
|
131
|
+
unchanged:
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
const filters = { from: "2026-09-01", to: "2026-09-07", limit: 20 };
|
|
135
|
+
const page = await client.listTasks(filters);
|
|
136
|
+
if (page.hasMore && page.nextCursor) {
|
|
137
|
+
const nextPage = await client.listTasks({ ...filters, cursor: page.nextCursor });
|
|
138
|
+
console.log(nextPage.items);
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The UTC interval is `[from,to)`, defaults to seven days ending tomorrow UTC, and cannot exceed 92
|
|
143
|
+
days. Page size defaults to 20 and is capped at 100. Optional `state` and `model` filters narrow the
|
|
144
|
+
results. Each item's `cost` remains an exact decimal USD string; it is final only when `settled` is
|
|
145
|
+
true. Hidden tasks are excluded, so use `getUsage` for settled spending reports. Use `getTask` for a
|
|
146
|
+
selected result, not automatically for every item. History is for discovery and recovery; use `run`,
|
|
147
|
+
`waitForTask`, or webhooks for normal completion tracking.
|
package/contracts/openapi.yaml
CHANGED
|
@@ -353,6 +353,106 @@ paths:
|
|
|
353
353
|
'404': { $ref: '#/components/responses/NotFound' }
|
|
354
354
|
'429': { $ref: '#/components/responses/RateLimited' }
|
|
355
355
|
'500': { $ref: '#/components/responses/ServerError' }
|
|
356
|
+
/api/v1/jobs:
|
|
357
|
+
get:
|
|
358
|
+
tags: [Tasks]
|
|
359
|
+
operationId: listTasks
|
|
360
|
+
summary: List task history for the authenticated API key
|
|
361
|
+
description: |
|
|
362
|
+
Returns only visible tasks created by this API key and its account,
|
|
363
|
+
newest first by createdAt and taskId. The list contains metadata only;
|
|
364
|
+
use recordInfo for a selected task's result. No input, output, signed
|
|
365
|
+
media URL, or execution-channel information is included.
|
|
366
|
+
Dates form a UTC half-open interval [from,to), up to 92 days.
|
|
367
|
+
Default to is tomorrow in UTC; omitted from is seven days before to.
|
|
368
|
+
Keep all filters, including explicit from/to dates, unchanged while
|
|
369
|
+
paginating with nextCursor. Pages read live state, not a frozen snapshot.
|
|
370
|
+
Unknown, duplicate, or empty query parameters are rejected. Queries
|
|
371
|
+
have a five-second server budget and return 503 on timeout.
|
|
372
|
+
parameters:
|
|
373
|
+
- name: from
|
|
374
|
+
in: query
|
|
375
|
+
schema: { type: string, format: date }
|
|
376
|
+
description: Inclusive UTC date in YYYY-MM-DD format.
|
|
377
|
+
- name: to
|
|
378
|
+
in: query
|
|
379
|
+
schema: { type: string, format: date }
|
|
380
|
+
description: Exclusive UTC date in YYYY-MM-DD format.
|
|
381
|
+
- name: state
|
|
382
|
+
in: query
|
|
383
|
+
schema: { type: string, enum: [queued, running, succeeded, failed, canceled, expired] }
|
|
384
|
+
- name: model
|
|
385
|
+
in: query
|
|
386
|
+
schema: { type: string }
|
|
387
|
+
description: Exact catalog model identifier or a declared alias.
|
|
388
|
+
- name: limit
|
|
389
|
+
in: query
|
|
390
|
+
schema: { type: integer, minimum: 1, maximum: 100, default: 20 }
|
|
391
|
+
- name: cursor
|
|
392
|
+
in: query
|
|
393
|
+
schema: { type: string }
|
|
394
|
+
description: Opaque nextCursor from the previous page; do not construct it yourself.
|
|
395
|
+
responses:
|
|
396
|
+
'200':
|
|
397
|
+
description: Current-key task summaries without prompt or result payloads.
|
|
398
|
+
headers:
|
|
399
|
+
Cache-Control:
|
|
400
|
+
schema: { type: string, const: no-store }
|
|
401
|
+
content:
|
|
402
|
+
application/json:
|
|
403
|
+
schema: { $ref: '#/components/schemas/APIKeyTaskListEnvelope' }
|
|
404
|
+
'400': { $ref: '#/components/responses/BadRequest' }
|
|
405
|
+
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
406
|
+
'403': { $ref: '#/components/responses/Forbidden' }
|
|
407
|
+
'429': { $ref: '#/components/responses/RateLimited' }
|
|
408
|
+
'500': { $ref: '#/components/responses/ServerError' }
|
|
409
|
+
'503': { $ref: '#/components/responses/Unavailable' }
|
|
410
|
+
/api/v1/usage:
|
|
411
|
+
get:
|
|
412
|
+
tags: [Account]
|
|
413
|
+
operationId: getUsage
|
|
414
|
+
summary: Get usage for the authenticated API key
|
|
415
|
+
description: |
|
|
416
|
+
Only tasks created by this API key and its account are included,
|
|
417
|
+
including hidden historical tasks. Other keys and workspaces cannot
|
|
418
|
+
be selected. Unknown or repeated query parameters are rejected.
|
|
419
|
+
Dates form a UTC half-open interval [from,to), up to 92 days.
|
|
420
|
+
The default to is tomorrow in UTC; omitted from is seven days before to.
|
|
421
|
+
Calls are attributed to task creation time. Spend sums only settled
|
|
422
|
+
actual charges for those tasks, never pending holds. Late settlement
|
|
423
|
+
can change a previous day's spend. These are task usage totals, not
|
|
424
|
+
a statement of cash movements or remaining API-key budget.
|
|
425
|
+
An additional account-wide token bucket allows a burst of 30 requests
|
|
426
|
+
and replenishes 30 tokens per minute, shared by all keys on the account.
|
|
427
|
+
Observe Retry-After on 429. This reporting limit fails closed when its
|
|
428
|
+
limiter is unavailable. Queries have a five-second server budget;
|
|
429
|
+
a timeout returns 503 and suggests retrying a shorter date range.
|
|
430
|
+
parameters:
|
|
431
|
+
- name: from
|
|
432
|
+
in: query
|
|
433
|
+
schema: { type: string, format: date }
|
|
434
|
+
description: Inclusive UTC date in YYYY-MM-DD format.
|
|
435
|
+
- name: to
|
|
436
|
+
in: query
|
|
437
|
+
schema: { type: string, format: date }
|
|
438
|
+
description: Exclusive UTC date in YYYY-MM-DD format.
|
|
439
|
+
responses:
|
|
440
|
+
'200':
|
|
441
|
+
description: Current-key usage with exact USD decimal strings and sparse daily/model buckets.
|
|
442
|
+
headers:
|
|
443
|
+
Cache-Control:
|
|
444
|
+
schema: { type: string, const: no-store }
|
|
445
|
+
X-RateLimit-Limit: { $ref: '#/components/headers/RateLimitLimit' }
|
|
446
|
+
X-RateLimit-Remaining: { $ref: '#/components/headers/RateLimitRemaining' }
|
|
447
|
+
content:
|
|
448
|
+
application/json:
|
|
449
|
+
schema: { $ref: '#/components/schemas/APIKeyUsageEnvelope' }
|
|
450
|
+
'400': { $ref: '#/components/responses/BadRequest' }
|
|
451
|
+
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
452
|
+
'403': { $ref: '#/components/responses/Forbidden' }
|
|
453
|
+
'429': { $ref: '#/components/responses/RateLimited' }
|
|
454
|
+
'500': { $ref: '#/components/responses/ServerError' }
|
|
455
|
+
'503': { $ref: '#/components/responses/Unavailable' }
|
|
356
456
|
/api/v1/chat/credit:
|
|
357
457
|
get:
|
|
358
458
|
tags: [Account]
|
|
@@ -408,8 +508,10 @@ paths:
|
|
|
408
508
|
description: |
|
|
409
509
|
Compares the stored byte count and media type with the ticket, checks
|
|
410
510
|
the image signature, computes SHA-256, and copies the temporary object
|
|
411
|
-
to an immutable private key.
|
|
412
|
-
|
|
511
|
+
to an immutable private key. Reference this uploaded file with the returned
|
|
512
|
+
spicy:// URI. Publicly accessible HTTPS media URLs can instead be passed
|
|
513
|
+
directly in supported model input fields, without uploading. Repeating
|
|
514
|
+
a successful commit is idempotent.
|
|
413
515
|
parameters:
|
|
414
516
|
- name: fileId
|
|
415
517
|
in: path
|
|
@@ -821,7 +923,16 @@ components:
|
|
|
821
923
|
description: Exact `model` value from the model catalog.
|
|
822
924
|
input:
|
|
823
925
|
type: object
|
|
824
|
-
description:
|
|
926
|
+
description: >-
|
|
927
|
+
Validated against the selected model's inputSchema. Declared image fields accept
|
|
928
|
+
public HTTPS URLs, committed spicy:// file URIs, or standard Base64 Data URIs
|
|
929
|
+
(image/jpeg, image/png, image/webp, image/gif). Inline images are limited to
|
|
930
|
+
1048576 decoded bytes and 8388608 pixels each, 8192 pixels per side, and
|
|
931
|
+
16 images / 16777216 pixels in total. The complete JSON request must fit within
|
|
932
|
+
2097152 bytes. Model-specific limits still apply. Bare Base64, SVG and inline
|
|
933
|
+
audio/video are not accepted; use HTTPS or file uploads instead. Inline images
|
|
934
|
+
are stored as account-bound uploaded files; returned input contains file URIs,
|
|
935
|
+
never the original Base64 bytes. Quote validation does not upload or reserve funds.
|
|
825
936
|
additionalProperties: true
|
|
826
937
|
callBackUrl:
|
|
827
938
|
type: string
|
|
@@ -861,9 +972,10 @@ components:
|
|
|
861
972
|
data: { $ref: '#/components/schemas/TaskQuoteResponse' }
|
|
862
973
|
CreateTaskResponse:
|
|
863
974
|
type: object
|
|
864
|
-
required: [taskId, state, estimatedCost]
|
|
975
|
+
required: [taskId, state, estimatedCost, deadlineAt]
|
|
865
976
|
properties:
|
|
866
977
|
taskId: { type: string }
|
|
978
|
+
deadlineAt: { type: string, format: date-time, description: Server execution deadline fixed at acceptance; not a local wait timeout or result URL expiry. Idempotent replays retain the original deadline. }
|
|
867
979
|
state:
|
|
868
980
|
type: string
|
|
869
981
|
enum: [queued, running, succeeded, failed, canceled, expired]
|
|
@@ -903,6 +1015,31 @@ components:
|
|
|
903
1015
|
code: { type: integer, const: 200 }
|
|
904
1016
|
msg: { type: string, const: success }
|
|
905
1017
|
data: { $ref: '#/components/schemas/CreateTaskResponse' }
|
|
1018
|
+
TaskOutput:
|
|
1019
|
+
type: object
|
|
1020
|
+
additionalProperties: true
|
|
1021
|
+
description: First-party result metadata. Ready assets include directly usable temporary URLs; no download-ticket request is needed. Poll again to refresh an expired URL. Temporary URLs are bearer access grants; never attach your API key when fetching them.
|
|
1022
|
+
properties:
|
|
1023
|
+
text: { type: string }
|
|
1024
|
+
assets:
|
|
1025
|
+
type: array
|
|
1026
|
+
items: { $ref: '#/components/schemas/TaskOutputAsset' }
|
|
1027
|
+
TaskOutputAsset:
|
|
1028
|
+
type: object
|
|
1029
|
+
additionalProperties: true
|
|
1030
|
+
properties:
|
|
1031
|
+
key: { type: string, description: Compatibility identifier for optional download-url requests. }
|
|
1032
|
+
url: { type: string, format: uri, description: First-party signed GET URL, normally valid for 20 minutes and never beyond the 14-day result retention period. Absent while pending or unavailable. }
|
|
1033
|
+
expiresAt: { type: string, format: date-time, description: Expiry of this URL, not the result retention deadline. }
|
|
1034
|
+
mime: { type: string }
|
|
1035
|
+
width: { type: integer }
|
|
1036
|
+
height: { type: integer }
|
|
1037
|
+
durationSeconds: { type: number }
|
|
1038
|
+
bytes: { type: integer, format: int64 }
|
|
1039
|
+
role: { type: string }
|
|
1040
|
+
nsfw: { type: boolean }
|
|
1041
|
+
pending: { type: boolean }
|
|
1042
|
+
unavailable: { type: boolean }
|
|
906
1043
|
TaskRecord:
|
|
907
1044
|
type: object
|
|
908
1045
|
required: [taskId, model, state, cost, settled, createdAt]
|
|
@@ -914,13 +1051,10 @@ components:
|
|
|
914
1051
|
type: string
|
|
915
1052
|
enum: [queued, running, succeeded, failed, canceled, expired]
|
|
916
1053
|
input:
|
|
917
|
-
description: Normalized model input. Omitted after retention redaction.
|
|
918
|
-
type: object
|
|
919
|
-
additionalProperties: true
|
|
920
|
-
output:
|
|
921
|
-
description: Normalized first-party model output when available. Asset entries contain SpicyAPI object keys, never execution-channel URLs or raw responses. Omitted after retention redaction.
|
|
1054
|
+
description: Normalized model input; inline images become account-bound file URIs. Omitted after retention redaction.
|
|
922
1055
|
type: object
|
|
923
1056
|
additionalProperties: true
|
|
1057
|
+
output: { $ref: '#/components/schemas/TaskOutput' }
|
|
924
1058
|
errorCode: { type: string, description: Stable SpicyAPI failure identifier; never a raw execution-channel code. }
|
|
925
1059
|
errorMessage: { type: string, description: Safe normalized explanation without internal service names, hosts, task IDs, or raw errors. }
|
|
926
1060
|
cost: { $ref: '#/components/schemas/USDString' }
|
|
@@ -928,6 +1062,7 @@ components:
|
|
|
928
1062
|
type: boolean
|
|
929
1063
|
description: When false, `cost` is the held estimate. On success the final charge is capped at that hold; unused funds are released. Failed or expired tasks release the hold in full.
|
|
930
1064
|
createdAt: { type: string, format: date-time }
|
|
1065
|
+
deadlineAt: { type: string, format: date-time, description: Server execution deadline. Present in current responses; historical stored webhook events may omit it. Not the result retention or URL expiry time. }
|
|
931
1066
|
completedAt: { type: string, format: date-time }
|
|
932
1067
|
TaskRecordEnvelope:
|
|
933
1068
|
allOf:
|
|
@@ -952,6 +1087,84 @@ components:
|
|
|
952
1087
|
error_message: { type: string }
|
|
953
1088
|
cost: { $ref: '#/components/schemas/USDString' }
|
|
954
1089
|
created_at: { type: string, format: date-time }
|
|
1090
|
+
APIKeyTaskItem:
|
|
1091
|
+
type: object
|
|
1092
|
+
additionalProperties: false
|
|
1093
|
+
required: [taskId, model, state, cost, settled, createdAt, deadlineAt]
|
|
1094
|
+
properties:
|
|
1095
|
+
taskId: { type: string }
|
|
1096
|
+
model: { type: string, description: Public model identifier. }
|
|
1097
|
+
state: { type: string, enum: [queued, running, succeeded, failed, canceled, expired] }
|
|
1098
|
+
cost:
|
|
1099
|
+
allOf:
|
|
1100
|
+
- $ref: '#/components/schemas/USDString'
|
|
1101
|
+
description: Final charged USD if settled; otherwise the current held estimate.
|
|
1102
|
+
settled: { type: boolean }
|
|
1103
|
+
createdAt: { type: string, format: date-time }
|
|
1104
|
+
deadlineAt: { type: string, format: date-time }
|
|
1105
|
+
completedAt: { type: string, format: date-time }
|
|
1106
|
+
APIKeyTaskListResponse:
|
|
1107
|
+
type: object
|
|
1108
|
+
additionalProperties: false
|
|
1109
|
+
required: [items, hasMore]
|
|
1110
|
+
properties:
|
|
1111
|
+
items:
|
|
1112
|
+
type: array
|
|
1113
|
+
items: { $ref: '#/components/schemas/APIKeyTaskItem' }
|
|
1114
|
+
hasMore: { type: boolean }
|
|
1115
|
+
nextCursor: { type: string, description: Present only when hasMore is true. }
|
|
1116
|
+
APIKeyTaskListEnvelope:
|
|
1117
|
+
allOf:
|
|
1118
|
+
- $ref: '#/components/schemas/EnvelopeBase'
|
|
1119
|
+
- type: object
|
|
1120
|
+
required: [data]
|
|
1121
|
+
properties:
|
|
1122
|
+
code: { type: integer, const: 200 }
|
|
1123
|
+
msg: { type: string, const: success }
|
|
1124
|
+
data: { $ref: '#/components/schemas/APIKeyTaskListResponse' }
|
|
1125
|
+
APIKeyUsageResponse:
|
|
1126
|
+
type: object
|
|
1127
|
+
additionalProperties: false
|
|
1128
|
+
required: [from, to, currency, totalCalls, totalSpend, days, models]
|
|
1129
|
+
properties:
|
|
1130
|
+
from: { type: string, format: date }
|
|
1131
|
+
to: { type: string, format: date }
|
|
1132
|
+
currency: { type: string, const: USD }
|
|
1133
|
+
totalCalls: { type: integer, format: int64, minimum: 0 }
|
|
1134
|
+
totalSpend: { $ref: '#/components/schemas/USDString' }
|
|
1135
|
+
days:
|
|
1136
|
+
type: array
|
|
1137
|
+
items: { $ref: '#/components/schemas/UsageDayItem' }
|
|
1138
|
+
models:
|
|
1139
|
+
type: array
|
|
1140
|
+
items: { $ref: '#/components/schemas/UsageModelItem' }
|
|
1141
|
+
UsageDayItem:
|
|
1142
|
+
type: object
|
|
1143
|
+
additionalProperties: false
|
|
1144
|
+
required: [day, calls, succeeded, failed, spend]
|
|
1145
|
+
properties:
|
|
1146
|
+
day: { type: string, format: date }
|
|
1147
|
+
calls: { type: integer, format: int64, minimum: 0 }
|
|
1148
|
+
succeeded: { type: integer, format: int64, minimum: 0 }
|
|
1149
|
+
failed: { type: integer, format: int64, minimum: 0 }
|
|
1150
|
+
spend: { $ref: '#/components/schemas/USDString' }
|
|
1151
|
+
UsageModelItem:
|
|
1152
|
+
type: object
|
|
1153
|
+
additionalProperties: false
|
|
1154
|
+
required: [model, calls, succeeded, failed, spend]
|
|
1155
|
+
properties:
|
|
1156
|
+
model: { type: string, description: Public model identifier. }
|
|
1157
|
+
calls: { type: integer, format: int64, minimum: 0 }
|
|
1158
|
+
succeeded: { type: integer, format: int64, minimum: 0 }
|
|
1159
|
+
failed: { type: integer, format: int64, minimum: 0 }
|
|
1160
|
+
spend: { $ref: '#/components/schemas/USDString' }
|
|
1161
|
+
APIKeyUsageEnvelope:
|
|
1162
|
+
allOf:
|
|
1163
|
+
- $ref: '#/components/schemas/EnvelopeBase'
|
|
1164
|
+
- type: object
|
|
1165
|
+
required: [data]
|
|
1166
|
+
properties:
|
|
1167
|
+
data: { $ref: '#/components/schemas/APIKeyUsageResponse' }
|
|
955
1168
|
Balance:
|
|
956
1169
|
type: object
|
|
957
1170
|
required: [available, held, total]
|
|
@@ -986,7 +1199,10 @@ components:
|
|
|
986
1199
|
type: object
|
|
987
1200
|
required: [model, family, displayName, provider, modality, tasks, async, mature, policyTier, taskTimeoutSeconds, enabled, available, quantityField, pricing, version, availability, badges, relatedModels, updatedAt]
|
|
988
1201
|
properties:
|
|
989
|
-
model:
|
|
1202
|
+
model:
|
|
1203
|
+
type: string
|
|
1204
|
+
description: Preferred callable identifier in publisher/model/task form. Image editing uses the edit suffix; previously published identifiers remain accepted.
|
|
1205
|
+
example: bytedance/seedream-5.0-lite/edit
|
|
990
1206
|
family:
|
|
991
1207
|
type: string
|
|
992
1208
|
description: Stable product-family identifier; endpoint variants are listed in `tasks` and expressed by `inputSchema`.
|
package/dist/src/docs/index.js
CHANGED
|
@@ -33,7 +33,7 @@ const definitions = [
|
|
|
33
33
|
{
|
|
34
34
|
slug: "media",
|
|
35
35
|
title: "Media transfer",
|
|
36
|
-
summary: "
|
|
36
|
+
summary: "Public HTTPS media inputs, optional local uploads, and direct signed result URLs.",
|
|
37
37
|
keywords: ["upload", "download", "file", "image", "上传", "下载", "文件"],
|
|
38
38
|
},
|
|
39
39
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/docs/index.ts"],"names":[],"mappings":"AAQA,MAAM,aAAa,GAAG,6BAA6B,CAAC;AAEpD,MAAM,WAAW,GAA2C;IAC1D;QACE,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,YAAY;QACnB,OAAO,EAAE,gEAAgE;QACzE,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC;KACvD;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,gBAAgB;QACvB,OAAO,EAAE,8DAA8D;QACvE,QAAQ,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC;KACxD;IACD;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,uBAAuB;QAC9B,OAAO,EAAE,wEAAwE;QACjF,QAAQ,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;KACpE;IACD;QACE,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,oBAAoB;QAC3B,OAAO,EAAE,iEAAiE;QAC1E,QAAQ,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC;KACpE;IACD;QACE,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,cAAc;QACrB,OAAO,EAAE,0EAA0E;QACnF,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC;KAC1C;IACD;QACE,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,gBAAgB;QACvB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/docs/index.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