Finout Cost API

Query and analyze costs using Finout Views

OpenAPI Specification

finout-cost-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Finout Cost API
  description: The Finout API provides seamless access to powerful cloud cost management tools, enabling you to integrate, analyze, and optimize your cloud expenses. It includes endpoints for cost insights, tagging, forecasting, and more, empowering teams to automate workflows, track spending, and drive efficiency across cloud environments.
  version: 1.0.0
  contact:
    name: Finout
    url: https://www.finout.io/
  termsOfService: https://www.finout.io/
servers:
- url: https://app.finout.io/v1
  description: Finout Production API
security:
- clientId: []
  secretKey: []
tags:
- name: Cost
  description: Query and analyze costs using Finout Views
paths:
  /view:
    post:
      operationId: queryCosts
      summary: Finout Query costs for a view
      description: Query and analyze costs using user-defined Finout Views. You can query the costs for any date range of up to 90 days specified in UTC timestamps. You must either specify dates or delete them completely; the query will not work when blank dates are still present.
      tags:
      - Cost
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - viewId
              properties:
                viewId:
                  type: string
                  description: The ID of the Finout View to query.
                date:
                  type: object
                  description: Optional date range. Must either be fully specified or omitted entirely.
                  properties:
                    unixTimeMillSecondsStart:
                      type: integer
                      format: int64
                      description: Start of the date range in Unix milliseconds (UTC).
                    unixTimeMillSecondsEnd:
                      type: integer
                      format: int64
                      description: End of the date range in Unix milliseconds (UTC).
                filter:
                  $ref: '#/components/schemas/FilterObject'
      responses:
        '200':
          description: Successful cost query response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
        '400':
          description: Bad request. The request was malformed or missing required fields.
        '401':
          description: Unauthorized. Invalid or missing authentication credentials.
        '429':
          description: Too many requests. Rate limit exceeded.
components:
  schemas:
    FilterObject:
      type: object
      description: A filter object used to narrow query results. Supports logical AND/OR grouping and various operators for matching conditions.
      properties:
        costCenter:
          type: string
          description: The cost center to filter on (e.g., AWS, GCP, Azure).
        key:
          type: string
          description: The MegaBill key to filter by.
        displayName:
          type: string
          description: The display name for the filter field.
        operator:
          type: string
          description: The filter operator.
          enum:
          - oneOf
          - notOneOf
          - is
          - isNot
          - contains
          - notContains
          - exists
          - notExists
        value:
          description: The value or values to match against. Can be a string or array of strings depending on the operator.
          oneOf:
          - type: string
          - type: array
            items:
              type: string
        and:
          type: array
          description: Logical AND grouping of filter conditions.
          items:
            $ref: '#/components/schemas/FilterObject'
        or:
          type: array
          description: Logical OR grouping of filter conditions.
          items:
            $ref: '#/components/schemas/FilterObject'
  securitySchemes:
    clientId:
      type: apiKey
      in: header
      name: x-finout-client-id
      description: The Client ID generated from the Finout Admin Portal under API Tokens.
    secretKey:
      type: apiKey
      in: header
      name: x-finout-secret-key
      description: The Secret Key generated from the Finout Admin Portal under API Tokens. This value is only shown once at generation time.