> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ankra.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Stream chat responses for cluster troubleshooting



## OpenAPI

````yaml https://platform.ankra.app/openapi.json post /api/v1/org/clusters/{cluster_id}/kubernetes/chat
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
tags:
  - name: Clusters
    description: Create, inspect and manage clusters, and the stacks deployed on them.
  - name: Managed Clusters
    description: Provider-managed control planes, driven through one common surface.
  - name: Imported Clusters
    description: Clusters that already existed and were connected to Ankra.
  - name: Cluster Access
    description: Kubeconfigs, service-account tokens and per-cluster access grants.
  - name: Kubernetes
    description: Read and act on the Kubernetes objects inside a cluster.
  - name: DigitalOcean Clusters
    description: Provision and manage DigitalOcean Kubernetes clusters.
  - name: Hetzner Clusters
    description: Provision and manage Hetzner Kubernetes clusters.
  - name: OVH Clusters
    description: Provision and manage OVH Kubernetes clusters.
  - name: Scaleway Clusters
    description: Provision and manage Scaleway Kapsule clusters.
  - name: UpCloud Clusters
    description: Provision and manage UpCloud Kubernetes clusters.
  - name: Applications
    description: Deploy, configure and observe applications across the fleet.
  - name: Stack Profiles
    description: Reusable stack definitions, their versions and sharing.
  - name: Charts
    description: Browse the chart catalogue behind stacks and addons.
  - name: Helm
    description: Helm registries, credentials and the charts they expose.
  - name: Executions
    description: Long-running platform executions and their jobs.
  - name: Operations
    description: Cancel in-flight cluster operations and their jobs.
  - name: Chat
    description: Conversational sessions, plans and confirmable actions.
  - name: AI Agent Runs
    description: Autonomous agent runs and their outcomes.
  - name: AI Tickets
    description: The AI ticket board, its sync connections and settings.
  - name: AI Playbooks
    description: Reusable playbooks the AI lanes execute.
  - name: AI Conditions
    description: Conditions that gate AI autonomy.
  - name: AI Engineering Handoffs
    description: Work the AI lanes escalate to a human engineer.
  - name: AI Environment
    description: The environment and base stacks AI demos deploy into.
  - name: Security
    description: Findings, advisories, SBOMs, compliance and posture.
  - name: Cost
    description: Cluster and fleet cost, rate cards and cost settings.
  - name: Billing
    description: Subscription and spend caps.
  - name: Organisation
    description: Members, invitations, audit logs and organisation settings.
  - name: Account Tokens
    description: Personal access tokens for the API and CLI.
  - name: Credentials
    description: The shared credential store.
  - name: Azure Credentials
    description: Azure credentials and SSH keys.
  - name: DigitalOcean Credentials
    description: DigitalOcean credentials and SSH keys.
  - name: Hetzner Credentials
    description: Hetzner credentials and SSH keys.
  - name: OVH Credentials
    description: OVH credentials and SSH keys.
  - name: Scaleway Credentials
    description: Scaleway credentials.
  - name: UpCloud Credentials
    description: UpCloud credentials and SSH keys.
  - name: Data Source Credentials
    description: Credentials for metrics and log sources.
  - name: DNS Credentials
    description: Credentials for DNS providers.
  - name: DNS
    description: DNS zones and records, including custom organisation zones.
  - name: Cloudflare
    description: Cloudflare domains and the credentials behind them.
  - name: Variables
    description: Organisation- and cluster-scoped variables.
  - name: SOPS
    description: Encrypt and decrypt values with the organisation SOPS config.
  - name: Alerts
    description: Alert integrations and ingest credentials.
  - name: Notifications
    description: Notification routes and their delivery targets.
  - name: Support
    description: Support tickets.
paths:
  /api/v1/org/clusters/{cluster_id}/kubernetes/chat:
    post:
      tags:
        - Chat
      summary: Stream chat responses for cluster troubleshooting
      operationId: chat_endpoint_api_v1_org_clusters__cluster_id__kubernetes_chat_post
      parameters:
        - in: path
          name: cluster_id
          required: true
          schema:
            format: uuid4
            title: Cluster Id
            type: string
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - in: header
          name: x-ankra-organisation-id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Ankra-Organisation-Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UnifiedTroubleshootRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: Streaming chat response
        '401':
          description: Unauthorized
        '404':
          description: Cluster not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    UnifiedTroubleshootRequest:
      properties:
        addon_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Addon Name
        chart_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Chart Name
        chart_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Chart Version
        compliance_focus:
          anyOf:
            - $ref: '#/components/schemas/ComplianceFocus'
            - type: 'null'
          title: Compliance Focus
        conversation_history:
          anyOf:
            - items:
                $ref: '#/components/schemas/ConversationMessage'
              type: array
            - type: 'null'
          title: Conversation History
        conversation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Conversation Id
        current_values:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Current Values
        default_values:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Default Values
        draft_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Draft Id
        history_forked:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            When true, this turn forks the conversation at the end of the
            supplied conversation_history (edit-and-resend): the server fills in
            the turns before it from the stored transcript and never the branch
            after it.
          title: History Forked
        idempotency_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Idempotency Key
        images:
          anyOf:
            - items:
                $ref: '#/components/schemas/ImageAttachment'
              type: array
            - type: 'null'
          title: Images
        include_logs:
          default: true
          title: Include Logs
          type: boolean
        interaction_mode:
          default: agentic
          enum:
            - ask
            - agentic
            - plan
          title: Interaction Mode
          type: string
        is_config_page:
          default: false
          title: Is Config Page
          type: boolean
        max_log_lines:
          default: 50
          title: Max Log Lines
          type: integer
        model_mode:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Mode
        namespace:
          anyOf:
            - type: string
            - type: 'null'
          title: Namespace
        page_context:
          anyOf:
            - $ref: '#/components/schemas/PageContext'
            - type: 'null'
        query:
          title: Query
          type: string
        rag_context:
          anyOf:
            - $ref: '#/components/schemas/RAGContext'
            - type: 'null'
        regenerate_seed:
          anyOf:
            - type: string
            - type: 'null'
          title: Regenerate Seed
        repository_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Repository Name
        resource_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Resource Name
        resource_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Resource Type
        supersedes_plan_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Supersedes Plan Id
      required:
        - query
      title: UnifiedTroubleshootRequest
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ComplianceFocus:
      properties:
        check_id:
          maxLength: 128
          minLength: 1
          title: Check Id
          type: string
        benchmark_id:
          anyOf:
            - maxLength: 128
              minLength: 1
              type: string
            - type: 'null'
          title: Benchmark Id
        source:
          enum:
            - benchmark
            - config_audit
          title: Source
          type: string
      required:
        - check_id
        - source
      title: ComplianceFocus
      type: object
    ConversationMessage:
      properties:
        content:
          description: Message content
          title: Content
          type: string
        images:
          anyOf:
            - items:
                $ref: '#/components/schemas/ImageAttachment'
              type: array
            - type: 'null'
          description: Attached images
          title: Images
        role:
          description: 'Message role: user or assistant'
          title: Role
          type: string
        tools_used:
          anyOf:
            - items:
                $ref: '#/components/schemas/ToolUsedSummary'
              type: array
            - type: 'null'
          description: >-
            Tools invoked while producing this message. Forwarded by the portal
            so the next turn can detect prior assistant write actions for
            post-write verification.
          title: Tools Used
      required:
        - role
        - content
      title: ConversationMessage
      type: object
    ImageAttachment:
      properties:
        data:
          description: Base64-encoded image data
          title: Data
          type: string
        media_type:
          description: 'MIME type: image/png, image/jpeg, image/gif, image/webp'
          title: Media Type
          type: string
      required:
        - media_type
        - data
      title: ImageAttachment
      type: object
    PageContext:
      properties:
        active_tab:
          anyOf:
            - type: string
            - type: 'null'
          title: Active Tab
        current_url:
          title: Current Url
          type: string
        filters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Filters
        page_type:
          title: Page Type
          type: string
        viewing_addon:
          anyOf:
            - $ref: '#/components/schemas/ViewingAddon'
            - type: 'null'
        viewing_resource:
          anyOf:
            - $ref: '#/components/schemas/ViewingResource'
            - type: 'null'
        viewing_stack:
          anyOf:
            - $ref: '#/components/schemas/ViewingStack'
            - type: 'null'
        viewing_stack_profile:
          anyOf:
            - $ref: '#/components/schemas/ViewingStackProfile'
            - type: 'null'
      required:
        - page_type
        - current_url
      title: PageContext
      type: object
    RAGContext:
      properties:
        documents:
          items:
            $ref: '#/components/schemas/RAGSearchResult'
          title: Documents
          type: array
        query:
          default: ''
          title: Query
          type: string
        retrieval_time_ms:
          default: 0
          title: Retrieval Time Ms
          type: number
        total_tokens_estimated:
          default: 0
          title: Total Tokens Estimated
          type: integer
      title: RAGContext
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    ToolUsedSummary:
      properties:
        finished_at:
          anyOf:
            - type: string
            - type: 'null'
          description: ISO8601 timestamp the tool completed
          title: Finished At
        parameters_preview:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: Sanitised snapshot of the tool input parameters
          title: Parameters Preview
        status:
          anyOf:
            - type: string
            - type: 'null'
          description: 'Outcome of the tool call: success or error'
          title: Status
        tool_name:
          description: Name of the tool the assistant invoked
          title: Tool Name
          type: string
      required:
        - tool_name
      title: ToolUsedSummary
      type: object
    ViewingAddon:
      properties:
        addon_name:
          title: Addon Name
          type: string
        stack_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Stack Name
      required:
        - addon_name
      title: ViewingAddon
      type: object
    ViewingResource:
      properties:
        api_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Api Version
        kind:
          type: string
          title: Kind
        name:
          title: Name
          type: string
        namespace:
          anyOf:
            - type: string
            - type: 'null'
          title: Namespace
      required:
        - kind
        - name
      title: ViewingResource
      type: object
    ViewingStack:
      properties:
        draft_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Draft Id
        is_draft:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Draft
        is_new_stack:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is New Stack
        stack_name:
          title: Stack Name
          type: string
      required:
        - stack_name
      title: ViewingStack
      type: object
    ViewingStackProfile:
      properties:
        draft_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Draft Id
        is_new_profile:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is New Profile
        profile_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Profile Id
      title: ViewingStackProfile
      type: object
    RAGSearchResult:
      properties:
        content:
          title: Content
          type: string
        document_id:
          format: uuid4
          title: Document Id
          type: string
        metadata:
          additionalProperties: true
          title: Metadata
          type: object
        similarity_score:
          title: Similarity Score
          type: number
        source_id:
          anyOf:
            - format: uuid4
              type: string
            - type: 'null'
          title: Source Id
        source_type:
          $ref: '#/components/schemas/SourceType'
      required:
        - document_id
        - content
        - source_type
        - similarity_score
      title: RAGSearchResult
      type: object
    SourceType:
      enum:
        - chart
        - chart_readme
        - chart_values
        - chart_version
        - helm_registry
        - k8s_pattern
        - troubleshoot
        - troubleshoot_guide
        - documentation
        - conversation
        - platform_resource
        - kubernetes_docs
      title: SourceType
      type: string

````