@kaana.ai/contracts 8.9.0 → 8.10.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.
@@ -314,10 +314,10 @@ export declare const routingProfileSchema: z.ZodObject<{
314
314
  displayName: z.ZodString;
315
315
  description: z.ZodOptional<z.ZodString>;
316
316
  optimiseFor: z.ZodEnum<{
317
+ price: "price";
317
318
  latency: "latency";
318
319
  throughput: "throughput";
319
320
  quality: "quality";
320
- price: "price";
321
321
  balanced: "balanced";
322
322
  }>;
323
323
  candidates: z.ZodArray<z.ZodObject<{
@@ -250,9 +250,14 @@ export declare const chatCompletionsRequestSchema: z.ZodObject<{
250
250
  fp32: "fp32";
251
251
  }>>>;
252
252
  sort: z.ZodOptional<z.ZodEnum<{
253
+ price: "price";
253
254
  latency: "latency";
254
255
  throughput: "throughput";
255
256
  }>>;
257
+ max_price: z.ZodOptional<z.ZodObject<{
258
+ prompt: z.ZodOptional<z.ZodNumber>;
259
+ completion: z.ZodOptional<z.ZodNumber>;
260
+ }, z.core.$strict>>;
256
261
  preferred_max_latency: z.ZodOptional<z.ZodNumber>;
257
262
  preferred_min_throughput: z.ZodOptional<z.ZodNumber>;
258
263
  }, z.core.$strict>>;
@@ -9,11 +9,17 @@
9
9
  * rather than widened.
10
10
  *
11
11
  * The names are OpenRouter's, so a client written for OpenRouter's `provider`
12
- * object works, and only the controls Kaana can honour are accepted:
13
- * `sort: "price"`, `max_price`, `zdr`, `data_collection`, `preferred_*` with a
14
- * percentile object, and `enforce_distillable_text` are refused by `.strict()`
15
- * rather than silently ignored. `max_price` and the data policy stay Oxy's:
16
- * Kaana never prices, and Oxy applies data policy when it computes the grant.
12
+ * object works, and only the controls Kaana can honour are accepted: `zdr`,
13
+ * `data_collection`, `preferred_*` with a percentile object and
14
+ * `enforce_distillable_text` are refused by `.strict()` rather than silently
15
+ * ignored, because the data policy is Oxy's and is applied when it computes the
16
+ * grant.
17
+ *
18
+ * `max_price` and `sort: "price"` read the DECLARED LIST PRICE of a model line,
19
+ * the price Oxy rates the grant at, in USD per million tokens. They are about
20
+ * which model line serves the request, because every route of one line costs
21
+ * the customer the same: they never expose an amount, and a line whose price
22
+ * the catalogue does not state is neither within a ceiling nor cheap.
17
23
  *
18
24
  * Provider names here are Kaana provider slugs as a caller sees them in the
19
25
  * catalogue. A response never names one.
@@ -55,9 +61,14 @@ export declare const providerPreferencesSchema: z.ZodObject<{
55
61
  fp32: "fp32";
56
62
  }>>>;
57
63
  sort: z.ZodOptional<z.ZodEnum<{
64
+ price: "price";
58
65
  latency: "latency";
59
66
  throughput: "throughput";
60
67
  }>>;
68
+ max_price: z.ZodOptional<z.ZodObject<{
69
+ prompt: z.ZodOptional<z.ZodNumber>;
70
+ completion: z.ZodOptional<z.ZodNumber>;
71
+ }, z.core.$strict>>;
61
72
  preferred_max_latency: z.ZodOptional<z.ZodNumber>;
62
73
  preferred_min_throughput: z.ZodOptional<z.ZodNumber>;
63
74
  }, z.core.$strict>;
@@ -9,11 +9,17 @@
9
9
  * rather than widened.
10
10
  *
11
11
  * The names are OpenRouter's, so a client written for OpenRouter's `provider`
12
- * object works, and only the controls Kaana can honour are accepted:
13
- * `sort: "price"`, `max_price`, `zdr`, `data_collection`, `preferred_*` with a
14
- * percentile object, and `enforce_distillable_text` are refused by `.strict()`
15
- * rather than silently ignored. `max_price` and the data policy stay Oxy's:
16
- * Kaana never prices, and Oxy applies data policy when it computes the grant.
12
+ * object works, and only the controls Kaana can honour are accepted: `zdr`,
13
+ * `data_collection`, `preferred_*` with a percentile object and
14
+ * `enforce_distillable_text` are refused by `.strict()` rather than silently
15
+ * ignored, because the data policy is Oxy's and is applied when it computes the
16
+ * grant.
17
+ *
18
+ * `max_price` and `sort: "price"` read the DECLARED LIST PRICE of a model line,
19
+ * the price Oxy rates the grant at, in USD per million tokens. They are about
20
+ * which model line serves the request, because every route of one line costs
21
+ * the customer the same: they never expose an amount, and a line whose price
22
+ * the catalogue does not state is neither within a ceiling nor cheap.
17
23
  *
18
24
  * Provider names here are Kaana provider slugs as a caller sees them in the
19
25
  * catalogue. A response never names one.
@@ -58,8 +64,26 @@ export const providerPreferencesSchema = z
58
64
  require_parameters: z.boolean().optional(),
59
65
  /** Keep only routes published at one of these quantizations; `unknown` admits unstated ones. */
60
66
  quantizations: z.array(providerQuantizationSchema).min(1).max(12).optional(),
61
- /** Prefer the route with the lowest recent latency or the highest recent throughput. */
62
- sort: z.enum(['latency', 'throughput']).optional(),
67
+ /**
68
+ * Prefer the model line with the lowest declared list price, or the route
69
+ * with the lowest recent latency or the highest recent throughput.
70
+ */
71
+ sort: z.enum(['price', 'latency', 'throughput']).optional(),
72
+ /**
73
+ * A ceiling on the declared list price of the model line, in USD per million
74
+ * tokens. A line over it, or one whose price is not stated, is not used; the
75
+ * request is refused rather than served above it.
76
+ */
77
+ max_price: z
78
+ .object({
79
+ prompt: z.number().positive().max(1_000_000).optional(),
80
+ completion: z.number().positive().max(1_000_000).optional(),
81
+ })
82
+ .strict()
83
+ .refine((ceiling) => ceiling.prompt !== undefined || ceiling.completion !== undefined, {
84
+ message: 'max_price names prompt, completion or both',
85
+ })
86
+ .optional(),
63
87
  /** Seconds. A route slower than this recently is tried later, never excluded (p50). */
64
88
  preferred_max_latency: z.number().positive().max(600).optional(),
65
89
  /** Output tokens per second. A route slower than this recently is tried later, never excluded (p50). */
@@ -204,9 +204,14 @@ export declare const responsesRequestSchema: z.ZodObject<{
204
204
  fp32: "fp32";
205
205
  }>>>;
206
206
  sort: z.ZodOptional<z.ZodEnum<{
207
+ price: "price";
207
208
  latency: "latency";
208
209
  throughput: "throughput";
209
210
  }>>;
211
+ max_price: z.ZodOptional<z.ZodObject<{
212
+ prompt: z.ZodOptional<z.ZodNumber>;
213
+ completion: z.ZodOptional<z.ZodNumber>;
214
+ }, z.core.$strict>>;
210
215
  preferred_max_latency: z.ZodOptional<z.ZodNumber>;
211
216
  preferred_min_throughput: z.ZodOptional<z.ZodNumber>;
212
217
  }, z.core.$strict>>;
@@ -100,7 +100,7 @@
100
100
  * change to, say, the catalogue reject every in-flight inference request; the
101
101
  * per-shape `schemaVersion` is what a message is validated against.
102
102
  */
103
- export declare const INFERENCE_CONTRACT_VERSION = "8.9.0";
103
+ export declare const INFERENCE_CONTRACT_VERSION = "8.10.0";
104
104
  /**
105
105
  * Contract set 4.0.0 (Kaana ADR 0002) is the first published as
106
106
  * `@kaana.ai/contracts`. MAJOR because the set changed hands and split in two:
@@ -230,6 +230,12 @@ export declare const INFERENCE_CONTRACT_VERSION = "8.9.0";
230
230
  * request member only: the signed grant and envelope are unchanged, and a
231
231
  * response carries no new body member, so every older reader parses what 8.9.0
232
232
  * serves.
233
+ *
234
+ * Contract set 8.10.0 is additive: `max_price` and `sort: "price"` in the
235
+ * `provider` routing preference (`providerPreferencesSchema`, Kaana ADR 0008).
236
+ * Both read the declared list price of a model line, in USD per million tokens.
237
+ * Public request members only: the signed grant and envelope are unchanged and
238
+ * no response carries an amount.
233
239
  */
234
240
  /** The public API's one origin and version. */
235
241
  export declare const KAANA_API_BASE_URL = "https://kaana.ai/v1";
@@ -100,7 +100,7 @@
100
100
  * change to, say, the catalogue reject every in-flight inference request; the
101
101
  * per-shape `schemaVersion` is what a message is validated against.
102
102
  */
103
- export const INFERENCE_CONTRACT_VERSION = '8.9.0';
103
+ export const INFERENCE_CONTRACT_VERSION = '8.10.0';
104
104
  /**
105
105
  * Contract set 4.0.0 (Kaana ADR 0002) is the first published as
106
106
  * `@kaana.ai/contracts`. MAJOR because the set changed hands and split in two:
@@ -230,6 +230,12 @@ export const INFERENCE_CONTRACT_VERSION = '8.9.0';
230
230
  * request member only: the signed grant and envelope are unchanged, and a
231
231
  * response carries no new body member, so every older reader parses what 8.9.0
232
232
  * serves.
233
+ *
234
+ * Contract set 8.10.0 is additive: `max_price` and `sort: "price"` in the
235
+ * `provider` routing preference (`providerPreferencesSchema`, Kaana ADR 0008).
236
+ * Both read the declared list price of a model line, in USD per million tokens.
237
+ * Public request members only: the signed grant and envelope are unchanged and
238
+ * no response carries an amount.
233
239
  */
234
240
  /** The public API's one origin and version. */
235
241
  export const KAANA_API_BASE_URL = 'https://kaana.ai/v1';
package/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Kaana API",
5
- "version": "8.9.0",
5
+ "version": "8.10.0",
6
6
  "description": "Kaana inference API. Generated from @kaana.ai/contracts; the Zod source is the authority. Accounts, applications, oxy_sk_ keys, limits and billing are managed in Oxy Console: https://console.oxy.so"
7
7
  },
8
8
  "servers": [
@@ -5506,10 +5506,27 @@
5506
5506
  "sort": {
5507
5507
  "type": "string",
5508
5508
  "enum": [
5509
+ "price",
5509
5510
  "latency",
5510
5511
  "throughput"
5511
5512
  ]
5512
5513
  },
5514
+ "max_price": {
5515
+ "type": "object",
5516
+ "properties": {
5517
+ "prompt": {
5518
+ "type": "number",
5519
+ "exclusiveMinimum": 0,
5520
+ "maximum": 1000000
5521
+ },
5522
+ "completion": {
5523
+ "type": "number",
5524
+ "exclusiveMinimum": 0,
5525
+ "maximum": 1000000
5526
+ }
5527
+ },
5528
+ "additionalProperties": false
5529
+ },
5513
5530
  "preferred_max_latency": {
5514
5531
  "type": "number",
5515
5532
  "exclusiveMinimum": 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaana.ai/contracts",
3
- "version": "8.9.0",
3
+ "version": "8.10.0",
4
4
  "description": "Kaana inference contract: the Zod schemas of the public API at https://kaana.ai/v1 and, under /internal, of the Oxy-Kaana grant, settlement and signed lane.",
5
5
  "type": "module",
6
6
  "sideEffects": false,