Skip to content

HTTP models: AccountingContract – ApiKnowledgeListItem

Exact OpenAPI component declarations. $ref values identify other components in the complete schema.

{
"properties": {
"usage": {
"$ref": "#/components/schemas/SessionUsageEndpointContract"
},
"cost": {
"$ref": "#/components/schemas/SessionCostEndpointContract"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"usage",
"cost"
],
"title": "AccountingContract",
"description": "Server-owned token and cost accounting.\n\nClients read these endpoints instead of folding raw `model.completed`\nevents, which would skip cache, provider-attempt, and price-book semantics."
}
{
"properties": {
"agents": {
"items": {
"$ref": "#/components/schemas/ApiAgentSummary"
},
"type": "array",
"title": "Agents"
},
"total_count": {
"type": "integer",
"minimum": 0.0,
"title": "Total Count"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"agents",
"total_count"
],
"title": "AgentsResponse"
}
{
"properties": {
"kind": {
"$ref": "#/components/schemas/AggregateAccuracyKind"
},
"reason": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Reason"
},
"limit": {
"anyOf": [
{
"type": "integer",
"minimum": 1.0
},
{
"type": "null"
}
],
"title": "Limit"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"kind"
],
"title": "AggregateAccuracy",
"description": "Truthfulness metadata for a bounded aggregate or one of its sections."
}
{
"type": "string",
"enum": [
"exact",
"sampled",
"truncated"
],
"title": "AggregateAccuracyKind",
"description": "How completely an aggregate projection represents its requested scope."
}
{
"properties": {
"read_tokens": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)$",
"title": "Read Tokens"
},
"write_tokens": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)$",
"title": "Write Tokens"
},
"write_5m_tokens": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)$",
"title": "Write 5M Tokens"
},
"write_1h_tokens": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)$",
"title": "Write 1H Tokens"
},
"write_unknown_ttl_tokens": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)$",
"title": "Write Unknown Ttl Tokens"
},
"cached_input_tokens": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)$",
"title": "Cached Input Tokens"
},
"uncached_input_tokens": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)$",
"title": "Uncached Input Tokens"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"read_tokens",
"write_tokens",
"write_5m_tokens",
"write_1h_tokens",
"write_unknown_ttl_tokens",
"cached_input_tokens",
"uncached_input_tokens"
],
"title": "AggregateCacheUsageMetrics",
"description": "Lossless JSON projection of identity-free aggregate cache counters."
}
{
"properties": {
"session_ids": {
"items": {
"type": "string"
},
"type": "array",
"title": "Session Ids"
},
"session_count": {
"type": "integer",
"minimum": 0.0,
"title": "Session Count"
},
"currency": {
"type": "string",
"title": "Currency"
},
"model_steps": {
"type": "integer",
"minimum": 0.0,
"title": "Model Steps"
},
"priced_model_steps": {
"type": "integer",
"minimum": 0.0,
"title": "Priced Model Steps"
},
"unpriced_model_steps": {
"type": "integer",
"minimum": 0.0,
"title": "Unpriced Model Steps"
},
"auxiliary_attempts": {
"type": "integer",
"minimum": 0.0,
"title": "Auxiliary Attempts",
"default": 0
},
"unpriced_auxiliary_attempts": {
"type": "integer",
"minimum": 0.0,
"title": "Unpriced Auxiliary Attempts",
"default": 0
},
"missing_usage_model_steps": {
"type": "integer",
"minimum": 0.0,
"title": "Missing Usage Model Steps",
"default": 0
},
"missing_pricing_model_steps": {
"type": "integer",
"minimum": 0.0,
"title": "Missing Pricing Model Steps",
"default": 0
},
"unsupported_pricing_model_steps": {
"type": "integer",
"minimum": 0.0,
"title": "Unsupported Pricing Model Steps",
"default": 0
},
"total_cost": {
"type": "string",
"pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
"title": "Total Cost"
},
"line_items": {
"items": {
"$ref": "#/components/schemas/CostLineItem"
},
"type": "array",
"title": "Line Items"
},
"session_costs": {
"items": {
"$ref": "#/components/schemas/SessionCostSummary"
},
"type": "array",
"title": "Session Costs"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"session_ids",
"session_count",
"currency",
"model_steps",
"priced_model_steps",
"unpriced_model_steps",
"total_cost",
"line_items",
"session_costs"
],
"title": "AggregateCostSummary"
}
{
"properties": {
"web_search_calls": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)$",
"title": "Web Search Calls",
"default": "0"
},
"web_search_outcome_unknown": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)$",
"title": "Web Search Outcome Unknown",
"default": "0"
}
},
"additionalProperties": false,
"type": "object",
"title": "AggregateHostedToolUsageMetrics",
"description": "Lossless aggregate provider-hosted resource counters."
}
{
"properties": {
"input_tokens": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)$",
"title": "Input Tokens"
},
"output_tokens": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)$",
"title": "Output Tokens"
},
"total_tokens": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)$",
"title": "Total Tokens"
},
"reasoning_output_tokens": {
"type": "string",
"pattern": "^(0|[1-9]\\d*)$",
"title": "Reasoning Output Tokens"
},
"cache": {
"$ref": "#/components/schemas/AggregateCacheUsageMetrics"
},
"hosted_tools": {
"$ref": "#/components/schemas/AggregateHostedToolUsageMetrics"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"input_tokens",
"output_tokens",
"total_tokens",
"reasoning_output_tokens",
"cache"
],
"title": "AggregateUsageMetrics",
"description": "Lossless JSON projection of identity-free aggregate token counters."
}
{
"properties": {
"session_ids": {
"items": {
"type": "string"
},
"type": "array",
"title": "Session Ids"
},
"session_count": {
"type": "integer",
"minimum": 0.0,
"title": "Session Count"
},
"model_steps": {
"type": "integer",
"minimum": 0.0,
"title": "Model Steps"
},
"unmeasured_model_attempts": {
"type": "integer",
"maximum": 9.223372036854776e+18,
"minimum": 0.0,
"title": "Unmeasured Model Attempts",
"default": 0
},
"tool_calls": {
"type": "integer",
"minimum": 0.0,
"title": "Tool Calls"
},
"provider_names": {
"items": {
"type": "string"
},
"type": "array",
"title": "Provider Names"
},
"models": {
"items": {
"type": "string"
},
"type": "array",
"title": "Models"
},
"usage": {
"$ref": "#/components/schemas/AggregateUsageMetrics"
},
"session_summaries": {
"items": {
"$ref": "#/components/schemas/SessionUsageSummary"
},
"type": "array",
"title": "Session Summaries"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"session_ids",
"session_count",
"model_steps",
"tool_calls",
"provider_names",
"models",
"usage",
"session_summaries"
],
"title": "AggregateUsageSummary"
}
{
"properties": {
"name": {
"type": "string",
"title": "Name"
},
"provider_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Provider Name"
},
"model": {
"type": "string",
"title": "Model"
},
"tool_count": {
"type": "integer",
"minimum": 0.0,
"title": "Tool Count"
},
"tools": {
"items": {
"$ref": "#/components/schemas/ApiToolSummary"
},
"type": "array",
"title": "Tools"
},
"metadata": {
"additionalProperties": true,
"type": "object",
"title": "Metadata"
},
"provider_options": {
"additionalProperties": true,
"type": "object",
"title": "Provider Options"
},
"thinking": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Thinking"
},
"has_system_prompt": {
"type": "boolean",
"title": "Has System Prompt"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"name",
"provider_name",
"model",
"tool_count",
"tools",
"metadata",
"provider_options",
"thinking",
"has_system_prompt"
],
"title": "ApiAgentSummary"
}
{
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"artifact_store_id": {
"type": "string",
"title": "Artifact Store Id"
},
"filename": {
"type": "string",
"title": "Filename"
},
"content_type": {
"type": "string",
"title": "Content Type"
},
"size_bytes": {
"type": "integer",
"minimum": 0.0,
"title": "Size Bytes"
},
"scope": {
"type": "string",
"title": "Scope"
},
"session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Session Id"
},
"agent_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Agent Name"
},
"environment_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Environment Name"
},
"created_at": {
"type": "string",
"title": "Created At"
},
"metadata": {
"additionalProperties": true,
"type": "object",
"title": "Metadata"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"id",
"artifact_store_id",
"filename",
"content_type",
"size_bytes",
"scope",
"session_id",
"agent_name",
"environment_name",
"created_at",
"metadata"
],
"title": "ApiArtifactSummary"
}
{
"properties": {
"name": {
"type": "string",
"title": "Name"
},
"metadata": {
"additionalProperties": true,
"type": "object",
"title": "Metadata"
},
"is_factory": {
"type": "boolean",
"title": "Is Factory"
},
"workspace_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Workspace Id"
},
"workspace_branch_capabilities": {
"$ref": "#/components/schemas/ApiWorkspaceBranchCapabilities"
},
"workspace_branch_lifecycle": {
"$ref": "#/components/schemas/ApiWorkspaceBranchLifecycle"
},
"artifact_store_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Artifact Store Id"
},
"runner_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Runner Type"
},
"binding_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Binding Type"
},
"vault_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Vault Type"
},
"proxy_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Proxy Type"
},
"knowledge_store_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Knowledge Store Type"
},
"mcp_server_count": {
"type": "integer",
"minimum": 0.0,
"title": "Mcp Server Count"
},
"workspace_checkpoint_policy": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Workspace Checkpoint Policy"
},
"lifecycle_policy": {
"anyOf": [
{
"$ref": "#/components/schemas/EnvironmentLifecyclePolicy"
},
{
"type": "null"
}
]
},
"workspace_instructions": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Workspace Instructions"
},
"bound_workspace": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Bound Workspace"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"name",
"metadata",
"is_factory",
"workspace_id",
"workspace_branch_capabilities",
"workspace_branch_lifecycle",
"artifact_store_id",
"runner_type",
"binding_type",
"vault_type",
"proxy_type",
"knowledge_store_type",
"mcp_server_count",
"lifecycle_policy",
"workspace_instructions"
],
"title": "ApiEnvironmentSummary"
}
{
"properties": {
"detail": {
"type": "string",
"title": "Detail"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"detail"
],
"title": "ApiErrorResponse"
}
{
"properties": {
"sequence": {
"type": "integer",
"minimum": 0.0,
"title": "Sequence"
},
"id": {
"type": "string",
"maxLength": 512,
"title": "Id"
},
"type": {
"type": "string",
"title": "Type"
},
"session_id": {
"type": "string",
"title": "Session Id"
},
"interaction_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Interaction Id"
},
"agent_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Agent Name"
},
"environment_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Environment Name"
},
"workflow_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Workflow Name"
},
"tool_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Tool Name"
},
"payload": {
"additionalProperties": true,
"type": "object",
"title": "Payload"
},
"timestamp": {
"type": "string",
"title": "Timestamp"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"sequence",
"id",
"type",
"session_id",
"interaction_id",
"agent_name",
"environment_name",
"workflow_name",
"tool_name",
"payload",
"timestamp"
],
"title": "ApiEventRecord"
}
{
"properties": {
"total_events": {
"type": "integer",
"minimum": 0.0,
"title": "Total Events"
},
"counts_by_type": {
"additionalProperties": {
"type": "integer"
},
"type": "object",
"title": "Counts By Type"
},
"latest_event": {
"anyOf": [
{
"$ref": "#/components/schemas/ApiEventRecord"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"type": "object",
"required": [
"total_events",
"counts_by_type",
"latest_event"
],
"title": "ApiEventSummary"
}
{
"properties": {
"kind": {
"type": "string",
"enum": [
"session_parent",
"task_parent",
"task_session"
],
"title": "Kind"
},
"source_id": {
"type": "string",
"maxLength": 1024,
"minLength": 1,
"title": "Source Id"
},
"target_id": {
"type": "string",
"maxLength": 1024,
"minLength": 1,
"title": "Target Id"
},
"target_loaded": {
"type": "boolean",
"title": "Target Loaded"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"kind",
"source_id",
"target_id",
"target_loaded"
],
"title": "ApiExecutionTopologyEdge"
}
{
"properties": {
"model_policy": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"title": "Model Policy"
},
"tool_completion": {
"anyOf": [
{
"$ref": "#/components/schemas/ToolCompletionResult"
},
{
"type": "null"
}
]
},
"status": {
"$ref": "#/components/schemas/InteractionStatus"
},
"start_event_id": {
"type": "string",
"title": "Start Event Id"
},
"start_event_sequence": {
"anyOf": [
{
"type": "integer",
"minimum": 1.0
},
{
"type": "null"
}
],
"title": "Start Event Sequence"
},
"source_transcript_start": {
"anyOf": [
{
"type": "integer",
"minimum": 0.0
},
{
"type": "null"
}
],
"title": "Source Transcript Start"
},
"source_transcript_end": {
"anyOf": [
{
"type": "integer",
"minimum": 0.0
},
{
"type": "null"
}
],
"title": "Source Transcript End"
},
"result_transcript_start": {
"anyOf": [
{
"type": "integer",
"minimum": 0.0
},
{
"type": "null"
}
],
"title": "Result Transcript Start"
},
"result_transcript_end": {
"anyOf": [
{
"type": "integer",
"minimum": 0.0
},
{
"type": "null"
}
],
"title": "Result Transcript End"
},
"started_at": {
"type": "string",
"format": "date-time",
"title": "Started At"
},
"completed_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Completed At"
},
"active_duration_ms": {
"type": "integer",
"minimum": 0.0,
"title": "Active Duration Ms",
"default": 0
},
"wall_duration_ms": {
"anyOf": [
{
"type": "integer",
"minimum": 0.0
},
{
"type": "null"
}
],
"title": "Wall Duration Ms"
},
"model_step_count": {
"type": "integer",
"minimum": 0.0,
"title": "Model Step Count",
"default": 0
},
"tool_call_count": {
"type": "integer",
"minimum": 0.0,
"title": "Tool Call Count",
"default": 0
},
"token_usage": {
"$ref": "#/components/schemas/AggregateUsageMetrics"
},
"provider_names": {
"items": {
"type": "string"
},
"type": "array",
"title": "Provider Names"
},
"models": {
"items": {
"type": "string"
},
"type": "array",
"title": "Models"
},
"pending_action_kind": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Pending Action Kind"
},
"targeted_tool_grant_count": {
"anyOf": [
{
"type": "integer",
"maximum": 32.0,
"minimum": 1.0
},
{
"type": "null"
}
],
"title": "Targeted Tool Grant Count"
},
"targeted_tool_grant_batch_fingerprint": {
"anyOf": [
{
"type": "string",
"pattern": "^sha256:[0-9a-f]{64}$"
},
{
"type": "null"
}
],
"title": "Targeted Tool Grant Batch Fingerprint"
},
"queued_interaction_profile_handoff": {
"anyOf": [
{
"additionalProperties": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "object"
},
{
"type": "null"
}
],
"title": "Queued Interaction Profile Handoff"
},
"interaction_id": {
"type": "string",
"title": "Interaction Id"
},
"session_id": {
"type": "string",
"title": "Session Id"
},
"terminal_event_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Terminal Event Id"
},
"terminal_event_sequence": {
"anyOf": [
{
"type": "integer",
"minimum": 1.0
},
{
"type": "null"
}
],
"title": "Terminal Event Sequence"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"status",
"start_event_id",
"started_at",
"interaction_id",
"session_id",
"terminal_event_id",
"updated_at"
],
"title": "ApiInteractionSummary"
}
{
"properties": {
"trust": {
"$ref": "#/components/schemas/InvocationOriginTrust"
},
"subject": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Subject"
},
"tenant": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Tenant"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"trust",
"subject",
"tenant"
],
"title": "ApiInvocationOrigin"
}
{
"properties": {
"chunk_id": {
"type": "string",
"title": "Chunk Id"
},
"entry_id": {
"type": "string",
"title": "Entry Id"
},
"entry_revision": {
"type": "integer",
"maximum": 2147483647.0,
"minimum": 1.0,
"title": "Entry Revision"
},
"chunk_index": {
"type": "integer",
"minimum": 0.0,
"title": "Chunk Index"
},
"text": {
"type": "string",
"title": "Text"
},
"content_hash": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Content Hash"
},
"source_uri": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Source Uri"
},
"metadata": {
"additionalProperties": true,
"type": "object",
"title": "Metadata"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"chunk_id",
"entry_id",
"entry_revision",
"chunk_index",
"text",
"content_hash",
"source_uri",
"metadata"
],
"title": "ApiKnowledgeChunk"
}
{
"properties": {
"entry_id": {
"type": "string",
"title": "Entry Id"
},
"revision": {
"type": "integer",
"maximum": 2147483647.0,
"minimum": 1.0,
"title": "Revision"
},
"namespace": {
"type": "string",
"title": "Namespace"
},
"kind": {
"type": "string",
"title": "Kind"
},
"visibility": {
"type": "string",
"title": "Visibility"
},
"status": {
"type": "string",
"title": "Status"
},
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Title"
},
"labels": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"title": "Labels"
},
"aspects": {
"items": {
"type": "string"
},
"type": "array",
"title": "Aspects"
},
"impact_targets": {
"items": {
"type": "string"
},
"type": "array",
"title": "Impact Targets"
},
"source_type": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Source Type"
},
"source_uri": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Source Uri"
},
"source_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Source Id"
},
"created_by_type": {
"type": "string",
"title": "Created By Type"
},
"created_by": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Created By"
},
"created_at": {
"type": "string",
"title": "Created At"
},
"updated_at": {
"type": "string",
"title": "Updated At"
},
"importance": {
"anyOf": [
{
"type": "string",
"pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
},
{
"type": "null"
}
],
"title": "Importance"
},
"importance_source": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Importance Source"
},
"confidence": {
"anyOf": [
{
"type": "string",
"pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
},
{
"type": "null"
}
],
"title": "Confidence"
},
"chunk_count": {
"type": "integer",
"minimum": 0.0,
"title": "Chunk Count"
},
"text_preview": {
"type": "string",
"title": "Text Preview"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"entry_id",
"revision",
"namespace",
"kind",
"visibility",
"status",
"title",
"labels",
"aspects",
"impact_targets",
"source_type",
"source_uri",
"source_id",
"created_by_type",
"created_by",
"created_at",
"updated_at",
"importance",
"importance_source",
"confidence",
"chunk_count",
"text_preview"
],
"title": "ApiKnowledgeListItem"
}