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

> ## Agent Instructions
> This is the Sevalla REST API reference. Base URL: https://api.sevalla.com/v3. Authenticate with an API key in the Authorization header as a Bearer token.
> The OpenAPI spec is at https://api.sevalla.com/v3/openapi.json. Concepts and dashboard guides are at https://docs.sevalla.com (index: https://docs.sevalla.com/llms.txt).
> To act on a Sevalla account from an AI agent, prefer the Sevalla MCP server (https://mcp.sevalla.com/mcp, see https://docs.sevalla.com/ai-agents/overview.md) or the Sevalla CLI (https://api-docs.sevalla.com/v3/cli.md).

# Get usage for a date range

> Get the usage and cost of a free range of whole UTC days, counted by the day the usage happened, with totals per usage type and, on request, per day and per service. Use it for a calendar month or any other range that does not follow the billing periods. Each piece of usage is priced with the effective price of the billing period it was billed in, at the current prices. The amounts are an estimate and not a copy of an invoice: a free range matches no single invoice, and its totals can differ by a few cents from adding up billing periods, because each billing period is rounded on its own. All amounts are before tax, credits and discounts. Usage billed in the current period can still change in price until that period closes. Usage arrives several hours after it happens, so the most recent days can be incomplete. Returns 404 when the company has no active subscription. Send usage requests one after another: while another usage request of the company is still running, a request can get a 429 with a `retry-after` header.



## OpenAPI

````yaml https://api.sevalla.com/v3/openapi.json get /usage/range
openapi: 3.1.0
info:
  title: Sevalla API docs
  version: 1.0.0
servers:
  - url: https://api.sevalla.com/v3
security:
  - bearerAuth: []
paths:
  /usage/range:
    get:
      tags:
        - Usage
      summary: Get usage for a date range
      description: >-
        Get the usage and cost of a free range of whole UTC days, counted by the
        day the usage happened, with totals per usage type and, on request, per
        day and per service. Use it for a calendar month or any other range that
        does not follow the billing periods. Each piece of usage is priced with
        the effective price of the billing period it was billed in, at the
        current prices. The amounts are an estimate and not a copy of an
        invoice: a free range matches no single invoice, and its totals can
        differ by a few cents from adding up billing periods, because each
        billing period is rounded on its own. All amounts are before tax,
        credits and discounts. Usage billed in the current period can still
        change in price until that period closes. Usage arrives several hours
        after it happens, so the most recent days can be incomplete. Returns 404
        when the company has no active subscription. Send usage requests one
        after another: while another usage request of the company is still
        running, a request can get a 429 with a `retry-after` header.
      operationId: getUsageRangeV3
      parameters:
        - schema:
            type: string
            format: date
            pattern: >-
              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
            example: '2026-11-01'
          in: query
          name: start_date
          required: true
          description: First UTC day of the range, as YYYY-MM-DD
        - schema:
            type: string
            format: date
            pattern: >-
              ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
            example: '2026-11-07'
          in: query
          name: end_date
          required: true
          description: >-
            Last UTC day of the range, as YYYY-MM-DD. The day itself is
            included. It cannot be before `start_date` and the range can cover
            at most 366 days.
        - schema:
            example: fb5e5168-4281-4bec-94c5-0d1584e9e657
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          in: query
          name: project_id
          required: false
          description: >-
            Count only the usage of the services that are in this project now.
            Usage of a service that was deleted or moved out of the project is
            not counted, and a project without services gives zero usage.
            Returns 404 when the company has no such project.
        - schema:
            example: >-
              fb5e5168-4281-4bec-94c5-0d1584e9e657,0b9b4e3c-6a0f-4d53-9a55-6f0f4d0f1c2e
            type: string
          in: query
          name: service_ids
          required: false
          description: >-
            Comma-separated identifiers of the services to count: applications,
            databases, static sites, object storage buckets and load balancers.
            Up to 100 identifiers. Together with `project_id`, only the listed
            services that are in the project are counted. An identifier without
            usage adds nothing.
        - schema:
            example: appCompute,db
            type: string
          in: query
          name: types
          required: false
          description: >-
            Comma-separated usage types to count. By default every type is
            counted. `appCompute` - running time of application processes.
            `appStorage` - persistent disks of applications. `appBuild` - build
            time of applications. `appBandwidth` - bandwidth of applications.
            `staticSiteBuild` - build time of static sites.
            `staticSiteBandwidth` - bandwidth of static sites. `db` - running
            time of databases. `objectStorage` - data stored in object storage
            buckets. `loadBalancer` - running time of load balancers.
            `loadBalancerBandwidth` - bandwidth of load balancers.
        - schema:
            example: days,services
            type: string
          in: query
          name: include
          required: false
          description: >-
            Comma-separated optional parts to add to the response. `days` -
            usage per UTC day. `services` - usage per service, which can be long
            for a company with many services. By default neither is returned.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  period_start:
                    type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                    description: >-
                      Start of the window the usage is counted for, in ISO 8601
                      format
                    example: '2026-10-14T09:23:11.000Z'
                  period_end:
                    type: string
                    format: date-time
                    pattern: >-
                      ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                    description: >-
                      End of the window the usage is counted for, in ISO 8601
                      format. For a range of days it is the last millisecond of
                      the last day.
                    example: '2026-11-14T09:23:11.000Z'
                  total_cost:
                    type: number
                    description: >-
                      Sum of the costs of all usage types in USD, before tax,
                      credits and discounts
                    example: 20.62
                  usage_by_type:
                    type: array
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - appCompute
                            - appStorage
                            - appBuild
                            - appBandwidth
                            - staticSiteBuild
                            - staticSiteBandwidth
                            - db
                            - objectStorage
                            - loadBalancer
                            - loadBalancerBandwidth
                          description: >-
                            Usage type. `appCompute` - running time of
                            application processes. `appStorage` - persistent
                            disks of applications. `appBuild` - build time of
                            applications. `appBandwidth` - bandwidth of
                            applications. `staticSiteBuild` - build time of
                            static sites. `staticSiteBandwidth` - bandwidth of
                            static sites. `db` - running time of databases.
                            `objectStorage` - data stored in object storage
                            buckets. `loadBalancer` - running time of load
                            balancers. `loadBalancerBandwidth` - bandwidth of
                            load balancers.
                          example: appCompute
                        total_usage:
                          type: number
                          description: >-
                            Amount of usage in the billing unit of the type. The
                            unit depends on the type (running time weighted by
                            the size of the resource, or bytes), so usage of
                            different types cannot be added together.
                          example: 2678400
                        unit_price:
                          type: number
                          description: >-
                            Effective price of one unit of usage in USD, before
                            tax. The price tier comes from the usage of the
                            whole company in the billing period, also when the
                            result is filtered. Over several billing periods it
                            is the average price of those periods.
                          example: 0.0000077
                        cost:
                          type: number
                          description: >-
                            Cost of the usage in USD before tax, credits and
                            discounts, rounded to cents
                          example: 20.62
                      required:
                        - type
                        - total_usage
                        - unit_price
                        - cost
                      additionalProperties: false
                    description: >-
                      Usage and cost per usage type. A type without usage is
                      left out.
                  days:
                    description: >-
                      Usage per UTC day, oldest first. Only returned when
                      `include` has `days`. A day without usage is listed with a
                      zero total. Each cost is rounded on its own, so the days
                      do not have to add up to `total_cost` to the cent.
                    type: array
                    items:
                      type: object
                      properties:
                        date:
                          type: string
                          format: date
                          pattern: >-
                            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                          description: UTC day the usage happened on, as YYYY-MM-DD
                          example: '2026-10-14'
                        total_cost:
                          type: number
                          description: >-
                            Sum of the costs of all usage types in USD, before
                            tax, credits and discounts
                          example: 20.62
                        usage_by_type:
                          type: array
                          items:
                            type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - appCompute
                                  - appStorage
                                  - appBuild
                                  - appBandwidth
                                  - staticSiteBuild
                                  - staticSiteBandwidth
                                  - db
                                  - objectStorage
                                  - loadBalancer
                                  - loadBalancerBandwidth
                                description: >-
                                  Usage type. `appCompute` - running time of
                                  application processes. `appStorage` -
                                  persistent disks of applications. `appBuild` -
                                  build time of applications. `appBandwidth` -
                                  bandwidth of applications. `staticSiteBuild` -
                                  build time of static sites.
                                  `staticSiteBandwidth` - bandwidth of static
                                  sites. `db` - running time of databases.
                                  `objectStorage` - data stored in object
                                  storage buckets. `loadBalancer` - running time
                                  of load balancers. `loadBalancerBandwidth` -
                                  bandwidth of load balancers.
                                example: appCompute
                              total_usage:
                                type: number
                                description: >-
                                  Amount of usage in the billing unit of the
                                  type. The unit depends on the type (running
                                  time weighted by the size of the resource, or
                                  bytes), so usage of different types cannot be
                                  added together.
                                example: 2678400
                              unit_price:
                                type: number
                                description: >-
                                  Effective price of one unit of usage in USD,
                                  before tax. The price tier comes from the
                                  usage of the whole company in the billing
                                  period, also when the result is filtered. Over
                                  several billing periods it is the average
                                  price of those periods.
                                example: 0.0000077
                              cost:
                                type: number
                                description: >-
                                  Cost of the usage in USD before tax, credits
                                  and discounts, rounded to cents
                                example: 20.62
                            required:
                              - type
                              - total_usage
                              - unit_price
                              - cost
                            additionalProperties: false
                          description: >-
                            Usage and cost per usage type. A type without usage
                            is left out.
                      required:
                        - date
                        - total_cost
                        - usage_by_type
                      additionalProperties: false
                  services:
                    description: >-
                      Usage per service. Only returned when `include` has
                      `services`. Each cost is rounded on its own, so the
                      services do not have to add up to `total_cost` to the
                      cent.
                    type: array
                    items:
                      type: object
                      properties:
                        service_id:
                          description: >-
                            Identifier of the service, or null for usage that is
                            not tied to a service
                          example: fb5e5168-4281-4bec-94c5-0d1584e9e657
                          type:
                            - string
                            - 'null'
                        service_name:
                          description: >-
                            Name of the service as stored with its usage, or
                            null when no name was stored
                          example: my-app
                          type:
                            - string
                            - 'null'
                        total_cost:
                          type: number
                          description: >-
                            Sum of the costs of all usage types in USD, before
                            tax, credits and discounts
                          example: 20.62
                        usage_by_type:
                          type: array
                          items:
                            type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - appCompute
                                  - appStorage
                                  - appBuild
                                  - appBandwidth
                                  - staticSiteBuild
                                  - staticSiteBandwidth
                                  - db
                                  - objectStorage
                                  - loadBalancer
                                  - loadBalancerBandwidth
                                description: >-
                                  Usage type. `appCompute` - running time of
                                  application processes. `appStorage` -
                                  persistent disks of applications. `appBuild` -
                                  build time of applications. `appBandwidth` -
                                  bandwidth of applications. `staticSiteBuild` -
                                  build time of static sites.
                                  `staticSiteBandwidth` - bandwidth of static
                                  sites. `db` - running time of databases.
                                  `objectStorage` - data stored in object
                                  storage buckets. `loadBalancer` - running time
                                  of load balancers. `loadBalancerBandwidth` -
                                  bandwidth of load balancers.
                                example: appCompute
                              total_usage:
                                type: number
                                description: >-
                                  Amount of usage in the billing unit of the
                                  type. The unit depends on the type (running
                                  time weighted by the size of the resource, or
                                  bytes), so usage of different types cannot be
                                  added together.
                                example: 2678400
                              unit_price:
                                type: number
                                description: >-
                                  Effective price of one unit of usage in USD,
                                  before tax. The price tier comes from the
                                  usage of the whole company in the billing
                                  period, also when the result is filtered. Over
                                  several billing periods it is the average
                                  price of those periods.
                                example: 0.0000077
                              cost:
                                type: number
                                description: >-
                                  Cost of the usage in USD before tax, credits
                                  and discounts, rounded to cents
                                example: 20.62
                            required:
                              - type
                              - total_usage
                              - unit_price
                              - cost
                            additionalProperties: false
                          description: >-
                            Usage and cost per usage type. A type without usage
                            is left out.
                      required:
                        - service_id
                        - service_name
                        - total_cost
                        - usage_by_type
                      additionalProperties: false
                required:
                  - period_start
                  - period_end
                  - total_cost
                  - usage_by_type
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Bad request
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 400
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Unauthorized
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 401
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: >-
                      This API key is missing the <RESOURCE>:<ACTION>
                      permission. Grant it to the key or use a key that has it.
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 403
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Not found
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 404
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '429':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Too many requests
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 429
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Internal Server Error
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 500
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Pass your API key as a Bearer token in the
        Authorization header.

````

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