diff --git a/crates/claude-connector/tests/fixtures/lease_v2/usage_readout.bin b/crates/claude-connector/tests/fixtures/lease_v2/usage_readout.bin index 3fe12c8..1d78ffd 100644 Binary files a/crates/claude-connector/tests/fixtures/lease_v2/usage_readout.bin and b/crates/claude-connector/tests/fixtures/lease_v2/usage_readout.bin differ diff --git a/crates/model-connector/tests/fixtures/wire_v5/carriage_invocation.frame b/crates/model-connector/tests/fixtures/wire_v5/carriage_invocation.frame new file mode 100644 index 0000000..cd2b441 --- /dev/null +++ b/crates/model-connector/tests/fixtures/wire_v5/carriage_invocation.frame @@ -0,0 +1 @@ +‡©messageId®golden-request©operation¦invoke§payloadÚ(hqlzY2hlbWFfaWTZJGdhbWVjdWx0Lm1vZGVsLnRyYW5zcG9ydF9lbnZlbG9wZS52NbFjYWxsZXJfcnVudGltZV9pZK1nb2xkZW4tY2FsbGVyqnJlcXVlc3RfaWSuZ29sZGVuLXJlcXVlc3SsbWVzc2FnZV9raW5kqkludm9jYXRpb26lbm9uY2WczNNEzMAUzNnM6R7Mw8zLK2tVqmNpcGhlcnRleHTFAzP67vXYXmqhOshO0nXptUYY6bqoOX7fFNdJG9gOey20X58xRSDMpPUj6wDLIHrOnyl7ovYk+mGl42cVc9UO9q54Q84Oln6PKq+nueHuMzohIWG57u90UjYbVYeV+wYW/kcRXKupLFey43YDRPMf6PjBJ8JCZDj5Y4OACwy30jlb/JIzQlasR+QMfvP0CzE8DmO8WK6QPuSAxhWmlUpWelKjGcaVn5cb1vqNBA6sYfnUFwa2UweMFJcVhR2Sln3CRP/dG7vOTZFenrx2yHm3OVxOdi65cU5YgLlv1j6WtbOKNrHo05VNPITVBSIMlKTGM0Z+NM3HYt7wf+y2KWFvXcxmKojEoLeoyZG1PJIzmIL0isG/Y/UO8QTleKv/THoUyToHNRjoP7s7WxTvfndBHHvvuVcJjVDO8yJeiDAwB6Xqr19ZfyuDBLus9OwAoyzNaQhSDLi1z1d8Vb1ziyqvonV1yEjgLBOFUhmpvH5okNgUfaNxvMarOfdtidlkI7qxEt/xbGk2k5YVEricOmJFr5k5Etk4hKxlsL6yNBnDClUVoDv/FXhz2fc1El1UG0qUMLtPJgz9J81zc5EiTBGzkxTHAYQpDkZyWknMM02sfOyrDbIQp66MCT5kzsoRwuaQ5BkZJ1mnZsqk+3/kRTkouoz7huLTwCrlgIT0hNDtVSLxKzkJGJb4xqueNWVN2oD/Hko7tiGGYecgjkVo+mwMim6SJK2j9dxnTauMtRl1aqU46SRWOD88Kdi164v6VVD0TaW08pYaSTa1Jse4T9m4SahVsadiYIA3uMyP36ZkUUvq0czUep+8vGDiwNspvFDd5EvkgwyZ3GYUmwk62IQ5FOTTXKoTFwojQOxq66rnGC9084Kmv2RTCiZM3lIPU03q+U/qr67wIdnLSieMGtDYTOkNaCHOws5vFDVdCrDElmoTnMIx565GdU02tOzR9N2tumd1XOdtuEKJl+Y3FwkY74y8vRyCRoehKymN8kjc9+Jn1tXM9Z7OdWFa1xCJzJh37la8zz/Am4MBvgfSedNd34bVVdVgCBYwprsDc+eX1Ygx2OWBSV1RlpyznlnKDaU+Op5le2Q=¯payloadEncoding²messagepack-base64­payloadSchemaÙ$gamecult.model.transport_envelope.v5­schemaVersion¼cultnet.operation_request.v0©serviceId¸gamecult.model.connector \ No newline at end of file diff --git a/crates/model-connector/tests/fixtures/wire_v5/input_reasoning_state.mp b/crates/model-connector/tests/fixtures/wire_v5/input_reasoning_state.mp new file mode 100644 index 0000000..c6eae0c --- /dev/null +++ b/crates/model-connector/tests/fixtures/wire_v5/input_reasoning_state.mp @@ -0,0 +1 @@ +�®ReasoningStateƒ¨provider²anthropic-messages¥model¯claude-opus-4-5¥stateÄ€€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ \ No newline at end of file diff --git a/crates/model-connector/tests/fixtures/wire_v5/provider_request.mp b/crates/model-connector/tests/fixtures/wire_v5/provider_request.mp new file mode 100644 index 0000000..67bfcf4 Binary files /dev/null and b/crates/model-connector/tests/fixtures/wire_v5/provider_request.mp differ diff --git a/crates/model-connector/tests/fixtures/wire_v5/transport_envelope.mp b/crates/model-connector/tests/fixtures/wire_v5/transport_envelope.mp new file mode 100644 index 0000000..9a4cff7 Binary files /dev/null and b/crates/model-connector/tests/fixtures/wire_v5/transport_envelope.mp differ diff --git a/crates/model-connector/tests/fixtures/wire_v5/transport_invocation.mp b/crates/model-connector/tests/fixtures/wire_v5/transport_invocation.mp new file mode 100644 index 0000000..53f3302 Binary files /dev/null and b/crates/model-connector/tests/fixtures/wire_v5/transport_invocation.mp differ diff --git a/crates/model-connector/tests/fixtures/wire_v5/transport_receipt_failed.mp b/crates/model-connector/tests/fixtures/wire_v5/transport_receipt_failed.mp new file mode 100644 index 0000000..e0792e8 Binary files /dev/null and b/crates/model-connector/tests/fixtures/wire_v5/transport_receipt_failed.mp differ diff --git a/crates/model-connector/tests/fixtures/wire_v5/transport_receipt_failed_no_usage.mp b/crates/model-connector/tests/fixtures/wire_v5/transport_receipt_failed_no_usage.mp new file mode 100644 index 0000000..5019171 Binary files /dev/null and b/crates/model-connector/tests/fixtures/wire_v5/transport_receipt_failed_no_usage.mp differ diff --git a/crates/model-connector/tests/fixtures/wire_v5/transport_result_refused.mp b/crates/model-connector/tests/fixtures/wire_v5/transport_result_refused.mp new file mode 100644 index 0000000..1bb6be0 --- /dev/null +++ b/crates/model-connector/tests/fixtures/wire_v5/transport_result_refused.mp @@ -0,0 +1 @@ +„©schema_idÙ"gamecult.model.transport_result.v5ªrequest_id®golden-request±caller_runtime_id­golden-caller«disposition�§Refused«OutputBound \ No newline at end of file diff --git a/crates/model-connector/tests/fixtures/wire_v5/transport_result_transported.mp b/crates/model-connector/tests/fixtures/wire_v5/transport_result_transported.mp new file mode 100644 index 0000000..3bc20bc Binary files /dev/null and b/crates/model-connector/tests/fixtures/wire_v5/transport_result_transported.mp differ diff --git a/schemas/transport_receipt.json b/schemas/transport_receipt.json index 0011d79..231d9ea 100644 --- a/schemas/transport_receipt.json +++ b/schemas/transport_receipt.json @@ -6,6 +6,14 @@ "caller_runtime_id": { "type": "string" }, + "cost_micro_usd": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + }, "foreign_reasoning_dropped": { "description": "How many foreign `ReasoningState` items the service removed from the\nrequest before the backend saw it.", "type": "integer", diff --git a/schemas/transport_result.json b/schemas/transport_result.json index 4ba4597..0a4f6b8 100644 --- a/schemas/transport_result.json +++ b/schemas/transport_result.json @@ -284,6 +284,14 @@ "caller_runtime_id": { "type": "string" }, + "cost_micro_usd": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0 + }, "foreign_reasoning_dropped": { "description": "How many foreign `ReasoningState` items the service removed from the\nrequest before the backend saw it.", "type": "integer", diff --git a/schemas/usage_readout.json b/schemas/usage_readout.json index 8f321fa..01e92f2 100644 --- a/schemas/usage_readout.json +++ b/schemas/usage_readout.json @@ -16,15 +16,61 @@ }, "schema_id": { "type": "string" + }, + "spend": { + "type": "array", + "items": { + "$ref": "#/$defs/CallerModelSpend" + } } }, "additionalProperties": false, "required": [ "schema_id", "at_unix_ms", + "spend", "plan_quota" ], "$defs": { + "CallerModelSpend": { + "description": "One caller's committed monthly usage row for a single model in UTC `YYYY-MM`.", + "type": "object", + "properties": { + "caller": { + "type": "string" + }, + "calls": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "calls_without_price": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "cost_micro_usd": { + "type": "integer", + "format": "uint64", + "minimum": 0 + }, + "model": { + "type": "string" + }, + "month": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "caller", + "model", + "month", + "calls", + "cost_micro_usd", + "calls_without_price" + ] + }, "PlanQuota": { "description": "One window of the subscription plan, as the provider reported it.", "type": "object",