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

# Network detail rows

> Serves the merged connections table as client rows: each client endpoint with its summed cost and counters, the tag aggregates of all its request traffic, and its costliest connections nested as servers (server_limit, default 7, negative for all; server_count gives the full number, and the client's sums cover every one). Each connection keeps the reports-side shape -- identity, traffic, health and the monthly cost projection -- with the tag aggregates of its own request traffic, grouped by endpoint pair, port, locality and whether it went through a Service ClusterIP or was NAT translated. Per-zone-pair attribution is on GET /service-map/connections/:id. Totals describe the whole window, computed before the row cap, like the service map, plus the attributed cost of every request row with a connection and how many of those rows carry a shown tag. group_by picks the tag keys aggregated (tag:<key>; empty means every key), group narrows to requests carrying exact tag key/value pairs, and filters (tag:<key>, dst_port, proto) are AND across dimensions and OR within one. Every tag aggregate carries its previous-window sums and cost change. Clients arrive costliest first, capped at limit; the frontend filters, sorts and pages them client-side



## OpenAPI

````yaml /api-reference/costgraph/openapi.json post /api/v1/tenant/network/detail
openapi: 3.0.0
info:
  description: Read and manage your CostGraph organization, spend, alerts, and settings.
  title: CostGraph API
  contact: {}
  version: '1.0'
servers:
  - url: https://api.costgraph.ai
security: []
tags:
  - name: ai
    x-group: AI
  - name: ai-serving
    x-group: AI serving
  - name: anomalies
    x-group: Anomalies
  - name: auth
    x-group: Auth
  - name: billing
    x-group: Billing
  - name: billing-export
    x-group: Billing export
  - name: budgets
    x-group: Budgets
  - name: ci
    x-group: CI
  - name: compute-recommendations
    x-group: Compute recommendations
  - name: config
    x-group: Config
  - name: context-graph
    x-group: Context graph
  - name: cost
    x-group: Cost
  - name: gpus
    x-group: GPUs
  - name: graphai
    x-group: Graph AI
  - name: integrations
    x-group: Integrations
  - name: invitations
    x-group: Invitations
  - name: kubernetes-clusters
    x-group: Kubernetes clusters
  - name: marketplace
    x-group: Marketplace
  - name: network-requests
    x-group: Network requests
  - name: notifications
    x-group: Notifications
  - name: oauth
    x-group: OAuth
  - name: oauth-clients
    x-group: OAuth clients
  - name: opencost
    x-group: OpenCost
  - name: organization
    x-group: Audit log
  - name: organizations
    x-group: Organizations
  - name: placement-alternatives
    x-group: Placement alternatives
  - name: reports
    x-group: Reports
  - name: service-map
    x-group: Service map
  - name: settings
    x-group: Settings
  - name: sso
    x-group: Single sign-on
  - name: tenants
    x-group: Tenants
  - name: ticketing
    x-group: Ticketing
  - name: user
    x-group: Users
  - name: virtual-machines
    x-group: Virtual machines
  - name: virtual-tags
    x-group: Virtual tags
  - name: workflows
    x-group: Workflows
paths:
  /api/v1/tenant/network/detail:
    post:
      tags:
        - network-requests
      summary: Network detail rows
      description: >-
        Serves the merged connections table as client rows: each client endpoint
        with its summed cost and counters, the tag aggregates of all its request
        traffic, and its costliest connections nested as servers (server_limit,
        default 7, negative for all; server_count gives the full number, and the
        client's sums cover every one). Each connection keeps the reports-side
        shape -- identity, traffic, health and the monthly cost projection --
        with the tag aggregates of its own request traffic, grouped by endpoint
        pair, port, locality and whether it went through a Service ClusterIP or
        was NAT translated. Per-zone-pair attribution is on GET
        /service-map/connections/:id. Totals describe the whole window, computed
        before the row cap, like the service map, plus the attributed cost of
        every request row with a connection and how many of those rows carry a
        shown tag. group_by picks the tag keys aggregated (tag:<key>; empty
        means every key), group narrows to requests carrying exact tag key/value
        pairs, and filters (tag:<key>, dst_port, proto) are AND across
        dimensions and OR within one. Every tag aggregate carries its
        previous-window sums and cost change. Clients arrive costliest first,
        capped at limit; the frontend filters, sorts and pages them client-side
      parameters:
        - description: Tenant ID
          name: X-CostGraph-Tenant-ID
          in: header
          required: true
          schema:
            type: string
        - description: Cost period; defaults to month_to_date
          name: period
          in: query
          schema:
            type: string
            enum:
              - month_to_date
              - last_7d
              - last_30d
              - calendar_month
              - custom
        - description: >-
            Closed calendar month in YYYY-MM format; required when
            period=calendar_month
          name: month
          in: query
          schema:
            type: string
        - description: Window start in RFC3339 format; required when period=custom
          name: start
          in: query
          schema:
            type: string
        - description: Window end in RFC3339 format; required when period=custom
          name: end
          in: query
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/networkdetail.DetailQueryRequest'
        description: >-
          Tag keys to aggregate (group_by, tag:<key>), exact tag pairs to narrow
          to (group, bare keys), filters as dimension -> values, sort_by
          (cost|bytes) for tags, and limit capping the client rows at the
          costliest N (default 500, max 5000, negative unpaged), and
          server_limit capping each client's servers (default 7, negative for
          all). Every field is optional
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/responses.SuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/networkdetail.DetailResult'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    networkdetail.DetailQueryRequest:
      type: object
      properties:
        filter:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        group:
          type: object
          additionalProperties:
            type: string
        group_by:
          type: array
          items:
            type: string
        limit:
          description: >-
            Caps the client rows at the costliest N; a negative Limit is
            unpaged.
          type: integer
          nullable: true
        server_limit:
          description: >-
            Caps each client's servers at its costliest N; a negative
            ServerLimit

            returns them all.
          type: integer
          nullable: true
        sort_by:
          type: string
          enum:
            - cost
            - bytes
    responses.SuccessResponse:
      type: object
      required:
        - message
        - status
      properties:
        data: {}
        message:
          type: string
          example: some message
        status:
          type: string
          example: success
    networkdetail.DetailResult:
      type: object
      properties:
        range:
          $ref: '#/components/schemas/networkdetail.DateRange'
        rows:
          description: One row per client service, costliest first, capped at Limit.
          type: array
          items:
            $ref: '#/components/schemas/networkdetail.DetailClient'
        totals:
          $ref: '#/components/schemas/networkdetail.DetailTotals'
    responses.ErrorResponse:
      type: object
      required:
        - message
        - status
      properties:
        message:
          type: string
          example: some message
        status:
          type: string
          example: error
    networkdetail.DateRange:
      type: object
      properties:
        end:
          type: string
        start:
          type: string
    networkdetail.DetailClient:
      type: object
      properties:
        client:
          type: string
        client_endpoint_id:
          type: string
        cost_monthly:
          description: Summed over Servers. Nil when none of them is priced.
          type: number
        counters:
          description: |-
            Summed over Servers; ConnectionsActiveMax is the largest, and
            ObservedFrom is left empty.
          allOf:
            - $ref: '#/components/schemas/networkdetail.DetailCounters'
        server_count:
          description: Every connection the client has, before the cap.
          type: integer
        servers:
          description: |-
            The client's costliest connections, capped at ServerLimit. Cost,
            Counters and Tags above cover every one, shown or not.
          type: array
          items:
            $ref: '#/components/schemas/networkdetail.DetailConnection'
        tags:
          description: |-
            Tag aggregates over all the client's request traffic: each tag pair
            summed across its connections, both windows.
          type: array
          items:
            $ref: '#/components/schemas/networkrequests.TagAggregate'
    networkdetail.DetailTotals:
      type: object
      properties:
        attributed_cost_monthly:
          type: number
        bytes_by_locality:
          type: object
          additionalProperties:
            type: number
            format: float64
        bytes_client_to_server:
          type: number
        bytes_server_to_client:
          type: number
        cost_attributed_connections:
          type: integer
        cost_by_locality:
          description: An absent key means no edge reported that value, not a zero.
          type: object
          additionalProperties:
            type: number
            format: float64
        cost_by_mechanism:
          type: object
          additionalProperties:
            type: number
            format: float64
        request_cost_monthly:
          type: number
        tagged_requests:
          type: integer
        total_connections:
          description: Edge count before the row cap.
          type: integer
        total_services:
          type: integer
        unhealthy_connections:
          type: integer
    networkdetail.DetailCounters:
      type: object
      properties:
        bytes_client_to_server:
          type: number
        bytes_server_to_client:
          type: number
        connections_active_max:
          type: integer
        connections_closed:
          type: integer
        connections_failed:
          type: integer
        connections_opened:
          type: integer
        connections_refused:
          type: integer
        connections_reset:
          type: integer
        observed_from:
          type: string
        observed_seconds:
          type: number
        packets_client_to_server:
          type: number
        packets_server_to_client:
          type: number
    networkdetail.DetailConnection:
      type: object
      properties:
        client:
          type: string
        client_endpoint_id:
          type: string
        cost_monthly:
          type: number
        counters:
          $ref: '#/components/schemas/networkdetail.DetailCounters'
        id:
          type: string
        last_seen_at:
          type: string
          nullable: true
        locality:
          type: string
        nat_translated:
          description: >-
            True when the agent saw the traffic NAT translated; like the
            ClusterIP

            flag, it splits an otherwise identical connection.
          type: boolean
        port:
          type: integer
        server:
          type: string
        server_endpoint_id:
          type: string
        server_kind:
          type: string
        service_vip_observed:
          description: >-
            True when the traffic went to a Service's ClusterIP rather than

            straight to pod IPs: the same workloads and port can show twice,
            once

            each way.
          type: boolean
        tags:
          type: array
          items:
            $ref: '#/components/schemas/networkrequests.TagAggregate'
    networkrequests.TagAggregate:
      type: object
      properties:
        changePct:
          type: number
        key:
          type: string
        previous:
          $ref: '#/components/schemas/networkrequests.Totals'
        totals:
          $ref: '#/components/schemas/networkrequests.Totals'
        value:
          type: string
    networkrequests.Totals:
      type: object
      properties:
        attributed_cost_monthly:
          type: number
        req_bytes:
          type: number
        resp_bytes:
          type: number
  securitySchemes:
    BearerAuth:
      description: Enter "Bearer {token}"
      type: apiKey
      name: Authorization
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.