@zinn-digital/sdk 0.1.1431 → 0.1.1433

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.
@@ -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. */
@@ -75234,6 +75331,8 @@ export interface components {
75234
75331
  * @enum {string}
75235
75332
  */
75236
75333
  os_family: "" | "windows";
75334
+ /** @description The catalogue slug for this image (`ubuntu-24.04`, `alma-9`), the token an add-on's `supported_images` lists. Equal to `id` on the cloud range; on a dedicated server `id` is the supplier's distribution name ("Ubuntu 24.04 LTS base"). ⛔ Match an add-on's `supported_images` against THIS, never `id`, or no add-on that lists systems can be chosen on a dedicated server. An image with no known slug (an app image) returns `id` unchanged and matches nothing. */
75335
+ os_slug?: string;
75237
75336
  };
75238
75337
  ComputeInstallMedia: {
75239
75338
  /** @description `x86` or `arm`. */
@@ -151243,6 +151342,62 @@ export interface operations {
151243
151342
  429: components["responses"]["TooManyRequests"];
151244
151343
  };
151245
151344
  };
151345
+ createAiInferenceChat: {
151346
+ parameters: {
151347
+ query?: never;
151348
+ header?: never;
151349
+ path?: never;
151350
+ cookie?: never;
151351
+ };
151352
+ requestBody: {
151353
+ content: {
151354
+ "application/json": components["schemas"]["AiInferenceChatRequest"];
151355
+ };
151356
+ };
151357
+ responses: {
151358
+ /** @description The reply, the tokens used, what was charged and the balance after. */
151359
+ 200: {
151360
+ headers: {
151361
+ [name: string]: unknown;
151362
+ };
151363
+ content: {
151364
+ "application/json": components["schemas"]["AiInferenceReply"];
151365
+ };
151366
+ };
151367
+ 401: components["responses"]["Unauthorized"];
151368
+ 403: components["responses"]["Forbidden"];
151369
+ 422: components["responses"]["UnprocessableEntity"];
151370
+ 429: components["responses"]["TooManyRequests"];
151371
+ 503: components["responses"]["ServiceUnavailable"];
151372
+ };
151373
+ };
151374
+ listAiInferenceModels: {
151375
+ parameters: {
151376
+ query?: {
151377
+ /** @description Which organization this is about. Required when the caller belongs to more than one; a caller in exactly one may omit it. */
151378
+ org_id?: components["schemas"]["Uuid"];
151379
+ };
151380
+ header?: never;
151381
+ path?: never;
151382
+ cookie?: never;
151383
+ };
151384
+ requestBody?: never;
151385
+ responses: {
151386
+ /** @description The offered models and their prices. */
151387
+ 200: {
151388
+ headers: {
151389
+ [name: string]: unknown;
151390
+ };
151391
+ content: {
151392
+ "application/json": components["schemas"]["AiInferenceModels"];
151393
+ };
151394
+ };
151395
+ 401: components["responses"]["Unauthorized"];
151396
+ 403: components["responses"]["Forbidden"];
151397
+ 422: components["responses"]["UnprocessableEntity"];
151398
+ 429: components["responses"]["TooManyRequests"];
151399
+ };
151400
+ };
151246
151401
  listAiModelNotices: {
151247
151402
  parameters: {
151248
151403
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.1.1431",
3
+ "version": "0.1.1433",
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>",