> ## 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 (endpoints of the same kind and name share one row, identified by the endpoint with the most cost and traffic) with its summed cost and counters, the tag aggregates of all its request traffic, and its costliest servers nested (by default only those at or above 1 GB when sorted by bytes or $0.10 a month when sorted by cost; server_limit and server_offset page through the rest and a negative server_limit returns all; client with client_kind narrows the response to one client; server_count gives the full number, and the client's sums cover every one). A server is one row per name, kind and port, covering its protocol, ClusterIP and NAT variants: its counters, cost, last_seen_at and tags are the totals for the whole server, connection_ids lists every connection merged into it, and localities nests one entry per locality (same-zone, cross-zone, internet and so on), costliest first, each with its own counters, cost, last_seen_at, tags and connection_ids. locality on the server is the real locality when there is exactly one and "mixed" otherwise. Pass a server's or a locality's connection_ids to GET /network/connections/{id}/series (first as the path id, the rest as ids) to chart exactly that traffic. Per-zone-pair attribution is on GET /network/connections/{id}. Totals describe the whole window, computed before the row cap, plus the attributed cost of the request rows with a connection that carry a shown tag and how many of those tagged rows there are. top_flows lists the five costliest flows (client, server name and kind, port, locality) of the whole filtered set, with cost, bytes, connection and unhealthy counts, their share of the filtered bytes and cost, and connection_ids. 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, locality, kind) are AND across dimensions and OR within one; locality, kind (the server endpoint kind) and dst_port (the server port) narrow the connections themselves, so the rows, top_flows and the totals cover only matching traffic. Every tag aggregate carries its previous-window sums and cost change. sort_by (cost, the default, or bytes) ranks everything: clients arrive in that order and are capped at limit, each client keeps its top servers by it (server_limit), localities under a server, top_flows and tags follow it too; cost puts unpriced rows last and breaks ties on bytes, bytes breaks ties on cost, and totals and server_count do not depend on it. 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
    x-group: Network
  - 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: operator
    x-group: Operator
  - name: organization
    x-group: Audit log
  - name: organizations
    x-group: Organizations
  - name: placement-alternatives
    x-group: Placement alternatives
  - name: reports
    x-group: Reports
  - name: sandboxes
    x-group: Sandboxes
  - 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
        (endpoints of the same kind and name share one row, identified by the
        endpoint with the most cost and traffic) with its summed cost and
        counters, the tag aggregates of all its request traffic, and its
        costliest servers nested (by default only those at or above 1 GB when
        sorted by bytes or $0.10 a month when sorted by cost; server_limit and
        server_offset page through the rest and a negative server_limit returns
        all; client with client_kind narrows the response to one client;
        server_count gives the full number, and the client's sums cover every
        one). A server is one row per name, kind and port, covering its
        protocol, ClusterIP and NAT variants: its counters, cost, last_seen_at
        and tags are the totals for the whole server, connection_ids lists every
        connection merged into it, and localities nests one entry per locality
        (same-zone, cross-zone, internet and so on), costliest first, each with
        its own counters, cost, last_seen_at, tags and connection_ids. locality
        on the server is the real locality when there is exactly one and "mixed"
        otherwise. Pass a server's or a locality's connection_ids to GET
        /network/connections/{id}/series (first as the path id, the rest as ids)
        to chart exactly that traffic. Per-zone-pair attribution is on GET
        /network/connections/{id}. Totals describe the whole window, computed
        before the row cap, plus the attributed cost of the request rows with a
        connection that carry a shown tag and how many of those tagged rows
        there are. top_flows lists the five costliest flows (client, server name
        and kind, port, locality) of the whole filtered set, with cost, bytes,
        connection and unhealthy counts, their share of the filtered bytes and
        cost, and connection_ids. 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,
        locality, kind) are AND across dimensions and OR within one; locality,
        kind (the server endpoint kind) and dst_port (the server port) narrow
        the connections themselves, so the rows, top_flows and the totals cover
        only matching traffic. Every tag aggregate carries its previous-window
        sums and cost change. sort_by (cost, the default, or bytes) ranks
        everything: clients arrive in that order and are capped at limit, each
        client keeps its top servers by it (server_limit), localities under a
        server, top_flows and tags follow it too; cost puts unpriced rows last
        and breaks ties on bytes, bytes breaks ties on cost, and totals and
        server_count do not depend on it. 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, default cost) ranking clients, servers, localities, top
          flows and tags, and limit capping the client rows at the top N by it
          (default 500, max 5000, negative unpaged), server_limit capping each
          client's servers (default: those at or above 1 GB by bytes or $0.10 by
          cost, negative for all), server_offset skipping each client's first N
          servers, and client with client_kind narrowing to one client. 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:
        client:
          type: string
          nullable: true
        client_kind:
          type: string
          nullable: true
        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 top N by SortBy; a negative Limit is
            unpaged.
          type: integer
          nullable: true
        server_limit:
          description: >-
            Caps each client's servers at its top N by SortBy; a negative

            ServerLimit returns them all. Unset, a client lists the servers at
            or

            above MinServerBytes (SortBy bytes) or MinServerCost (SortBy cost).
          type: integer
          nullable: true
        server_offset:
          type: integer
          minimum: 0
          nullable: true
        sort_by:
          description: >-
            Ranks everything: the client rows and which survive Limit, each
            client's

            servers and which survive ServerLimit, the localities under a
            server,

            the top flows and the tags. Cost (the default) puts unpriced rows
            last

            and breaks ties on bytes; bytes breaks ties on cost.
          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'
        top_flows:
          description: |-
            The five costliest flows of the whole filtered set, not only of the
            returned rows.
          type: array
          items:
            $ref: '#/components/schemas/networkdetail.DetailTopFlow'
        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
        client_kind:
          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'
        last_seen_at:
          type: string
          nullable: true
        server_count:
          description: Every connection the client has, before the cap.
          type: integer
        servers:
          description: >-
            The client's costliest connections, paged by ServerLimit and
            ServerOffset. Cost,

            Counters and Tags above cover every one, shown or not.
          type: array
          items:
            $ref: '#/components/schemas/networkdetail.DetailConnection'
        tagged:
          $ref: '#/components/schemas/networkdetail.DetailTagged'
        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'
        untagged:
          $ref: '#/components/schemas/networkdetail.DetailTagged'
    networkdetail.DetailTopFlow:
      type: object
      properties:
        bytes_total:
          type: number
        client:
          type: string
        client_endpoint_id:
          type: string
        client_kind:
          type: string
        connection_ids:
          type: array
          items:
            type: string
        connections_opened:
          type: integer
        cost_monthly:
          type: number
        locality:
          type: string
        port:
          type: integer
        server:
          type: string
        server_endpoint_id:
          type: string
        server_kind:
          type: string
        share_of_bytes:
          type: number
        share_of_cost:
          type: number
          nullable: true
        unhealthy_connections:
          type: integer
    networkdetail.DetailTotals:
      type: object
      properties:
        attributed_cost_monthly:
          type: number
        bytes_client_to_server:
          type: number
        bytes_server_to_client:
          type: number
        cost_attributed_connections:
          type: integer
        cross_zone_cost_monthly:
          type: number
          nullable: true
        internet_cost_monthly:
          type: number
          nullable: true
        other_cost_monthly:
          type: number
          nullable: true
        tagged:
          $ref: '#/components/schemas/networkdetail.DetailTagged'
        total_connections:
          description: Edge count before the row cap.
          type: integer
        total_services:
          type: integer
        unhealthy_connections:
          type: integer
        untagged:
          $ref: '#/components/schemas/networkdetail.DetailTagged'
    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
        connection_ids:
          description: |-
            Every connection merged into this row; pass them to the connection
            series to read the whole server.
          type: array
          items:
            type: string
        cost_monthly:
          type: number
        counters:
          $ref: '#/components/schemas/networkdetail.DetailCounters'
        id:
          type: string
        last_seen_at:
          type: string
          nullable: true
        localities:
          description: One entry per locality, costliest first, ties on bytes.
          type: array
          items:
            $ref: '#/components/schemas/networkdetail.DetailLocality'
        locality:
          description: >-
            The locality of the flows when there is exactly one, "mixed" when
            the

            server is reached through several; Localities has each.
          type: string
        nat_translated:
          description: True when the agent saw any of the traffic NAT translated.
          type: boolean
        port:
          type: integer
        server:
          type: string
        server_endpoint_id:
          type: string
        server_kind:
          type: string
        service_vip_observed:
          description: >-
            True when any of the traffic went to a Service's ClusterIP rather
            than

            straight to pod IPs.
          type: boolean
        tagged:
          $ref: '#/components/schemas/networkdetail.DetailTagged'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/networkrequests.TagAggregate'
        untagged:
          $ref: '#/components/schemas/networkdetail.DetailTagged'
    networkdetail.DetailTagged:
      type: object
      properties:
        bytes:
          type: number
        cost_monthly:
          type: number
          nullable: true
        req_bytes:
          type: number
        resp_bytes:
          type: number
    networkrequests.TagAggregate:
      type: object
      properties:
        changePct:
          type: number
          nullable: true
        key:
          type: string
        previous:
          $ref: '#/components/schemas/networkrequests.Totals'
        totals:
          $ref: '#/components/schemas/networkrequests.Totals'
        value:
          type: string
    networkdetail.DetailLocality:
      type: object
      properties:
        connection_ids:
          type: array
          items:
            type: string
        cost_monthly:
          type: number
        counters:
          $ref: '#/components/schemas/networkdetail.DetailCounters'
        last_seen_at:
          type: string
          nullable: true
        locality:
          type: string
        nat_translated:
          type: boolean
        service_vip_observed:
          type: boolean
        tagged:
          $ref: '#/components/schemas/networkdetail.DetailTagged'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/networkrequests.TagAggregate'
        untagged:
          $ref: '#/components/schemas/networkdetail.DetailTagged'
    networkrequests.Totals:
      type: object
      properties:
        attributed_cost_monthly:
          type: number
          nullable: true
        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.