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

# Connection details for writing a kubeconfig for a granted cluster

> What `prime factory k8s login` needs to write a kubeconfig: the cluster
CA and one entry per pool the caller holds a live grant on.

Shape (shared with the prime CLI)::

    {"cluster": str, "certificateAuthorityData": str (base64 PEM),
     "grants": [{"pool": str, "namespace": str,
                 "server": str | None,          # https://<proxy FQDN>
                 "tlsServerName": str | None,   # kubernetes.default.svc
                 "unavailableReason": str | None}]}

Researchers reach the apiserver only through each pool's Tailscale API
proxy, so there is no cluster-level `server`. A grant whose proxy has
not joined (or cannot be resolved) has `server: null` and a
human-readable `unavailableReason`; the CLI writes a context only for a
non-empty `server`. One grant's unresolved proxy never fails the others.

No credential is returned — the kubeconfig's `exec` block fetches those
per kubectl invocation from the mint endpoint above.



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json get /api/v1/clusters/{cluster_name}/kubeconfig-info
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/v1/clusters/{cluster_name}/kubeconfig-info:
    get:
      tags:
        - clusters
      summary: Connection details for writing a kubeconfig for a granted cluster
      description: |-
        What `prime factory k8s login` needs to write a kubeconfig: the cluster
        CA and one entry per pool the caller holds a live grant on.

        Shape (shared with the prime CLI)::

            {"cluster": str, "certificateAuthorityData": str (base64 PEM),
             "grants": [{"pool": str, "namespace": str,
                         "server": str | None,          # https://<proxy FQDN>
                         "tlsServerName": str | None,   # kubernetes.default.svc
                         "unavailableReason": str | None}]}

        Researchers reach the apiserver only through each pool's Tailscale API
        proxy, so there is no cluster-level `server`. A grant whose proxy has
        not joined (or cannot be resolved) has `server: null` and a
        human-readable `unavailableReason`; the CLI writes a context only for a
        non-empty `server`. One grant's unresolved proxy never fails the others.

        No credential is returned — the kubeconfig's `exec` block fetches those
        per kubectl invocation from the mint endpoint above.
      operationId: get_kubeconfig_info_api_v1_clusters__cluster_name__kubeconfig_info_get
      parameters:
        - name: cluster_name
          in: path
          required: true
          schema:
            type: string
            title: Cluster Name
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '401':
          description: Authorization failed
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    ErrorDetail:
      properties:
        param:
          type: string
          title: Param
        details:
          type: string
          title: Details
      type: object
      required:
        - param
        - details
      title: ErrorDetail
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````