@zinn-digital/sdk 0.1.1430 → 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 +160 -2
- package/package.json +1 -1
|
@@ -17616,7 +17616,7 @@ export interface paths {
|
|
|
17616
17616
|
put?: never;
|
|
17617
17617
|
/**
|
|
17618
17618
|
* Buy one tracking number that forwards to the customer's own number (za-160).
|
|
17619
|
-
* @description Gated on `ads.manage`; audit action `ads.call_number_ordered` (no phone number in its metadata). The price is the voice vendor's own answer for that number, re-read now, times the platform margin; the first charge (the vendor's upfront fee plus the first month, both taken by the vendor at purchase) is taken from the org's prepaid Zinn® credit BEFORE the order and returned if the vendor refuses it. Refused (422) when call tracking is not open (`callNotOpen`), the CRM source `telnyx` is not set up (`callNoSource`), the forward-to number is not a United States number or is one of our own tracking numbers (a call loop, `callForwardToNotOffered`), the account holds its cap (`callTooMany`), the account is not in good standing (`callAccountOnHold`), the credit is short (`callNoCredit`), the number was taken (`callNumberGone`) or its price is no longer the `first_month_usd_micros` the customer was shown (`callPriceChanged`, nothing charged). An order the vendor has not finished yet leaves the number `ordering` and starts the account's number sweep at once (retried until it completes); a vendor that does not answer the order leaves it `ordering` too: it is found by its reference, or refunded.
|
|
17619
|
+
* @description Gated on `ads.manage`; audit action `ads.call_number_ordered` (no phone number in its metadata). The price is the voice vendor's own answer for that number, re-read now, times the platform margin; the first charge (the vendor's upfront fee plus the first month, both taken by the vendor at purchase) is taken from the org's prepaid Zinn® credit BEFORE the order and returned if the vendor refuses it. Refused (422) when call tracking is not open (`callNotOpen`), the CRM source `telnyx` is not set up (`callNoSource`), the forward-to number is not a United States number or is one of our own tracking numbers (a call loop, `callForwardToNotOffered`), the account holds its cap (`callTooMany`), the account is not in good standing (`callAccountOnHold`), the credit is short (`callNoCredit`), the only credit left is AI Hosting plan-included credit, which pays for AI Hosting only (`callPlanCreditsOnly`, 402), the number was taken (`callNumberGone`) or its price is no longer the `first_month_usd_micros` the customer was shown (`callPriceChanged`, nothing charged). An order the vendor has not finished yet leaves the number `ordering` and starts the account's number sweep at once (retried until it completes); a vendor that does not answer the order leaves it `ordering` too: it is found by its reference, or refunded.
|
|
17620
17620
|
*/
|
|
17621
17621
|
post: operations["orderAdsCallNumber"];
|
|
17622
17622
|
delete?: never;
|
|
@@ -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;
|
|
@@ -68038,7 +68080,7 @@ export interface components {
|
|
|
68038
68080
|
skip_params?: {
|
|
68039
68081
|
[key: string]: unknown;
|
|
68040
68082
|
};
|
|
68041
|
-
/** @description Machine-readable cause, e.g. `AI_BUDGET_EXHAUSTED`, `AI_NOT_IN_GOOD_STANDING`, `not_enough_discussion`, `nothing_blocked`. */
|
|
68083
|
+
/** @description Machine-readable cause, e.g. `AI_BUDGET_EXHAUSTED`, `PLAN_CREDITS_AI_HOSTING_ONLY` (only AI Hosting plan-included credit is left, and it pays for AI Hosting only), `AI_NOT_IN_GOOD_STANDING`, `not_enough_discussion`, `nothing_blocked`. */
|
|
68042
68084
|
skip_reason?: string | null;
|
|
68043
68085
|
/** @description **Read this.** True means nothing ran and nothing was charged. A caller that treats `200` as "it worked" records a success for a call that did nothing. */
|
|
68044
68086
|
skipped: boolean;
|
|
@@ -69527,6 +69569,11 @@ export interface components {
|
|
|
69527
69569
|
last_pack_micros: number;
|
|
69528
69570
|
/** @description True only when a live customer key exists for EVERY provider we route to, so credits cannot be spent at all. The banner stays silent then. Not "this org has a key": one key still leaves the other providers billing credits. */
|
|
69529
69571
|
on_byo: boolean;
|
|
69572
|
+
/**
|
|
69573
|
+
* Format: int64
|
|
69574
|
+
* @description The part of `balance_micros` an AI Hosting plan included, in USD micros. It is spendable on AI Hosting only (inference, the AI site builder and editor, chat, AI environments); every other credit-priced feature spends the rest (bought top-up credit) and refuses `PLAN_CREDITS_AI_HOSTING_ONLY` when only plan credit is left (owner ruling 2026-11-03).
|
|
69575
|
+
*/
|
|
69576
|
+
plan_credit_micros: number;
|
|
69530
69577
|
/** @description How many assistant questions the current balance is worth, from the measured cost of one real question. An illustration — a long article costs several times more. */
|
|
69531
69578
|
typical_calls_remaining: number;
|
|
69532
69579
|
};
|
|
@@ -69659,6 +69706,61 @@ export interface components {
|
|
|
69659
69706
|
AiImageProviderAvailabilityList: {
|
|
69660
69707
|
data: components["schemas"]["AiImageProviderAvailability"][];
|
|
69661
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
|
+
};
|
|
69662
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. */
|
|
69663
69765
|
AiModel: {
|
|
69664
69766
|
/** @description 0 means the provider did not tell us. */
|
|
@@ -151238,6 +151340,62 @@ export interface operations {
|
|
|
151238
151340
|
429: components["responses"]["TooManyRequests"];
|
|
151239
151341
|
};
|
|
151240
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
|
+
};
|
|
151241
151399
|
listAiModelNotices: {
|
|
151242
151400
|
parameters: {
|
|
151243
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>",
|