@kindgi/api 0.1.2 → 0.1.3
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/app.d.ts.map +1 -1
- package/dist/app.js +2 -1
- package/dist/app.js.map +1 -1
- package/dist/cost-binding.d.ts +81 -5
- package/dist/cost-binding.d.ts.map +1 -1
- package/dist/cost-binding.js +6 -0
- package/dist/cost-binding.js.map +1 -1
- package/dist/hitl-binding.d.ts +20 -5
- package/dist/hitl-binding.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/middleware/auth.d.ts +3 -2
- package/dist/middleware/auth.d.ts.map +1 -1
- package/dist/middleware/auth.js.map +1 -1
- package/dist/middleware/idempotency.d.ts +5 -1
- package/dist/middleware/idempotency.d.ts.map +1 -1
- package/dist/middleware/idempotency.js +8 -1
- package/dist/middleware/idempotency.js.map +1 -1
- package/dist/openapi/operations.d.ts.map +1 -1
- package/dist/openapi/operations.js +83 -18
- package/dist/openapi/operations.js.map +1 -1
- package/dist/openapi/schemas.d.ts +18 -0
- package/dist/openapi/schemas.d.ts.map +1 -1
- package/dist/openapi/schemas.js +202 -7
- package/dist/openapi/schemas.js.map +1 -1
- package/dist/provenance-binding.d.ts +27 -1
- package/dist/provenance-binding.d.ts.map +1 -1
- package/dist/provenance-binding.js.map +1 -1
- package/dist/reviewer-binding.d.ts +10 -2
- package/dist/reviewer-binding.d.ts.map +1 -1
- package/dist/reviewer-role.d.ts +13 -0
- package/dist/reviewer-role.d.ts.map +1 -0
- package/dist/reviewer-role.js +27 -0
- package/dist/reviewer-role.js.map +1 -0
- package/dist/routes/approvals.d.ts +5 -4
- package/dist/routes/approvals.d.ts.map +1 -1
- package/dist/routes/approvals.js +52 -16
- package/dist/routes/approvals.js.map +1 -1
- package/dist/routes/conversations.d.ts +7 -1
- package/dist/routes/conversations.d.ts.map +1 -1
- package/dist/routes/conversations.js +41 -1
- package/dist/routes/conversations.js.map +1 -1
- package/dist/routes/cost.d.ts.map +1 -1
- package/dist/routes/cost.js +95 -9
- package/dist/routes/cost.js.map +1 -1
- package/dist/routes/identity.d.ts +7 -0
- package/dist/routes/identity.d.ts.map +1 -1
- package/dist/routes/identity.js +3 -2
- package/dist/routes/identity.js.map +1 -1
- package/dist/routes/provenance.d.ts.map +1 -1
- package/dist/routes/provenance.js +32 -1
- package/dist/routes/provenance.js.map +1 -1
- package/dist/routes/runs.d.ts +0 -7
- package/dist/routes/runs.d.ts.map +1 -1
- package/dist/routes/runs.js +44 -20
- package/dist/routes/runs.js.map +1 -1
- package/dist/routes/scope-params.d.ts +16 -1
- package/dist/routes/scope-params.d.ts.map +1 -1
- package/dist/routes/scope-params.js +28 -0
- package/dist/routes/scope-params.js.map +1 -1
- package/dist/types.d.ts +4 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/webhook-endpoint-binding.d.ts +11 -0
- package/dist/webhook-endpoint-binding.d.ts.map +1 -1
- package/dist/webhook-endpoint-binding.js.map +1 -1
- package/openapi.json +599 -24
- package/package.json +21 -21
- package/src/app.ts +5 -1
- package/src/cost-binding.ts +96 -5
- package/src/hitl-binding.ts +20 -4
- package/src/index.ts +3 -0
- package/src/middleware/auth.ts +3 -2
- package/src/middleware/idempotency.ts +7 -1
- package/src/openapi/operations.ts +93 -18
- package/src/openapi/schemas.ts +221 -7
- package/src/provenance-binding.ts +42 -1
- package/src/reviewer-binding.ts +10 -2
- package/src/reviewer-role.ts +35 -0
- package/src/routes/approvals.ts +70 -19
- package/src/routes/conversations.ts +57 -1
- package/src/routes/cost.ts +104 -20
- package/src/routes/identity.ts +10 -2
- package/src/routes/provenance.ts +48 -1
- package/src/routes/runs.ts +54 -22
- package/src/routes/scope-params.ts +35 -1
- package/src/types.ts +4 -3
- package/src/webhook-endpoint-binding.ts +11 -0
package/openapi.json
CHANGED
|
@@ -224,6 +224,30 @@
|
|
|
224
224
|
"cancelled"
|
|
225
225
|
]
|
|
226
226
|
},
|
|
227
|
+
"RunAgent": {
|
|
228
|
+
"type": "object",
|
|
229
|
+
"additionalProperties": false,
|
|
230
|
+
"required": [
|
|
231
|
+
"id",
|
|
232
|
+
"version",
|
|
233
|
+
"conversationId"
|
|
234
|
+
],
|
|
235
|
+
"description": "Set on an agent's turn (an agent run, or the turn a flow's agent step started): the agent, the version that ran and the conversation. Absent on other runs, and on turns that ran before Kindgi 0.1.3.",
|
|
236
|
+
"properties": {
|
|
237
|
+
"id": {
|
|
238
|
+
"type": "string",
|
|
239
|
+
"description": "The agent id."
|
|
240
|
+
},
|
|
241
|
+
"version": {
|
|
242
|
+
"type": "string",
|
|
243
|
+
"description": "The agent version that ran (semver)."
|
|
244
|
+
},
|
|
245
|
+
"conversationId": {
|
|
246
|
+
"type": "string",
|
|
247
|
+
"format": "uuid"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
},
|
|
227
251
|
"Run": {
|
|
228
252
|
"type": "object",
|
|
229
253
|
"additionalProperties": false,
|
|
@@ -299,6 +323,9 @@
|
|
|
299
323
|
"type": "string",
|
|
300
324
|
"description": "Set on a child run: the node in the parent run that started it."
|
|
301
325
|
},
|
|
326
|
+
"agent": {
|
|
327
|
+
"$ref": "#/components/schemas/RunAgent"
|
|
328
|
+
},
|
|
302
329
|
"publicAccessToken": {
|
|
303
330
|
"type": "string",
|
|
304
331
|
"description": "Only in the response to `POST /v1/runs`, when the deployment issues public run tokens: a read-only token for this run (and its descendants) to hand to a browser, for `GET /v1/runs/{runId}/progress` and its stream."
|
|
@@ -511,6 +538,9 @@
|
|
|
511
538
|
"type": "string",
|
|
512
539
|
"description": "Set on a child run: the node in the parent run that started it."
|
|
513
540
|
},
|
|
541
|
+
"agent": {
|
|
542
|
+
"$ref": "#/components/schemas/RunAgent"
|
|
543
|
+
},
|
|
514
544
|
"publicAccessToken": {
|
|
515
545
|
"type": "string",
|
|
516
546
|
"description": "Only in the response to `POST /v1/runs`, when the deployment issues public run tokens: a read-only token for this run (and its descendants) to hand to a browser, for `GET /v1/runs/{runId}/progress` and its stream."
|
|
@@ -1356,6 +1386,55 @@
|
|
|
1356
1386
|
"expiresAt": {
|
|
1357
1387
|
"type": "string",
|
|
1358
1388
|
"format": "date-time"
|
|
1389
|
+
},
|
|
1390
|
+
"decision": {
|
|
1391
|
+
"description": "The reviewer's decision, once one is recorded. Absent while the approval is open, and when it ended without one (it expired, or a timeout escalated it).",
|
|
1392
|
+
"$ref": "#/components/schemas/ApprovalDecisionRecord"
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
},
|
|
1396
|
+
"ApprovalDecisionRecord": {
|
|
1397
|
+
"type": "object",
|
|
1398
|
+
"additionalProperties": false,
|
|
1399
|
+
"required": [
|
|
1400
|
+
"decision",
|
|
1401
|
+
"reviewerId",
|
|
1402
|
+
"reviewerRoleAtDecision",
|
|
1403
|
+
"decidedAt"
|
|
1404
|
+
],
|
|
1405
|
+
"properties": {
|
|
1406
|
+
"decision": {
|
|
1407
|
+
"type": "string",
|
|
1408
|
+
"enum": [
|
|
1409
|
+
"approve",
|
|
1410
|
+
"reject",
|
|
1411
|
+
"escalate",
|
|
1412
|
+
"withdraw"
|
|
1413
|
+
]
|
|
1414
|
+
},
|
|
1415
|
+
"decidedBy": {
|
|
1416
|
+
"type": "string",
|
|
1417
|
+
"description": "Who decided, as an actor: `user:<userId>`, the reviewer's user. The run's journal and provenance name the decider the same way. The Kindgi runtime always records it; a deployment whose HITL binding doesn't leaves it out."
|
|
1418
|
+
},
|
|
1419
|
+
"reviewerId": {
|
|
1420
|
+
"type": "string",
|
|
1421
|
+
"format": "uuid"
|
|
1422
|
+
},
|
|
1423
|
+
"reviewerRoleAtDecision": {
|
|
1424
|
+
"type": "string",
|
|
1425
|
+
"enum": [
|
|
1426
|
+
"standard",
|
|
1427
|
+
"senior",
|
|
1428
|
+
"admin"
|
|
1429
|
+
],
|
|
1430
|
+
"description": "Reviewer role class. Hierarchy: standard < senior < admin."
|
|
1431
|
+
},
|
|
1432
|
+
"decidedAt": {
|
|
1433
|
+
"type": "string",
|
|
1434
|
+
"format": "date-time"
|
|
1435
|
+
},
|
|
1436
|
+
"rationale": {
|
|
1437
|
+
"type": "string"
|
|
1359
1438
|
}
|
|
1360
1439
|
}
|
|
1361
1440
|
},
|
|
@@ -1452,7 +1531,7 @@
|
|
|
1452
1531
|
"type": "string"
|
|
1453
1532
|
},
|
|
1454
1533
|
"value": {
|
|
1455
|
-
"description": "Payload passed to the run waitpoint (`RunBinding.completeToken`) when the approval is linked to a suspended run and the decision is `approve` or `reject`."
|
|
1534
|
+
"description": "Payload passed to the run waitpoint (`RunBinding.completeToken`) when the approval is linked to a suspended run and the decision is `approve` or `reject`. Refused (400 `bad-input`) for an agent's tool-call or session gate (`tool-call:pending`, `agent-turn:session-hitl-gate`): those resume on the decision alone."
|
|
1456
1535
|
}
|
|
1457
1536
|
}
|
|
1458
1537
|
},
|
|
@@ -3607,6 +3686,11 @@
|
|
|
3607
3686
|
"participantId": {
|
|
3608
3687
|
"type": "string"
|
|
3609
3688
|
},
|
|
3689
|
+
"projectId": {
|
|
3690
|
+
"type": "string",
|
|
3691
|
+
"format": "uuid",
|
|
3692
|
+
"description": "The project the conversation is in: the project of the run that opened it, or `projectId` on open (the tenant's Default project when omitted). Absent on conversations from before Kindgi 0.1.3; those are listed only without a scope."
|
|
3693
|
+
},
|
|
3610
3694
|
"scope": {
|
|
3611
3695
|
"type": "object",
|
|
3612
3696
|
"additionalProperties": true,
|
|
@@ -3716,6 +3800,11 @@
|
|
|
3716
3800
|
"type": "string",
|
|
3717
3801
|
"description": "Optional. Defaults to `\"Untitled conversation\"` when omitted."
|
|
3718
3802
|
},
|
|
3803
|
+
"projectId": {
|
|
3804
|
+
"type": "string",
|
|
3805
|
+
"format": "uuid",
|
|
3806
|
+
"description": "The project the conversation is in; `GET /v1/conversations?scopeKind=project&scopeId=…` lists it. A project of the caller's tenant, else `400 bad-input`. Omitted: the tenant's Default project, as for a run."
|
|
3807
|
+
},
|
|
3719
3808
|
"scope": {
|
|
3720
3809
|
"type": "object",
|
|
3721
3810
|
"additionalProperties": true,
|
|
@@ -4859,6 +4948,11 @@
|
|
|
4859
4948
|
"createdAt": {
|
|
4860
4949
|
"type": "string",
|
|
4861
4950
|
"format": "date-time"
|
|
4951
|
+
},
|
|
4952
|
+
"projectId": {
|
|
4953
|
+
"type": "string",
|
|
4954
|
+
"format": "uuid",
|
|
4955
|
+
"description": "The project of the record's run. Absent on records from before Kindgi 0.1.3; those are listed only without a scope."
|
|
4862
4956
|
}
|
|
4863
4957
|
}
|
|
4864
4958
|
},
|
|
@@ -5040,6 +5134,33 @@
|
|
|
5040
5134
|
"createdAt": {
|
|
5041
5135
|
"type": "string",
|
|
5042
5136
|
"format": "date-time"
|
|
5137
|
+
},
|
|
5138
|
+
"callUsage": {
|
|
5139
|
+
"type": "object",
|
|
5140
|
+
"description": "Each model call's usage from the cost ledger, by the `callId` in its `model-call` node's attributes. Joined when read: not part of the signed DAG. A signed export includes it, as it stood when signed.",
|
|
5141
|
+
"additionalProperties": {
|
|
5142
|
+
"type": "object",
|
|
5143
|
+
"additionalProperties": false,
|
|
5144
|
+
"required": [
|
|
5145
|
+
"usage"
|
|
5146
|
+
],
|
|
5147
|
+
"properties": {
|
|
5148
|
+
"usage": {
|
|
5149
|
+
"$ref": "#/components/schemas/ModelCallTokens"
|
|
5150
|
+
},
|
|
5151
|
+
"costUsd": {
|
|
5152
|
+
"type": "number",
|
|
5153
|
+
"minimum": 0
|
|
5154
|
+
},
|
|
5155
|
+
"durationMs": {
|
|
5156
|
+
"type": "integer",
|
|
5157
|
+
"minimum": 0
|
|
5158
|
+
},
|
|
5159
|
+
"servedModel": {
|
|
5160
|
+
"type": "string"
|
|
5161
|
+
}
|
|
5162
|
+
}
|
|
5163
|
+
}
|
|
5043
5164
|
}
|
|
5044
5165
|
}
|
|
5045
5166
|
},
|
|
@@ -5085,7 +5206,7 @@
|
|
|
5085
5206
|
}
|
|
5086
5207
|
},
|
|
5087
5208
|
"ExportProvenanceResult": {
|
|
5088
|
-
"description": "Signed exportable bundle. `bundle` is base64 of the exact bytes that were signed (sorted-key canonical JSON, no whitespace); verifiers can pass those bytes directly to `verifyEd25519`. The bundle body itself includes `bundleSchemaVersion`, `runId`, `tenantId`, `dag: { nodes, edges }`, `messages?` (if requested), etc. See `canonicalization` for the deterministic serialization algorithm.",
|
|
5209
|
+
"description": "Signed exportable bundle. `bundle` is base64 of the exact bytes that were signed (sorted-key canonical JSON, no whitespace); verifiers can pass those bytes directly to `verifyEd25519`. The bundle body itself includes `bundleSchemaVersion`, `runId`, `tenantId`, `dag: { nodes, edges }`, `messages?` (if requested), `callUsage?` (the usage of the model calls, from the cost ledger), etc. See `canonicalization` for the deterministic serialization algorithm.",
|
|
5089
5210
|
"type": "object",
|
|
5090
5211
|
"additionalProperties": false,
|
|
5091
5212
|
"required": [
|
|
@@ -5110,7 +5231,7 @@
|
|
|
5110
5231
|
},
|
|
5111
5232
|
"bundleSchemaVersion": {
|
|
5112
5233
|
"type": "string",
|
|
5113
|
-
"description": "Semver for the shape of the bundle body. Currently `1.0.
|
|
5234
|
+
"description": "Semver for the shape of the bundle body. Currently `1.1.0`, which adds `callUsage`: each model call's usage from the cost ledger, by call id, as it stood when signed."
|
|
5114
5235
|
},
|
|
5115
5236
|
"algorithm": {
|
|
5116
5237
|
"type": "string",
|
|
@@ -6175,7 +6296,13 @@
|
|
|
6175
6296
|
"day",
|
|
6176
6297
|
"month",
|
|
6177
6298
|
"tenant",
|
|
6178
|
-
"conversationId"
|
|
6299
|
+
"conversationId",
|
|
6300
|
+
"model",
|
|
6301
|
+
"servedModel",
|
|
6302
|
+
"projectId",
|
|
6303
|
+
"orgId",
|
|
6304
|
+
"rootRunId",
|
|
6305
|
+
"flowId"
|
|
6179
6306
|
]
|
|
6180
6307
|
},
|
|
6181
6308
|
"CostRecord": {
|
|
@@ -6240,6 +6367,184 @@
|
|
|
6240
6367
|
"type": "object",
|
|
6241
6368
|
"additionalProperties": true,
|
|
6242
6369
|
"description": "Free-form filter/display tags — never counters."
|
|
6370
|
+
},
|
|
6371
|
+
"callId": {
|
|
6372
|
+
"type": "string",
|
|
6373
|
+
"description": "A model call's id (`category` `llm.inference`); its provenance `model-call` node carries it too."
|
|
6374
|
+
},
|
|
6375
|
+
"projectId": {
|
|
6376
|
+
"type": "string",
|
|
6377
|
+
"format": "uuid"
|
|
6378
|
+
},
|
|
6379
|
+
"rootRunId": {
|
|
6380
|
+
"type": "string",
|
|
6381
|
+
"format": "uuid",
|
|
6382
|
+
"description": "The root of the record's run tree (a flow run, for its agent turns)."
|
|
6383
|
+
},
|
|
6384
|
+
"parentRunId": {
|
|
6385
|
+
"type": "string",
|
|
6386
|
+
"format": "uuid"
|
|
6387
|
+
},
|
|
6388
|
+
"agentVersion": {
|
|
6389
|
+
"type": "string"
|
|
6390
|
+
},
|
|
6391
|
+
"flowId": {
|
|
6392
|
+
"type": "string",
|
|
6393
|
+
"description": "The flow of the run tree's root."
|
|
6394
|
+
},
|
|
6395
|
+
"nodeId": {
|
|
6396
|
+
"type": "string",
|
|
6397
|
+
"description": "The step that made the call."
|
|
6398
|
+
},
|
|
6399
|
+
"step": {
|
|
6400
|
+
"type": "integer",
|
|
6401
|
+
"minimum": 1,
|
|
6402
|
+
"description": "The turn's step number."
|
|
6403
|
+
},
|
|
6404
|
+
"purpose": {
|
|
6405
|
+
"type": "string",
|
|
6406
|
+
"description": "What the call was for, beyond the turn's own model step: `guardrail-judge:<guardrail id>`."
|
|
6407
|
+
},
|
|
6408
|
+
"model": {
|
|
6409
|
+
"type": "string",
|
|
6410
|
+
"description": "The model actually called."
|
|
6411
|
+
},
|
|
6412
|
+
"servedModel": {
|
|
6413
|
+
"type": "string",
|
|
6414
|
+
"description": "The exact model version the vendor reported (vendors alias)."
|
|
6415
|
+
},
|
|
6416
|
+
"fallback": {
|
|
6417
|
+
"type": "boolean",
|
|
6418
|
+
"description": "The router picked a fallback provider for the turn."
|
|
6419
|
+
},
|
|
6420
|
+
"status": {
|
|
6421
|
+
"type": "string",
|
|
6422
|
+
"enum": [
|
|
6423
|
+
"ok",
|
|
6424
|
+
"failed"
|
|
6425
|
+
],
|
|
6426
|
+
"description": "`ok`: the provider answered. `failed`: the call threw."
|
|
6427
|
+
},
|
|
6428
|
+
"usage": {
|
|
6429
|
+
"$ref": "#/components/schemas/ModelCallTokens"
|
|
6430
|
+
},
|
|
6431
|
+
"durationMs": {
|
|
6432
|
+
"type": "integer",
|
|
6433
|
+
"minimum": 0
|
|
6434
|
+
},
|
|
6435
|
+
"finishReason": {
|
|
6436
|
+
"type": "string"
|
|
6437
|
+
},
|
|
6438
|
+
"providerRequestId": {
|
|
6439
|
+
"type": "string",
|
|
6440
|
+
"description": "The vendor's id for the request."
|
|
6441
|
+
},
|
|
6442
|
+
"attempts": {
|
|
6443
|
+
"type": "integer",
|
|
6444
|
+
"minimum": 1,
|
|
6445
|
+
"description": "HTTP attempts the call took, the client's retries included."
|
|
6446
|
+
},
|
|
6447
|
+
"error": {
|
|
6448
|
+
"$ref": "#/components/schemas/ModelCallError"
|
|
6449
|
+
},
|
|
6450
|
+
"rawUsage": {
|
|
6451
|
+
"type": "object",
|
|
6452
|
+
"additionalProperties": false,
|
|
6453
|
+
"required": [
|
|
6454
|
+
"provider",
|
|
6455
|
+
"model",
|
|
6456
|
+
"usage"
|
|
6457
|
+
],
|
|
6458
|
+
"description": "The vendor's own usage object, exactly as it reported it. Only with `include=rawUsage`.",
|
|
6459
|
+
"properties": {
|
|
6460
|
+
"provider": {
|
|
6461
|
+
"type": "string"
|
|
6462
|
+
},
|
|
6463
|
+
"model": {
|
|
6464
|
+
"type": "string"
|
|
6465
|
+
},
|
|
6466
|
+
"usage": {
|
|
6467
|
+
"type": "object",
|
|
6468
|
+
"additionalProperties": true
|
|
6469
|
+
}
|
|
6470
|
+
}
|
|
6471
|
+
}
|
|
6472
|
+
}
|
|
6473
|
+
},
|
|
6474
|
+
"ModelCallTokens": {
|
|
6475
|
+
"type": "object",
|
|
6476
|
+
"additionalProperties": false,
|
|
6477
|
+
"required": [
|
|
6478
|
+
"promptTokens",
|
|
6479
|
+
"completionTokens"
|
|
6480
|
+
],
|
|
6481
|
+
"description": "The call's tokens. `promptTokens` / `completionTokens` are the totals; `cacheReadTokens` / `cacheWriteTokens` are parts of `promptTokens`, `reasoningTokens` of `completionTokens`, present when the provider reports them.",
|
|
6482
|
+
"properties": {
|
|
6483
|
+
"promptTokens": {
|
|
6484
|
+
"type": "integer",
|
|
6485
|
+
"minimum": 0
|
|
6486
|
+
},
|
|
6487
|
+
"completionTokens": {
|
|
6488
|
+
"type": "integer",
|
|
6489
|
+
"minimum": 0
|
|
6490
|
+
},
|
|
6491
|
+
"cacheReadTokens": {
|
|
6492
|
+
"type": "integer",
|
|
6493
|
+
"minimum": 0
|
|
6494
|
+
},
|
|
6495
|
+
"cacheWriteTokens": {
|
|
6496
|
+
"type": "integer",
|
|
6497
|
+
"minimum": 0
|
|
6498
|
+
},
|
|
6499
|
+
"reasoningTokens": {
|
|
6500
|
+
"type": "integer",
|
|
6501
|
+
"minimum": 0
|
|
6502
|
+
}
|
|
6503
|
+
}
|
|
6504
|
+
},
|
|
6505
|
+
"ModelCallError": {
|
|
6506
|
+
"type": "object",
|
|
6507
|
+
"additionalProperties": false,
|
|
6508
|
+
"required": [
|
|
6509
|
+
"message"
|
|
6510
|
+
],
|
|
6511
|
+
"description": "Why a model call failed (`status: failed`).",
|
|
6512
|
+
"properties": {
|
|
6513
|
+
"message": {
|
|
6514
|
+
"type": "string"
|
|
6515
|
+
}
|
|
6516
|
+
}
|
|
6517
|
+
},
|
|
6518
|
+
"CostTokenTotals": {
|
|
6519
|
+
"type": "object",
|
|
6520
|
+
"additionalProperties": false,
|
|
6521
|
+
"required": [
|
|
6522
|
+
"prompt",
|
|
6523
|
+
"completion",
|
|
6524
|
+
"cacheRead",
|
|
6525
|
+
"cacheWrite",
|
|
6526
|
+
"reasoning"
|
|
6527
|
+
],
|
|
6528
|
+
"properties": {
|
|
6529
|
+
"prompt": {
|
|
6530
|
+
"type": "integer",
|
|
6531
|
+
"minimum": 0
|
|
6532
|
+
},
|
|
6533
|
+
"completion": {
|
|
6534
|
+
"type": "integer",
|
|
6535
|
+
"minimum": 0
|
|
6536
|
+
},
|
|
6537
|
+
"cacheRead": {
|
|
6538
|
+
"type": "integer",
|
|
6539
|
+
"minimum": 0
|
|
6540
|
+
},
|
|
6541
|
+
"cacheWrite": {
|
|
6542
|
+
"type": "integer",
|
|
6543
|
+
"minimum": 0
|
|
6544
|
+
},
|
|
6545
|
+
"reasoning": {
|
|
6546
|
+
"type": "integer",
|
|
6547
|
+
"minimum": 0
|
|
6243
6548
|
}
|
|
6244
6549
|
}
|
|
6245
6550
|
},
|
|
@@ -6271,7 +6576,8 @@
|
|
|
6271
6576
|
"required": [
|
|
6272
6577
|
"key",
|
|
6273
6578
|
"count",
|
|
6274
|
-
"totalUsd"
|
|
6579
|
+
"totalUsd",
|
|
6580
|
+
"tokens"
|
|
6275
6581
|
],
|
|
6276
6582
|
"properties": {
|
|
6277
6583
|
"key": {
|
|
@@ -6291,6 +6597,9 @@
|
|
|
6291
6597
|
"totalUsd": {
|
|
6292
6598
|
"type": "number",
|
|
6293
6599
|
"minimum": 0
|
|
6600
|
+
},
|
|
6601
|
+
"tokens": {
|
|
6602
|
+
"$ref": "#/components/schemas/CostTokenTotals"
|
|
6294
6603
|
}
|
|
6295
6604
|
}
|
|
6296
6605
|
},
|
|
@@ -6301,6 +6610,7 @@
|
|
|
6301
6610
|
"groups",
|
|
6302
6611
|
"totalUsd",
|
|
6303
6612
|
"totalRecords",
|
|
6613
|
+
"tokens",
|
|
6304
6614
|
"timeRange",
|
|
6305
6615
|
"groupBy"
|
|
6306
6616
|
],
|
|
@@ -6319,6 +6629,9 @@
|
|
|
6319
6629
|
"type": "integer",
|
|
6320
6630
|
"minimum": 0
|
|
6321
6631
|
},
|
|
6632
|
+
"tokens": {
|
|
6633
|
+
"$ref": "#/components/schemas/CostTokenTotals"
|
|
6634
|
+
},
|
|
6322
6635
|
"timeRange": {
|
|
6323
6636
|
"type": "object",
|
|
6324
6637
|
"additionalProperties": false,
|
|
@@ -7329,7 +7642,7 @@
|
|
|
7329
7642
|
}
|
|
7330
7643
|
},
|
|
7331
7644
|
"WhoamiResult": {
|
|
7332
|
-
"description": "Introspection of the caller's current authentication context. Always carries `tenantId` and `scopes` (empty for static bearer tokens), plus `userId` when the token carries one; session-token callers additionally see `sessionId`, `providerId`, and `expiresAt`. `user` is the caller's directory record, present when the deployment wires an identity directory and it knows the `userId`. `reviewerRole` is set when the token carries a reviewer role — clients can
|
|
7645
|
+
"description": "Introspection of the caller's current authentication context. Always carries `tenantId` and `scopes` (empty for static bearer tokens), plus `userId` when the token carries one; session-token callers additionally see `sessionId`, `providerId`, and `expiresAt`. `user` is the caller's directory record, present when the deployment wires an identity directory and it knows the `userId`. `reviewerRole` is set when the caller is a reviewer — its token carries a reviewer role, or its user is a registered reviewer — so clients can gate reviewer-only UI (the approvals surface) without a second round trip.",
|
|
7333
7646
|
"type": "object",
|
|
7334
7647
|
"additionalProperties": false,
|
|
7335
7648
|
"required": [
|
|
@@ -10697,6 +11010,29 @@
|
|
|
10697
11010
|
}
|
|
10698
11011
|
}
|
|
10699
11012
|
},
|
|
11013
|
+
"RunTreeUsage": {
|
|
11014
|
+
"type": "object",
|
|
11015
|
+
"additionalProperties": false,
|
|
11016
|
+
"required": [
|
|
11017
|
+
"calls",
|
|
11018
|
+
"costUsd",
|
|
11019
|
+
"tokens"
|
|
11020
|
+
],
|
|
11021
|
+
"description": "The model calls of the run tree (this run and every run it started) that the cost ledger had recorded when this run finished: a child run still running then isn't in it. `calls` counts failed calls too. Absent when the runtime records no usage.",
|
|
11022
|
+
"properties": {
|
|
11023
|
+
"calls": {
|
|
11024
|
+
"type": "integer",
|
|
11025
|
+
"minimum": 0
|
|
11026
|
+
},
|
|
11027
|
+
"costUsd": {
|
|
11028
|
+
"type": "number",
|
|
11029
|
+
"minimum": 0
|
|
11030
|
+
},
|
|
11031
|
+
"tokens": {
|
|
11032
|
+
"$ref": "#/components/schemas/CostTokenTotals"
|
|
11033
|
+
}
|
|
11034
|
+
}
|
|
11035
|
+
},
|
|
10700
11036
|
"FinishedRun": {
|
|
10701
11037
|
"type": "object",
|
|
10702
11038
|
"additionalProperties": false,
|
|
@@ -10753,6 +11089,9 @@
|
|
|
10753
11089
|
"completedAt": {
|
|
10754
11090
|
"type": "string",
|
|
10755
11091
|
"format": "date-time"
|
|
11092
|
+
},
|
|
11093
|
+
"usage": {
|
|
11094
|
+
"$ref": "#/components/schemas/RunTreeUsage"
|
|
10756
11095
|
}
|
|
10757
11096
|
}
|
|
10758
11097
|
},
|
|
@@ -11149,7 +11488,7 @@
|
|
|
11149
11488
|
}
|
|
11150
11489
|
},
|
|
11151
11490
|
"400": {
|
|
11152
|
-
"description": "Malformed cursor or
|
|
11491
|
+
"description": "Malformed cursor, filter or scope.",
|
|
11153
11492
|
"content": {
|
|
11154
11493
|
"application/json": {
|
|
11155
11494
|
"schema": {
|
|
@@ -11192,6 +11531,25 @@
|
|
|
11192
11531
|
"required": false,
|
|
11193
11532
|
"description": "Opaque cursor from a prior response. Absent → first page."
|
|
11194
11533
|
},
|
|
11534
|
+
{
|
|
11535
|
+
"name": "scopeKind",
|
|
11536
|
+
"in": "query",
|
|
11537
|
+
"schema": {
|
|
11538
|
+
"$ref": "#/components/schemas/ScopeKind"
|
|
11539
|
+
},
|
|
11540
|
+
"required": false,
|
|
11541
|
+
"description": "Optional scope discriminator. If absent, no scope filter is applied."
|
|
11542
|
+
},
|
|
11543
|
+
{
|
|
11544
|
+
"name": "scopeId",
|
|
11545
|
+
"in": "query",
|
|
11546
|
+
"schema": {
|
|
11547
|
+
"type": "string",
|
|
11548
|
+
"minLength": 1
|
|
11549
|
+
},
|
|
11550
|
+
"required": false,
|
|
11551
|
+
"description": "Required IF scopeKind is `org` or `project`. MUST be absent if scopeKind=`tenant` (tenant is implicit from the session). Malformed combinations return 400 scope-invalid."
|
|
11552
|
+
},
|
|
11195
11553
|
{
|
|
11196
11554
|
"name": "parentRunId",
|
|
11197
11555
|
"in": "query",
|
|
@@ -11211,6 +11569,16 @@
|
|
|
11211
11569
|
"required": false,
|
|
11212
11570
|
"description": "When true, only runs that are not a child of another run."
|
|
11213
11571
|
},
|
|
11572
|
+
{
|
|
11573
|
+
"name": "agentId",
|
|
11574
|
+
"in": "query",
|
|
11575
|
+
"schema": {
|
|
11576
|
+
"type": "string",
|
|
11577
|
+
"minLength": 1
|
|
11578
|
+
},
|
|
11579
|
+
"required": false,
|
|
11580
|
+
"description": "Only this agent's turns, at any version. Turns that ran before Kindgi 0.1.3 don't name their agent and aren't matched."
|
|
11581
|
+
},
|
|
11214
11582
|
{
|
|
11215
11583
|
"name": "include",
|
|
11216
11584
|
"in": "query",
|
|
@@ -11249,6 +11617,16 @@
|
|
|
11249
11617
|
}
|
|
11250
11618
|
}
|
|
11251
11619
|
},
|
|
11620
|
+
"400": {
|
|
11621
|
+
"description": "`runId` is not a run id (a UUID).",
|
|
11622
|
+
"content": {
|
|
11623
|
+
"application/json": {
|
|
11624
|
+
"schema": {
|
|
11625
|
+
"$ref": "#/components/schemas/WireError"
|
|
11626
|
+
}
|
|
11627
|
+
}
|
|
11628
|
+
}
|
|
11629
|
+
},
|
|
11252
11630
|
"401": {
|
|
11253
11631
|
"description": "Missing / malformed / expired / revoked bearer token.",
|
|
11254
11632
|
"content": {
|
|
@@ -11505,6 +11883,16 @@
|
|
|
11505
11883
|
}
|
|
11506
11884
|
}
|
|
11507
11885
|
},
|
|
11886
|
+
"400": {
|
|
11887
|
+
"description": "`runId` is not a run id (a UUID).",
|
|
11888
|
+
"content": {
|
|
11889
|
+
"application/json": {
|
|
11890
|
+
"schema": {
|
|
11891
|
+
"$ref": "#/components/schemas/WireError"
|
|
11892
|
+
}
|
|
11893
|
+
}
|
|
11894
|
+
}
|
|
11895
|
+
},
|
|
11508
11896
|
"401": {
|
|
11509
11897
|
"description": "Missing / malformed / expired / revoked bearer token.",
|
|
11510
11898
|
"content": {
|
|
@@ -11574,6 +11962,16 @@
|
|
|
11574
11962
|
}
|
|
11575
11963
|
}
|
|
11576
11964
|
},
|
|
11965
|
+
"400": {
|
|
11966
|
+
"description": "`runId` is not a run id (a UUID).",
|
|
11967
|
+
"content": {
|
|
11968
|
+
"application/json": {
|
|
11969
|
+
"schema": {
|
|
11970
|
+
"$ref": "#/components/schemas/WireError"
|
|
11971
|
+
}
|
|
11972
|
+
}
|
|
11973
|
+
}
|
|
11974
|
+
},
|
|
11577
11975
|
"401": {
|
|
11578
11976
|
"description": "Missing / malformed / expired / revoked bearer token.",
|
|
11579
11977
|
"content": {
|
|
@@ -11642,6 +12040,16 @@
|
|
|
11642
12040
|
}
|
|
11643
12041
|
}
|
|
11644
12042
|
},
|
|
12043
|
+
"400": {
|
|
12044
|
+
"description": "`runId` is not a run id (a UUID).",
|
|
12045
|
+
"content": {
|
|
12046
|
+
"application/json": {
|
|
12047
|
+
"schema": {
|
|
12048
|
+
"$ref": "#/components/schemas/WireError"
|
|
12049
|
+
}
|
|
12050
|
+
}
|
|
12051
|
+
}
|
|
12052
|
+
},
|
|
11645
12053
|
"401": {
|
|
11646
12054
|
"description": "Missing / malformed / expired / revoked bearer token.",
|
|
11647
12055
|
"content": {
|
|
@@ -11704,6 +12112,16 @@
|
|
|
11704
12112
|
}
|
|
11705
12113
|
}
|
|
11706
12114
|
},
|
|
12115
|
+
"400": {
|
|
12116
|
+
"description": "`runId` is not a run id (a UUID).",
|
|
12117
|
+
"content": {
|
|
12118
|
+
"application/json": {
|
|
12119
|
+
"schema": {
|
|
12120
|
+
"$ref": "#/components/schemas/WireError"
|
|
12121
|
+
}
|
|
12122
|
+
}
|
|
12123
|
+
}
|
|
12124
|
+
},
|
|
11707
12125
|
"401": {
|
|
11708
12126
|
"description": "Missing / malformed / expired / revoked bearer token.",
|
|
11709
12127
|
"content": {
|
|
@@ -12575,7 +12993,7 @@
|
|
|
12575
12993
|
}
|
|
12576
12994
|
},
|
|
12577
12995
|
"400": {
|
|
12578
|
-
"description": "Malformed query parameter.",
|
|
12996
|
+
"description": "Malformed query parameter or scope.",
|
|
12579
12997
|
"content": {
|
|
12580
12998
|
"application/json": {
|
|
12581
12999
|
"schema": {
|
|
@@ -12595,7 +13013,7 @@
|
|
|
12595
13013
|
}
|
|
12596
13014
|
},
|
|
12597
13015
|
"403": {
|
|
12598
|
-
"description": "
|
|
13016
|
+
"description": "The caller isn't a reviewer, or asked for a tier above its own.",
|
|
12599
13017
|
"content": {
|
|
12600
13018
|
"application/json": {
|
|
12601
13019
|
"schema": {
|
|
@@ -12605,7 +13023,7 @@
|
|
|
12605
13023
|
}
|
|
12606
13024
|
}
|
|
12607
13025
|
},
|
|
12608
|
-
"description": "Requires
|
|
13026
|
+
"description": "Requires a reviewer: a token that carries a `reviewerRole`, or whose user is a registered reviewer (the roster gives the role). Role-scoped: reviewers only see approvals whose `requiredRole` rank ≤ their rank (standard < senior < admin). `scopeKind`/`scopeId` narrow to one project's approvals, or every project's in an org; approvals from before Kindgi 0.1.3 have no project and are listed only without a scope.",
|
|
12609
13027
|
"parameters": [
|
|
12610
13028
|
{
|
|
12611
13029
|
"name": "limit",
|
|
@@ -12628,6 +13046,25 @@
|
|
|
12628
13046
|
"required": false,
|
|
12629
13047
|
"description": "Opaque cursor from a prior response. Absent → first page."
|
|
12630
13048
|
},
|
|
13049
|
+
{
|
|
13050
|
+
"name": "scopeKind",
|
|
13051
|
+
"in": "query",
|
|
13052
|
+
"schema": {
|
|
13053
|
+
"$ref": "#/components/schemas/ScopeKind"
|
|
13054
|
+
},
|
|
13055
|
+
"required": false,
|
|
13056
|
+
"description": "Optional scope discriminator. If absent, no scope filter is applied."
|
|
13057
|
+
},
|
|
13058
|
+
{
|
|
13059
|
+
"name": "scopeId",
|
|
13060
|
+
"in": "query",
|
|
13061
|
+
"schema": {
|
|
13062
|
+
"type": "string",
|
|
13063
|
+
"minLength": 1
|
|
13064
|
+
},
|
|
13065
|
+
"required": false,
|
|
13066
|
+
"description": "Required IF scopeKind is `org` or `project`. MUST be absent if scopeKind=`tenant` (tenant is implicit from the session). Malformed combinations return 400 scope-invalid."
|
|
13067
|
+
},
|
|
12631
13068
|
{
|
|
12632
13069
|
"name": "status",
|
|
12633
13070
|
"in": "query",
|
|
@@ -12693,7 +13130,7 @@
|
|
|
12693
13130
|
}
|
|
12694
13131
|
},
|
|
12695
13132
|
"403": {
|
|
12696
|
-
"description": "
|
|
13133
|
+
"description": "The caller isn't a reviewer.",
|
|
12697
13134
|
"content": {
|
|
12698
13135
|
"application/json": {
|
|
12699
13136
|
"schema": {
|
|
@@ -12713,7 +13150,7 @@
|
|
|
12713
13150
|
}
|
|
12714
13151
|
}
|
|
12715
13152
|
},
|
|
12716
|
-
"description": "Returns 404 for ids that exist but require a higher role than the caller (avoids cross-tier existence leaks — see API-ROUTE-CONVENTIONS.md §2.4).",
|
|
13153
|
+
"description": "Returns 404 for ids that exist but require a higher role than the caller (avoids cross-tier existence leaks — see API-ROUTE-CONVENTIONS.md §2.4). A decided approval carries its `decision`: what the reviewer decided, why, and who (`decidedBy`, `user:<userId>`).",
|
|
12717
13154
|
"parameters": [
|
|
12718
13155
|
{
|
|
12719
13156
|
"name": "approvalId",
|
|
@@ -12812,7 +13249,7 @@
|
|
|
12812
13249
|
}
|
|
12813
13250
|
}
|
|
12814
13251
|
},
|
|
12815
|
-
"description": "Records the decision (`HitlBinding.submitReview`). When the approval carries a `waitTokenId` and the decision is `approve` or `reject`, also completes the waitpoint so the suspended run resumes.",
|
|
13252
|
+
"description": "Records the decision (`HitlBinding.submitReview`). When the approval carries a `waitTokenId` and the decision is `approve` or `reject`, also completes the waitpoint so the suspended run resumes, with `{ decided, rationale?, decidedBy, approvalId }`: the run's journal records who decided which approval (`decidedBy` is `user:<userId>`).",
|
|
12816
13253
|
"parameters": [
|
|
12817
13254
|
{
|
|
12818
13255
|
"name": "approvalId",
|
|
@@ -13214,7 +13651,7 @@
|
|
|
13214
13651
|
}
|
|
13215
13652
|
},
|
|
13216
13653
|
"403": {
|
|
13217
|
-
"description": "
|
|
13654
|
+
"description": "The caller isn't a reviewer.",
|
|
13218
13655
|
"content": {
|
|
13219
13656
|
"application/json": {
|
|
13220
13657
|
"schema": {
|
|
@@ -15513,7 +15950,7 @@
|
|
|
15513
15950
|
}
|
|
15514
15951
|
},
|
|
15515
15952
|
"400": {
|
|
15516
|
-
"description": "Malformed query parameter.",
|
|
15953
|
+
"description": "Malformed query parameter or scope.",
|
|
15517
15954
|
"content": {
|
|
15518
15955
|
"application/json": {
|
|
15519
15956
|
"schema": {
|
|
@@ -15533,7 +15970,7 @@
|
|
|
15533
15970
|
}
|
|
15534
15971
|
}
|
|
15535
15972
|
},
|
|
15536
|
-
"description": "Cursor-paginated. Fixed sort: `openedAt desc, id desc`. Filters: `?agentId=`, `?status=open|closed
|
|
15973
|
+
"description": "Cursor-paginated. Fixed sort: `openedAt desc, id desc`. Filters: `?agentId=`, `?status=open|closed`, and `scopeKind`/`scopeId` for one project's conversations, or every project's in an org. Conversations from before Kindgi 0.1.3 have no project and are listed only without a scope.",
|
|
15537
15974
|
"parameters": [
|
|
15538
15975
|
{
|
|
15539
15976
|
"name": "limit",
|
|
@@ -15556,6 +15993,25 @@
|
|
|
15556
15993
|
"required": false,
|
|
15557
15994
|
"description": "Opaque cursor from a prior response. Absent → first page."
|
|
15558
15995
|
},
|
|
15996
|
+
{
|
|
15997
|
+
"name": "scopeKind",
|
|
15998
|
+
"in": "query",
|
|
15999
|
+
"schema": {
|
|
16000
|
+
"$ref": "#/components/schemas/ScopeKind"
|
|
16001
|
+
},
|
|
16002
|
+
"required": false,
|
|
16003
|
+
"description": "Optional scope discriminator. If absent, no scope filter is applied."
|
|
16004
|
+
},
|
|
16005
|
+
{
|
|
16006
|
+
"name": "scopeId",
|
|
16007
|
+
"in": "query",
|
|
16008
|
+
"schema": {
|
|
16009
|
+
"type": "string",
|
|
16010
|
+
"minLength": 1
|
|
16011
|
+
},
|
|
16012
|
+
"required": false,
|
|
16013
|
+
"description": "Required IF scopeKind is `org` or `project`. MUST be absent if scopeKind=`tenant` (tenant is implicit from the session). Malformed combinations return 400 scope-invalid."
|
|
16014
|
+
},
|
|
15559
16015
|
{
|
|
15560
16016
|
"name": "agentId",
|
|
15561
16017
|
"in": "query",
|
|
@@ -15638,7 +16094,7 @@
|
|
|
15638
16094
|
}
|
|
15639
16095
|
}
|
|
15640
16096
|
},
|
|
15641
|
-
"description": "Pins `(agentId, agentVersion)` at open time. `title` defaults to `\"Untitled conversation\"` when omitted; `scope` accepts arbitrary JSON.",
|
|
16097
|
+
"description": "Pins `(agentId, agentVersion)` at open time. `title` defaults to `\"Untitled conversation\"` when omitted; `projectId` puts it in a project (lists filter by it; omitted, the Default project); `scope` accepts arbitrary JSON.",
|
|
15642
16098
|
"parameters": [
|
|
15643
16099
|
{
|
|
15644
16100
|
"name": "Idempotency-Key",
|
|
@@ -17317,7 +17773,7 @@
|
|
|
17317
17773
|
}
|
|
17318
17774
|
},
|
|
17319
17775
|
"400": {
|
|
17320
|
-
"description": "Malformed cursor
|
|
17776
|
+
"description": "Malformed cursor, `createdAfter` timestamp or scope.",
|
|
17321
17777
|
"content": {
|
|
17322
17778
|
"application/json": {
|
|
17323
17779
|
"schema": {
|
|
@@ -17337,7 +17793,7 @@
|
|
|
17337
17793
|
}
|
|
17338
17794
|
}
|
|
17339
17795
|
},
|
|
17340
|
-
"description": "Cursor-paginated. Metadata rows only — clients fetch the DAG payload via `GET /v1/provenance/{runId}`. Fixed sort: `createdAt desc, id desc`. Filters: `?runId=`, `?agentId=`, `?createdAfter
|
|
17796
|
+
"description": "Cursor-paginated. Metadata rows only — clients fetch the DAG payload via `GET /v1/provenance/{runId}`. Fixed sort: `createdAt desc, id desc`. Filters: `?runId=`, `?agentId=`, `?createdAfter=`, and `scopeKind`/`scopeId` for one project's records, or every project's in an org (records from before Kindgi 0.1.3 have no project and are listed only without a scope).",
|
|
17341
17797
|
"parameters": [
|
|
17342
17798
|
{
|
|
17343
17799
|
"name": "limit",
|
|
@@ -17360,6 +17816,25 @@
|
|
|
17360
17816
|
"required": false,
|
|
17361
17817
|
"description": "Opaque cursor from a prior response. Absent → first page."
|
|
17362
17818
|
},
|
|
17819
|
+
{
|
|
17820
|
+
"name": "scopeKind",
|
|
17821
|
+
"in": "query",
|
|
17822
|
+
"schema": {
|
|
17823
|
+
"$ref": "#/components/schemas/ScopeKind"
|
|
17824
|
+
},
|
|
17825
|
+
"required": false,
|
|
17826
|
+
"description": "Optional scope discriminator. If absent, no scope filter is applied."
|
|
17827
|
+
},
|
|
17828
|
+
{
|
|
17829
|
+
"name": "scopeId",
|
|
17830
|
+
"in": "query",
|
|
17831
|
+
"schema": {
|
|
17832
|
+
"type": "string",
|
|
17833
|
+
"minLength": 1
|
|
17834
|
+
},
|
|
17835
|
+
"required": false,
|
|
17836
|
+
"description": "Required IF scopeKind is `org` or `project`. MUST be absent if scopeKind=`tenant` (tenant is implicit from the session). Malformed combinations return 400 scope-invalid."
|
|
17837
|
+
},
|
|
17363
17838
|
{
|
|
17364
17839
|
"name": "runId",
|
|
17365
17840
|
"in": "query",
|
|
@@ -19264,7 +19739,7 @@
|
|
|
19264
19739
|
}
|
|
19265
19740
|
}
|
|
19266
19741
|
},
|
|
19267
|
-
"description": "Cursor-paginated. Filters (all AND): `runId`, `agentId`, `conversationId`, `category`, `providerId`, `from`, `to`. Sort order is fixed: `occurredAt desc, id desc`. Records represent one accounted resource event each —
|
|
19742
|
+
"description": "Cursor-paginated. Filters (all AND): `runId` (with `includeDescendants`, its whole subtree), `rootRunId`, `agentId`, `conversationId`, `category`, `providerId`, `model`, `servedModel`, `from`, `to`. Sort order is fixed: `occurredAt desc, id desc`. Records represent one accounted resource event each — a model call (`category` `llm.inference`: one record per call, with its model, usage and what the vendor said about it), tool invocation, storage write, sandbox execution, etc. `include=rawUsage` adds each model call's usage as the vendor reported it.",
|
|
19268
19743
|
"parameters": [
|
|
19269
19744
|
{
|
|
19270
19745
|
"name": "limit",
|
|
@@ -19334,6 +19809,44 @@
|
|
|
19334
19809
|
"required": false,
|
|
19335
19810
|
"description": "Filter records to this provider id (exact match)."
|
|
19336
19811
|
},
|
|
19812
|
+
{
|
|
19813
|
+
"name": "model",
|
|
19814
|
+
"in": "query",
|
|
19815
|
+
"schema": {
|
|
19816
|
+
"type": "string"
|
|
19817
|
+
},
|
|
19818
|
+
"required": false,
|
|
19819
|
+
"description": "Filter model calls to this model, the one actually called (exact match)."
|
|
19820
|
+
},
|
|
19821
|
+
{
|
|
19822
|
+
"name": "servedModel",
|
|
19823
|
+
"in": "query",
|
|
19824
|
+
"schema": {
|
|
19825
|
+
"type": "string"
|
|
19826
|
+
},
|
|
19827
|
+
"required": false,
|
|
19828
|
+
"description": "Filter model calls to the exact model version the vendor reported (exact match)."
|
|
19829
|
+
},
|
|
19830
|
+
{
|
|
19831
|
+
"name": "rootRunId",
|
|
19832
|
+
"in": "query",
|
|
19833
|
+
"schema": {
|
|
19834
|
+
"type": "string",
|
|
19835
|
+
"format": "uuid"
|
|
19836
|
+
},
|
|
19837
|
+
"required": false,
|
|
19838
|
+
"description": "Every record of the run tree whose root is this run: a flow run and the agent turns and sub-flows it started."
|
|
19839
|
+
},
|
|
19840
|
+
{
|
|
19841
|
+
"name": "includeDescendants",
|
|
19842
|
+
"in": "query",
|
|
19843
|
+
"schema": {
|
|
19844
|
+
"type": "boolean",
|
|
19845
|
+
"default": false
|
|
19846
|
+
},
|
|
19847
|
+
"required": false,
|
|
19848
|
+
"description": "With `runId`: the run's records and those of every run it started, at any depth. `true` or `false` (default)."
|
|
19849
|
+
},
|
|
19337
19850
|
{
|
|
19338
19851
|
"name": "from",
|
|
19339
19852
|
"in": "query",
|
|
@@ -19352,7 +19865,7 @@
|
|
|
19352
19865
|
"format": "date-time"
|
|
19353
19866
|
},
|
|
19354
19867
|
"required": false,
|
|
19355
|
-
"description": "ISO 8601 timestamp; records with `occurredAt
|
|
19868
|
+
"description": "ISO 8601 timestamp; records with `occurredAt < to` (exclusive). Required on `/v1/cost/aggregate` (or both endpoints omitted for default last-30-days window)."
|
|
19356
19869
|
},
|
|
19357
19870
|
{
|
|
19358
19871
|
"name": "scopeKind",
|
|
@@ -19382,6 +19895,18 @@
|
|
|
19382
19895
|
},
|
|
19383
19896
|
"required": false,
|
|
19384
19897
|
"description": "Default `true`. `false` = literal-at-this-scope only (admin/audit view). Load-bearing for policy/config-scoped resources (mcp-endpoints); documented no-op for content-scoped resources (agents/flows/tools/...)."
|
|
19898
|
+
},
|
|
19899
|
+
{
|
|
19900
|
+
"name": "include",
|
|
19901
|
+
"in": "query",
|
|
19902
|
+
"schema": {
|
|
19903
|
+
"type": "string",
|
|
19904
|
+
"enum": [
|
|
19905
|
+
"rawUsage"
|
|
19906
|
+
]
|
|
19907
|
+
},
|
|
19908
|
+
"required": false,
|
|
19909
|
+
"description": "Extra fields, comma-separated. `rawUsage`: each model call's usage object exactly as the vendor reported it."
|
|
19385
19910
|
}
|
|
19386
19911
|
],
|
|
19387
19912
|
"security": [
|
|
@@ -19439,6 +19964,18 @@
|
|
|
19439
19964
|
},
|
|
19440
19965
|
"required": true,
|
|
19441
19966
|
"description": "CostRecordId — opaque string identifier chosen by the binding."
|
|
19967
|
+
},
|
|
19968
|
+
{
|
|
19969
|
+
"name": "include",
|
|
19970
|
+
"in": "query",
|
|
19971
|
+
"schema": {
|
|
19972
|
+
"type": "string",
|
|
19973
|
+
"enum": [
|
|
19974
|
+
"rawUsage"
|
|
19975
|
+
]
|
|
19976
|
+
},
|
|
19977
|
+
"required": false,
|
|
19978
|
+
"description": "Extra fields, comma-separated. `rawUsage`: each model call's usage object exactly as the vendor reported it."
|
|
19442
19979
|
}
|
|
19443
19980
|
],
|
|
19444
19981
|
"security": [
|
|
@@ -19487,7 +20024,7 @@
|
|
|
19487
20024
|
}
|
|
19488
20025
|
}
|
|
19489
20026
|
},
|
|
19490
|
-
"description": "Primary consumer path for dashboards. `groupBy` is required (comma-separated dimensions from the closed set); time range is required (both `from` and `to`, or both omitted for the default last-30-days window echoed back in `timeRange`). Filters compose on top of the time window. `?scopeKind + ?scopeId
|
|
20027
|
+
"description": "Primary consumer path for dashboards. `groupBy` is required (comma-separated dimensions from the closed set); time range is required (both `from` and `to`, or both omitted for the default last-30-days window echoed back in `timeRange`). Filters compose on top of the time window. `?scopeKind + ?scopeId` narrow the aggregate to a scope: `org` covers every project in the org, so one call sums an org's spend. Each group, and the total, carries its cost and its token sums (`tokens`). `inherit` has no effect on cost records, which always belong to a project.",
|
|
19491
20028
|
"parameters": [
|
|
19492
20029
|
{
|
|
19493
20030
|
"name": "groupBy",
|
|
@@ -19496,7 +20033,7 @@
|
|
|
19496
20033
|
"type": "string"
|
|
19497
20034
|
},
|
|
19498
20035
|
"required": true,
|
|
19499
|
-
"description": "Comma-separated list of dimensions to aggregate over. Each value must be one of `agentId | runId | category | providerId | day | month | tenant | conversationId`. Duplicates collapse."
|
|
20036
|
+
"description": "Comma-separated list of dimensions to aggregate over. Each value must be one of `agentId | runId | category | providerId | day | month | tenant | conversationId | model | servedModel | projectId | orgId | rootRunId | flowId`. `model` is the model actually called; `servedModel` the exact version the vendor reported; `orgId` the org of the record's project. Duplicates collapse."
|
|
19500
20037
|
},
|
|
19501
20038
|
{
|
|
19502
20039
|
"name": "from",
|
|
@@ -19516,7 +20053,7 @@
|
|
|
19516
20053
|
"format": "date-time"
|
|
19517
20054
|
},
|
|
19518
20055
|
"required": false,
|
|
19519
|
-
"description": "ISO 8601 timestamp; records with `occurredAt
|
|
20056
|
+
"description": "ISO 8601 timestamp; records with `occurredAt < to` (exclusive). Required on `/v1/cost/aggregate` (or both endpoints omitted for default last-30-days window)."
|
|
19520
20057
|
},
|
|
19521
20058
|
{
|
|
19522
20059
|
"name": "category",
|
|
@@ -19565,6 +20102,44 @@
|
|
|
19565
20102
|
"required": false,
|
|
19566
20103
|
"description": "Filter records to this conversation id (exact match)."
|
|
19567
20104
|
},
|
|
20105
|
+
{
|
|
20106
|
+
"name": "model",
|
|
20107
|
+
"in": "query",
|
|
20108
|
+
"schema": {
|
|
20109
|
+
"type": "string"
|
|
20110
|
+
},
|
|
20111
|
+
"required": false,
|
|
20112
|
+
"description": "Filter model calls to this model, the one actually called (exact match)."
|
|
20113
|
+
},
|
|
20114
|
+
{
|
|
20115
|
+
"name": "servedModel",
|
|
20116
|
+
"in": "query",
|
|
20117
|
+
"schema": {
|
|
20118
|
+
"type": "string"
|
|
20119
|
+
},
|
|
20120
|
+
"required": false,
|
|
20121
|
+
"description": "Filter model calls to the exact model version the vendor reported (exact match)."
|
|
20122
|
+
},
|
|
20123
|
+
{
|
|
20124
|
+
"name": "rootRunId",
|
|
20125
|
+
"in": "query",
|
|
20126
|
+
"schema": {
|
|
20127
|
+
"type": "string",
|
|
20128
|
+
"format": "uuid"
|
|
20129
|
+
},
|
|
20130
|
+
"required": false,
|
|
20131
|
+
"description": "Every record of the run tree whose root is this run: a flow run and the agent turns and sub-flows it started."
|
|
20132
|
+
},
|
|
20133
|
+
{
|
|
20134
|
+
"name": "includeDescendants",
|
|
20135
|
+
"in": "query",
|
|
20136
|
+
"schema": {
|
|
20137
|
+
"type": "boolean",
|
|
20138
|
+
"default": false
|
|
20139
|
+
},
|
|
20140
|
+
"required": false,
|
|
20141
|
+
"description": "With `runId`: the run's records and those of every run it started, at any depth. `true` or `false` (default)."
|
|
20142
|
+
},
|
|
19568
20143
|
{
|
|
19569
20144
|
"name": "scopeKind",
|
|
19570
20145
|
"in": "query",
|