@kaana.ai/contracts 8.8.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.
- package/dist/internal/catalogue.d.ts +1 -1
- package/dist/public/chatCompletions.d.ts +5 -0
- package/dist/public/providerPreferences.d.ts +16 -5
- package/dist/public/providerPreferences.js +31 -7
- package/dist/public/responses.d.ts +35 -0
- package/dist/public/responses.js +40 -2
- package/dist/public/version.d.ts +20 -1
- package/dist/public/version.js +20 -1
- package/openapi.json +86 -2
- package/package.json +1 -1
|
@@ -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
|
-
* `
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
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
|
-
* `
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
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
|
-
/**
|
|
62
|
-
|
|
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). */
|
|
@@ -23,6 +23,33 @@ export declare const modelTargetSchema: z.ZodUnion<readonly [z.ZodString, z.ZodE
|
|
|
23
23
|
pro: "pro";
|
|
24
24
|
ultra: "ultra";
|
|
25
25
|
}>]>;
|
|
26
|
+
/**
|
|
27
|
+
* The response format of `POST /v1/responses`: the signed request's format
|
|
28
|
+
* (`responseFormatSchema`) and, on the two JSON formats, `repair` (contract set
|
|
29
|
+
* 8.9.0, Kaana ADR 0009 decision 5).
|
|
30
|
+
*
|
|
31
|
+
* `repair: true` asks Kaana to repair nearly valid JSON in the final text of a
|
|
32
|
+
* non-streaming answer that ended with `stop`: a surrounding code fence, prose
|
|
33
|
+
* around the value, trailing commas, closers a normal stop forgot. It never
|
|
34
|
+
* changes text that already parses, never repairs an answer cut by the token
|
|
35
|
+
* limit (`length`) or ended by a filter, a refusal or a tool call, and checks
|
|
36
|
+
* nothing against `schema` (Kaana carries no validator). A repaired answer is
|
|
37
|
+
* marked by the response header `Kaana-Repaired: true`, never by a body
|
|
38
|
+
* member. It is refused on `text` and with `stream: true`, and it is not part of
|
|
39
|
+
* the signed request: no provider and no Oxy sees it. Default off.
|
|
40
|
+
*/
|
|
41
|
+
export declare const responsesResponseFormatSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
42
|
+
type: z.ZodLiteral<"text">;
|
|
43
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
44
|
+
type: z.ZodLiteral<"json_object">;
|
|
45
|
+
repair: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
47
|
+
type: z.ZodLiteral<"json_schema">;
|
|
48
|
+
name: z.ZodString;
|
|
49
|
+
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
50
|
+
strict: z.ZodBoolean;
|
|
51
|
+
repair: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
}, z.core.$strict>], "type">;
|
|
26
53
|
/**
|
|
27
54
|
* The request. `model` may be absent: the application's routing policy in Oxy
|
|
28
55
|
* Console may name a default target, and the request is refused only when it
|
|
@@ -137,11 +164,13 @@ export declare const responsesRequestSchema: z.ZodObject<{
|
|
|
137
164
|
type: z.ZodLiteral<"text">;
|
|
138
165
|
}, z.core.$strict>, z.ZodObject<{
|
|
139
166
|
type: z.ZodLiteral<"json_object">;
|
|
167
|
+
repair: z.ZodOptional<z.ZodBoolean>;
|
|
140
168
|
}, z.core.$strict>, z.ZodObject<{
|
|
141
169
|
type: z.ZodLiteral<"json_schema">;
|
|
142
170
|
name: z.ZodString;
|
|
143
171
|
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
144
172
|
strict: z.ZodBoolean;
|
|
173
|
+
repair: z.ZodOptional<z.ZodBoolean>;
|
|
145
174
|
}, z.core.$strict>], "type">>;
|
|
146
175
|
reasoning: z.ZodOptional<z.ZodObject<{
|
|
147
176
|
effort: z.ZodOptional<z.ZodEnum<{
|
|
@@ -175,9 +204,14 @@ export declare const responsesRequestSchema: z.ZodObject<{
|
|
|
175
204
|
fp32: "fp32";
|
|
176
205
|
}>>>;
|
|
177
206
|
sort: z.ZodOptional<z.ZodEnum<{
|
|
207
|
+
price: "price";
|
|
178
208
|
latency: "latency";
|
|
179
209
|
throughput: "throughput";
|
|
180
210
|
}>>;
|
|
211
|
+
max_price: z.ZodOptional<z.ZodObject<{
|
|
212
|
+
prompt: z.ZodOptional<z.ZodNumber>;
|
|
213
|
+
completion: z.ZodOptional<z.ZodNumber>;
|
|
214
|
+
}, z.core.$strict>>;
|
|
181
215
|
preferred_max_latency: z.ZodOptional<z.ZodNumber>;
|
|
182
216
|
preferred_min_throughput: z.ZodOptional<z.ZodNumber>;
|
|
183
217
|
}, z.core.$strict>>;
|
|
@@ -294,6 +328,7 @@ export declare const responseSchema: z.ZodObject<{
|
|
|
294
328
|
}, z.core.$strict>;
|
|
295
329
|
latencyMs: z.ZodNumber;
|
|
296
330
|
}, z.core.$strict>;
|
|
331
|
+
export type ResponsesResponseFormat = z.infer<typeof responsesResponseFormatSchema>;
|
|
297
332
|
export type ModelTarget = z.infer<typeof modelTargetSchema>;
|
|
298
333
|
export type ResponsesRequest = z.infer<typeof responsesRequestSchema>;
|
|
299
334
|
export type Response = z.infer<typeof responseSchema>;
|
package/dist/public/responses.js
CHANGED
|
@@ -11,7 +11,7 @@ import { z } from 'zod';
|
|
|
11
11
|
import { maxUtf16Length, minUtf16Length } from '../stringBounds.js';
|
|
12
12
|
import { powerLevelSchema } from './catalogue.js';
|
|
13
13
|
import { generationIdSchema, modelReferenceSchema, requestIdSchema } from './identifiers.js';
|
|
14
|
-
import { inferenceMessageSchema, inferenceReasoningSchema, requestLabelsSchema,
|
|
14
|
+
import { inferenceMessageSchema, inferenceReasoningSchema, requestLabelsSchema, toolChoiceSchema, toolDefinitionSchema, } from './messages.js';
|
|
15
15
|
import { usageQuantitySchema } from './money.js';
|
|
16
16
|
import { routingPolicyReferenceSchema } from './policy.js';
|
|
17
17
|
import { promptCacheKeySchema, providerPreferencesSchema } from './providerPreferences.js';
|
|
@@ -23,6 +23,34 @@ import { inferenceFinishReasonSchema } from './streamEvents.js';
|
|
|
23
23
|
* the string alone).
|
|
24
24
|
*/
|
|
25
25
|
export const modelTargetSchema = z.union([modelReferenceSchema, powerLevelSchema]);
|
|
26
|
+
/**
|
|
27
|
+
* The response format of `POST /v1/responses`: the signed request's format
|
|
28
|
+
* (`responseFormatSchema`) and, on the two JSON formats, `repair` (contract set
|
|
29
|
+
* 8.9.0, Kaana ADR 0009 decision 5).
|
|
30
|
+
*
|
|
31
|
+
* `repair: true` asks Kaana to repair nearly valid JSON in the final text of a
|
|
32
|
+
* non-streaming answer that ended with `stop`: a surrounding code fence, prose
|
|
33
|
+
* around the value, trailing commas, closers a normal stop forgot. It never
|
|
34
|
+
* changes text that already parses, never repairs an answer cut by the token
|
|
35
|
+
* limit (`length`) or ended by a filter, a refusal or a tool call, and checks
|
|
36
|
+
* nothing against `schema` (Kaana carries no validator). A repaired answer is
|
|
37
|
+
* marked by the response header `Kaana-Repaired: true`, never by a body
|
|
38
|
+
* member. It is refused on `text` and with `stream: true`, and it is not part of
|
|
39
|
+
* the signed request: no provider and no Oxy sees it. Default off.
|
|
40
|
+
*/
|
|
41
|
+
export const responsesResponseFormatSchema = z.discriminatedUnion('type', [
|
|
42
|
+
z.object({ type: z.literal('text') }).strict(),
|
|
43
|
+
z.object({ type: z.literal('json_object'), repair: z.boolean().optional() }).strict(),
|
|
44
|
+
z
|
|
45
|
+
.object({
|
|
46
|
+
type: z.literal('json_schema'),
|
|
47
|
+
name: z.string().check(minUtf16Length(1)).check(maxUtf16Length(128)),
|
|
48
|
+
schema: z.record(z.string(), z.unknown()),
|
|
49
|
+
strict: z.boolean(),
|
|
50
|
+
repair: z.boolean().optional(),
|
|
51
|
+
})
|
|
52
|
+
.strict(),
|
|
53
|
+
]);
|
|
26
54
|
/** The message-or-text input `/v1/responses` accepts. */
|
|
27
55
|
const responsesInputSchema = z.union([
|
|
28
56
|
z.string().check(minUtf16Length(1)),
|
|
@@ -55,7 +83,7 @@ export const responsesRequestSchema = z
|
|
|
55
83
|
.optional(),
|
|
56
84
|
tools: z.array(toolDefinitionSchema).max(128).optional(),
|
|
57
85
|
toolChoice: toolChoiceSchema.optional(),
|
|
58
|
-
responseFormat:
|
|
86
|
+
responseFormat: responsesResponseFormatSchema.optional(),
|
|
59
87
|
/** Refused when the resolved model does not advertise the effort. */
|
|
60
88
|
reasoning: inferenceReasoningSchema.optional(),
|
|
61
89
|
labels: requestLabelsSchema.optional(),
|
|
@@ -68,6 +96,16 @@ export const responsesRequestSchema = z
|
|
|
68
96
|
})
|
|
69
97
|
.strict()
|
|
70
98
|
.superRefine((request, ctx) => {
|
|
99
|
+
if (request.responseFormat !== undefined &&
|
|
100
|
+
'repair' in request.responseFormat &&
|
|
101
|
+
request.responseFormat.repair === true &&
|
|
102
|
+
request.stream === true) {
|
|
103
|
+
ctx.addIssue({
|
|
104
|
+
code: 'custom',
|
|
105
|
+
path: ['responseFormat', 'repair'],
|
|
106
|
+
message: 'repair works on a whole answer and cannot be used with stream: true',
|
|
107
|
+
});
|
|
108
|
+
}
|
|
71
109
|
if (request.toolChoice !== undefined && (request.tools ?? []).length === 0) {
|
|
72
110
|
ctx.addIssue({
|
|
73
111
|
code: 'custom',
|
package/dist/public/version.d.ts
CHANGED
|
@@ -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.
|
|
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:
|
|
@@ -223,6 +223,19 @@ export declare const INFERENCE_CONTRACT_VERSION = "8.8.0";
|
|
|
223
223
|
* is emitted only to a request that carried `reasoning`. A consumer on 8.5.0 or
|
|
224
224
|
* earlier (Oxy's legacy signed lane) refuses a message or request that carries
|
|
225
225
|
* what is new, so Oxy reads it before a customer sends it.
|
|
226
|
+
*
|
|
227
|
+
* Contract set 8.9.0 is additive: the optional `repair` member of
|
|
228
|
+
* `POST /v1/responses`'s `responseFormat` (`responsesResponseFormatSchema`, Kaana
|
|
229
|
+
* ADR 0009 decision 5) and the response header `Kaana-Repaired`. It is a public
|
|
230
|
+
* request member only: the signed grant and envelope are unchanged, and a
|
|
231
|
+
* response carries no new body member, so every older reader parses what 8.9.0
|
|
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.
|
|
226
239
|
*/
|
|
227
240
|
/** The public API's one origin and version. */
|
|
228
241
|
export declare const KAANA_API_BASE_URL = "https://kaana.ai/v1";
|
|
@@ -254,6 +267,12 @@ export declare const KAANA_USAGE_HEADER = "Kaana-Usage";
|
|
|
254
267
|
*/
|
|
255
268
|
export declare const KAANA_ROUTING_POLICY_ID_HEADER = "Kaana-Routing-Policy-Id";
|
|
256
269
|
export declare const KAANA_ROUTING_POLICY_VERSION_HEADER = "Kaana-Routing-Policy-Version";
|
|
270
|
+
/**
|
|
271
|
+
* The response header Kaana sets to `true` when it changed the model's JSON
|
|
272
|
+
* text because the request asked for `responseFormat.repair` (contract set
|
|
273
|
+
* 8.9.0). Absent otherwise.
|
|
274
|
+
*/
|
|
275
|
+
export declare const KAANA_REPAIRED_HEADER = "Kaana-Repaired";
|
|
257
276
|
/** The request header that names the end user a service token acts for. */
|
|
258
277
|
export declare const KAANA_ON_BEHALF_OF_HEADER = "X-Oxy-User-Id";
|
|
259
278
|
/** The request header that makes a request idempotent. */
|
package/dist/public/version.js
CHANGED
|
@@ -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.
|
|
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:
|
|
@@ -223,6 +223,19 @@ export const INFERENCE_CONTRACT_VERSION = '8.8.0';
|
|
|
223
223
|
* is emitted only to a request that carried `reasoning`. A consumer on 8.5.0 or
|
|
224
224
|
* earlier (Oxy's legacy signed lane) refuses a message or request that carries
|
|
225
225
|
* what is new, so Oxy reads it before a customer sends it.
|
|
226
|
+
*
|
|
227
|
+
* Contract set 8.9.0 is additive: the optional `repair` member of
|
|
228
|
+
* `POST /v1/responses`'s `responseFormat` (`responsesResponseFormatSchema`, Kaana
|
|
229
|
+
* ADR 0009 decision 5) and the response header `Kaana-Repaired`. It is a public
|
|
230
|
+
* request member only: the signed grant and envelope are unchanged, and a
|
|
231
|
+
* response carries no new body member, so every older reader parses what 8.9.0
|
|
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.
|
|
226
239
|
*/
|
|
227
240
|
/** The public API's one origin and version. */
|
|
228
241
|
export const KAANA_API_BASE_URL = 'https://kaana.ai/v1';
|
|
@@ -254,6 +267,12 @@ export const KAANA_USAGE_HEADER = 'Kaana-Usage';
|
|
|
254
267
|
*/
|
|
255
268
|
export const KAANA_ROUTING_POLICY_ID_HEADER = 'Kaana-Routing-Policy-Id';
|
|
256
269
|
export const KAANA_ROUTING_POLICY_VERSION_HEADER = 'Kaana-Routing-Policy-Version';
|
|
270
|
+
/**
|
|
271
|
+
* The response header Kaana sets to `true` when it changed the model's JSON
|
|
272
|
+
* text because the request asked for `responseFormat.repair` (contract set
|
|
273
|
+
* 8.9.0). Absent otherwise.
|
|
274
|
+
*/
|
|
275
|
+
export const KAANA_REPAIRED_HEADER = 'Kaana-Repaired';
|
|
257
276
|
/** The request header that names the end user a service token acts for. */
|
|
258
277
|
export const KAANA_ON_BEHALF_OF_HEADER = 'X-Oxy-User-Id';
|
|
259
278
|
/** The request header that makes a request idempotent. */
|
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.
|
|
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,
|
|
@@ -8026,7 +8043,7 @@
|
|
|
8026
8043
|
"$ref": "#/components/schemas/ToolChoice"
|
|
8027
8044
|
},
|
|
8028
8045
|
"responseFormat": {
|
|
8029
|
-
"$ref": "#/components/schemas/
|
|
8046
|
+
"$ref": "#/components/schemas/ResponsesResponseFormat"
|
|
8030
8047
|
},
|
|
8031
8048
|
"reasoning": {
|
|
8032
8049
|
"$ref": "#/components/schemas/InferenceReasoning"
|
|
@@ -8051,6 +8068,73 @@
|
|
|
8051
8068
|
],
|
|
8052
8069
|
"additionalProperties": false
|
|
8053
8070
|
},
|
|
8071
|
+
"ResponsesResponseFormat": {
|
|
8072
|
+
"oneOf": [
|
|
8073
|
+
{
|
|
8074
|
+
"type": "object",
|
|
8075
|
+
"properties": {
|
|
8076
|
+
"type": {
|
|
8077
|
+
"type": "string",
|
|
8078
|
+
"const": "text"
|
|
8079
|
+
}
|
|
8080
|
+
},
|
|
8081
|
+
"required": [
|
|
8082
|
+
"type"
|
|
8083
|
+
],
|
|
8084
|
+
"additionalProperties": false
|
|
8085
|
+
},
|
|
8086
|
+
{
|
|
8087
|
+
"type": "object",
|
|
8088
|
+
"properties": {
|
|
8089
|
+
"type": {
|
|
8090
|
+
"type": "string",
|
|
8091
|
+
"const": "json_object"
|
|
8092
|
+
},
|
|
8093
|
+
"repair": {
|
|
8094
|
+
"type": "boolean"
|
|
8095
|
+
}
|
|
8096
|
+
},
|
|
8097
|
+
"required": [
|
|
8098
|
+
"type"
|
|
8099
|
+
],
|
|
8100
|
+
"additionalProperties": false
|
|
8101
|
+
},
|
|
8102
|
+
{
|
|
8103
|
+
"type": "object",
|
|
8104
|
+
"properties": {
|
|
8105
|
+
"type": {
|
|
8106
|
+
"type": "string",
|
|
8107
|
+
"const": "json_schema"
|
|
8108
|
+
},
|
|
8109
|
+
"name": {
|
|
8110
|
+
"type": "string",
|
|
8111
|
+
"minLength": 1,
|
|
8112
|
+
"maxLength": 128
|
|
8113
|
+
},
|
|
8114
|
+
"schema": {
|
|
8115
|
+
"type": "object",
|
|
8116
|
+
"propertyNames": {
|
|
8117
|
+
"type": "string"
|
|
8118
|
+
},
|
|
8119
|
+
"additionalProperties": {}
|
|
8120
|
+
},
|
|
8121
|
+
"strict": {
|
|
8122
|
+
"type": "boolean"
|
|
8123
|
+
},
|
|
8124
|
+
"repair": {
|
|
8125
|
+
"type": "boolean"
|
|
8126
|
+
}
|
|
8127
|
+
},
|
|
8128
|
+
"required": [
|
|
8129
|
+
"type",
|
|
8130
|
+
"name",
|
|
8131
|
+
"schema",
|
|
8132
|
+
"strict"
|
|
8133
|
+
],
|
|
8134
|
+
"additionalProperties": false
|
|
8135
|
+
}
|
|
8136
|
+
]
|
|
8137
|
+
},
|
|
8054
8138
|
"RoutingPolicyReference": {
|
|
8055
8139
|
"type": "object",
|
|
8056
8140
|
"properties": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaana.ai/contracts",
|
|
3
|
-
"version": "8.
|
|
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,
|