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

# List a framework's per-project compliance

> List a framework's compliance stats per project.



## OpenAPI

````yaml get /frameworks/{frameworkId}/project-rule-stats
openapi: 3.0.3
info:
  contact:
    email: support@openlayer.com
    name: Openlayer
    url: https://openlayer.com/
  description: API for interacting with the Openlayer server.
  title: Openlayer API
  version: '1.0'
  x-logo:
    url: https://logo.clearbit.com/openlayer.com
servers:
  - url: https://api.openlayer.com/v1
    description: Our prod backend
security:
  - bearerAuth: []
paths:
  /frameworks/{frameworkId}/project-rule-stats:
    get:
      tags:
        - Governance
      summary: List a framework's per-project compliance
      description: List a framework's compliance stats per project.
      operationId: listFrameworkProjectRuleStats
      parameters:
        - $ref: '#/components/parameters/frameworkId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
        - $ref: '#/components/parameters/asc'
        - name: sortColumn
          in: query
          description: The column to sort on.
          required: false
          schema:
            type: string
            enum:
              - projectName
              - total
              - overallCompletion
              - totalPassing
              - totalFailing
              - totalSkipped
              - totalRunning
              - totalError
              - totalPending
              - totalDueSoon
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProjectRuleStatistic'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            stats = client.governance.frameworks.list_project_rule_stats(
                "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
                sort_column="overallCompletion",
            )
            print(stats.items)
        - lang: typescript
          source: >
            import Openlayer from 'openlayer';


            const client = new Openlayer();


            const stats = await
            client.governance.frameworks.listProjectRuleStats('5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b',
            {
              sortColumn: 'overallCompletion',
              asc: true,
            });


            console.log(stats.items);
        - lang: go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openlayer-ai/openlayer-go\"\n)\n\nclient := openlayer.NewClient()\nstats, err := client.Governance.Frameworks.ListProjectRuleStats(\n\tcontext.TODO(),\n\t\"5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b\",\n\topenlayer.GovernanceFrameworkListProjectRuleStatsParams{},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", stats.Items)\n"
        - lang: java
          source: >
            import com.openlayer.api.client.OpenlayerClient;

            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;

            import
            com.openlayer.api.models.governance.frameworks.FrameworkListProjectRuleStatsParams;

            import
            com.openlayer.api.models.governance.frameworks.FrameworkListProjectRuleStatsResponse;


            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();


            FrameworkListProjectRuleStatsParams params =
            FrameworkListProjectRuleStatsParams.builder()
                .frameworkId("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b")
                .sortColumn(FrameworkListProjectRuleStatsParams.SortColumn.OVERALL_COMPLETION)
                .asc(false)
                .build();
            FrameworkListProjectRuleStatsResponse stats =
            client.governance().frameworks().listProjectRuleStats(params);
        - lang: ruby
          source: >
            require "openlayer"


            openlayer = Openlayer::Client.new(api_key: ENV["OPENLAYER_API_KEY"])


            rule_stats =
            openlayer.governance.frameworks.list_project_rule_stats("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b")


            puts(rule_stats)
        - lang: curl
          source: |
            curl --request GET \
              --url 'https://api.openlayer.com/v1/frameworks/9f1b3c2d-4e5a-4f60-8a71-2b3c4d5e6f70/project-rule-stats?sortColumn=totalFailing&asc=false' \
              --header 'Authorization: Bearer <token>'
components:
  parameters:
    frameworkId:
      name: frameworkId
      in: path
      description: The framework id.
      required: true
      schema:
        type: string
        format: uuid
    page:
      name: page
      in: query
      description: The page to return in a paginated query.
      schema:
        type: integer
        minimum: 1
        default: 1
    perPage:
      name: perPage
      in: query
      description: Maximum number of items to return per page.
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
    asc:
      name: asc
      in: query
      description: Whether to sort in ascending order.
      required: false
      schema:
        type: boolean
        default: true
  schemas:
    ProjectRuleStatistic:
      description: One project's rule result counts by status, for a single framework.
      allOf:
        - $ref: '#/components/schemas/RuleResultStatusCounts'
        - type: object
          properties:
            projectId:
              type: string
              format: uuid
              description: The project id.
              example: 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
            projectName:
              type: string
              description: The project name.
              example: Customer chatbot
            taskType:
              type: string
              description: The project's task type.
              example: llm-base
            byRuleType:
              type: object
              description: >-
                The same counts, broken down by the type of the rule each result
                belongs to.
              properties:
                platform:
                  $ref: '#/components/schemas/RuleResultStatusCounts'
                evidence:
                  $ref: '#/components/schemas/RuleResultStatusCounts'
          required:
            - projectId
            - projectName
            - taskType
    RuleResultStatusCounts:
      type: object
      properties:
        total:
          type: integer
          minimum: 0
          description: The total number of rule results.
        totalPassing:
          type: integer
          minimum: 0
          description: The number of passing rule results.
        totalFailing:
          type: integer
          minimum: 0
          description: The number of failing rule results.
        totalSkipped:
          type: integer
          minimum: 0
          description: The number of skipped rule results.
        totalRunning:
          type: integer
          minimum: 0
          description: The number of rule results currently being evaluated.
        totalError:
          type: integer
          minimum: 0
          description: The number of rule results that errored during evaluation.
        totalPending:
          type: integer
          minimum: 0
          description: The number of rule results that have not been satisfied yet.
        totalDueSoon:
          type: integer
          minimum: 0
          description: The number of rule results whose evidence is about to expire.
      required:
        - total
        - totalPassing
        - totalFailing
        - totalSkipped
        - totalRunning
        - totalError
        - totalPending
        - totalDueSoon
  responses:
    UnexpectedError:
      description: Unexpected error.
      content:
        application/json:
          schema:
            type: object
            required:
              - code
              - error
            properties:
              code:
                type: integer
                format: int32
              error:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your workspace API key. See [Find your API
        key](https://www.openlayer.com/docs/workspace-and-projects/find-your-api-key)
        for more information.

````

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