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

# /l2beat/projects/costs

> Get L2BEAT onchain costs per scaling project (calldata, blobs, compute, overhead)

**Price:** 1 credit

**💡 AI Hint:** Get the onchain costs that Ethereum layer-two scaling projects pay to post data and proofs to L1, over a chosen time window. Each project carries the cost split into calldata, blobs, compute, and overhead, expressed in gas, ETH, and USD, plus the number of L2 user operations. Omit 'project' to get all projects ranked by total USD cost, or pass a slug for a single project.

**⚠️ Common errors:** 412: Project not found



## OpenAPI

````yaml /openapi-filtered.json post /api/l2beat/projects/costs
openapi: 3.1.0
info:
  title: Any Site API
  description: >+
    Any Site API provides programmatic access to data from LinkedIn, Instagram,
    Twitter, and other platforms.


    ## Authentication


    All API endpoints require an `access-token` header with a valid API token.
    Tokens can be created in the [dashboard](https://app.anysite.io/).


    ## Pricing


    Each endpoint has a credit cost listed in its description. Credits are
    deducted from your token balance per request.

  version: 0.0.1
servers: []
security:
  - AccessToken: []
paths:
  /api/l2beat/projects/costs:
    post:
      tags:
        - /l2beat
      summary: /l2beat/projects/costs
      description: >-
        Get L2BEAT onchain costs per scaling project (calldata, blobs, compute,
        overhead)


        **Price:** 1 credit


        **💡 AI Hint:** Get the onchain costs that Ethereum layer-two scaling
        projects pay to post data and proofs to L1, over a chosen time window.
        Each project carries the cost split into calldata, blobs, compute, and
        overhead, expressed in gas, ETH, and USD, plus the number of L2 user
        operations. Omit 'project' to get all projects ranked by total USD cost,
        or pass a slug for a single project.


        **⚠️ Common errors:** 412: Project not found
      operationId: __api_l2beat_projects_costs_post
      parameters:
        - name: access-token
          in: header
          required: true
          schema:
            anyOf:
              - type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/L2beatProjectsCostsPayload'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/L2beatProjectCosts'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    L2beatProjectsCostsPayload:
      properties:
        timeout:
          type: integer
          maximum: 1500
          minimum: 20
          description: Max scrapping execution timeout (in seconds)
          default: 300
        project:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Project slug to return costs for a single project; omit for all
            projects
          examples:
            - base
        count:
          type: integer
          minimum: 1
          description: Max number of projects to return
        range:
          $ref: '#/components/schemas/L2beatRange'
          description: Time window for the onchain cost aggregation
          default: 30d
      type: object
      required:
        - count
    L2beatProjectCosts:
      properties:
        '@type':
          type: string
          default: L2beatProjectCosts
        id:
          type: string
        gas:
          anyOf:
            - $ref: '#/components/schemas/L2beatCostBreakdown'
            - type: 'null'
        eth:
          anyOf:
            - $ref: '#/components/schemas/L2beatCostBreakdown'
            - type: 'null'
        usd:
          anyOf:
            - $ref: '#/components/schemas/L2beatCostBreakdown'
            - type: 'null'
        uops_count:
          anyOf:
            - type: integer
            - type: 'null'
        synced_until:
          anyOf:
            - type: integer
            - type: 'null'
      type: object
      required:
        - id
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
    L2beatRange:
      type: string
      enum:
        - 1d
        - 7d
        - 30d
        - 90d
        - 180d
        - 1y
        - max
    L2beatCostBreakdown:
      properties:
        '@type':
          type: string
          default: L2beatCostBreakdown
        overhead:
          anyOf:
            - type: number
            - type: 'null'
        calldata:
          anyOf:
            - type: number
            - type: 'null'
        compute:
          anyOf:
            - type: number
            - type: 'null'
        blobs:
          anyOf:
            - type: number
            - type: 'null'
        total:
          anyOf:
            - type: number
            - type: 'null'
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
        msg:
          type: string
        type:
          type: string
        input: {}
        ctx:
          type: object
      type: object
      required:
        - loc
        - msg
        - type
  securitySchemes:
    AccessToken:
      type: apiKey
      in: header
      name: access-token
      description: API token from the dashboard

````