@zinn-digital/sdk 0.1.1431 → 0.1.1432
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/dist/generated/schema.d.ts +153 -0
- package/package.json +1 -1
|
@@ -23740,6 +23740,48 @@ export interface paths {
|
|
|
23740
23740
|
patch?: never;
|
|
23741
23741
|
trace?: never;
|
|
23742
23742
|
};
|
|
23743
|
+
"/v1/ai/inference/chat": {
|
|
23744
|
+
parameters: {
|
|
23745
|
+
query?: never;
|
|
23746
|
+
header?: never;
|
|
23747
|
+
path?: never;
|
|
23748
|
+
cookie?: never;
|
|
23749
|
+
};
|
|
23750
|
+
get?: never;
|
|
23751
|
+
put?: never;
|
|
23752
|
+
/**
|
|
23753
|
+
* Run one chat completion on an open model, paid from Zinn® AI credits.
|
|
23754
|
+
* @description Serverless AI inference for Zinn® AI Hosting plans (every AI Hosting plan grants `serverless_inference`). Runs in the request, on actual tokens, billed from the org's Zinn® AI credits: plan-included credits first spend here (this is an AI Hosting surface), then bought top-up credit. The platform's small daily included allowance never funds it, and a customer's own provider key is not used.
|
|
23755
|
+
*
|
|
23756
|
+
* Gates, each before anything is sent or charged: the plan grants `serverless_inference` (else `422 FEATURE_NOT_INCLUDED`); the model is offered and priced (else `422`, `refusal.aiInference.unknownModel`); the org is in good standing (else `422 AI_NOT_IN_GOOD_STANDING`); credit is left (else `422 AI_CREDIT_REQUIRED`, `details[].can_buy`). A failed model call answers `503` with a `failure` whose class is `our_fault` and names no supplier, and charges nothing. At most 64 messages of 32,000 characters; `max_output_tokens` 1 to 4,096 (default 1,024). Requires `sites.create`.
|
|
23757
|
+
*/
|
|
23758
|
+
post: operations["createAiInferenceChat"];
|
|
23759
|
+
delete?: never;
|
|
23760
|
+
options?: never;
|
|
23761
|
+
head?: never;
|
|
23762
|
+
patch?: never;
|
|
23763
|
+
trace?: never;
|
|
23764
|
+
};
|
|
23765
|
+
"/v1/ai/inference/models": {
|
|
23766
|
+
parameters: {
|
|
23767
|
+
query?: never;
|
|
23768
|
+
header?: never;
|
|
23769
|
+
path?: never;
|
|
23770
|
+
cookie?: never;
|
|
23771
|
+
};
|
|
23772
|
+
/**
|
|
23773
|
+
* The open models serverless AI inference offers, with the customer price.
|
|
23774
|
+
* @description The models `POST /v1/ai/inference/chat` accepts (Zinn® AI Hosting, AIHOSTING slice 2), each with what one million input and output tokens CHARGE the customer in USD micros (the meter's price, so the number shown is the number the ledger debits). `default_model` is the cheapest priced model, derived from measured prices. Requires `sites.view`.
|
|
23775
|
+
*/
|
|
23776
|
+
get: operations["listAiInferenceModels"];
|
|
23777
|
+
put?: never;
|
|
23778
|
+
post?: never;
|
|
23779
|
+
delete?: never;
|
|
23780
|
+
options?: never;
|
|
23781
|
+
head?: never;
|
|
23782
|
+
patch?: never;
|
|
23783
|
+
trace?: never;
|
|
23784
|
+
};
|
|
23743
23785
|
"/v1/ai/model-notices": {
|
|
23744
23786
|
parameters: {
|
|
23745
23787
|
query?: never;
|
|
@@ -69664,6 +69706,61 @@ export interface components {
|
|
|
69664
69706
|
AiImageProviderAvailabilityList: {
|
|
69665
69707
|
data: components["schemas"]["AiImageProviderAvailability"][];
|
|
69666
69708
|
};
|
|
69709
|
+
AiInferenceChatRequest: {
|
|
69710
|
+
/** @default 1024 */
|
|
69711
|
+
max_output_tokens: number;
|
|
69712
|
+
messages: components["schemas"]["AiInferenceMessage"][];
|
|
69713
|
+
/** @description A model from `GET /v1/ai/inference/models`; empty means the default. */
|
|
69714
|
+
model?: string;
|
|
69715
|
+
org_id?: components["schemas"]["Uuid"];
|
|
69716
|
+
};
|
|
69717
|
+
AiInferenceMessage: {
|
|
69718
|
+
content: string;
|
|
69719
|
+
/** @enum {string} */
|
|
69720
|
+
role: "system" | "user" | "assistant";
|
|
69721
|
+
};
|
|
69722
|
+
AiInferenceModel: {
|
|
69723
|
+
/** @description The model id to send as `model`. */
|
|
69724
|
+
id: string;
|
|
69725
|
+
/**
|
|
69726
|
+
* Format: int64
|
|
69727
|
+
* @description What one million input tokens charge the customer, in USD micros.
|
|
69728
|
+
*/
|
|
69729
|
+
input_micros_per_mtok: number;
|
|
69730
|
+
/**
|
|
69731
|
+
* Format: int64
|
|
69732
|
+
* @description What one million output tokens charge the customer, in USD micros.
|
|
69733
|
+
*/
|
|
69734
|
+
output_micros_per_mtok: number;
|
|
69735
|
+
};
|
|
69736
|
+
AiInferenceModels: {
|
|
69737
|
+
/** @description The cheapest priced model. */
|
|
69738
|
+
default_model: string;
|
|
69739
|
+
models: components["schemas"]["AiInferenceModel"][];
|
|
69740
|
+
};
|
|
69741
|
+
AiInferenceReply: {
|
|
69742
|
+
/**
|
|
69743
|
+
* Format: int64
|
|
69744
|
+
* @description The org's Zinn® AI credit balance after the call, in USD micros.
|
|
69745
|
+
*/
|
|
69746
|
+
balance_micros: number;
|
|
69747
|
+
/**
|
|
69748
|
+
* Format: int64
|
|
69749
|
+
* @description What this call charged, in USD micros.
|
|
69750
|
+
*/
|
|
69751
|
+
charged_micros: number;
|
|
69752
|
+
finish_reason: string;
|
|
69753
|
+
message: {
|
|
69754
|
+
content: string;
|
|
69755
|
+
/** @enum {string} */
|
|
69756
|
+
role: "assistant";
|
|
69757
|
+
};
|
|
69758
|
+
model: string;
|
|
69759
|
+
usage: {
|
|
69760
|
+
input_tokens: number;
|
|
69761
|
+
output_tokens: number;
|
|
69762
|
+
};
|
|
69763
|
+
};
|
|
69667
69764
|
/** @description One model, as read from the provider's own catalogue and proven against our prompts. ⛔ Model ids are **data, never a hardcoded list** (§2.2) — this table is refreshed daily from each vendor. */
|
|
69668
69765
|
AiModel: {
|
|
69669
69766
|
/** @description 0 means the provider did not tell us. */
|
|
@@ -151243,6 +151340,62 @@ export interface operations {
|
|
|
151243
151340
|
429: components["responses"]["TooManyRequests"];
|
|
151244
151341
|
};
|
|
151245
151342
|
};
|
|
151343
|
+
createAiInferenceChat: {
|
|
151344
|
+
parameters: {
|
|
151345
|
+
query?: never;
|
|
151346
|
+
header?: never;
|
|
151347
|
+
path?: never;
|
|
151348
|
+
cookie?: never;
|
|
151349
|
+
};
|
|
151350
|
+
requestBody: {
|
|
151351
|
+
content: {
|
|
151352
|
+
"application/json": components["schemas"]["AiInferenceChatRequest"];
|
|
151353
|
+
};
|
|
151354
|
+
};
|
|
151355
|
+
responses: {
|
|
151356
|
+
/** @description The reply, the tokens used, what was charged and the balance after. */
|
|
151357
|
+
200: {
|
|
151358
|
+
headers: {
|
|
151359
|
+
[name: string]: unknown;
|
|
151360
|
+
};
|
|
151361
|
+
content: {
|
|
151362
|
+
"application/json": components["schemas"]["AiInferenceReply"];
|
|
151363
|
+
};
|
|
151364
|
+
};
|
|
151365
|
+
401: components["responses"]["Unauthorized"];
|
|
151366
|
+
403: components["responses"]["Forbidden"];
|
|
151367
|
+
422: components["responses"]["UnprocessableEntity"];
|
|
151368
|
+
429: components["responses"]["TooManyRequests"];
|
|
151369
|
+
503: components["responses"]["ServiceUnavailable"];
|
|
151370
|
+
};
|
|
151371
|
+
};
|
|
151372
|
+
listAiInferenceModels: {
|
|
151373
|
+
parameters: {
|
|
151374
|
+
query?: {
|
|
151375
|
+
/** @description Which organization this is about. Required when the caller belongs to more than one; a caller in exactly one may omit it. */
|
|
151376
|
+
org_id?: components["schemas"]["Uuid"];
|
|
151377
|
+
};
|
|
151378
|
+
header?: never;
|
|
151379
|
+
path?: never;
|
|
151380
|
+
cookie?: never;
|
|
151381
|
+
};
|
|
151382
|
+
requestBody?: never;
|
|
151383
|
+
responses: {
|
|
151384
|
+
/** @description The offered models and their prices. */
|
|
151385
|
+
200: {
|
|
151386
|
+
headers: {
|
|
151387
|
+
[name: string]: unknown;
|
|
151388
|
+
};
|
|
151389
|
+
content: {
|
|
151390
|
+
"application/json": components["schemas"]["AiInferenceModels"];
|
|
151391
|
+
};
|
|
151392
|
+
};
|
|
151393
|
+
401: components["responses"]["Unauthorized"];
|
|
151394
|
+
403: components["responses"]["Forbidden"];
|
|
151395
|
+
422: components["responses"]["UnprocessableEntity"];
|
|
151396
|
+
429: components["responses"]["TooManyRequests"];
|
|
151397
|
+
};
|
|
151398
|
+
};
|
|
151246
151399
|
listAiModelNotices: {
|
|
151247
151400
|
parameters: {
|
|
151248
151401
|
query?: never;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zinn-digital/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1432",
|
|
4
4
|
"description": "Typed TypeScript client for the Zinn Digital Platform API, generated from its OpenAPI spec.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Neil Lock \u2014 CEO, Zinn Digital\u00ae Ltd <office@zinndigital.com>",
|