1097 lines
26 KiB
JSON
1097 lines
26 KiB
JSON
{
|
|
"$defs": {
|
|
"catalog_sync": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"contract_version",
|
|
"kind",
|
|
"request_id",
|
|
"operation_id"
|
|
],
|
|
"properties": {
|
|
"contract_version": {
|
|
"const": "codex-link/1"
|
|
},
|
|
"kind": {
|
|
"const": "catalog_sync"
|
|
},
|
|
"request_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"operation_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
}
|
|
}
|
|
},
|
|
"context_compact_view": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"contract_version",
|
|
"kind",
|
|
"request_id",
|
|
"operation_id",
|
|
"view_handle",
|
|
"expected_checkpoint_revision"
|
|
],
|
|
"properties": {
|
|
"contract_version": {
|
|
"const": "codex-link/1"
|
|
},
|
|
"kind": {
|
|
"const": "context_compact_view"
|
|
},
|
|
"request_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"operation_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"view_handle": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"expected_checkpoint_revision": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
}
|
|
}
|
|
},
|
|
"context_view": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"view_handle",
|
|
"can_compact",
|
|
"label",
|
|
"checkpoint_revision",
|
|
"current_model_label",
|
|
"limiting_target_id",
|
|
"target_budgets",
|
|
"active_summary_count",
|
|
"summary_tokens",
|
|
"summary_token_measurement",
|
|
"last_operation_id",
|
|
"last_operation_state",
|
|
"last_operation_error",
|
|
"compact_attempts"
|
|
],
|
|
"properties": {
|
|
"view_handle": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"can_compact": {
|
|
"type": "boolean"
|
|
},
|
|
"label": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"checkpoint_revision": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"current_model_label": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"limiting_target_id": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"target_budgets": {
|
|
"anyOf": [
|
|
{
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/$defs/target_budget"
|
|
},
|
|
"minItems": 1
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"active_summary_count": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"summary_tokens": {
|
|
"anyOf": [
|
|
{
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"summary_token_measurement": {
|
|
"anyOf": [
|
|
{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"target_id",
|
|
"tokenizer_id",
|
|
"tokenizer_revision",
|
|
"count_method"
|
|
],
|
|
"properties": {
|
|
"target_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"tokenizer_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"tokenizer_revision": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"count_method": {
|
|
"enum": [
|
|
"exact_tokenizer",
|
|
"verified_upper_bound"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"last_operation_id": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"last_operation_state": {
|
|
"anyOf": [
|
|
{
|
|
"enum": [
|
|
"accepted",
|
|
"running",
|
|
"completed",
|
|
"failed",
|
|
"indeterminate"
|
|
]
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"last_operation_error": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/$defs/error"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"compact_attempts": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"attempt_id",
|
|
"member_label",
|
|
"state",
|
|
"usage"
|
|
],
|
|
"properties": {
|
|
"attempt_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"member_label": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"state": {
|
|
"enum": [
|
|
"prepared",
|
|
"running",
|
|
"completed",
|
|
"failed",
|
|
"indeterminate"
|
|
]
|
|
},
|
|
"usage": {
|
|
"$ref": "#/$defs/usage"
|
|
}
|
|
}
|
|
},
|
|
"minItems": 0
|
|
}
|
|
}
|
|
},
|
|
"context_views_get": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"contract_version",
|
|
"kind",
|
|
"request_id",
|
|
"operation_id"
|
|
],
|
|
"properties": {
|
|
"contract_version": {
|
|
"const": "codex-link/1"
|
|
},
|
|
"kind": {
|
|
"const": "context_views_get"
|
|
},
|
|
"request_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"operation_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
}
|
|
}
|
|
},
|
|
"context_views_result": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"contract_version",
|
|
"kind",
|
|
"request_id",
|
|
"operation_id",
|
|
"settings_revision",
|
|
"views"
|
|
],
|
|
"properties": {
|
|
"contract_version": {
|
|
"const": "codex-link/1"
|
|
},
|
|
"kind": {
|
|
"const": "context_views_result"
|
|
},
|
|
"request_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"operation_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"settings_revision": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"views": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/$defs/context_view"
|
|
},
|
|
"minItems": 0
|
|
}
|
|
}
|
|
},
|
|
"control_accepted": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"contract_version",
|
|
"kind",
|
|
"request_id",
|
|
"operation_id",
|
|
"settings_revision",
|
|
"operation_state",
|
|
"error"
|
|
],
|
|
"properties": {
|
|
"contract_version": {
|
|
"const": "codex-link/1"
|
|
},
|
|
"kind": {
|
|
"const": "control_accepted"
|
|
},
|
|
"request_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"operation_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"settings_revision": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"operation_state": {
|
|
"enum": [
|
|
"accepted",
|
|
"running",
|
|
"completed",
|
|
"failed",
|
|
"indeterminate"
|
|
]
|
|
},
|
|
"error": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/$defs/error"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"control_error": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"contract_version",
|
|
"kind",
|
|
"request_id",
|
|
"operation_id",
|
|
"settings_revision",
|
|
"error"
|
|
],
|
|
"properties": {
|
|
"contract_version": {
|
|
"const": "codex-link/1"
|
|
},
|
|
"kind": {
|
|
"const": "control_error"
|
|
},
|
|
"request_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"operation_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"settings_revision": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"error": {
|
|
"$ref": "#/$defs/error"
|
|
}
|
|
}
|
|
},
|
|
"control_request": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/$defs/settings_get"
|
|
},
|
|
{
|
|
"$ref": "#/$defs/settings_update"
|
|
},
|
|
{
|
|
"$ref": "#/$defs/status_get"
|
|
},
|
|
{
|
|
"$ref": "#/$defs/catalog_sync"
|
|
},
|
|
{
|
|
"$ref": "#/$defs/context_views_get"
|
|
},
|
|
{
|
|
"$ref": "#/$defs/context_compact_view"
|
|
}
|
|
]
|
|
},
|
|
"control_response": {
|
|
"oneOf": [
|
|
{
|
|
"$ref": "#/$defs/settings_result"
|
|
},
|
|
{
|
|
"$ref": "#/$defs/status_result"
|
|
},
|
|
{
|
|
"$ref": "#/$defs/context_views_result"
|
|
},
|
|
{
|
|
"$ref": "#/$defs/control_accepted"
|
|
},
|
|
{
|
|
"$ref": "#/$defs/control_error"
|
|
}
|
|
]
|
|
},
|
|
"error": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"code",
|
|
"message",
|
|
"recovery_action"
|
|
],
|
|
"properties": {
|
|
"code": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"message": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"recovery_action": {
|
|
"enum": [
|
|
"retry_control_read",
|
|
"reconcile_only",
|
|
"repair_required",
|
|
"select_route",
|
|
"reconfigure",
|
|
"none"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"output_cap_enforcement": {
|
|
"oneOf": [
|
|
{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"method",
|
|
"field",
|
|
"value",
|
|
"proof_revision",
|
|
"verified"
|
|
],
|
|
"properties": {
|
|
"method": {
|
|
"const": "request_field"
|
|
},
|
|
"field": {
|
|
"enum": [
|
|
"max_output_tokens",
|
|
"max_tokens",
|
|
"max_completion_tokens",
|
|
"num_predict"
|
|
]
|
|
},
|
|
"value": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"proof_revision": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"verified": {
|
|
"const": true
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"method",
|
|
"value",
|
|
"proof_revision",
|
|
"verified"
|
|
],
|
|
"properties": {
|
|
"method": {
|
|
"const": "provider_fixed_maximum"
|
|
},
|
|
"value": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"proof_revision": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"verified": {
|
|
"const": true
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"settings": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"settings_revision",
|
|
"enabled",
|
|
"compression_enabled",
|
|
"threshold_tokens",
|
|
"source_binding_handle",
|
|
"compact_route_id",
|
|
"legacy_intent_imported",
|
|
"ownership_manifest_revision",
|
|
"activation_state"
|
|
],
|
|
"properties": {
|
|
"settings_revision": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"enabled": {
|
|
"type": "boolean"
|
|
},
|
|
"compression_enabled": {
|
|
"type": "boolean"
|
|
},
|
|
"threshold_tokens": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"source_binding_handle": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"compact_route_id": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"legacy_intent_imported": {
|
|
"type": "boolean"
|
|
},
|
|
"ownership_manifest_revision": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"activation_state": {
|
|
"enum": [
|
|
"disabled",
|
|
"pending_runtime_acceptance",
|
|
"ready",
|
|
"restart_required",
|
|
"conflict",
|
|
"recovery_pending"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"settings_get": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"contract_version",
|
|
"kind",
|
|
"request_id",
|
|
"operation_id"
|
|
],
|
|
"properties": {
|
|
"contract_version": {
|
|
"const": "codex-link/1"
|
|
},
|
|
"kind": {
|
|
"const": "settings_get"
|
|
},
|
|
"request_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"operation_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
}
|
|
}
|
|
},
|
|
"settings_result": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"contract_version",
|
|
"kind",
|
|
"request_id",
|
|
"operation_id",
|
|
"settings",
|
|
"available_sources"
|
|
],
|
|
"properties": {
|
|
"contract_version": {
|
|
"const": "codex-link/1"
|
|
},
|
|
"kind": {
|
|
"const": "settings_result"
|
|
},
|
|
"request_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"operation_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"settings": {
|
|
"$ref": "#/$defs/settings"
|
|
},
|
|
"available_sources": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"source_binding_handle",
|
|
"label",
|
|
"authorized"
|
|
],
|
|
"properties": {
|
|
"source_binding_handle": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"label": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
},
|
|
"authorized": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"minItems": 0
|
|
}
|
|
}
|
|
},
|
|
"settings_update": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"contract_version",
|
|
"kind",
|
|
"request_id",
|
|
"operation_id",
|
|
"expected_settings_revision",
|
|
"patch"
|
|
],
|
|
"properties": {
|
|
"contract_version": {
|
|
"const": "codex-link/1"
|
|
},
|
|
"kind": {
|
|
"const": "settings_update"
|
|
},
|
|
"request_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"operation_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"expected_settings_revision": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"patch": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [],
|
|
"properties": {
|
|
"enabled": {
|
|
"type": "boolean"
|
|
},
|
|
"compression_enabled": {
|
|
"type": "boolean"
|
|
},
|
|
"threshold_tokens": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"source_binding_handle": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
}
|
|
},
|
|
"minProperties": 1
|
|
}
|
|
}
|
|
},
|
|
"status_get": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"contract_version",
|
|
"kind",
|
|
"request_id",
|
|
"operation_id"
|
|
],
|
|
"properties": {
|
|
"contract_version": {
|
|
"const": "codex-link/1"
|
|
},
|
|
"kind": {
|
|
"const": "status_get"
|
|
},
|
|
"request_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"operation_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
}
|
|
}
|
|
},
|
|
"status_result": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"contract_version",
|
|
"kind",
|
|
"request_id",
|
|
"operation_id",
|
|
"status"
|
|
],
|
|
"properties": {
|
|
"contract_version": {
|
|
"const": "codex-link/1"
|
|
},
|
|
"kind": {
|
|
"const": "status_result"
|
|
},
|
|
"request_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"operation_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"status": {
|
|
"$ref": "#/$defs/status_snapshot"
|
|
}
|
|
}
|
|
},
|
|
"status_snapshot": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"settings_revision",
|
|
"runtime_mode",
|
|
"native_available",
|
|
"external_admission",
|
|
"needs_restart",
|
|
"catalog_state",
|
|
"active_turns",
|
|
"uncertain_operations",
|
|
"last_operation_id",
|
|
"error"
|
|
],
|
|
"properties": {
|
|
"settings_revision": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"runtime_mode": {
|
|
"enum": [
|
|
"native",
|
|
"managed",
|
|
"unknown"
|
|
]
|
|
},
|
|
"native_available": {
|
|
"type": "boolean"
|
|
},
|
|
"external_admission": {
|
|
"enum": [
|
|
"open",
|
|
"closed",
|
|
"draining",
|
|
"recovery_required"
|
|
]
|
|
},
|
|
"needs_restart": {
|
|
"type": "boolean"
|
|
},
|
|
"catalog_state": {
|
|
"enum": [
|
|
"unknown",
|
|
"fresh",
|
|
"stale",
|
|
"unauthorized",
|
|
"empty"
|
|
]
|
|
},
|
|
"active_turns": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"uncertain_operations": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"last_operation_id": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"error": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/$defs/error"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"target_budget": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"target_id",
|
|
"canonical_leaf_id",
|
|
"limits_source",
|
|
"limits_revision",
|
|
"tokenizer_id",
|
|
"tokenizer_revision",
|
|
"count_method",
|
|
"serialization_revision",
|
|
"input_tokens",
|
|
"context_window_tokens",
|
|
"output_cap_tokens",
|
|
"safety_margin_tokens",
|
|
"max_input_tokens",
|
|
"max_output_tokens",
|
|
"request_bytes",
|
|
"max_request_bytes",
|
|
"output_cap_enforcement"
|
|
],
|
|
"properties": {
|
|
"target_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"canonical_leaf_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"limits_source": {
|
|
"enum": [
|
|
"provider_contract",
|
|
"provider_api",
|
|
"verified_adapter",
|
|
"verified_measurement"
|
|
]
|
|
},
|
|
"limits_revision": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"tokenizer_id": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"tokenizer_revision": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"count_method": {
|
|
"enum": [
|
|
"exact_tokenizer",
|
|
"verified_upper_bound"
|
|
]
|
|
},
|
|
"serialization_revision": {
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
"input_tokens": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"context_window_tokens": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"output_cap_tokens": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"safety_margin_tokens": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"max_input_tokens": {
|
|
"anyOf": [
|
|
{
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 9007199254740991
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"max_output_tokens": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"request_bytes": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"max_request_bytes": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 9007199254740991
|
|
},
|
|
"output_cap_enforcement": {
|
|
"$ref": "#/$defs/output_cap_enforcement"
|
|
}
|
|
}
|
|
},
|
|
"usage": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"input_tokens",
|
|
"output_tokens",
|
|
"measurement",
|
|
"cost_microunits",
|
|
"currency",
|
|
"cost_source"
|
|
],
|
|
"properties": {
|
|
"input_tokens": {
|
|
"anyOf": [
|
|
{
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"output_tokens": {
|
|
"anyOf": [
|
|
{
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"measurement": {
|
|
"enum": [
|
|
"measured",
|
|
"estimated",
|
|
"unknown"
|
|
]
|
|
},
|
|
"cost_microunits": {
|
|
"anyOf": [
|
|
{
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 9007199254740991
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"currency": {
|
|
"anyOf": [
|
|
{
|
|
"const": "USD"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"cost_source": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string",
|
|
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|