# Models: C

> API models starting with C.

## `Call`

- `run_id: str` (`runId` on the wire)
- `node_id: str | None` (`nodeId` on the wire) (optional)
- `scope: str | None` (optional)
- `tool_id: str` (`toolId` on the wire)
- `arguments: Any | None` (optional)
- `result: Any | None` (optional)

## `CallUsage`

- `usage: kindgi.client.ModelCallTokens`
- `cost_usd: float | None` (`costUsd` on the wire) (optional)
- `duration_ms: int | None` (`durationMs` on the wire) (optional)
- `served_model: str | None` (`servedModel` on the wire) (optional)

## `CandidateItem`

An output's score: Σ yesWeight and Σ totalWeight over its judged items, and over those among the first `k` ranked items.

- `yes_weight: float` (`yesWeight` on the wire)
- `total_weight: float` (`totalWeight` on the wire)
- `items: int`
- `judged_items: int` (`judgedItems` on the wire)
- `top_k: kindgi.client.TopK` (`topK` on the wire)
- `fresh: kindgi.client.Fresh | None` (optional)

## `Capability`

- `root: str`

## `Capability4`

Capability declaration — see `@kindgi/capabilities`. Additional properties are permitted so new capability kinds do not require a wire change.

## `Capability5`

- `root: str`

## `CapabilityCollectionPage`

- `data: list[kindgi.client.CapabilityDescriptor]`
- `next_cursor: str | None` (`nextCursor` on the wire) (optional)
- `has_more: bool` (`hasMore` on the wire)

## `CapabilityDescriptor`

- `id: str`
- `feature: Union[str, Literal['structured-output', 'vision', 'audio-input', 'audio-output', 'tool-use', 'parallel-tool-use', 'thinking', 'long-context', 'code-execution', 'web-search', 'file-search', 'streaming', 'batch']]`
- `description: str`
- `kind: str | None` (optional)
- `params_schema: dict[str, Any] | None` (`paramsSchema` on the wire) (optional)
- `providers: list[kindgi.client.CapabilityProvider] | None` (optional)

## `CapabilityProvider`

A provider of the tenant with a model that has the feature.

- `provider_id: str` (`providerId` on the wire)
- `models: list[str]`

## `Change`

- `block_id: str` (`blockId` on the wire)
- `content: kindgi.client.Content1`

## `Changes`

The first repetition's items against the judged ones.

- `kept: list[kindgi.client.KeptItem]`
- `dropped: list[kindgi.client.DroppedItem]`
- `new: list[kindgi.client.NewItem]`

## `ClaimMappingScopesSpec`

Claim path + optional delimiter for extracting Kindgi OAuth scopes from provider claims. When absent, scopes come from the token response `scope` field instead.

- `claim: str`
- `delimiter: str | None` (optional)

## `ClaimMappingSpec`

Per-provider claim mapping. All fields optional; closer to OIDC defaults (sub/email/name) → fewer overrides needed.

- `user_id: str | None` (`userId` on the wire) (optional)
- `email: str | None` (optional)
- `display_name: str | None` (`displayName` on the wire) (optional)
- `scopes: kindgi.client.ClaimMappingScopesSpec | None` (optional)
- `metadata: list[kindgi.client.Metadatum] | None` (optional)

## `CodeArtifactRef1`

Handler-artifact pointer. Discriminated on `kind`: `oci` is the deploy-pipeline shape (image + module path + artifactVersion); `filesystem` is the local-development shape — absolute host path at the pack's on-disk handler file. Production servers SHOULD reject `filesystem`.

- `kind: Literal['oci']`
- `image_ref: str` (`imageRef` on the wire)
- `module_path: str` (`modulePath` on the wire)
- `artifact_version: str` (`artifactVersion` on the wire)

## `CodeArtifactRef2`

Handler-artifact pointer. Discriminated on `kind`: `oci` is the deploy-pipeline shape (image + module path + artifactVersion); `filesystem` is the local-development shape — absolute host path at the pack's on-disk handler file. Production servers SHOULD reject `filesystem`.

- `kind: Literal['filesystem']`
- `module_path: str` (`modulePath` on the wire)

## `Comparison`

- `max_age_hours: float | None` (`maxAgeHours` on the wire) (optional)
- `suite: kindgi.client.Suite | None` (optional)

## `Comparison1`

- `eval_run_id: uuid.UUID | None` (`evalRunId` on the wire) (optional)
- `role: Literal['reference', 'candidate', 'proof']`
- `part: Literal['search', 'hold-out']`
- `block_id: str | None` (`blockId` on the wire) (optional)
- `changed: dict[str, Any] | None` (optional)
- `score: float | None` (optional)
- `failed: str | None` (optional)
- `refused: list[kindgi.client.RefusedItem] | None` (optional)
- `hypothesis: str | None` (optional)

## `ComparisonCandidate1`

What ran on the cases: an agent version, or a flow version (with any versions it swapped in).

- `kind: Literal['agent']`
- `agent_id: str` (`agentId` on the wire)
- `version: str`
- `pins_digest: str | None` (`pinsDigest` on the wire) (optional)
- `overrides: kindgi.client.Overrides | None` (optional)

## `ComparisonCandidate2`

What ran on the cases: an agent version, or a flow version (with any versions it swapped in).

- `kind: Literal['flow']`
- `flow_id: str` (`flowId` on the wire)
- `version: str`
- `versions: kindgi.client.FlowVersionOverrides | None` (optional)

## `ComparisonCaseResult`

One case of a comparison: its replay runs, the scores, the items kept, dropped and new, the tool calls, and why it didn't run when it didn't.

- `case_id: str` (`caseId` on the wire)
- `run_ids: list[str]` (`runIds` on the wire)
- `baseline: kindgi.client.Baseline2`
- `candidate: list[kindgi.client.CandidateItem]`
- `changes: kindgi.client.Changes | None` (optional)
- `tools: list[kindgi.client.Tool2] | None` (optional)
- `diverged: bool`
- `refused_writes: int` (`refusedWrites` on the wire)
- `no_context: bool` (`noContext` on the wire)
- `approval_skipped: bool` (`approvalSkipped` on the wire)
- `error: str | None` (optional)
- `stopped: kindgi.client.Stopped | None` (optional)
- `rescored: Optional[Literal[False]]` (optional)

## `ComparisonMetric`

One metric, the recorded runs beside the candidate. `null` where a side had no judged evidence; `n` / `weight` are the candidate's evidence (cases with judged items, and the judgment weight behind them), `baselineN` / `baselineWeight` the recorded side's.

- `baseline: float | None`
- `candidate: float | None`
- `delta: float | None`
- `n: int`
- `weight: float`
- `baseline_n: int` (`baselineN` on the wire)
- `baseline_weight: float` (`baselineWeight` on the wire)
- `direction: Literal['higher']`
- `k: int | None` (optional)
- `spread: float | None` (optional)
- `fresh_weight: float | None` (`freshWeight` on the wire) (optional)

## `CompleteApprovalBody`

- `decision: Literal['approve', 'reject', 'escalate', 'withdraw']`
- `rationale: str | None` (optional)
- `value: Any | None` (optional)

## `CompleteApprovalResult`

A recorded decision, and what it did to the run waiting on the approval. `runStatus` is the run's status when the decision couldn't resolve its waitpoint because the run had already ended (e.g. `cancelled` after the decision was recorded); the decision stands.

- `kind: Literal['terminal', 'escalated']`
- `approval: kindgi.client.Approval`
- `decision: kindgi.client.ReviewDecision`
- `next_approval: kindgi.client.Approval | None` (`nextApproval` on the wire) (optional)
- `waitpoint_resolved: bool` (`waitpointResolved` on the wire)
- `run_status: Optional[Literal['pending', 'running', 'suspended', 'completed', 'failed', 'cancelled']]` (`runStatus` on the wire) (optional)
- `resume: kindgi.client.Resume | kindgi.client.Resume1 | None` (optional)

## `ComplianceEvidence`

One evidence record — matches `@kindgi/specs/compliance-evidence.schema.json` (`payload` is a versioned document opaque to the wire schema).

- `id: str`
- `tenant_id: uuid.UUID` (`tenantId` on the wire)
- `project_id: uuid.UUID | None` (`projectId` on the wire) (optional)
- `kind: str`
- `timestamp: AwareDatetime`
- `actor: kindgi.client.Actor | None` (optional)
- `subject: kindgi.client.Subject1 | None` (optional)
- `outcome: Optional[Literal['allowed', 'denied', 'succeeded', 'failed', 'escalated']]` (optional)
- `payload: dict[str, Any]`
- `provenance_ref: kindgi.client.ProvenanceRef2 | None` (`provenanceRef` on the wire) (optional)
- `signature: kindgi.client.Signature1 | None` (optional)

## `ComplianceEvidenceCollectionPage`

- `data: list[kindgi.client.ComplianceEvidence]`
- `has_more: bool` (`hasMore` on the wire)
- `next_cursor: str | None` (`nextCursor` on the wire) (optional)

## `Config`

Transport-tagged config union. Server enforces `config.transport === transport` at registration.

- `transport: Literal['stdio']`
- `command: str`
- `args: list[str] | None` (optional)
- `env: dict[str, str] | None` (optional)

## `Config1`

Transport-tagged config union. Server enforces `config.transport === transport` at registration.

- `transport: Literal['http-sse']`
- `url: AnyUrl`
- `sse_url: AnyUrl | None` (`sseUrl` on the wire) (optional)
- `headers: dict[str, str] | None` (optional)

## `Config2`

Transport-tagged config union. Server enforces `config.transport === transport` at registration.

- `transport: Literal['streamable-http']`
- `url: AnyUrl`
- `headers: dict[str, str] | None` (optional)

## `Config3`

Transport-tagged config union. Server enforces `config.transport === transport` at registration.

- `transport: Literal['stdio']`
- `command: str`
- `args: list[str] | None` (optional)
- `env: dict[str, str] | None` (optional)

## `Config4`

Transport-tagged config union. Server enforces `config.transport === transport` at registration.

- `transport: Literal['http-sse']`
- `url: AnyUrl`
- `sse_url: AnyUrl | None` (`sseUrl` on the wire) (optional)
- `headers: dict[str, str] | None` (optional)

## `Config5`

Transport-tagged config union. Server enforces `config.transport === transport` at registration.

- `transport: Literal['streamable-http']`
- `url: AnyUrl`
- `headers: dict[str, str] | None` (optional)

## `Config6`

- `cron_expression: str` (`cronExpression` on the wire)
- `timezone: str | None` (optional)
- `input: Any | None` (optional)

## `Config7`

- `cron_expression: str | None` (`cronExpression` on the wire) (optional)
- `timezone: str | None` (optional)
- `input: Any | None` (optional)

## `Config8`

- `input: Any | None` (optional)

## `Content`

The new content: `{ values }` for a settings block (its schema carries over), `{ template }` for a prompt block (its parameters carry over).

- `values: dict[str, Any] | None` (optional)
- `template: str | None` (optional)

## `Content1`

`{ values }` for a settings block (they must satisfy its schema), `{ template }` for a prompt block.

- `values: dict[str, Any] | None` (optional)
- `template: str | None` (optional)

## `Content2`

- `type: Literal['text']`
- `text: str`

## `Content3`

- `type: Literal['image']`
- `data: str`
- `mime_type: str` (`mimeType` on the wire)

## `Conversation`

- `id: uuid.UUID`
- `tenant_id: uuid.UUID` (`tenantId` on the wire)
- `agent_id: str` (`agentId` on the wire)
- `agent_version: str` (`agentVersion` on the wire)
- `title: str`
- `participant_id: str | None` (`participantId` on the wire) (optional)
- `project_id: uuid.UUID | None` (`projectId` on the wire) (optional)
- `scope: dict[str, Any]`
- `status: Literal['open', 'closed']`
- `opened_at: AwareDatetime` (`openedAt` on the wire)
- `closed_at: AwareDatetime | None` (`closedAt` on the wire) (optional)
- `unregistered_at: AwareDatetime | None` (`unregisteredAt` on the wire) (optional)
- `turn_count: int` (`turnCount` on the wire)
- `last_message_at: AwareDatetime | None` (`lastMessageAt` on the wire) (optional)
- `metadata: dict[str, Any] | None` (optional)

## `ConversationCollectionPage`

- `data: list[kindgi.client.Conversation]`
- `next_cursor: str | None` (`nextCursor` on the wire) (optional)
- `has_more: bool` (`hasMore` on the wire)

## `ConversationMessage`

- `sequence: int`
- `role: Literal['user', 'agent', 'tool', 'system']`
- `content: Any`
- `tool_call: kindgi.client.ToolCall | None` (`toolCall` on the wire) (optional)
- `actor: str | None` (optional)
- `created_at: AwareDatetime` (`createdAt` on the wire)

## `ConversationMessageCollectionPage`

- `data: list[kindgi.client.ConversationMessage]`
- `next_cursor: str | None` (`nextCursor` on the wire) (optional)
- `has_more: bool` (`hasMore` on the wire)

## `ConversationPolicy`

- `history_limit: int | None` (`historyLimit` on the wire) (optional)
- `auto_close_after_inactive_seconds: int | None` (`autoCloseAfterInactiveSeconds` on the wire) (optional)
- `hitl_after_turns: int | None` (`hitlAfterTurns` on the wire) (optional)

## `ConversationStatus`

- `root: Literal['open', 'closed']`

## `CostAggregateGroup`

- `key: dict[str, str | None]`
- `count: int`
- `total_usd: float` (`totalUsd` on the wire)
- `tokens: kindgi.client.CostTokenTotals`

## `CostAggregateResult`

- `groups: list[kindgi.client.CostAggregateGroup]`
- `total_groups: int | None` (`totalGroups` on the wire) (optional)
- `truncated: bool | None` (optional)
- `total_usd: float` (`totalUsd` on the wire)
- `total_records: int` (`totalRecords` on the wire)
- `tokens: kindgi.client.CostTokenTotals`
- `time_range: kindgi.client.TimeRange` (`timeRange` on the wire)
- `group_by: list[Literal['agentId', 'runId', 'category', 'providerId', 'day', 'month', 'tenant', 'conversationId', 'model', 'servedModel', 'projectId', 'orgId', 'rootRunId', 'flowId']]` (`groupBy` on the wire)

## `CostRecord`

- `id: str`
- `tenant_id: uuid.UUID` (`tenantId` on the wire)
- `category: str`
- `provider_id: str | None` (`providerId` on the wire) (optional)
- `run_id: uuid.UUID | None` (`runId` on the wire) (optional)
- `agent_id: str | None` (`agentId` on the wire) (optional)
- `conversation_id: uuid.UUID | None` (`conversationId` on the wire) (optional)
- `quantity: float`
- `unit: str`
- `cost_usd: float | None` (`costUsd` on the wire) (optional)
- `occurred_at: AwareDatetime` (`occurredAt` on the wire)
- `metrics: dict[str, Any] | None` (optional)
- `attributes: dict[str, Any] | None` (optional)
- `call_id: str | None` (`callId` on the wire) (optional)
- `project_id: uuid.UUID | None` (`projectId` on the wire) (optional)
- `root_run_id: uuid.UUID | None` (`rootRunId` on the wire) (optional)
- `parent_run_id: uuid.UUID | None` (`parentRunId` on the wire) (optional)
- `agent_version: str | None` (`agentVersion` on the wire) (optional)
- `flow_id: str | None` (`flowId` on the wire) (optional)
- `node_id: str | None` (`nodeId` on the wire) (optional)
- `step: int | None` (optional)
- `purpose: str | None` (optional)
- `model: str | None` (optional)
- `served_model: str | None` (`servedModel` on the wire) (optional)
- `fallback: bool | None` (optional)
- `status: Optional[Literal['ok', 'failed']]` (optional)
- `usage: kindgi.client.ModelCallTokens | None` (optional)
- `duration_ms: int | None` (`durationMs` on the wire) (optional)
- `finish_reason: str | None` (`finishReason` on the wire) (optional)
- `provider_request_id: str | None` (`providerRequestId` on the wire) (optional)
- `attempts: int | None` (optional)
- `error: kindgi.client.ModelCallError | None` (optional)
- `raw_usage: kindgi.client.RawUsage | None` (`rawUsage` on the wire) (optional)

## `CostRecordCollectionPage`

- `data: list[kindgi.client.CostRecord]`
- `next_cursor: str | None` (`nextCursor` on the wire) (optional)
- `has_more: bool` (`hasMore` on the wire)

## `CostTokenTotals`

- `prompt: int`
- `completion: int`
- `cache_read: int` (`cacheRead` on the wire)
- `cache_write: int` (`cacheWrite` on the wire)
- `reasoning: int`

## `CreateJudgeClassBody`

- `scope: kindgi.client.JudgeClassScope1 | kindgi.client.JudgeClassScope2 | kindgi.client.JudgeClassScope3`
- `name: str`
- `weight: float`
- `description: str | None` (optional)
- `assertable_by: kindgi.client.JudgeClassAssertableBy | None` (`assertableBy` on the wire) (optional)

## `CreateJudgmentBody`

- `run_id: str` (`runId` on the wire)
- `item: kindgi.client.JudgedItem`
- `verdict: Literal['yes', 'no']`
- `reason: str | None` (optional)
- `judge_class_id: str | None` (`judgeClassId` on the wire) (optional)
- `participant_id: str | None` (`participantId` on the wire) (optional)

## `CreateMemoryErasureBody`

- `root: kindgi.client.MemoryErasureFactSelector | kindgi.client.MemoryErasureSubjectSelector | kindgi.client.MemoryErasureConversationSelector`

## `CreateProposalBody`

A hand-written proposal: new content for a data block that `fromVersion` pins, for a live scope. The same change from the same version for the same scope is one proposal (answered with `X-Proposal-Deduped: true`).

- `agent_id: str` (`agentId` on the wire)
- `from_version: str` (`fromVersion` on the wire)
- `scope: kindgi.client.LiveScopeTenant | kindgi.client.LiveScopeOrg | kindgi.client.LiveScopeProject | kindgi.client.LiveScopeSegment`
- `tier: Literal['settings-block', 'prompt-block']`
- `change: kindgi.client.Change`
- `hypothesis: str`
- `evidence: kindgi.client.Evidence1 | None` (optional)

## `CreateResourceResult`

Shared 201 response body for platform-hierarchy create endpoints — the freshly-assigned id of the created row.

- `id: str`

## `CreateServiceAccountBody`

- `name: str`
- `description: str | None` (optional)
- `grants: list[Annotated[kindgi.client.ServiceAccountGrantTenantAdmin | kindgi.client.ServiceAccountGrantTenantMember | kindgi.client.ServiceAccountGrantProjectBody, FieldInfo(annotation=NoneType, required=True, discriminator='kind')]] | None` (optional)

## `CreateSystemTenantBody`

- `name: str`
- `slug: str | None` (optional)
- `production_allowed: bool | None` (`productionAllowed` on the wire) (optional)
- `test: bool | None` (optional)
- `image_prefix: str | None` (`imagePrefix` on the wire) (optional)
- `first_admin: kindgi.client.FirstAdmin | None` (`firstAdmin` on the wire) (optional)

## `CreateSystemTenantResult`

- `tenant: kindgi.client.SystemTenant`
- `first_admin: kindgi.client.FirstAdmin1 | None` (`firstAdmin` on the wire) (optional)
- `admin_key: kindgi.client.AdminKey | None` (`adminKey` on the wire) (optional)

## `CreateUserBody`

- `display_name: str` (`displayName` on the wire)
- `primary_email: str | None` (`primaryEmail` on the wire) (optional)

## `CreateWebhookEndpointBody`

- `url: AnyUrl`
- `events: list[Literal['run.finished', 'improvement-pass.finished', 'approval.requested']]`
- `filter: kindgi.client.WebhookEndpointFilter | None` (optional)
- `secret_ref: kindgi.client.WebhookSecretRef` (`secretRef` on the wire)
- `description: str | None` (optional)
