{ "components": { "responses": { "BadRequest": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "The request is invalid." }, "Conflict": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "The requested identity already exists." }, "Forbidden": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "The credential does not have the required scope." }, "NotFound": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "The requested resource does not exist or is not visible." }, "ProjectionRebuilding": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectionRebuild" } } }, "description": "The parsed projection is rebuilding; retry after the requested delay.", "headers": { "Retry-After": { "description": "Seconds before retrying.", "required": true, "schema": { "minimum": 1, "type": "integer" } } } }, "Unauthorized": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Authentication is required." } }, "schemas": { "AccountBot": { "additionalProperties": false, "properties": { "created_at": { "format": "date-time", "type": "string" }, "id": { "format": "int64", "type": "integer" }, "tokens": { "items": { "$ref": "#/components/schemas/AccountToken" }, "type": "array" }, "username": { "type": "string" } }, "required": [ "created_at", "id", "tokens", "username" ], "type": "object" }, "AccountInvite": { "additionalProperties": false, "properties": { "CreatedAt": { "format": "date-time", "type": "string" }, "CreatedBy": { "type": "string" }, "ExpiresAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "ID": { "format": "int64", "type": "integer" }, "Note": { "type": "string" }, "RedeemedAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "RedeemedBy": { "anyOf": [ { "type": "string" }, { "type": "null" } ] } }, "required": [ "CreatedAt", "CreatedBy", "ExpiresAt", "ID", "Note", "RedeemedAt", "RedeemedBy" ], "type": "object" }, "AccountProject": { "additionalProperties": false, "properties": { "id": { "format": "int64", "type": "integer" }, "name": { "type": "string" }, "published": { "type": "boolean" }, "remote_key": { "type": "string" } }, "required": [ "id", "name", "published", "remote_key" ], "type": "object" }, "AccountResponse": { "additionalProperties": false, "properties": { "bots": { "items": { "$ref": "#/components/schemas/AccountBot" }, "type": "array" }, "connections": { "items": { "$ref": "#/components/schemas/OAuthGrant" }, "type": "array" }, "invites": { "items": { "$ref": "#/components/schemas/AccountInvite" }, "type": "array" }, "projects": { "items": { "$ref": "#/components/schemas/AccountProject" }, "type": "array" }, "reparse": { "$ref": "#/components/schemas/Status" }, "tokens": { "items": { "$ref": "#/components/schemas/AccountToken" }, "type": "array" }, "user": { "$ref": "#/components/schemas/Viewer" } }, "required": [ "bots", "connections", "invites", "projects", "reparse", "tokens", "user" ], "type": "object" }, "AccountToken": { "additionalProperties": false, "properties": { "CreatedAt": { "format": "date-time", "type": "string" }, "ID": { "format": "int64", "type": "integer" }, "LastUsedAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "Name": { "type": "string" }, "RevokedAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "Scope": { "type": "string" } }, "required": [ "CreatedAt", "ID", "LastUsedAt", "Name", "RevokedAt", "Scope" ], "type": "object" }, "Analytics": { "additionalProperties": false, "properties": { "Agents": { "items": { "$ref": "#/components/schemas/Breakdown" }, "type": "array" }, "Cache": { "$ref": "#/components/schemas/CacheStats" }, "Models": { "items": { "$ref": "#/components/schemas/Breakdown" }, "type": "array" }, "Series": { "items": { "$ref": "#/components/schemas/DayPoint" }, "type": "array" }, "Sessions": { "format": "int64", "type": "integer" }, "TotalCacheRead": { "format": "int64", "type": "integer" }, "TotalCacheWrite": { "format": "int64", "type": "integer" }, "TotalCost": { "type": "number" }, "TotalIn": { "format": "int64", "type": "integer" }, "TotalOut": { "format": "int64", "type": "integer" }, "TotalReasoning": { "format": "int64", "type": "integer" }, "Users": { "items": { "$ref": "#/components/schemas/Breakdown" }, "type": "array" } }, "required": [ "Agents", "Cache", "Models", "Series", "Sessions", "TotalCacheRead", "TotalCacheWrite", "TotalCost", "TotalIn", "TotalOut", "TotalReasoning", "Users" ], "type": "object" }, "AnnounceSession": { "additionalProperties": false, "properties": { "agent": { "enum": [ "claude", "codex", "pi", "cursor", "grok", "opencode" ], "type": "string" }, "cwd": { "type": "string" }, "git_branch": { "type": "string" }, "kind": { "default": "remote", "enum": [ "remote", "standalone", "orphaned" ], "type": "string" }, "local_root": { "type": "string" }, "machine": { "type": "string" }, "project_remote": { "type": "string" }, "source_session_id": { "minLength": 1, "type": "string" }, "terminal": { "default": false, "type": "boolean" } }, "required": [ "agent", "source_session_id" ], "type": "object" }, "AttachmentView": { "additionalProperties": false, "properties": { "ByteLen": { "format": "int64", "type": "integer" }, "Filename": { "type": "string" }, "MediaType": { "type": "string" }, "MessageOrdinal": { "format": "int64", "type": "integer" }, "SHA256": { "type": "string" } }, "required": [ "ByteLen", "Filename", "MediaType", "MessageOrdinal", "SHA256" ], "type": "object" }, "Breakdown": { "additionalProperties": false, "properties": { "CacheRead": { "format": "int64", "type": "integer" }, "CacheWrite": { "format": "int64", "type": "integer" }, "CostUSD": { "type": "number" }, "CostKnown": { "type": "boolean" }, "Input": { "format": "int64", "type": "integer" }, "Label": { "type": "string" }, "Output": { "format": "int64", "type": "integer" }, "Reasoning": { "format": "int64", "type": "integer" }, "Sessions": { "format": "int64", "type": "integer" } }, "required": [ "CacheRead", "CacheWrite", "CostKnown", "CostUSD", "Input", "Label", "Output", "Reasoning", "Sessions" ], "type": "object" }, "CacheStats": { "additionalProperties": false, "properties": { "CacheRead": { "format": "int64", "type": "integer" }, "CacheWrite": { "format": "int64", "type": "integer" }, "Input": { "format": "int64", "type": "integer" }, "Output": { "format": "int64", "type": "integer" }, "SavingsUSD": { "type": "number" } }, "required": [ "CacheRead", "CacheWrite", "Input", "Output", "SavingsUSD" ], "type": "object" }, "ChurnFile": { "additionalProperties": false, "properties": { "Edits": { "format": "int64", "type": "integer" }, "Path": { "type": "string" }, "Project": { "type": "string" }, "ProjectID": { "format": "int64", "type": "integer" }, "Sessions": { "format": "int64", "type": "integer" } }, "required": [ "Edits", "Path", "Project", "ProjectID", "Sessions" ], "type": "object" }, "ChurnNode": { "additionalProperties": false, "properties": { "Edits": { "format": "int64", "type": "integer" }, "Folder": { "type": "string" }, "Path": { "type": "string" }, "Project": { "type": "string" }, "Sessions": { "format": "int64", "type": "integer" } }, "required": [ "Edits", "Folder", "Path", "Project", "Sessions" ], "type": "object" }, "ChurnTrend": { "additionalProperties": false, "properties": { "Clipped": { "format": "int64", "type": "integer" }, "Files": { "items": { "format": "int64", "type": "integer" }, "type": "array" }, "Projects": { "format": "int64", "type": "integer" }, "ReEdits": { "items": { "format": "int64", "type": "integer" }, "type": "array" }, "TotalHotFiles": { "format": "int64", "type": "integer" }, "TotalReEdits": { "format": "int64", "type": "integer" }, "Tree": { "items": { "$ref": "#/components/schemas/ChurnNode" }, "type": "array" } }, "required": [ "Clipped", "Files", "Projects", "ReEdits", "TotalHotFiles", "TotalReEdits", "Tree" ], "type": "object" }, "ConcurrencyStats": { "additionalProperties": false, "properties": { "AvgConcurrent": { "type": "number" }, "BusiestUser": { "type": "string" }, "BusiestUserPeak": { "format": "int64", "type": "integer" }, "FleetPeak": { "format": "int64", "type": "integer" }, "FleetPeakAt": { "format": "date-time", "type": "string" }, "Sessions": { "format": "int64", "type": "integer" } }, "required": [ "AvgConcurrent", "BusiestUser", "BusiestUserPeak", "FleetPeak", "FleetPeakAt", "Sessions" ], "type": "object" }, "ContextBucket": { "additionalProperties": false, "properties": { "Count": { "format": "int64", "type": "integer" }, "Hi": { "format": "int64", "type": "integer" }, "Lo": { "format": "int64", "type": "integer" } }, "required": [ "Count", "Hi", "Lo" ], "type": "object" }, "ContextHealthStats": { "additionalProperties": false, "properties": { "PeakTokensMax": { "format": "int64", "type": "integer" }, "PeakTokensP50": { "format": "int64", "type": "integer" }, "PeakTokensP90": { "format": "int64", "type": "integer" }, "Sessions": { "format": "int64", "type": "integer" }, "SessionsWithReset": { "format": "int64", "type": "integer" }, "TotalResets": { "format": "int64", "type": "integer" } }, "required": [ "PeakTokensMax", "PeakTokensP50", "PeakTokensP90", "Sessions", "SessionsWithReset", "TotalResets" ], "type": "object" }, "ContextMarker": { "additionalProperties": false, "properties": { "Kind": { "type": "string" }, "Tokens": { "format": "int64", "type": "integer" } }, "required": [ "Kind", "Tokens" ], "type": "object" }, "CreateBot": { "additionalProperties": false, "properties": { "username": { "type": "string" } }, "required": [ "username" ], "type": "object" }, "CreateInvite": { "additionalProperties": false, "properties": { "expires_hours": { "minimum": 0, "type": "integer" }, "note": { "type": "string" } }, "type": "object" }, "CreateToken": { "additionalProperties": false, "properties": { "name": { "type": "string" }, "scope": { "default": "ingest", "enum": [ "ingest", "read", "full" ], "type": "string" } }, "required": [ "name" ], "type": "object" }, "CreatedInviteResponse": { "additionalProperties": false, "properties": { "expires_at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "id": { "format": "int64", "type": "integer" }, "invite_token": { "type": "string" }, "note": { "type": "string" } }, "required": [ "expires_at", "id", "invite_token", "note" ], "type": "object" }, "CreatedTokenResponse": { "additionalProperties": false, "properties": { "id": { "format": "int64", "type": "integer" }, "name": { "type": "string" }, "scope": { "type": "string" }, "token": { "type": "string" } }, "required": [ "id", "name", "scope", "token" ], "type": "object" }, "DateRange": { "additionalProperties": false, "properties": { "Days": { "format": "int64", "type": "integer" }, "Key": { "type": "string" }, "Label": { "type": "string" } }, "required": [ "Days", "Key", "Label" ], "type": "object" }, "DayPoint": { "additionalProperties": false, "properties": { "CacheRead": { "format": "int64", "type": "integer" }, "CacheWrite": { "format": "int64", "type": "integer" }, "CostUSD": { "type": "number" }, "Day": { "format": "date-time", "type": "string" }, "Input": { "format": "int64", "type": "integer" }, "Output": { "format": "int64", "type": "integer" } }, "required": [ "CacheRead", "CacheWrite", "CostUSD", "Day", "Input", "Output" ], "type": "object" }, "DeletedBotResponse": { "additionalProperties": false, "properties": { "deleted": { "type": "boolean" } }, "required": [ "deleted" ], "type": "object" }, "DeletedSessionResponse": { "additionalProperties": false, "properties": { "deleted": { "type": "boolean" }, "project_id": { "format": "int64", "type": "integer" } }, "required": [ "deleted", "project_id" ], "type": "object" }, "Economics": { "additionalProperties": false, "properties": { "AbandonedSharePct": { "type": "number" }, "CacheHitRate": { "items": { "type": "number" }, "type": "array" }, "CacheHitRateLatest": { "type": "number" }, "CacheMeasured": { "items": { "type": "boolean" }, "type": "array" }, "CacheSavings": { "items": { "type": "number" }, "type": "array" }, "CostAbandoned": { "items": { "type": "number" }, "type": "array" }, "CostCompleted": { "items": { "type": "number" }, "type": "array" }, "CostOther": { "items": { "type": "number" }, "type": "array" }, "TotalAbandoned": { "type": "number" }, "TotalCacheSavings": { "type": "number" }, "TotalSpend": { "type": "number" } }, "required": [ "AbandonedSharePct", "CacheHitRate", "CacheHitRateLatest", "CacheMeasured", "CacheSavings", "CostAbandoned", "CostCompleted", "CostOther", "TotalAbandoned", "TotalCacheSavings", "TotalSpend" ], "type": "object" }, "Error": { "additionalProperties": false, "properties": { "code": { "type": "string" }, "error": { "type": "string" } }, "required": [ "error" ], "type": "object" }, "FacetCount": { "additionalProperties": false, "properties": { "Count": { "format": "int64", "type": "integer" }, "Value": { "type": "string" } }, "required": [ "Count", "Value" ], "type": "object" }, "FacetValues": { "additionalProperties": false, "properties": { "Agents": { "items": { "type": "string" }, "type": "array" }, "Machines": { "items": { "type": "string" }, "type": "array" }, "Users": { "items": { "type": "string" }, "type": "array" } }, "required": [ "Agents", "Machines", "Users" ], "type": "object" }, "FileChurn": { "additionalProperties": false, "properties": { "Clipped": { "format": "int64", "type": "integer" }, "Files": { "items": { "$ref": "#/components/schemas/ChurnFile" }, "type": "array" } }, "required": [ "Clipped", "Files" ], "type": "object" }, "FleetMix": { "additionalProperties": false, "properties": { "Models": { "items": { "$ref": "#/components/schemas/ModelSeries" }, "type": "array" }, "NewestFirst": { "format": "int64", "type": "integer" }, "NewestModel": { "type": "string" } }, "required": [ "Models", "NewestFirst", "NewestModel" ], "type": "object" }, "Gallery": { "additionalProperties": false, "properties": { "LongestCostUSD": { "type": "number" }, "LongestDurationS": { "type": "number" }, "MedianCompletedCostUSD": { "type": "number" }, "MedianCostUSD": { "type": "number" }, "MedianDurationS": { "type": "number" }, "PriciestCostUSD": { "type": "number" }, "PriciestDurationS": { "type": "number" }, "Rows": { "items": { "$ref": "#/components/schemas/GallerySession" }, "type": "array" }, "Total": { "format": "int64", "type": "integer" } }, "required": [ "LongestCostUSD", "LongestDurationS", "MedianCompletedCostUSD", "MedianCostUSD", "MedianDurationS", "PriciestCostUSD", "PriciestDurationS", "Rows", "Total" ], "type": "object" }, "GallerySession": { "additionalProperties": false, "properties": { "Archetype": { "type": "string" }, "CostUSD": { "type": "number" }, "DurationS": { "type": "number" }, "Grade": { "type": "string" }, "Outcome": { "type": "string" } }, "required": [ "Archetype", "CostUSD", "DurationS", "Grade", "Outcome" ], "type": "object" }, "GlobalFacetValues": { "additionalProperties": false, "properties": { "Agents": { "items": { "$ref": "#/components/schemas/FacetCount" }, "type": "array" }, "Machines": { "items": { "$ref": "#/components/schemas/FacetCount" }, "type": "array" }, "Projects": { "items": { "$ref": "#/components/schemas/ProjectFacet" }, "type": "array" }, "Users": { "items": { "$ref": "#/components/schemas/FacetCount" }, "type": "array" } }, "required": [ "Agents", "Machines", "Projects", "Users" ], "type": "object" }, "Insights": { "additionalProperties": false, "properties": { "Archetypes": { "items": { "$ref": "#/components/schemas/LabeledCount" }, "type": "array" }, "Churn": { "$ref": "#/components/schemas/FileChurn" }, "Concurrency": { "$ref": "#/components/schemas/ConcurrencyStats" }, "Context": { "$ref": "#/components/schemas/ContextHealthStats" }, "Hygiene": { "$ref": "#/components/schemas/PromptHygiene" }, "Quality": { "$ref": "#/components/schemas/QualityDistribution" }, "Tools": { "$ref": "#/components/schemas/ToolStats" }, "Trends": { "anyOf": [ { "$ref": "#/components/schemas/Trends" }, { "type": "null" } ] }, "Velocity": { "$ref": "#/components/schemas/VelocityStats" } }, "required": [ "Archetypes", "Churn", "Concurrency", "Context", "Hygiene", "Quality", "Tools", "Trends", "Velocity" ], "type": "object" }, "InsightsResponse": { "additionalProperties": false, "properties": { "generated_at": { "format": "date-time", "type": "string" }, "insights": { "$ref": "#/components/schemas/Insights" }, "range": { "type": "string" }, "ranges": { "items": { "$ref": "#/components/schemas/DateRange" }, "type": "array" } }, "required": [ "generated_at", "insights", "range", "ranges" ], "type": "object" }, "LabeledCount": { "additionalProperties": false, "properties": { "Count": { "format": "int64", "type": "integer" }, "Key": { "type": "string" } }, "required": [ "Count", "Key" ], "type": "object" }, "Login": { "additionalProperties": false, "properties": { "password": { "format": "password", "type": "string" }, "username": { "type": "string" } }, "required": [ "username", "password" ], "type": "object" }, "LoginResponse": { "additionalProperties": false, "properties": { "is_admin": { "type": "boolean" }, "username": { "type": "string" } }, "required": [ "is_admin", "username" ], "type": "object" }, "Message": { "additionalProperties": false, "properties": { "Content": { "type": "string" }, "DuplicatePrompt": { "type": "boolean" }, "HasThinking": { "type": "boolean" }, "HasToolUse": { "type": "boolean" }, "Model": { "type": "string" }, "Ordinal": { "format": "int64", "type": "integer" }, "PromptDigest": { "format": "int64", "type": "integer" }, "PromptFactsCurrent": { "type": "boolean" }, "PromptNoCode": { "type": "boolean" }, "PromptShort": { "type": "boolean" }, "Role": { "type": "string" }, "ThinkingBytes": { "format": "int64", "type": "integer" }, "ThinkingText": { "type": "string" }, "Timestamp": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "Usage": { "anyOf": [ { "$ref": "#/components/schemas/TurnUsage" }, { "type": "null" } ] } }, "required": [ "Content", "DuplicatePrompt", "HasThinking", "HasToolUse", "Model", "Ordinal", "PromptDigest", "PromptFactsCurrent", "PromptNoCode", "PromptShort", "Role", "ThinkingBytes", "ThinkingText", "Timestamp", "Usage" ], "type": "object" }, "ModelCost": { "additionalProperties": false, "properties": { "CostUSD": { "type": "number" }, "Model": { "type": "string" }, "Sessions": { "format": "int64", "type": "integer" }, "Tokens": { "format": "int64", "type": "integer" } }, "required": [ "CostUSD", "Model", "Sessions", "Tokens" ], "type": "object" }, "ModelFallback": { "additionalProperties": false, "properties": { "DeclinedCacheRead": { "anyOf": [ { "format": "int64", "type": "integer" }, { "type": "null" } ] }, "DeclinedCacheWrite": { "anyOf": [ { "format": "int64", "type": "integer" }, { "type": "null" } ] }, "DeclinedInput": { "anyOf": [ { "format": "int64", "type": "integer" }, { "type": "null" } ] }, "DeclinedOutput": { "anyOf": [ { "format": "int64", "type": "integer" }, { "type": "null" } ] }, "DedupKey": { "type": "string" }, "FromModel": { "type": "string" }, "MessageOrdinal": { "anyOf": [ { "format": "int64", "type": "integer" }, { "type": "null" } ] }, "OccurredAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "RefusalCategory": { "type": "string" }, "RefusalExplanation": { "type": "string" }, "ToModel": { "type": "string" }, "Trigger": { "type": "string" } }, "required": [ "DeclinedCacheRead", "DeclinedCacheWrite", "DeclinedInput", "DeclinedOutput", "DedupKey", "FromModel", "MessageOrdinal", "OccurredAt", "RefusalCategory", "RefusalExplanation", "ToModel", "Trigger" ], "type": "object" }, "ModelSeries": { "additionalProperties": false, "properties": { "First": { "format": "int64", "type": "integer" }, "Model": { "type": "string" }, "Share": { "items": { "type": "number" }, "type": "array" }, "WindowShare": { "type": "number" } }, "required": [ "First", "Model", "Share", "WindowShare" ], "type": "object" }, "OAuthConsentResponse": { "additionalProperties": false, "properties": { "app_csrf": { "type": "string" }, "client_id": { "type": "string" }, "client_name": { "type": "string" }, "code_challenge": { "type": "string" }, "csrf": { "type": "string" }, "redirect_uri": { "type": "string" }, "resource": { "type": "string" }, "state": { "type": "string" }, "username": { "type": "string" } }, "required": [ "app_csrf", "client_id", "client_name", "code_challenge", "csrf", "redirect_uri", "resource", "state", "username" ], "type": "object" }, "OAuthGrant": { "additionalProperties": false, "properties": { "ClientID": { "type": "string" }, "ClientName": { "type": "string" }, "ConnectedAt": { "format": "date-time", "type": "string" }, "LastUsedAt": { "format": "date-time", "type": "string" }, "Scope": { "type": "string" } }, "required": [ "ClientID", "ClientName", "ConnectedAt", "LastUsedAt", "Scope" ], "type": "object" }, "OverviewResponse": { "additionalProperties": false, "properties": { "analytics": { "$ref": "#/components/schemas/Analytics" }, "range": { "type": "string" }, "ranges": { "items": { "$ref": "#/components/schemas/DateRange" }, "type": "array" }, "selected_user_ids": { "items": { "format": "int64", "type": "integer" }, "type": "array" }, "users": { "items": { "$ref": "#/components/schemas/OverviewUser" }, "type": "array" } }, "required": [ "analytics", "range", "ranges", "selected_user_ids", "users" ], "type": "object" }, "OverviewUser": { "additionalProperties": false, "properties": { "ID": { "format": "int64", "type": "integer" }, "IsAdmin": { "type": "boolean" }, "Username": { "type": "string" } }, "required": [ "ID", "IsAdmin", "Username" ], "type": "object" }, "ProjectFacet": { "additionalProperties": false, "properties": { "Count": { "format": "int64", "type": "integer" }, "ID": { "format": "int64", "type": "integer" }, "Key": { "type": "string" }, "Kind": { "type": "string" }, "Name": { "type": "string" } }, "required": [ "Count", "ID", "Key", "Kind", "Name" ], "type": "object" }, "ProjectResponse": { "additionalProperties": false, "properties": { "analytics": { "$ref": "#/components/schemas/Analytics" }, "facets": { "$ref": "#/components/schemas/FacetValues" }, "filter": { "$ref": "#/components/schemas/SessionFilter" }, "insights": { "$ref": "#/components/schemas/Insights" }, "project": { "$ref": "#/components/schemas/ProjectSummary" }, "range": { "type": "string" }, "ranges": { "items": { "$ref": "#/components/schemas/DateRange" }, "type": "array" }, "remainder": { "$ref": "#/components/schemas/SessionRemainder" }, "sessions": { "items": { "$ref": "#/components/schemas/ProjectSessionSummary" }, "type": "array" } }, "required": [ "analytics", "facets", "filter", "insights", "project", "range", "ranges", "remainder", "sessions" ], "type": "object" }, "ProjectSessionSummary": { "additionalProperties": false, "properties": { "Agent": { "type": "string" }, "EndedAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "GitBranch": { "type": "string" }, "Grade": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "ID": { "format": "int64", "type": "integer" }, "LastActiveAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "Machine": { "type": "string" }, "MessageCount": { "format": "int64", "type": "integer" }, "ModelFallbackCount": { "format": "int64", "type": "integer" }, "Outcome": { "type": "string" }, "PublicID": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "StartedAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "Title": { "type": "string" }, "TotalCacheRead": { "format": "int64", "type": "integer" }, "TotalCacheWrite": { "format": "int64", "type": "integer" }, "TotalCostUSD": { "type": "number" }, "TotalInput": { "format": "int64", "type": "integer" }, "TotalOutput": { "format": "int64", "type": "integer" }, "UserMessageCount": { "format": "int64", "type": "integer" }, "Username": { "type": "string" }, "Visibility": { "type": "string" } }, "required": [ "Agent", "EndedAt", "GitBranch", "Grade", "ID", "LastActiveAt", "Machine", "MessageCount", "ModelFallbackCount", "Outcome", "PublicID", "StartedAt", "Title", "TotalCacheRead", "TotalCacheWrite", "TotalCostUSD", "TotalInput", "TotalOutput", "UserMessageCount", "Username", "Visibility" ], "type": "object" }, "ProjectSummary": { "additionalProperties": false, "properties": { "DisplayName": { "type": "string" }, "Host": { "type": "string" }, "ID": { "format": "int64", "type": "integer" }, "Kind": { "type": "string" }, "LastActivity": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "OverviewPublic": { "type": "boolean" }, "Owner": { "type": "string" }, "RemoteKey": { "type": "string" }, "Repo": { "type": "string" }, "SessionCount": { "format": "int64", "type": "integer" }, "TotalCacheRead": { "format": "int64", "type": "integer" }, "TotalCacheWrite": { "format": "int64", "type": "integer" }, "TotalCostUSD": { "type": "number" }, "TotalInput": { "format": "int64", "type": "integer" }, "TotalOutput": { "format": "int64", "type": "integer" } }, "required": [ "DisplayName", "Host", "ID", "Kind", "LastActivity", "OverviewPublic", "Owner", "RemoteKey", "Repo", "SessionCount", "TotalCacheRead", "TotalCacheWrite", "TotalCostUSD", "TotalInput", "TotalOutput" ], "type": "object" }, "ProjectionRebuild": { "additionalProperties": false, "properties": { "code": { "const": "projection_rebuild", "type": "string" }, "error": { "const": "projection rebuild in progress", "type": "string" }, "reparse": { "$ref": "#/components/schemas/ReparseStatusResponse" } }, "required": [ "code", "error", "reparse" ], "type": "object" }, "ProjectsResponse": { "additionalProperties": false, "properties": { "projects": { "items": { "$ref": "#/components/schemas/ProjectSummary" }, "type": "array" }, "sparklines": { "additionalProperties": { "items": { "type": "number" }, "type": "array" }, "type": "object" } }, "required": [ "projects", "sparklines" ], "type": "object" }, "PromptHygiene": { "additionalProperties": false, "properties": { "Duplicate": { "format": "int64", "type": "integer" }, "NoCodeContext": { "format": "int64", "type": "integer" }, "Prompts": { "format": "int64", "type": "integer" }, "Sessions": { "format": "int64", "type": "integer" }, "Short": { "format": "int64", "type": "integer" }, "UnstructuredStarts": { "format": "int64", "type": "integer" } }, "required": [ "Duplicate", "NoCodeContext", "Prompts", "Sessions", "Short", "UnstructuredStarts" ], "type": "object" }, "ProviderUsageBatch": { "additionalProperties": false, "properties": { "account_id": { "minLength": 1, "type": "string" }, "events": { "items": { "$ref": "#/components/schemas/ProviderUsageEvent" }, "maxItems": 2000, "type": "array" }, "provider": { "enum": [ "cursor" ], "type": "string" } }, "required": [ "provider", "account_id", "events" ], "type": "object" }, "ProviderUsageEvent": { "additionalProperties": false, "properties": { "cache_read_tokens": { "minimum": 0, "type": "integer" }, "cache_write_tokens": { "minimum": 0, "type": "integer" }, "conversation_id": { "type": "string" }, "cost_known": { "default": false, "type": "boolean" }, "cost_usd": { "type": "number" }, "event_key": { "minLength": 1, "type": "string" }, "input_tokens": { "minimum": 0, "type": "integer" }, "model": { "type": "string" }, "occurred_at": { "format": "date-time", "type": "string" }, "output_tokens": { "minimum": 0, "type": "integer" } }, "required": [ "event_key", "occurred_at" ], "type": "object" }, "PublicOverviewResponse": { "additionalProperties": false, "properties": { "analytics": { "$ref": "#/components/schemas/Analytics" }, "range": { "type": "string" }, "ranges": { "items": { "$ref": "#/components/schemas/DateRange" }, "type": "array" }, "username": { "type": "string" } }, "required": [ "analytics", "range", "ranges", "username" ], "type": "object" }, "PublicProjectResponse": { "additionalProperties": false, "properties": { "analytics": { "$ref": "#/components/schemas/Analytics" }, "insights": { "$ref": "#/components/schemas/Insights" }, "project": { "$ref": "#/components/schemas/ProjectSummary" }, "range": { "type": "string" }, "ranges": { "items": { "$ref": "#/components/schemas/DateRange" }, "type": "array" } }, "required": [ "analytics", "insights", "project", "range", "ranges" ], "type": "object" }, "PublicSessionResponse": { "additionalProperties": false, "properties": { "snapshot": { "$ref": "#/components/schemas/PublicSessionSnapshot" } }, "required": [ "snapshot" ], "type": "object" }, "PublicSessionSnapshot": { "additionalProperties": false, "properties": { "Audit": { "$ref": "#/components/schemas/SessionAudit" }, "Page": { "$ref": "#/components/schemas/TranscriptPage" }, "ProjectionRevision": { "format": "int64", "type": "integer" } }, "required": [ "Audit", "Page", "ProjectionRevision" ], "type": "object" }, "Publication": { "additionalProperties": false, "properties": { "published": { "type": "boolean" } }, "required": [ "published" ], "type": "object" }, "PublicationResponse": { "additionalProperties": false, "properties": { "published": { "type": "boolean" } }, "required": [ "published" ], "type": "object" }, "QualityDistribution": { "additionalProperties": false, "properties": { "Graded": { "format": "int64", "type": "integer" }, "Grades": { "items": { "$ref": "#/components/schemas/LabeledCount" }, "type": "array" }, "Outcomes": { "items": { "$ref": "#/components/schemas/LabeledCount" }, "type": "array" }, "Sessions": { "format": "int64", "type": "integer" } }, "required": [ "Graded", "Grades", "Outcomes", "Sessions" ], "type": "object" }, "Register": { "additionalProperties": false, "properties": { "invite_token": { "type": "string" }, "password": { "format": "password", "type": "string" }, "username": { "type": "string" } }, "required": [ "username", "password" ], "type": "object" }, "RegisteredUserResponse": { "additionalProperties": false, "properties": { "id": { "format": "int64", "type": "integer" }, "is_admin": { "type": "boolean" }, "username": { "type": "string" } }, "required": [ "id", "is_admin", "username" ], "type": "object" }, "ReparseStatusResponse": { "additionalProperties": false, "properties": { "done": { "format": "int64", "type": "integer" }, "failed": { "format": "int64", "type": "integer" }, "in_progress": { "type": "boolean" }, "started_at": { "format": "date-time", "type": "string" }, "total": { "format": "int64", "type": "integer" } }, "required": [ "done", "failed", "in_progress", "total" ], "type": "object" }, "RevokedResponse": { "additionalProperties": false, "properties": { "revoked": { "type": "boolean" } }, "required": [ "revoked" ], "type": "object" }, "RhythmGrid": { "additionalProperties": false, "properties": { "Cells": { "items": { "items": { "format": "int64", "type": "integer" }, "type": "array" }, "type": "array" } }, "required": [ "Cells" ], "type": "object" }, "SearchSnippet": { "additionalProperties": false, "properties": { "MatchEnd": { "format": "int64", "type": "integer" }, "MatchStart": { "format": "int64", "type": "integer" }, "Text": { "type": "string" } }, "required": [ "MatchEnd", "MatchStart", "Text" ], "type": "object" }, "SessionAudit": { "additionalProperties": false, "properties": { "Detail": { "$ref": "#/components/schemas/SessionDetail" }, "Fallbacks": { "items": { "$ref": "#/components/schemas/ModelFallback" }, "type": "array" }, "Signals": { "$ref": "#/components/schemas/SessionSignals" }, "Subagents": { "items": { "$ref": "#/components/schemas/SubagentRow" }, "type": "array" } }, "required": [ "Detail", "Fallbacks", "Signals", "Subagents" ], "type": "object" }, "SessionDetail": { "additionalProperties": false, "properties": { "Agent": { "type": "string" }, "Cwd": { "type": "string" }, "EndedAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "GitBranch": { "type": "string" }, "ID": { "format": "int64", "type": "integer" }, "LastActiveAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "Machine": { "type": "string" }, "MessageCount": { "format": "int64", "type": "integer" }, "ModelFallbackCount": { "format": "int64", "type": "integer" }, "OwnerID": { "format": "int64", "type": "integer" }, "PRNumber": { "format": "int64", "type": "integer" }, "PRRepo": { "type": "string" }, "PRURL": { "type": "string" }, "ParentID": { "anyOf": [ { "format": "int64", "type": "integer" }, { "type": "null" } ] }, "PermissionMode": { "type": "string" }, "ProjectID": { "format": "int64", "type": "integer" }, "ProjectKey": { "type": "string" }, "ProjectKind": { "type": "string" }, "ProjectName": { "type": "string" }, "PublicID": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "ReasoningEffort": { "type": "string" }, "Slug": { "type": "string" }, "StartedAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "SubagentName": { "type": "string" }, "Title": { "type": "string" }, "TotalCacheRead": { "format": "int64", "type": "integer" }, "TotalCacheSavingsUSD": { "type": "number" }, "TotalCacheWrite": { "format": "int64", "type": "integer" }, "TotalCostUSD": { "type": "number" }, "TotalInput": { "format": "int64", "type": "integer" }, "TotalOutput": { "format": "int64", "type": "integer" }, "UserMessageCount": { "format": "int64", "type": "integer" }, "Username": { "type": "string" }, "Visibility": { "type": "string" } }, "required": [ "Agent", "Cwd", "EndedAt", "GitBranch", "ID", "LastActiveAt", "Machine", "MessageCount", "ModelFallbackCount", "OwnerID", "PRNumber", "PRRepo", "PRURL", "ParentID", "PermissionMode", "ProjectID", "ProjectKey", "ProjectKind", "ProjectName", "PublicID", "ReasoningEffort", "Slug", "StartedAt", "SubagentName", "Title", "TotalCacheRead", "TotalCacheSavingsUSD", "TotalCacheWrite", "TotalCostUSD", "TotalInput", "TotalOutput", "UserMessageCount", "Username", "Visibility" ], "type": "object" }, "SessionEvent": { "additionalProperties": false, "properties": { "Attrs": { "additionalProperties": {}, "type": "object" }, "Kind": { "type": "string" }, "MessageOrdinal": { "anyOf": [ { "format": "int64", "type": "integer" }, { "type": "null" } ] }, "OccurredAt": { "format": "date-time", "type": "string" } }, "required": [ "Attrs", "Kind", "MessageOrdinal", "OccurredAt" ], "type": "object" }, "SessionFilter": { "additionalProperties": false, "properties": { "After": { "format": "int64", "type": "integer" }, "AfterVal": { "type": "string" }, "Agent": { "type": "string" }, "Desc": { "type": "boolean" }, "Grade": { "type": "string" }, "IncludeEmpty": { "type": "boolean" }, "IncludeSubagents": { "type": "boolean" }, "Limit": { "format": "int64", "type": "integer" }, "Machine": { "type": "string" }, "Offset": { "format": "int64", "type": "integer" }, "Outcome": { "type": "string" }, "ProjectID": { "format": "int64", "type": "integer" }, "Query": { "type": "string" }, "Range": { "type": "string" }, "RequireSpan": { "type": "boolean" }, "Since": { "format": "date-time", "type": "string" }, "Sort": { "type": "string" }, "Username": { "type": "string" } }, "required": [ "After", "AfterVal", "Agent", "Desc", "Grade", "IncludeEmpty", "IncludeSubagents", "Limit", "Machine", "Offset", "Outcome", "ProjectID", "Query", "Range", "RequireSpan", "Since", "Sort", "Username" ], "type": "object" }, "SessionProjectRequest": { "additionalProperties": false, "properties": { "project_id": { "format": "int64", "type": "integer" } }, "required": [ "project_id" ], "type": "object" }, "SessionProjectResponse": { "additionalProperties": false, "properties": { "pinned": { "type": "boolean" }, "project_id": { "format": "int64", "type": "integer" }, "session_id": { "format": "int64", "type": "integer" } }, "required": [ "pinned", "project_id", "session_id" ], "type": "object" }, "SessionPublicationResponse": { "additionalProperties": false, "properties": { "public_id": { "type": "string" }, "published": { "type": "boolean" } }, "required": [ "published" ], "type": "object" }, "SessionRemainder": { "additionalProperties": false, "properties": { "CacheRead": { "format": "int64", "type": "integer" }, "CacheWrite": { "format": "int64", "type": "integer" }, "CostUSD": { "type": "number" }, "Input": { "format": "int64", "type": "integer" }, "Output": { "format": "int64", "type": "integer" }, "Sessions": { "format": "int64", "type": "integer" } }, "required": [ "CacheRead", "CacheWrite", "CostUSD", "Input", "Output", "Sessions" ], "type": "object" }, "SessionResponse": { "additionalProperties": false, "properties": { "can_delete": { "type": "boolean" }, "owner": { "type": "boolean" }, "snapshot": { "$ref": "#/components/schemas/SessionSnapshot" } }, "required": [ "can_delete", "owner", "snapshot" ], "type": "object" }, "SessionRow": { "additionalProperties": false, "properties": { "Agent": { "type": "string" }, "EndedAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "GitBranch": { "type": "string" }, "Grade": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "ID": { "format": "int64", "type": "integer" }, "LastActiveAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "Machine": { "type": "string" }, "MessageCount": { "format": "int64", "type": "integer" }, "ModelFallbackCount": { "format": "int64", "type": "integer" }, "Outcome": { "type": "string" }, "ProjectID": { "format": "int64", "type": "integer" }, "ProjectKey": { "type": "string" }, "ProjectKind": { "type": "string" }, "ProjectName": { "type": "string" }, "PublicID": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "Search": { "$ref": "#/components/schemas/SearchSnippet" }, "StartedAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "Title": { "type": "string" }, "TotalCacheRead": { "format": "int64", "type": "integer" }, "TotalCacheWrite": { "format": "int64", "type": "integer" }, "TotalCostUSD": { "type": "number" }, "TotalInput": { "format": "int64", "type": "integer" }, "TotalOutput": { "format": "int64", "type": "integer" }, "Tree": { "$ref": "#/components/schemas/TreeRollup" }, "UserMessageCount": { "format": "int64", "type": "integer" }, "Username": { "type": "string" }, "Visibility": { "type": "string" } }, "required": [ "Agent", "EndedAt", "GitBranch", "Grade", "ID", "LastActiveAt", "Machine", "MessageCount", "ModelFallbackCount", "Outcome", "ProjectID", "ProjectKey", "ProjectKind", "ProjectName", "PublicID", "Search", "StartedAt", "Title", "TotalCacheRead", "TotalCacheWrite", "TotalCostUSD", "TotalInput", "TotalOutput", "Tree", "UserMessageCount", "Username", "Visibility" ], "type": "object" }, "SessionShape": { "additionalProperties": false, "properties": { "DupIDs": { "format": "int64", "type": "integer" }, "Outline": { "items": { "$ref": "#/components/schemas/Message" }, "type": "array" }, "Tools": { "items": { "$ref": "#/components/schemas/ToolCallView" }, "type": "array" } }, "required": [ "DupIDs", "Outline", "Tools" ], "type": "object" }, "SessionSignals": { "additionalProperties": false, "properties": { "AssistantTurns": { "anyOf": [ { "format": "int64", "type": "integer" }, { "type": "null" } ] }, "ContextResetCount": { "anyOf": [ { "format": "int64", "type": "integer" }, { "type": "null" } ] }, "DuplicatePromptCount": { "format": "int64", "type": "integer" }, "EditChurn": { "format": "int64", "type": "integer" }, "Grade": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "LongestFailureStreak": { "format": "int64", "type": "integer" }, "NoCodeContextCount": { "format": "int64", "type": "integer" }, "Outcome": { "type": "string" }, "OutcomeConfidence": { "type": "string" }, "PeakContextTokens": { "anyOf": [ { "format": "int64", "type": "integer" }, { "type": "null" } ] }, "PromptCount": { "format": "int64", "type": "integer" }, "Score": { "anyOf": [ { "format": "int64", "type": "integer" }, { "type": "null" } ] }, "SessionID": { "format": "int64", "type": "integer" }, "ShortPromptCount": { "format": "int64", "type": "integer" }, "ThinkingPeakTokens": { "anyOf": [ { "format": "int64", "type": "integer" }, { "type": "null" } ] }, "ThinkingTailTokens": { "anyOf": [ { "format": "int64", "type": "integer" }, { "type": "null" } ] }, "ThinkingTurns": { "anyOf": [ { "format": "int64", "type": "integer" }, { "type": "null" } ] }, "ToolCalls": { "format": "int64", "type": "integer" }, "ToolFailures": { "format": "int64", "type": "integer" }, "ToolRetries": { "format": "int64", "type": "integer" }, "UnstructuredStart": { "type": "boolean" } }, "required": [ "AssistantTurns", "ContextResetCount", "DuplicatePromptCount", "EditChurn", "Grade", "LongestFailureStreak", "NoCodeContextCount", "Outcome", "OutcomeConfidence", "PeakContextTokens", "PromptCount", "Score", "SessionID", "ShortPromptCount", "ThinkingPeakTokens", "ThinkingTailTokens", "ThinkingTurns", "ToolCalls", "ToolFailures", "ToolRetries", "UnstructuredStart" ], "type": "object" }, "SessionSnapshot": { "additionalProperties": false, "properties": { "Audit": { "$ref": "#/components/schemas/SessionAudit" }, "Page": { "$ref": "#/components/schemas/TranscriptPage" }, "Shape": { "anyOf": [ { "$ref": "#/components/schemas/SessionShape" }, { "type": "null" } ] } }, "required": [ "Audit", "Page", "Shape" ], "type": "object" }, "SessionSummary": { "additionalProperties": false, "properties": { "Agent": { "type": "string" }, "EndedAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "GitBranch": { "type": "string" }, "ID": { "format": "int64", "type": "integer" }, "LastActiveAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "Machine": { "type": "string" }, "MessageCount": { "format": "int64", "type": "integer" }, "ModelFallbackCount": { "format": "int64", "type": "integer" }, "PublicID": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "StartedAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "Title": { "type": "string" }, "TotalCacheRead": { "format": "int64", "type": "integer" }, "TotalCacheWrite": { "format": "int64", "type": "integer" }, "TotalCostUSD": { "type": "number" }, "TotalInput": { "format": "int64", "type": "integer" }, "TotalOutput": { "format": "int64", "type": "integer" }, "UserMessageCount": { "format": "int64", "type": "integer" }, "Username": { "type": "string" }, "Visibility": { "type": "string" } }, "required": [ "Agent", "EndedAt", "GitBranch", "ID", "LastActiveAt", "Machine", "MessageCount", "ModelFallbackCount", "PublicID", "StartedAt", "Title", "TotalCacheRead", "TotalCacheWrite", "TotalCostUSD", "TotalInput", "TotalOutput", "UserMessageCount", "Username", "Visibility" ], "type": "object" }, "SessionsResponse": { "additionalProperties": false, "properties": { "facets": { "$ref": "#/components/schemas/GlobalFacetValues" }, "filter": { "$ref": "#/components/schemas/SessionFilter" }, "has_more": { "type": "boolean" }, "sessions": { "items": { "$ref": "#/components/schemas/SessionRow" }, "type": "array" } }, "required": [ "facets", "filter", "has_more", "sessions" ], "type": "object" }, "SignalTrends": { "additionalProperties": false, "properties": { "AbandonedCount": { "items": { "format": "int64", "type": "integer" }, "type": "array" }, "AbandonedRate": { "items": { "type": "number" }, "type": "array" }, "ArchetypeShare": { "items": { "additionalProperties": { "type": "number" }, "type": "object" }, "type": "array" }, "CompletedCount": { "items": { "format": "int64", "type": "integer" }, "type": "array" }, "CompletedRate": { "items": { "type": "number" }, "type": "array" }, "ContextHistogram": { "items": { "$ref": "#/components/schemas/ContextBucket" }, "type": "array" }, "ContextMarkers": { "items": { "$ref": "#/components/schemas/ContextMarker" }, "type": "array" }, "ContextResets": { "items": { "format": "int64", "type": "integer" }, "type": "array" }, "GPA": { "items": { "type": "number" }, "type": "array" }, "GradeShare": { "items": { "additionalProperties": { "type": "number" }, "type": "object" }, "type": "array" }, "HygieneNoCode": { "items": { "type": "number" }, "type": "array" }, "HygieneRepeated": { "items": { "type": "number" }, "type": "array" }, "HygieneTerse": { "items": { "type": "number" }, "type": "array" }, "HygieneUnstructured": { "items": { "type": "number" }, "type": "array" }, "OutcomeTotal": { "items": { "format": "int64", "type": "integer" }, "type": "array" } }, "required": [ "AbandonedCount", "AbandonedRate", "ArchetypeShare", "CompletedCount", "CompletedRate", "ContextHistogram", "ContextMarkers", "ContextResets", "GPA", "GradeShare", "HygieneNoCode", "HygieneRepeated", "HygieneTerse", "HygieneUnstructured", "OutcomeTotal" ], "type": "object" }, "Status": { "additionalProperties": false, "properties": { "done": { "format": "int64", "type": "integer" }, "failed": { "format": "int64", "type": "integer" }, "in_progress": { "type": "boolean" }, "started_at": { "format": "date-time", "type": "string" }, "total": { "format": "int64", "type": "integer" } }, "required": [ "done", "failed", "in_progress", "total" ], "type": "object" }, "StatusResponse": { "additionalProperties": false, "properties": { "status": { "type": "string" } }, "required": [ "status" ], "type": "object" }, "SubagentRow": { "additionalProperties": false, "properties": { "Agent": { "type": "string" }, "EndedAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "GitBranch": { "type": "string" }, "Grade": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "ID": { "format": "int64", "type": "integer" }, "LastActiveAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "Machine": { "type": "string" }, "MessageCount": { "format": "int64", "type": "integer" }, "ModelFallbackCount": { "format": "int64", "type": "integer" }, "Outcome": { "type": "string" }, "PublicID": { "anyOf": [ { "type": "string" }, { "type": "null" } ] }, "StartedAt": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "SubagentName": { "type": "string" }, "Title": { "type": "string" }, "TotalCacheRead": { "format": "int64", "type": "integer" }, "TotalCacheWrite": { "format": "int64", "type": "integer" }, "TotalCostUSD": { "type": "number" }, "TotalInput": { "format": "int64", "type": "integer" }, "TotalOutput": { "format": "int64", "type": "integer" }, "UserMessageCount": { "format": "int64", "type": "integer" }, "Username": { "type": "string" }, "Visibility": { "type": "string" } }, "required": [ "Agent", "EndedAt", "GitBranch", "Grade", "ID", "LastActiveAt", "Machine", "MessageCount", "ModelFallbackCount", "Outcome", "PublicID", "StartedAt", "SubagentName", "Title", "TotalCacheRead", "TotalCacheWrite", "TotalCostUSD", "TotalInput", "TotalOutput", "UserMessageCount", "Username", "Visibility" ], "type": "object" }, "SubagentStats": { "additionalProperties": false, "properties": { "CostShare": { "items": { "type": "number" }, "type": "array" }, "CostThroughSubagentsPct": { "type": "number" }, "DeepestTree": { "format": "int64", "type": "integer" }, "DelegateShare": { "items": { "type": "number" }, "type": "array" }, "FanoutOrder": { "items": { "type": "string" }, "type": "array" }, "FanoutRows": { "items": { "additionalProperties": { "format": "int64", "type": "integer" }, "type": "object" }, "type": "array" }, "SessionsThatDelegatePct": { "type": "number" }, "SubagentSessionsInWindow": { "format": "int64", "type": "integer" } }, "required": [ "CostShare", "CostThroughSubagentsPct", "DeepestTree", "DelegateShare", "FanoutOrder", "FanoutRows", "SessionsThatDelegatePct", "SubagentSessionsInWindow" ], "type": "object" }, "TokenListItem": { "additionalProperties": false, "properties": { "created_at": { "format": "date-time", "type": "string" }, "id": { "format": "int64", "type": "integer" }, "last_used_at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "name": { "type": "string" }, "revoked_at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ] }, "scope": { "type": "string" } }, "required": [ "created_at", "id", "last_used_at", "name", "revoked_at", "scope" ], "type": "object" }, "TokensResponse": { "additionalProperties": false, "properties": { "tokens": { "items": { "$ref": "#/components/schemas/TokenListItem" }, "type": "array" } }, "required": [ "tokens" ], "type": "object" }, "ToolCallView": { "additionalProperties": false, "properties": { "AttributionAgent": { "type": "string" }, "AttributionPlugin": { "type": "string" }, "AttributionSkill": { "type": "string" }, "CallIndex": { "format": "int64", "type": "integer" }, "Category": { "type": "string" }, "Detail": { "type": "string" }, "FilePath": { "type": "string" }, "FileRelPath": { "type": "string" }, "InputBytes": { "format": "int64", "type": "integer" }, "InputMediaType": { "type": "string" }, "InputSHA": { "type": "string" }, "MessageOrdinal": { "format": "int64", "type": "integer" }, "ResultBytes": { "format": "int64", "type": "integer" }, "ResultMediaType": { "type": "string" }, "ResultSHA": { "type": "string" }, "ResultStatus": { "type": "string" }, "StructBytes": { "format": "int64", "type": "integer" }, "StructMediaType": { "type": "string" }, "StructSHA256": { "type": "string" }, "ToolName": { "type": "string" } }, "required": [ "AttributionAgent", "AttributionPlugin", "AttributionSkill", "CallIndex", "Category", "Detail", "FilePath", "FileRelPath", "InputBytes", "InputMediaType", "InputSHA", "MessageOrdinal", "ResultBytes", "ResultMediaType", "ResultSHA", "ResultStatus", "StructBytes", "StructMediaType", "StructSHA256", "ToolName" ], "type": "object" }, "ToolFailSeries": { "additionalProperties": false, "properties": { "Name": { "type": "string" }, "Rate": { "items": { "type": "number" }, "type": "array" } }, "required": [ "Name", "Rate" ], "type": "object" }, "ToolPoint": { "additionalProperties": false, "properties": { "Calls": { "format": "int64", "type": "integer" }, "Category": { "type": "string" }, "Failures": { "format": "int64", "type": "integer" }, "Name": { "type": "string" }, "Sessions": { "format": "int64", "type": "integer" } }, "required": [ "Calls", "Category", "Failures", "Name", "Sessions" ], "type": "object" }, "ToolStat": { "additionalProperties": false, "properties": { "Calls": { "format": "int64", "type": "integer" }, "Failures": { "format": "int64", "type": "integer" }, "Name": { "type": "string" } }, "required": [ "Calls", "Failures", "Name" ], "type": "object" }, "ToolStats": { "additionalProperties": false, "properties": { "Clipped": { "format": "int64", "type": "integer" }, "Tools": { "items": { "$ref": "#/components/schemas/ToolStat" }, "type": "array" }, "TotalCalls": { "format": "int64", "type": "integer" }, "TotalFailures": { "format": "int64", "type": "integer" }, "Turns": { "format": "int64", "type": "integer" } }, "required": [ "Clipped", "Tools", "TotalCalls", "TotalFailures", "Turns" ], "type": "object" }, "ToolTrends": { "additionalProperties": false, "properties": { "FailFleet": { "items": { "type": "number" }, "type": "array" }, "FailWorst": { "items": { "$ref": "#/components/schemas/ToolFailSeries" }, "type": "array" }, "Mix": { "items": { "additionalProperties": { "type": "number" }, "type": "object" }, "type": "array" }, "MixOrder": { "items": { "type": "string" }, "type": "array" }, "Reliability": { "items": { "$ref": "#/components/schemas/ToolPoint" }, "type": "array" } }, "required": [ "FailFleet", "FailWorst", "Mix", "MixOrder", "Reliability" ], "type": "object" }, "TranscriptPage": { "additionalProperties": false, "properties": { "Attachments": { "items": { "$ref": "#/components/schemas/AttachmentView" }, "type": "array" }, "EarlierCount": { "format": "int64", "type": "integer" }, "Events": { "items": { "$ref": "#/components/schemas/SessionEvent" }, "type": "array" }, "Fallbacks": { "items": { "$ref": "#/components/schemas/ModelFallback" }, "type": "array" }, "HasEarlier": { "type": "boolean" }, "More": { "type": "boolean" }, "Msgs": { "items": { "$ref": "#/components/schemas/Message" }, "type": "array" }, "Seed": { "items": { "$ref": "#/components/schemas/Message" }, "type": "array" }, "Tools": { "items": { "$ref": "#/components/schemas/ToolCallView" }, "type": "array" } }, "required": [ "Attachments", "EarlierCount", "Events", "Fallbacks", "HasEarlier", "More", "Msgs", "Seed", "Tools" ], "type": "object" }, "TranscriptResponse": { "additionalProperties": false, "properties": { "page": { "$ref": "#/components/schemas/TranscriptPage" } }, "required": [ "page" ], "type": "object" }, "TreeRollup": { "additionalProperties": false, "properties": { "CostUSD": { "type": "number" }, "SubagentCount": { "format": "int64", "type": "integer" } }, "required": [ "CostUSD", "SubagentCount" ], "type": "object" }, "Trends": { "additionalProperties": false, "properties": { "BucketStarts": { "items": { "format": "date-time", "type": "string" }, "type": "array" }, "Churn": { "$ref": "#/components/schemas/ChurnTrend" }, "Economics": { "$ref": "#/components/schemas/Economics" }, "FleetMix": { "$ref": "#/components/schemas/FleetMix" }, "Gallery": { "$ref": "#/components/schemas/Gallery" }, "Labels": { "items": { "type": "string" }, "type": "array" }, "ModelCost": { "items": { "$ref": "#/components/schemas/ModelCost" }, "type": "array" }, "Rhythm": { "$ref": "#/components/schemas/RhythmGrid" }, "Signals": { "$ref": "#/components/schemas/SignalTrends" }, "Subagents": { "$ref": "#/components/schemas/SubagentStats" }, "Tools": { "$ref": "#/components/schemas/ToolTrends" }, "Unit": { "type": "string" }, "Velocity": { "$ref": "#/components/schemas/VelocityTrends" } }, "required": [ "BucketStarts", "Churn", "Economics", "FleetMix", "Gallery", "Labels", "ModelCost", "Rhythm", "Signals", "Subagents", "Tools", "Unit", "Velocity" ], "type": "object" }, "TurnUsage": { "additionalProperties": false, "properties": { "CacheRead": { "format": "int64", "type": "integer" }, "CacheWrite": { "format": "int64", "type": "integer" }, "ContextTokens": { "format": "int64", "type": "integer" }, "CostUSD": { "type": "number" }, "Input": { "format": "int64", "type": "integer" }, "Output": { "format": "int64", "type": "integer" }, "Reasoning": { "format": "int64", "type": "integer" } }, "required": [ "CacheRead", "CacheWrite", "ContextTokens", "CostUSD", "Input", "Output", "Reasoning" ], "type": "object" }, "VelocityStats": { "additionalProperties": false, "properties": { "ActiveSeconds": { "type": "number" }, "FirstResponseP50": { "format": "int64", "type": "integer" }, "MsgsPerActiveMin": { "type": "number" }, "ResponseP50": { "format": "int64", "type": "integer" }, "ResponseP90": { "format": "int64", "type": "integer" }, "Sessions": { "format": "int64", "type": "integer" }, "ToolsPerActiveMin": { "type": "number" }, "Turns": { "format": "int64", "type": "integer" } }, "required": [ "ActiveSeconds", "FirstResponseP50", "MsgsPerActiveMin", "ResponseP50", "ResponseP90", "Sessions", "ToolsPerActiveMin", "Turns" ], "type": "object" }, "VelocityTrends": { "additionalProperties": false, "properties": { "ActiveHours": { "items": { "type": "number" }, "type": "array" }, "MsgsPerMin": { "items": { "type": "number" }, "type": "array" }, "ResponseP50": { "items": { "type": "number" }, "type": "array" }, "ResponseP90": { "items": { "type": "number" }, "type": "array" }, "ResponseP99": { "items": { "type": "number" }, "type": "array" }, "ToolsPerMin": { "items": { "type": "number" }, "type": "array" }, "WallHours": { "items": { "type": "number" }, "type": "array" } }, "required": [ "ActiveHours", "MsgsPerMin", "ResponseP50", "ResponseP90", "ResponseP99", "ToolsPerMin", "WallHours" ], "type": "object" }, "Viewer": { "additionalProperties": false, "properties": { "authenticated": { "type": "boolean" }, "csrf_token": { "type": "string" }, "is_admin": { "type": "boolean" }, "overview_public": { "type": "boolean" }, "user_id": { "format": "int64", "type": "integer" }, "username": { "type": "string" }, "version": { "type": "string" } }, "required": [ "authenticated", "is_admin", "overview_public", "version" ], "type": "object" } }, "securitySchemes": { "bearerToken": { "bearerFormat": "akari token", "scheme": "bearer", "type": "http" }, "sessionCookie": { "in": "cookie", "name": "akari_session", "type": "apiKey" } } }, "info": { "description": "HTTP API for the akari React application, session ingest clients, and account automation. Browser requests authenticate with the akari_session cookie. Non-browser clients use a bearer token with the scope required by each operation.", "title": "akari API", "version": "1.0.0" }, "openapi": "3.1.0", "paths": { "/api/v1/app/account": { "get": { "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountResponse" } } }, "description": "Account read model" } }, "summary": "Read account bots, tokens, connections, invites, and rebuild state", "tags": [ "Account" ] } }, "/api/v1/app/account/bots": { "post": { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateBot" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountBot" } } }, "description": "Bot account created" }, "409": { "$ref": "#/components/responses/Conflict" } }, "summary": "Create a bot account", "tags": [ "Account" ] } }, "/api/v1/app/account/bots/{bot_id}": { "delete": { "parameters": [ { "in": "path", "name": "bot_id", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeletedBotResponse" } } }, "description": "Bot account soft-deleted" }, "404": { "$ref": "#/components/responses/NotFound" } }, "summary": "Soft-delete a bot account and revoke its credentials", "tags": [ "Account" ] } }, "/api/v1/app/account/bots/{bot_id}/tokens": { "post": { "parameters": [ { "in": "path", "name": "bot_id", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateToken" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatedTokenResponse" } } }, "description": "Bot token created; the plaintext secret is returned once" }, "404": { "$ref": "#/components/responses/NotFound" } }, "summary": "Create an API token for a bot account", "tags": [ "Account" ] } }, "/api/v1/app/account/bots/{bot_id}/tokens/{token_id}": { "delete": { "parameters": [ { "in": "path", "name": "bot_id", "required": true, "schema": { "format": "int64", "type": "integer" } }, { "in": "path", "name": "token_id", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RevokedResponse" } } }, "description": "Bot token revoked" }, "404": { "$ref": "#/components/responses/NotFound" } }, "summary": "Revoke a bot account API token", "tags": [ "Account" ] } }, "/api/v1/app/account/connections/{client_id}": { "delete": { "parameters": [ { "in": "path", "name": "client_id", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RevokedResponse" } } }, "description": "Connection revoked" }, "404": { "$ref": "#/components/responses/NotFound" } }, "summary": "Revoke an OAuth client connection", "tags": [ "Account" ] } }, "/api/v1/app/account/invites/{id}": { "delete": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RevokedResponse" } } }, "description": "Invite revoked" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" } }, "summary": "Revoke a registration invitation", "tags": [ "Account" ] } }, "/api/v1/app/account/overview-publication": { "put": { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Publication" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicationResponse" } } }, "description": "Publication updated" } }, "summary": "Publish or unpublish the current user's overview", "tags": [ "Account" ] } }, "/api/v1/app/bootstrap": { "get": { "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Viewer" } } }, "description": "Viewer state" } }, "security": [], "summary": "Resolve the current application viewer", "tags": [ "Application" ] } }, "/api/v1/app/insights": { "get": { "parameters": [ { "in": "query", "name": "range", "schema": { "enum": [ "1d", "3d", "7d", "30d", "90d", "year", "all" ], "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InsightsResponse" } } }, "description": "Insights read model" }, "400": { "$ref": "#/components/responses/BadRequest" }, "503": { "$ref": "#/components/responses/ProjectionRebuilding" } }, "summary": "Read quality and workflow insights", "tags": [ "Application" ] } }, "/api/v1/app/oauth/authorize": { "get": { "parameters": [ { "in": "query", "name": "client_id", "required": true, "schema": { "type": "string" } }, { "in": "query", "name": "redirect_uri", "required": true, "schema": { "format": "uri", "type": "string" } }, { "in": "query", "name": "state", "required": true, "schema": { "type": "string" } }, { "in": "query", "name": "code_challenge", "required": true, "schema": { "type": "string" } }, { "in": "query", "name": "resource", "schema": { "format": "uri", "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OAuthConsentResponse" } } }, "description": "Consent read model" }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } }, "summary": "Resolve an OAuth consent request for the signed-in user", "tags": [ "Account" ] } }, "/api/v1/app/overview": { "get": { "parameters": [ { "in": "query", "name": "range", "schema": { "enum": [ "1d", "3d", "7d", "30d", "90d", "year", "all" ], "type": "string" } }, { "in": "query", "name": "user", "schema": { "items": { "format": "int64", "type": "integer" }, "type": "array" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OverviewResponse" } } }, "description": "Overview read model" }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "503": { "$ref": "#/components/responses/ProjectionRebuilding" } }, "summary": "Read fleet usage analytics", "tags": [ "Application" ] } }, "/api/v1/app/projects": { "get": { "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectsResponse" } } }, "description": "Project collection" }, "503": { "$ref": "#/components/responses/ProjectionRebuilding" } }, "summary": "List projects with lifetime rollups", "tags": [ "Application" ] } }, "/api/v1/app/projects/{id}": { "get": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } }, { "in": "query", "name": "range", "schema": { "enum": [ "1d", "3d", "7d", "30d", "90d", "year", "all" ], "type": "string" } }, { "in": "query", "name": "agent", "schema": { "type": "string" } }, { "in": "query", "name": "machine", "schema": { "type": "string" } }, { "in": "query", "name": "user", "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProjectResponse" } } }, "description": "Project read model" }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ProjectionRebuilding" } }, "summary": "Read one project with windowed sessions and analytics", "tags": [ "Application" ] } }, "/api/v1/app/projects/{id}/publication": { "put": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Publication" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicationResponse" } } }, "description": "Publication updated" }, "404": { "$ref": "#/components/responses/NotFound" } }, "summary": "Publish or unpublish a project overview", "tags": [ "Application" ] } }, "/api/v1/app/public/projects/{id}": { "get": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } }, { "in": "query", "name": "range", "schema": { "enum": [ "1d", "3d", "7d", "30d", "90d", "year", "all" ], "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicProjectResponse" } } }, "description": "Published project overview" }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ProjectionRebuilding" } }, "security": [], "summary": "Read a published project overview", "tags": [ "Public" ] } }, "/api/v1/app/public/sessions/{public_id}": { "get": { "parameters": [ { "in": "path", "name": "public_id", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicSessionResponse" } } }, "description": "Published session snapshot" }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ProjectionRebuilding" } }, "security": [], "summary": "Read a published session", "tags": [ "Public" ] } }, "/api/v1/app/public/sessions/{public_id}/transcript": { "get": { "parameters": [ { "in": "path", "name": "public_id", "required": true, "schema": { "type": "string" } }, { "in": "query", "name": "before", "required": true, "schema": { "minimum": 0, "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicSessionResponse" } } }, "description": "Published transcript page" }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ProjectionRebuilding" } }, "security": [], "summary": "Read an earlier published transcript window", "tags": [ "Public" ] } }, "/api/v1/app/public/users/{username}": { "get": { "parameters": [ { "in": "path", "name": "username", "required": true, "schema": { "type": "string" } }, { "in": "query", "name": "range", "schema": { "enum": [ "1d", "3d", "7d", "30d", "90d", "year", "all" ], "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicOverviewResponse" } } }, "description": "Published overview" }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ProjectionRebuilding" } }, "security": [], "summary": "Read a published user overview", "tags": [ "Public" ] } }, "/api/v1/app/reparse": { "post": { "responses": { "202": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReparseStatusResponse" } } }, "description": "Rebuild queued" }, "403": { "$ref": "#/components/responses/Forbidden" } }, "summary": "Queue a full projection rebuild", "tags": [ "Operations" ] } }, "/api/v1/app/sessions": { "get": { "parameters": [ { "in": "query", "name": "q", "schema": { "maxLength": 200, "type": "string" } }, { "in": "query", "name": "project", "schema": { "format": "int64", "minimum": 1, "type": "integer" } }, { "in": "query", "name": "agent", "schema": { "type": "string" } }, { "in": "query", "name": "machine", "schema": { "type": "string" } }, { "in": "query", "name": "user", "schema": { "type": "string" } }, { "in": "query", "name": "grade", "schema": { "enum": [ "A", "B", "C", "D", "F", "unscored" ], "type": "string" } }, { "in": "query", "name": "outcome", "schema": { "enum": [ "completed", "abandoned", "errored", "unknown" ], "type": "string" } }, { "in": "query", "name": "after", "schema": { "format": "int64", "minimum": 1, "type": "integer" } }, { "in": "query", "name": "range", "schema": { "enum": [ "1d", "3d", "7d", "30d", "90d", "year", "all" ], "type": "string" } }, { "in": "query", "name": "sort", "schema": { "enum": [ "updated", "messages", "tokens", "cost" ], "type": "string" } }, { "in": "query", "name": "dir", "schema": { "enum": [ "asc", "desc" ], "type": "string" } }, { "in": "query", "name": "empty", "schema": { "enum": [ "1" ], "type": "string" } }, { "in": "query", "name": "subagents", "schema": { "enum": [ "1" ], "type": "string" } }, { "in": "query", "name": "spanned", "schema": { "enum": [ "1" ], "type": "string" } }, { "in": "query", "name": "limit", "schema": { "default": 100, "maximum": 200, "minimum": 1, "type": "integer" } }, { "description": "Observed sort value paired with after for stable keyset pagination.", "in": "query", "name": "after_value", "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionsResponse" } } }, "description": "Session collection and facets" }, "400": { "$ref": "#/components/responses/BadRequest" }, "503": { "$ref": "#/components/responses/ProjectionRebuilding" } }, "summary": "Search and filter sessions", "tags": [ "Application" ] } }, "/api/v1/app/sessions/{id}": { "delete": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeletedSessionResponse" } } }, "description": "Deleted" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" } }, "summary": "Delete a session", "tags": [ "Application" ] }, "get": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionResponse" } } }, "description": "Session snapshot" }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ProjectionRebuilding" } }, "summary": "Read a session audit and transcript tail", "tags": [ "Application" ] } }, "/api/v1/app/sessions/{id}/append": { "get": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } }, { "in": "query", "name": "after", "required": true, "schema": { "minimum": 0, "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionResponse" } } }, "description": "Session snapshot fragment" }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ProjectionRebuilding" } }, "summary": "Read a session's turns past a rendered ordinal", "tags": [ "Application" ] } }, "/api/v1/app/sessions/{id}/project": { "put": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionProjectRequest" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionProjectResponse" } } }, "description": "Session pinned to the project" }, "400": { "$ref": "#/components/responses/BadRequest" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" } }, "summary": "Permanently pin an orphaned session onto a project", "tags": [ "Application" ] } }, "/api/v1/app/sessions/{id}/publication": { "put": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Publication" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SessionPublicationResponse" } } }, "description": "Publication updated" }, "404": { "$ref": "#/components/responses/NotFound" } }, "summary": "Publish or unpublish an owned session", "tags": [ "Application" ] } }, "/api/v1/app/sessions/{id}/transcript": { "get": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } }, { "in": "query", "name": "before", "required": true, "schema": { "minimum": 0, "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TranscriptResponse" } } }, "description": "Transcript page" }, "503": { "$ref": "#/components/responses/ProjectionRebuilding" } }, "summary": "Read an earlier transcript window", "tags": [ "Application" ] } }, "/api/v1/auth/login": { "post": { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Login" } } }, "required": true }, "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginResponse" } } }, "description": "Signed in" }, "401": { "$ref": "#/components/responses/Unauthorized" } }, "security": [], "summary": "Create a browser session", "tags": [ "Account" ] } }, "/api/v1/auth/logout": { "post": { "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StatusResponse" } } }, "description": "Signed out" } }, "summary": "Delete the current browser session", "tags": [ "Account" ] } }, "/api/v1/auth/register": { "post": { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Register" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegisteredUserResponse" } } }, "description": "Account created" }, "400": { "$ref": "#/components/responses/BadRequest" }, "403": { "$ref": "#/components/responses/Forbidden" } }, "security": [], "summary": "Register an account and create a browser session", "tags": [ "Account" ] } }, "/api/v1/ingest/blob/{sha256}": { "put": { "parameters": [ { "in": "path", "name": "sha256", "required": true, "schema": { "pattern": "^[a-f0-9]{64}$", "type": "string" } } ], "requestBody": { "content": { "application/octet-stream": { "schema": { "format": "binary", "type": "string" } } }, "required": true }, "responses": { "201": { "description": "Stored" }, "204": { "description": "Already present" } }, "summary": "Upload a content-addressed blob", "tags": [ "Ingest" ] } }, "/api/v1/ingest/blobs/check": { "post": { "responses": { "200": { "description": "Missing blob hashes" } }, "summary": "Check which content-addressed blobs are missing", "tags": [ "Ingest" ] } }, "/api/v1/ingest/provider-usage": { "post": { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProviderUsageBatch" } } }, "required": true }, "responses": { "200": { "description": "Events recorded" }, "403": { "$ref": "#/components/responses/Forbidden" }, "413": { "description": "Too many events in one request" } }, "summary": "Record vendor-reported account usage events", "tags": [ "Ingest" ] } }, "/api/v1/ingest/provider-usage/watermark": { "get": { "parameters": [ { "in": "query", "name": "account_id", "required": true, "schema": { "minLength": 1, "type": "string" } }, { "in": "query", "name": "provider", "required": true, "schema": { "enum": [ "cursor" ], "type": "string" } } ], "responses": { "200": { "description": "Newest stored event instant, or null" }, "403": { "$ref": "#/components/responses/Forbidden" } }, "summary": "Read where a provider usage collection should resume", "tags": [ "Ingest" ] } }, "/api/v1/ingest/session": { "post": { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AnnounceSession" } } }, "required": true }, "responses": { "200": { "description": "Upload state" }, "201": { "description": "Session created" }, "403": { "$ref": "#/components/responses/Forbidden" } }, "summary": "Announce or reconcile a session upload", "tags": [ "Ingest" ] } }, "/api/v1/ingest/session/{id}/chunk": { "post": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "requestBody": { "content": { "application/octet-stream": { "schema": { "format": "binary", "type": "string" } } }, "required": true }, "responses": { "200": { "description": "Chunk accepted" } }, "summary": "Append raw session bytes", "tags": [ "Ingest" ] } }, "/api/v1/ingest/session/{id}/finalize": { "post": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "responses": { "200": { "description": "Finalized" } }, "summary": "Declare a session terminal and grade it", "tags": [ "Ingest" ] } }, "/api/v1/ingest/session/{id}/reset": { "post": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "responses": { "200": { "description": "Reset" } }, "summary": "Reset a session upload", "tags": [ "Ingest" ] } }, "/api/v1/invites": { "post": { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateInvite" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatedInviteResponse" } } }, "description": "Invite created; the plaintext secret is returned once" }, "403": { "$ref": "#/components/responses/Forbidden" } }, "summary": "Create a registration invitation", "tags": [ "Account" ] } }, "/api/v1/reparse/events": { "get": { "responses": { "200": { "content": { "text/event-stream": { "schema": { "type": "string" } } }, "description": "Server-sent rebuild events" } }, "summary": "Stream projection rebuild progress", "tags": [ "Operations" ] } }, "/api/v1/reparse/status": { "get": { "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReparseStatusResponse" } } }, "description": "Rebuild status" } }, "summary": "Read projection rebuild progress", "tags": [ "Operations" ] } }, "/api/v1/session/{id}/blob/{sha256}": { "get": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } }, { "in": "path", "name": "sha256", "required": true, "schema": { "pattern": "^[a-f0-9]{64}$", "type": "string" } } ], "responses": { "200": { "description": "Blob bytes" }, "404": { "$ref": "#/components/responses/NotFound" } }, "summary": "Download a content-addressed tool body referenced by a visible session", "tags": [ "Application" ] } }, "/api/v1/tokens": { "get": { "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokensResponse" } } }, "description": "Token collection" } }, "summary": "List API tokens", "tags": [ "Account" ] }, "post": { "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateToken" } } }, "required": true }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreatedTokenResponse" } } }, "description": "Token created; the plaintext secret is returned once" } }, "summary": "Create an API token", "tags": [ "Account" ] } }, "/api/v1/tokens/{id}/revoke": { "post": { "parameters": [ { "in": "path", "name": "id", "required": true, "schema": { "format": "int64", "type": "integer" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StatusResponse" } } }, "description": "Revoked" } }, "summary": "Revoke an API token", "tags": [ "Account" ] } }, "/healthz": { "get": { "responses": { "200": { "description": "Healthy" }, "503": { "description": "Database unavailable" } }, "security": [], "summary": "Check database connectivity", "tags": [ "Operations" ] } } }, "security": [ { "sessionCookie": [] }, { "bearerToken": [] } ], "servers": [ { "description": "This akari instance", "url": "/" } ], "tags": [ { "description": "Read models consumed by the embedded React application.", "name": "Application" }, { "description": "Authentication, tokens, invitations, and account controls.", "name": "Account" }, { "description": "Session and content-addressed blob upload protocol.", "name": "Ingest" }, { "description": "Published read-only views that require no credential.", "name": "Public" }, { "description": "Health and projection rebuild state.", "name": "Operations" } ] }