@kaana.ai/contracts 8.2.0 → 8.4.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/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Kaana API",
5
- "version": "8.2.0",
5
+ "version": "8.4.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": [
@@ -395,6 +395,104 @@
395
395
  }
396
396
  }
397
397
  },
398
+ "/messages": {
399
+ "post": {
400
+ "summary": "Generate a message (Anthropic-Messages-compatible). Send the key as `x-api-key` or `Authorization: Bearer`.",
401
+ "parameters": [
402
+ {
403
+ "name": "Idempotency-Key",
404
+ "in": "header",
405
+ "required": false,
406
+ "description": "Makes a retried request return the original generation instead of running twice.",
407
+ "schema": {
408
+ "type": "string",
409
+ "minLength": 1,
410
+ "maxLength": 255
411
+ }
412
+ },
413
+ {
414
+ "name": "X-Oxy-User-Id",
415
+ "in": "header",
416
+ "required": false,
417
+ "description": "Delegated end user, attribution only; honoured only with an Oxy service token.",
418
+ "schema": {
419
+ "type": "string",
420
+ "minLength": 1,
421
+ "maxLength": 64
422
+ }
423
+ }
424
+ ],
425
+ "requestBody": {
426
+ "required": true,
427
+ "content": {
428
+ "application/json": {
429
+ "schema": {
430
+ "$ref": "#/components/schemas/AnthropicMessagesRequest"
431
+ }
432
+ }
433
+ }
434
+ },
435
+ "responses": {
436
+ "200": {
437
+ "description": "OK",
438
+ "headers": {
439
+ "Kaana-Request-Id": {
440
+ "description": "The request id; quote it when reporting a problem.",
441
+ "schema": {
442
+ "type": "string"
443
+ }
444
+ },
445
+ "Kaana-Contract-Version": {
446
+ "description": "The contract set that answered.",
447
+ "schema": {
448
+ "type": "string"
449
+ }
450
+ }
451
+ },
452
+ "content": {
453
+ "application/json": {
454
+ "schema": {
455
+ "$ref": "#/components/schemas/AnthropicMessage"
456
+ }
457
+ },
458
+ "text/event-stream": {
459
+ "schema": {
460
+ "type": "string",
461
+ "description": "With `stream: true`: `event: <type>` frames; a failure is an `error` frame."
462
+ },
463
+ "x-kaana-event": {
464
+ "$ref": "#/components/schemas/AnthropicStreamEvent"
465
+ }
466
+ }
467
+ }
468
+ },
469
+ "default": {
470
+ "description": "A failure decided before the first byte. After it, a stream ends with its terminal error event instead.",
471
+ "headers": {
472
+ "Kaana-Request-Id": {
473
+ "description": "The request id; quote it when reporting a problem.",
474
+ "schema": {
475
+ "type": "string"
476
+ }
477
+ },
478
+ "Kaana-Contract-Version": {
479
+ "description": "The contract set that answered.",
480
+ "schema": {
481
+ "type": "string"
482
+ }
483
+ }
484
+ },
485
+ "content": {
486
+ "application/json": {
487
+ "schema": {
488
+ "$ref": "#/components/schemas/AnthropicError"
489
+ }
490
+ }
491
+ }
492
+ }
493
+ }
494
+ }
495
+ },
398
496
  "/embeddings": {
399
497
  "post": {
400
498
  "summary": "Embed text (OpenAI-compatible).",
@@ -932,184 +1030,1220 @@
932
1030
  }
933
1031
  }
934
1032
  },
935
- "content": {
936
- "application/json": {
937
- "schema": {
938
- "$ref": "#/components/schemas/GenerationRecord"
939
- }
940
- }
941
- }
1033
+ "content": {
1034
+ "application/json": {
1035
+ "schema": {
1036
+ "$ref": "#/components/schemas/GenerationRecord"
1037
+ }
1038
+ }
1039
+ }
1040
+ },
1041
+ "default": {
1042
+ "description": "A failure decided before the first byte. After it, a stream ends with its terminal error event instead.",
1043
+ "headers": {
1044
+ "Kaana-Request-Id": {
1045
+ "description": "The request id; quote it when reporting a problem.",
1046
+ "schema": {
1047
+ "type": "string"
1048
+ }
1049
+ },
1050
+ "Kaana-Contract-Version": {
1051
+ "description": "The contract set that answered.",
1052
+ "schema": {
1053
+ "type": "string"
1054
+ }
1055
+ }
1056
+ },
1057
+ "content": {
1058
+ "application/json": {
1059
+ "schema": {
1060
+ "$ref": "#/components/schemas/PublicError"
1061
+ }
1062
+ }
1063
+ }
1064
+ }
1065
+ }
1066
+ }
1067
+ },
1068
+ "/generations": {
1069
+ "get": {
1070
+ "summary": "The record of the generation an idempotency key produced.",
1071
+ "parameters": [
1072
+ {
1073
+ "name": "idempotency_key",
1074
+ "in": "query",
1075
+ "required": true,
1076
+ "schema": {
1077
+ "type": "string",
1078
+ "minLength": 1,
1079
+ "maxLength": 255
1080
+ }
1081
+ },
1082
+ {
1083
+ "name": "X-Oxy-User-Id",
1084
+ "in": "header",
1085
+ "required": false,
1086
+ "description": "Delegated end user, attribution only; honoured only with an Oxy service token.",
1087
+ "schema": {
1088
+ "type": "string",
1089
+ "minLength": 1,
1090
+ "maxLength": 64
1091
+ }
1092
+ }
1093
+ ],
1094
+ "responses": {
1095
+ "200": {
1096
+ "description": "OK",
1097
+ "headers": {
1098
+ "Kaana-Request-Id": {
1099
+ "description": "The request id; quote it when reporting a problem.",
1100
+ "schema": {
1101
+ "type": "string"
1102
+ }
1103
+ },
1104
+ "Kaana-Contract-Version": {
1105
+ "description": "The contract set that answered.",
1106
+ "schema": {
1107
+ "type": "string"
1108
+ }
1109
+ }
1110
+ },
1111
+ "content": {
1112
+ "application/json": {
1113
+ "schema": {
1114
+ "$ref": "#/components/schemas/GenerationRecord"
1115
+ }
1116
+ }
1117
+ }
1118
+ },
1119
+ "default": {
1120
+ "description": "A failure decided before the first byte. After it, a stream ends with its terminal error event instead.",
1121
+ "headers": {
1122
+ "Kaana-Request-Id": {
1123
+ "description": "The request id; quote it when reporting a problem.",
1124
+ "schema": {
1125
+ "type": "string"
1126
+ }
1127
+ },
1128
+ "Kaana-Contract-Version": {
1129
+ "description": "The contract set that answered.",
1130
+ "schema": {
1131
+ "type": "string"
1132
+ }
1133
+ }
1134
+ },
1135
+ "content": {
1136
+ "application/json": {
1137
+ "schema": {
1138
+ "$ref": "#/components/schemas/PublicError"
1139
+ }
1140
+ }
1141
+ }
1142
+ }
1143
+ }
1144
+ }
1145
+ },
1146
+ "/realtime": {
1147
+ "get": {
1148
+ "summary": "Open a realtime session over WebSocket. The first frame is RealtimeSessionOpen (or session.resume); every frame is one JSON message.",
1149
+ "parameters": [
1150
+ {
1151
+ "name": "model",
1152
+ "in": "query",
1153
+ "required": true,
1154
+ "schema": {
1155
+ "$ref": "#/components/schemas/ModelReference"
1156
+ }
1157
+ }
1158
+ ],
1159
+ "responses": {
1160
+ "101": {
1161
+ "description": "Switching Protocols: the WebSocket is open."
1162
+ },
1163
+ "default": {
1164
+ "description": "A failure decided before the first byte. After it, a stream ends with its terminal error event instead.",
1165
+ "headers": {
1166
+ "Kaana-Request-Id": {
1167
+ "description": "The request id; quote it when reporting a problem.",
1168
+ "schema": {
1169
+ "type": "string"
1170
+ }
1171
+ },
1172
+ "Kaana-Contract-Version": {
1173
+ "description": "The contract set that answered.",
1174
+ "schema": {
1175
+ "type": "string"
1176
+ }
1177
+ }
1178
+ },
1179
+ "content": {
1180
+ "application/json": {
1181
+ "schema": {
1182
+ "$ref": "#/components/schemas/PublicError"
1183
+ }
1184
+ }
1185
+ }
1186
+ }
1187
+ },
1188
+ "x-kaana-websocket": {
1189
+ "open": {
1190
+ "$ref": "#/components/schemas/RealtimeSessionOpen"
1191
+ },
1192
+ "client": {
1193
+ "$ref": "#/components/schemas/RealtimeClientCommand"
1194
+ },
1195
+ "server": {
1196
+ "$ref": "#/components/schemas/RealtimePublicServerEvent"
1197
+ }
1198
+ }
1199
+ }
1200
+ }
1201
+ },
1202
+ "components": {
1203
+ "securitySchemes": {
1204
+ "bearer": {
1205
+ "type": "http",
1206
+ "scheme": "bearer",
1207
+ "description": "An oxy_sk_ key from Oxy Console, an Oxy service token for the kaana.ai audience, or an Oxy app session with inference:invoke."
1208
+ }
1209
+ },
1210
+ "schemas": {
1211
+ "AnthropicError": {
1212
+ "type": "object",
1213
+ "properties": {
1214
+ "type": {
1215
+ "type": "string",
1216
+ "const": "error"
1217
+ },
1218
+ "error": {
1219
+ "type": "object",
1220
+ "properties": {
1221
+ "type": {
1222
+ "type": "string",
1223
+ "enum": [
1224
+ "invalid_request_error",
1225
+ "authentication_error",
1226
+ "billing_error",
1227
+ "permission_error",
1228
+ "not_found_error",
1229
+ "request_too_large",
1230
+ "rate_limit_error",
1231
+ "timeout_error",
1232
+ "overloaded_error",
1233
+ "api_error"
1234
+ ]
1235
+ },
1236
+ "message": {
1237
+ "type": "string",
1238
+ "minLength": 1,
1239
+ "maxLength": 4096
1240
+ }
1241
+ },
1242
+ "required": [
1243
+ "type",
1244
+ "message"
1245
+ ],
1246
+ "additionalProperties": false
1247
+ },
1248
+ "request_id": {
1249
+ "type": "string",
1250
+ "minLength": 1,
1251
+ "maxLength": 256
1252
+ }
1253
+ },
1254
+ "required": [
1255
+ "type",
1256
+ "error"
1257
+ ],
1258
+ "additionalProperties": false
1259
+ },
1260
+ "AnthropicMessage": {
1261
+ "type": "object",
1262
+ "properties": {
1263
+ "id": {
1264
+ "type": "string",
1265
+ "minLength": 1,
1266
+ "maxLength": 256
1267
+ },
1268
+ "type": {
1269
+ "type": "string",
1270
+ "const": "message"
1271
+ },
1272
+ "role": {
1273
+ "type": "string",
1274
+ "const": "assistant"
1275
+ },
1276
+ "model": {
1277
+ "type": "string",
1278
+ "minLength": 1,
1279
+ "maxLength": 256
1280
+ },
1281
+ "content": {
1282
+ "type": "array",
1283
+ "items": {
1284
+ "oneOf": [
1285
+ {
1286
+ "type": "object",
1287
+ "properties": {
1288
+ "type": {
1289
+ "type": "string",
1290
+ "const": "text"
1291
+ },
1292
+ "text": {
1293
+ "type": "string"
1294
+ }
1295
+ },
1296
+ "required": [
1297
+ "type",
1298
+ "text"
1299
+ ],
1300
+ "additionalProperties": false
1301
+ },
1302
+ {
1303
+ "type": "object",
1304
+ "properties": {
1305
+ "type": {
1306
+ "type": "string",
1307
+ "const": "tool_use"
1308
+ },
1309
+ "id": {
1310
+ "type": "string",
1311
+ "minLength": 1,
1312
+ "maxLength": 128
1313
+ },
1314
+ "name": {
1315
+ "type": "string",
1316
+ "minLength": 1,
1317
+ "maxLength": 128
1318
+ },
1319
+ "input": {
1320
+ "type": "object",
1321
+ "propertyNames": {
1322
+ "type": "string"
1323
+ },
1324
+ "additionalProperties": {}
1325
+ }
1326
+ },
1327
+ "required": [
1328
+ "type",
1329
+ "id",
1330
+ "name",
1331
+ "input"
1332
+ ],
1333
+ "additionalProperties": false
1334
+ }
1335
+ ]
1336
+ }
1337
+ },
1338
+ "stop_reason": {
1339
+ "type": "string",
1340
+ "enum": [
1341
+ "end_turn",
1342
+ "max_tokens",
1343
+ "tool_use",
1344
+ "refusal"
1345
+ ]
1346
+ },
1347
+ "stop_sequence": {
1348
+ "type": "null",
1349
+ "const": null
1350
+ },
1351
+ "usage": {
1352
+ "type": "object",
1353
+ "properties": {
1354
+ "input_tokens": {
1355
+ "type": "integer",
1356
+ "minimum": 0,
1357
+ "maximum": 9007199254740991
1358
+ },
1359
+ "output_tokens": {
1360
+ "type": "integer",
1361
+ "minimum": 0,
1362
+ "maximum": 9007199254740991
1363
+ },
1364
+ "cache_read_input_tokens": {
1365
+ "type": "integer",
1366
+ "minimum": 0,
1367
+ "maximum": 9007199254740991
1368
+ }
1369
+ },
1370
+ "required": [
1371
+ "input_tokens",
1372
+ "output_tokens"
1373
+ ],
1374
+ "additionalProperties": false
1375
+ }
1376
+ },
1377
+ "required": [
1378
+ "id",
1379
+ "type",
1380
+ "role",
1381
+ "model",
1382
+ "content",
1383
+ "stop_reason",
1384
+ "stop_sequence",
1385
+ "usage"
1386
+ ],
1387
+ "additionalProperties": false
1388
+ },
1389
+ "AnthropicMessagesRequest": {
1390
+ "type": "object",
1391
+ "properties": {
1392
+ "model": {
1393
+ "$ref": "#/components/schemas/ModelTarget"
1394
+ },
1395
+ "max_tokens": {
1396
+ "type": "integer",
1397
+ "exclusiveMinimum": 0,
1398
+ "maximum": 9007199254740991
1399
+ },
1400
+ "messages": {
1401
+ "minItems": 1,
1402
+ "type": "array",
1403
+ "items": {
1404
+ "type": "object",
1405
+ "properties": {
1406
+ "role": {
1407
+ "type": "string",
1408
+ "enum": [
1409
+ "user",
1410
+ "assistant"
1411
+ ]
1412
+ },
1413
+ "content": {
1414
+ "anyOf": [
1415
+ {
1416
+ "type": "string"
1417
+ },
1418
+ {
1419
+ "minItems": 1,
1420
+ "type": "array",
1421
+ "items": {
1422
+ "anyOf": [
1423
+ {
1424
+ "type": "object",
1425
+ "properties": {
1426
+ "type": {
1427
+ "type": "string",
1428
+ "const": "text"
1429
+ },
1430
+ "text": {
1431
+ "type": "string"
1432
+ }
1433
+ },
1434
+ "required": [
1435
+ "type",
1436
+ "text"
1437
+ ],
1438
+ "additionalProperties": false
1439
+ },
1440
+ {
1441
+ "type": "object",
1442
+ "properties": {
1443
+ "type": {
1444
+ "type": "string",
1445
+ "const": "image"
1446
+ },
1447
+ "source": {
1448
+ "oneOf": [
1449
+ {
1450
+ "type": "object",
1451
+ "properties": {
1452
+ "type": {
1453
+ "type": "string",
1454
+ "const": "base64"
1455
+ },
1456
+ "media_type": {
1457
+ "type": "string",
1458
+ "minLength": 1,
1459
+ "maxLength": 255
1460
+ },
1461
+ "data": {
1462
+ "type": "string",
1463
+ "minLength": 1
1464
+ }
1465
+ },
1466
+ "required": [
1467
+ "type",
1468
+ "media_type",
1469
+ "data"
1470
+ ],
1471
+ "additionalProperties": false
1472
+ },
1473
+ {
1474
+ "type": "object",
1475
+ "properties": {
1476
+ "type": {
1477
+ "type": "string",
1478
+ "const": "url"
1479
+ },
1480
+ "url": {
1481
+ "type": "string",
1482
+ "minLength": 1,
1483
+ "maxLength": 4096
1484
+ }
1485
+ },
1486
+ "required": [
1487
+ "type",
1488
+ "url"
1489
+ ],
1490
+ "additionalProperties": false
1491
+ }
1492
+ ]
1493
+ }
1494
+ },
1495
+ "required": [
1496
+ "type",
1497
+ "source"
1498
+ ],
1499
+ "additionalProperties": false
1500
+ },
1501
+ {
1502
+ "type": "object",
1503
+ "properties": {
1504
+ "type": {
1505
+ "type": "string",
1506
+ "const": "tool_use"
1507
+ },
1508
+ "id": {
1509
+ "type": "string",
1510
+ "minLength": 1,
1511
+ "maxLength": 128
1512
+ },
1513
+ "name": {
1514
+ "type": "string",
1515
+ "minLength": 1,
1516
+ "maxLength": 128
1517
+ },
1518
+ "input": {
1519
+ "type": "object",
1520
+ "propertyNames": {
1521
+ "type": "string"
1522
+ },
1523
+ "additionalProperties": {}
1524
+ }
1525
+ },
1526
+ "required": [
1527
+ "type",
1528
+ "id",
1529
+ "name",
1530
+ "input"
1531
+ ],
1532
+ "additionalProperties": false
1533
+ },
1534
+ {
1535
+ "type": "object",
1536
+ "properties": {
1537
+ "type": {
1538
+ "type": "string",
1539
+ "const": "tool_result"
1540
+ },
1541
+ "tool_use_id": {
1542
+ "type": "string",
1543
+ "minLength": 1,
1544
+ "maxLength": 128
1545
+ },
1546
+ "content": {
1547
+ "anyOf": [
1548
+ {
1549
+ "type": "string"
1550
+ },
1551
+ {
1552
+ "type": "array",
1553
+ "items": {
1554
+ "anyOf": [
1555
+ {
1556
+ "type": "object",
1557
+ "properties": {
1558
+ "type": {
1559
+ "type": "string",
1560
+ "const": "text"
1561
+ },
1562
+ "text": {
1563
+ "type": "string"
1564
+ }
1565
+ },
1566
+ "required": [
1567
+ "type",
1568
+ "text"
1569
+ ],
1570
+ "additionalProperties": false
1571
+ },
1572
+ {
1573
+ "type": "object",
1574
+ "properties": {
1575
+ "type": {
1576
+ "type": "string",
1577
+ "const": "image"
1578
+ },
1579
+ "source": {
1580
+ "oneOf": [
1581
+ {
1582
+ "type": "object",
1583
+ "properties": {
1584
+ "type": {
1585
+ "type": "string",
1586
+ "const": "base64"
1587
+ },
1588
+ "media_type": {
1589
+ "type": "string",
1590
+ "minLength": 1,
1591
+ "maxLength": 255
1592
+ },
1593
+ "data": {
1594
+ "type": "string",
1595
+ "minLength": 1
1596
+ }
1597
+ },
1598
+ "required": [
1599
+ "type",
1600
+ "media_type",
1601
+ "data"
1602
+ ],
1603
+ "additionalProperties": false
1604
+ },
1605
+ {
1606
+ "type": "object",
1607
+ "properties": {
1608
+ "type": {
1609
+ "type": "string",
1610
+ "const": "url"
1611
+ },
1612
+ "url": {
1613
+ "type": "string",
1614
+ "minLength": 1,
1615
+ "maxLength": 4096
1616
+ }
1617
+ },
1618
+ "required": [
1619
+ "type",
1620
+ "url"
1621
+ ],
1622
+ "additionalProperties": false
1623
+ }
1624
+ ]
1625
+ }
1626
+ },
1627
+ "required": [
1628
+ "type",
1629
+ "source"
1630
+ ],
1631
+ "additionalProperties": false
1632
+ }
1633
+ ]
1634
+ }
1635
+ }
1636
+ ]
1637
+ },
1638
+ "is_error": {
1639
+ "type": "boolean"
1640
+ }
1641
+ },
1642
+ "required": [
1643
+ "type",
1644
+ "tool_use_id"
1645
+ ],
1646
+ "additionalProperties": false
1647
+ }
1648
+ ]
1649
+ }
1650
+ }
1651
+ ]
1652
+ }
1653
+ },
1654
+ "required": [
1655
+ "role",
1656
+ "content"
1657
+ ],
1658
+ "additionalProperties": false
1659
+ }
1660
+ },
1661
+ "system": {
1662
+ "anyOf": [
1663
+ {
1664
+ "type": "string"
1665
+ },
1666
+ {
1667
+ "type": "array",
1668
+ "items": {
1669
+ "type": "object",
1670
+ "properties": {
1671
+ "type": {
1672
+ "type": "string",
1673
+ "const": "text"
1674
+ },
1675
+ "text": {
1676
+ "type": "string"
1677
+ }
1678
+ },
1679
+ "required": [
1680
+ "type",
1681
+ "text"
1682
+ ],
1683
+ "additionalProperties": false
1684
+ }
1685
+ }
1686
+ ]
1687
+ },
1688
+ "temperature": {
1689
+ "type": "number",
1690
+ "minimum": 0,
1691
+ "maximum": 1
1692
+ },
1693
+ "top_p": {
1694
+ "type": "number",
1695
+ "minimum": 0,
1696
+ "maximum": 1
1697
+ },
1698
+ "top_k": {
1699
+ "type": "integer",
1700
+ "exclusiveMinimum": 0,
1701
+ "maximum": 9007199254740991
1702
+ },
1703
+ "stop_sequences": {
1704
+ "maxItems": 8,
1705
+ "type": "array",
1706
+ "items": {
1707
+ "type": "string",
1708
+ "minLength": 1,
1709
+ "maxLength": 256
1710
+ }
1711
+ },
1712
+ "stream": {
1713
+ "type": "boolean"
1714
+ },
1715
+ "tools": {
1716
+ "maxItems": 128,
1717
+ "type": "array",
1718
+ "items": {
1719
+ "type": "object",
1720
+ "properties": {
1721
+ "type": {
1722
+ "type": "string",
1723
+ "const": "custom"
1724
+ },
1725
+ "name": {
1726
+ "type": "string",
1727
+ "minLength": 1,
1728
+ "maxLength": 128
1729
+ },
1730
+ "description": {
1731
+ "type": "string",
1732
+ "maxLength": 32768
1733
+ },
1734
+ "input_schema": {
1735
+ "type": "object",
1736
+ "propertyNames": {
1737
+ "type": "string"
1738
+ },
1739
+ "additionalProperties": {}
1740
+ },
1741
+ "strict": {
1742
+ "type": "boolean"
1743
+ }
1744
+ },
1745
+ "required": [
1746
+ "name",
1747
+ "input_schema"
1748
+ ],
1749
+ "additionalProperties": false
1750
+ }
1751
+ },
1752
+ "tool_choice": {
1753
+ "oneOf": [
1754
+ {
1755
+ "type": "object",
1756
+ "properties": {
1757
+ "type": {
1758
+ "type": "string",
1759
+ "const": "auto"
1760
+ }
1761
+ },
1762
+ "required": [
1763
+ "type"
1764
+ ],
1765
+ "additionalProperties": false
1766
+ },
1767
+ {
1768
+ "type": "object",
1769
+ "properties": {
1770
+ "type": {
1771
+ "type": "string",
1772
+ "const": "any"
1773
+ }
1774
+ },
1775
+ "required": [
1776
+ "type"
1777
+ ],
1778
+ "additionalProperties": false
1779
+ },
1780
+ {
1781
+ "type": "object",
1782
+ "properties": {
1783
+ "type": {
1784
+ "type": "string",
1785
+ "const": "none"
1786
+ }
1787
+ },
1788
+ "required": [
1789
+ "type"
1790
+ ],
1791
+ "additionalProperties": false
1792
+ },
1793
+ {
1794
+ "type": "object",
1795
+ "properties": {
1796
+ "type": {
1797
+ "type": "string",
1798
+ "const": "tool"
1799
+ },
1800
+ "name": {
1801
+ "type": "string",
1802
+ "minLength": 1,
1803
+ "maxLength": 128
1804
+ }
1805
+ },
1806
+ "required": [
1807
+ "type",
1808
+ "name"
1809
+ ],
1810
+ "additionalProperties": false
1811
+ }
1812
+ ]
1813
+ },
1814
+ "thinking": {
1815
+ "type": "object",
1816
+ "properties": {
1817
+ "type": {
1818
+ "type": "string",
1819
+ "const": "disabled"
1820
+ }
1821
+ },
1822
+ "required": [
1823
+ "type"
1824
+ ],
1825
+ "additionalProperties": false
1826
+ },
1827
+ "output_config": {
1828
+ "type": "object",
1829
+ "properties": {
1830
+ "effort": {
1831
+ "$ref": "#/components/schemas/ReasoningEffort"
1832
+ }
1833
+ },
1834
+ "additionalProperties": false
1835
+ },
1836
+ "metadata": {
1837
+ "type": "object",
1838
+ "properties": {
1839
+ "user_id": {
1840
+ "anyOf": [
1841
+ {
1842
+ "type": "string",
1843
+ "maxLength": 512
1844
+ },
1845
+ {
1846
+ "type": "null"
1847
+ }
1848
+ ]
1849
+ }
1850
+ },
1851
+ "additionalProperties": false
1852
+ }
1853
+ },
1854
+ "required": [
1855
+ "model",
1856
+ "max_tokens",
1857
+ "messages"
1858
+ ],
1859
+ "additionalProperties": false
1860
+ },
1861
+ "AnthropicStreamEvent": {
1862
+ "oneOf": [
1863
+ {
1864
+ "type": "object",
1865
+ "properties": {
1866
+ "type": {
1867
+ "type": "string",
1868
+ "const": "message_start"
1869
+ },
1870
+ "message": {
1871
+ "type": "object",
1872
+ "properties": {
1873
+ "id": {
1874
+ "type": "string",
1875
+ "minLength": 1,
1876
+ "maxLength": 256
1877
+ },
1878
+ "type": {
1879
+ "type": "string",
1880
+ "const": "message"
1881
+ },
1882
+ "role": {
1883
+ "type": "string",
1884
+ "const": "assistant"
1885
+ },
1886
+ "model": {
1887
+ "type": "string",
1888
+ "minLength": 1,
1889
+ "maxLength": 256
1890
+ },
1891
+ "content": {
1892
+ "minItems": 0,
1893
+ "maxItems": 0,
1894
+ "type": "array",
1895
+ "items": {
1896
+ "oneOf": [
1897
+ {
1898
+ "type": "object",
1899
+ "properties": {
1900
+ "type": {
1901
+ "type": "string",
1902
+ "const": "text"
1903
+ },
1904
+ "text": {
1905
+ "type": "string"
1906
+ }
1907
+ },
1908
+ "required": [
1909
+ "type",
1910
+ "text"
1911
+ ],
1912
+ "additionalProperties": false
1913
+ },
1914
+ {
1915
+ "type": "object",
1916
+ "properties": {
1917
+ "type": {
1918
+ "type": "string",
1919
+ "const": "tool_use"
1920
+ },
1921
+ "id": {
1922
+ "type": "string",
1923
+ "minLength": 1,
1924
+ "maxLength": 128
1925
+ },
1926
+ "name": {
1927
+ "type": "string",
1928
+ "minLength": 1,
1929
+ "maxLength": 128
1930
+ },
1931
+ "input": {
1932
+ "type": "object",
1933
+ "propertyNames": {
1934
+ "type": "string"
1935
+ },
1936
+ "additionalProperties": {}
1937
+ }
1938
+ },
1939
+ "required": [
1940
+ "type",
1941
+ "id",
1942
+ "name",
1943
+ "input"
1944
+ ],
1945
+ "additionalProperties": false
1946
+ }
1947
+ ]
1948
+ }
1949
+ },
1950
+ "stop_reason": {
1951
+ "type": "null",
1952
+ "const": null
1953
+ },
1954
+ "stop_sequence": {
1955
+ "type": "null",
1956
+ "const": null
1957
+ },
1958
+ "usage": {
1959
+ "type": "object",
1960
+ "properties": {
1961
+ "input_tokens": {
1962
+ "type": "integer",
1963
+ "minimum": 0,
1964
+ "maximum": 9007199254740991
1965
+ },
1966
+ "output_tokens": {
1967
+ "type": "integer",
1968
+ "minimum": 0,
1969
+ "maximum": 9007199254740991
1970
+ },
1971
+ "cache_read_input_tokens": {
1972
+ "type": "integer",
1973
+ "minimum": 0,
1974
+ "maximum": 9007199254740991
1975
+ }
1976
+ },
1977
+ "required": [
1978
+ "input_tokens",
1979
+ "output_tokens"
1980
+ ],
1981
+ "additionalProperties": false
1982
+ }
1983
+ },
1984
+ "required": [
1985
+ "id",
1986
+ "type",
1987
+ "role",
1988
+ "model",
1989
+ "content",
1990
+ "stop_reason",
1991
+ "stop_sequence",
1992
+ "usage"
1993
+ ],
1994
+ "additionalProperties": false
1995
+ }
1996
+ },
1997
+ "required": [
1998
+ "type",
1999
+ "message"
2000
+ ],
2001
+ "additionalProperties": false
2002
+ },
2003
+ {
2004
+ "type": "object",
2005
+ "properties": {
2006
+ "type": {
2007
+ "type": "string",
2008
+ "const": "content_block_start"
2009
+ },
2010
+ "index": {
2011
+ "type": "integer",
2012
+ "minimum": 0,
2013
+ "maximum": 9007199254740991
2014
+ },
2015
+ "content_block": {
2016
+ "oneOf": [
2017
+ {
2018
+ "type": "object",
2019
+ "properties": {
2020
+ "type": {
2021
+ "type": "string",
2022
+ "const": "text"
2023
+ },
2024
+ "text": {
2025
+ "type": "string",
2026
+ "const": ""
2027
+ }
2028
+ },
2029
+ "required": [
2030
+ "type",
2031
+ "text"
2032
+ ],
2033
+ "additionalProperties": false
2034
+ },
2035
+ {
2036
+ "type": "object",
2037
+ "properties": {
2038
+ "type": {
2039
+ "type": "string",
2040
+ "const": "tool_use"
2041
+ },
2042
+ "id": {
2043
+ "type": "string",
2044
+ "minLength": 1,
2045
+ "maxLength": 128
2046
+ },
2047
+ "name": {
2048
+ "type": "string",
2049
+ "minLength": 1,
2050
+ "maxLength": 128
2051
+ },
2052
+ "input": {
2053
+ "type": "object",
2054
+ "properties": {},
2055
+ "additionalProperties": false
2056
+ }
2057
+ },
2058
+ "required": [
2059
+ "type",
2060
+ "id",
2061
+ "name",
2062
+ "input"
2063
+ ],
2064
+ "additionalProperties": false
2065
+ }
2066
+ ]
2067
+ }
2068
+ },
2069
+ "required": [
2070
+ "type",
2071
+ "index",
2072
+ "content_block"
2073
+ ],
2074
+ "additionalProperties": false
2075
+ },
2076
+ {
2077
+ "type": "object",
2078
+ "properties": {
2079
+ "type": {
2080
+ "type": "string",
2081
+ "const": "content_block_delta"
2082
+ },
2083
+ "index": {
2084
+ "type": "integer",
2085
+ "minimum": 0,
2086
+ "maximum": 9007199254740991
2087
+ },
2088
+ "delta": {
2089
+ "oneOf": [
2090
+ {
2091
+ "type": "object",
2092
+ "properties": {
2093
+ "type": {
2094
+ "type": "string",
2095
+ "const": "text_delta"
2096
+ },
2097
+ "text": {
2098
+ "type": "string"
2099
+ }
2100
+ },
2101
+ "required": [
2102
+ "type",
2103
+ "text"
2104
+ ],
2105
+ "additionalProperties": false
2106
+ },
2107
+ {
2108
+ "type": "object",
2109
+ "properties": {
2110
+ "type": {
2111
+ "type": "string",
2112
+ "const": "input_json_delta"
2113
+ },
2114
+ "partial_json": {
2115
+ "type": "string"
2116
+ }
2117
+ },
2118
+ "required": [
2119
+ "type",
2120
+ "partial_json"
2121
+ ],
2122
+ "additionalProperties": false
2123
+ }
2124
+ ]
2125
+ }
2126
+ },
2127
+ "required": [
2128
+ "type",
2129
+ "index",
2130
+ "delta"
2131
+ ],
2132
+ "additionalProperties": false
942
2133
  },
943
- "default": {
944
- "description": "A failure decided before the first byte. After it, a stream ends with its terminal error event instead.",
945
- "headers": {
946
- "Kaana-Request-Id": {
947
- "description": "The request id; quote it when reporting a problem.",
948
- "schema": {
949
- "type": "string"
950
- }
2134
+ {
2135
+ "type": "object",
2136
+ "properties": {
2137
+ "type": {
2138
+ "type": "string",
2139
+ "const": "content_block_stop"
951
2140
  },
952
- "Kaana-Contract-Version": {
953
- "description": "The contract set that answered.",
954
- "schema": {
955
- "type": "string"
956
- }
2141
+ "index": {
2142
+ "type": "integer",
2143
+ "minimum": 0,
2144
+ "maximum": 9007199254740991
957
2145
  }
958
2146
  },
959
- "content": {
960
- "application/json": {
961
- "schema": {
962
- "$ref": "#/components/schemas/PublicError"
963
- }
964
- }
965
- }
966
- }
967
- }
968
- }
969
- },
970
- "/generations": {
971
- "get": {
972
- "summary": "The record of the generation an idempotency key produced.",
973
- "parameters": [
974
- {
975
- "name": "idempotency_key",
976
- "in": "query",
977
- "required": true,
978
- "schema": {
979
- "type": "string",
980
- "minLength": 1,
981
- "maxLength": 255
982
- }
2147
+ "required": [
2148
+ "type",
2149
+ "index"
2150
+ ],
2151
+ "additionalProperties": false
983
2152
  },
984
2153
  {
985
- "name": "X-Oxy-User-Id",
986
- "in": "header",
987
- "required": false,
988
- "description": "Delegated end user, attribution only; honoured only with an Oxy service token.",
989
- "schema": {
990
- "type": "string",
991
- "minLength": 1,
992
- "maxLength": 64
993
- }
994
- }
995
- ],
996
- "responses": {
997
- "200": {
998
- "description": "OK",
999
- "headers": {
1000
- "Kaana-Request-Id": {
1001
- "description": "The request id; quote it when reporting a problem.",
1002
- "schema": {
1003
- "type": "string"
1004
- }
2154
+ "type": "object",
2155
+ "properties": {
2156
+ "type": {
2157
+ "type": "string",
2158
+ "const": "message_delta"
1005
2159
  },
1006
- "Kaana-Contract-Version": {
1007
- "description": "The contract set that answered.",
1008
- "schema": {
1009
- "type": "string"
1010
- }
2160
+ "delta": {
2161
+ "type": "object",
2162
+ "properties": {
2163
+ "stop_reason": {
2164
+ "type": "string",
2165
+ "enum": [
2166
+ "end_turn",
2167
+ "max_tokens",
2168
+ "tool_use",
2169
+ "refusal"
2170
+ ]
2171
+ },
2172
+ "stop_sequence": {
2173
+ "type": "null",
2174
+ "const": null
2175
+ }
2176
+ },
2177
+ "required": [
2178
+ "stop_reason",
2179
+ "stop_sequence"
2180
+ ],
2181
+ "additionalProperties": false
2182
+ },
2183
+ "usage": {
2184
+ "type": "object",
2185
+ "properties": {
2186
+ "input_tokens": {
2187
+ "type": "integer",
2188
+ "minimum": 0,
2189
+ "maximum": 9007199254740991
2190
+ },
2191
+ "output_tokens": {
2192
+ "type": "integer",
2193
+ "minimum": 0,
2194
+ "maximum": 9007199254740991
2195
+ },
2196
+ "cache_read_input_tokens": {
2197
+ "type": "integer",
2198
+ "minimum": 0,
2199
+ "maximum": 9007199254740991
2200
+ }
2201
+ },
2202
+ "required": [
2203
+ "input_tokens",
2204
+ "output_tokens"
2205
+ ],
2206
+ "additionalProperties": false
1011
2207
  }
1012
2208
  },
1013
- "content": {
1014
- "application/json": {
1015
- "schema": {
1016
- "$ref": "#/components/schemas/GenerationRecord"
1017
- }
1018
- }
1019
- }
2209
+ "required": [
2210
+ "type",
2211
+ "delta",
2212
+ "usage"
2213
+ ],
2214
+ "additionalProperties": false
1020
2215
  },
1021
- "default": {
1022
- "description": "A failure decided before the first byte. After it, a stream ends with its terminal error event instead.",
1023
- "headers": {
1024
- "Kaana-Request-Id": {
1025
- "description": "The request id; quote it when reporting a problem.",
1026
- "schema": {
1027
- "type": "string"
1028
- }
1029
- },
1030
- "Kaana-Contract-Version": {
1031
- "description": "The contract set that answered.",
1032
- "schema": {
1033
- "type": "string"
1034
- }
2216
+ {
2217
+ "type": "object",
2218
+ "properties": {
2219
+ "type": {
2220
+ "type": "string",
2221
+ "const": "message_stop"
1035
2222
  }
1036
2223
  },
1037
- "content": {
1038
- "application/json": {
1039
- "schema": {
1040
- "$ref": "#/components/schemas/PublicError"
1041
- }
1042
- }
1043
- }
1044
- }
1045
- }
1046
- }
1047
- },
1048
- "/realtime": {
1049
- "get": {
1050
- "summary": "Open a realtime session over WebSocket. The first frame is RealtimeSessionOpen (or session.resume); every frame is one JSON message.",
1051
- "parameters": [
1052
- {
1053
- "name": "model",
1054
- "in": "query",
1055
- "required": true,
1056
- "schema": {
1057
- "$ref": "#/components/schemas/ModelReference"
1058
- }
1059
- }
1060
- ],
1061
- "responses": {
1062
- "101": {
1063
- "description": "Switching Protocols: the WebSocket is open."
2224
+ "required": [
2225
+ "type"
2226
+ ],
2227
+ "additionalProperties": false
1064
2228
  },
1065
- "default": {
1066
- "description": "A failure decided before the first byte. After it, a stream ends with its terminal error event instead.",
1067
- "headers": {
1068
- "Kaana-Request-Id": {
1069
- "description": "The request id; quote it when reporting a problem.",
1070
- "schema": {
1071
- "type": "string"
1072
- }
1073
- },
1074
- "Kaana-Contract-Version": {
1075
- "description": "The contract set that answered.",
1076
- "schema": {
1077
- "type": "string"
1078
- }
2229
+ {
2230
+ "type": "object",
2231
+ "properties": {
2232
+ "type": {
2233
+ "type": "string",
2234
+ "const": "ping"
1079
2235
  }
1080
2236
  },
1081
- "content": {
1082
- "application/json": {
1083
- "schema": {
1084
- "$ref": "#/components/schemas/PublicError"
1085
- }
1086
- }
1087
- }
1088
- }
1089
- },
1090
- "x-kaana-websocket": {
1091
- "open": {
1092
- "$ref": "#/components/schemas/RealtimeSessionOpen"
1093
- },
1094
- "client": {
1095
- "$ref": "#/components/schemas/RealtimeClientCommand"
2237
+ "required": [
2238
+ "type"
2239
+ ],
2240
+ "additionalProperties": false
1096
2241
  },
1097
- "server": {
1098
- "$ref": "#/components/schemas/RealtimePublicServerEvent"
2242
+ {
2243
+ "$ref": "#/components/schemas/AnthropicError"
1099
2244
  }
1100
- }
1101
- }
1102
- }
1103
- },
1104
- "components": {
1105
- "securitySchemes": {
1106
- "bearer": {
1107
- "type": "http",
1108
- "scheme": "bearer",
1109
- "description": "An oxy_sk_ key from Oxy Console, an Oxy service token for the kaana.ai audience, or an Oxy app session with inference:invoke."
1110
- }
1111
- },
1112
- "schemas": {
2245
+ ]
2246
+ },
1113
2247
  "AudioInputMediaType": {
1114
2248
  "type": "string",
1115
2249
  "enum": [
@@ -3481,6 +4615,19 @@
3481
4615
  },
3482
4616
  "realtime": {
3483
4617
  "$ref": "#/components/schemas/ModelRealtimeCapabilities"
4618
+ },
4619
+ "unreported": {
4620
+ "type": "array",
4621
+ "items": {
4622
+ "type": "string",
4623
+ "enum": [
4624
+ "tools",
4625
+ "parallelToolCalls",
4626
+ "structuredOutput",
4627
+ "jsonMode",
4628
+ "promptCaching"
4629
+ ]
4630
+ }
3484
4631
  }
3485
4632
  },
3486
4633
  "required": [
@@ -5832,7 +6979,7 @@
5832
6979
  },
5833
6980
  "description": {
5834
6981
  "type": "string",
5835
- "maxLength": 2000
6982
+ "maxLength": 32768
5836
6983
  },
5837
6984
  "parameters": {
5838
6985
  "type": "object",
@@ -6727,7 +7874,7 @@
6727
7874
  },
6728
7875
  "description": {
6729
7876
  "type": "string",
6730
- "maxLength": 2000
7877
+ "maxLength": 32768
6731
7878
  },
6732
7879
  "parameters": {
6733
7880
  "type": "object",
@@ -6932,7 +8079,8 @@
6932
8079
  "cached_audio_input_tokens",
6933
8080
  "audio_output_tokens",
6934
8081
  "session_milliseconds",
6935
- "input_transcription_milliseconds"
8082
+ "input_transcription_milliseconds",
8083
+ "cache_write_input_tokens"
6936
8084
  ]
6937
8085
  },
6938
8086
  "Voice": {