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:
  '/workspaces/{workspaceId}':
    get:
      summary: Retrieve a workspace
      operationId: getWorkspaceById
      description: Retrieve a workspace.
      parameters:
        - $ref: '#/components/parameters/workspaceId'
      responses:
        '200':
          description: Response OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workspace'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            workspace = client.workspaces.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
            print(workspace.name)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const workspace = await client.workspaces.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');

            console.log(workspace.name);
        - 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()\nworkspace, err := client.Workspaces.Get(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", workspace.Name)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.workspaces.WorkspaceRetrieveResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            WorkspaceRetrieveResponse workspace = client.workspaces().retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
        - lang: ruby
          source: |
            require "openlayer"

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

            workspace = openlayer.workspaces.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")

            puts(workspace)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/workspaces/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --header 'Authorization: Bearer <token>'
    put:
      summary: Update a workspace
      operationId: updateWorkspaceById
      description: Update a workspace.
      parameters:
        - $ref: '#/components/parameters/workspaceId'
      responses:
        '200':
          description: Response OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workspace'
        default:
          $ref: '#/components/responses/UnexpectedError'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  $ref: '#/components/schemas/Workspace/properties/name'
                slug:
                  $ref: '#/components/schemas/Workspace/properties/slug'
                inviteCode:
                  $ref: '#/components/schemas/Workspace/properties/inviteCode'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            workspace = client.workspaces.update(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                name="My Workspace",
                slug="my-workspace",
            )
            print(workspace.slug)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const workspace = await client.workspaces.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
              name: 'My Workspace',
              slug: 'my-workspace',
            });

            console.log(workspace.slug);
        - 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()\nworkspace, err := client.Workspaces.Update(\n\tcontext.TODO(),\n\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\topenlayer.WorkspaceUpdateParams{\n\t\tName: openlayer.F(\"Openlayer Staging\"),\n\t\tSlug: openlayer.F(\"openlayer-staging\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", workspace.Name)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.workspaces.WorkspaceUpdateParams;
            import com.openlayer.api.models.workspaces.WorkspaceUpdateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            WorkspaceUpdateParams params = WorkspaceUpdateParams.builder()
                .workspaceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .name("Openlayer")
                .slug("openlayer")
                .build();
            WorkspaceUpdateResponse workspace = client.workspaces().update(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            workspace = openlayer.workspaces.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", name: "Openlayer")

            puts(workspace)
        - lang: curl
          source: |
            curl --request PUT \
              --url https://api.openlayer.com/v1/workspaces/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --header 'Authorization: Bearer <token>' \
              --data '{
                "name": "My Workspace",
                "slug": "my-workspace"
              }'
  '/workspaces/{workspaceId}/api-keys':
    get:
      summary: List API keys
      description: List your API keys in a workspace.
      operationId: listApiKeysInWorkspace
      parameters:
        - $ref: '#/components/parameters/workspaceId'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiKey'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            api_keys = client.workspaces.api_keys.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
            for api_key in api_keys:
                print(api_key.id, api_key.name, api_key.status)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const apiKeys = await client.workspaces.apiKeys.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');

            console.log(apiKeys);
        - 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()\napiKeys, err := client.Workspaces.APIKeys.List(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", len(*apiKeys))\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.workspaces.apikeys.ApiKeyListResponse;
            import java.util.List;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            List<ApiKeyListResponse> apiKeys = client.workspaces().apiKeys().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
        - lang: ruby
          source: |
            require "openlayer"

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

            api_keys = openlayer.workspaces.api_keys.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")

            puts(api_keys)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/workspaces/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/api-keys \
              --header 'Authorization: Bearer <token>'
    post:
      summary: Create an API key
      description: Create a new API key.
      operationId: createApiKeyInWorkspace
      parameters:
        - $ref: '#/components/parameters/workspaceId'
      responses:
        '201':
          description: Status Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKey'
        '400':
          description: '`expiresAt` is later than the calling API key''s expiry, or `null` while the calling key expires.'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  $ref: '#/components/schemas/ApiKey/properties/name'
                expiresAt:
                  $ref: '#/components/schemas/ApiKey/properties/expiresAt'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            api_key = client.workspaces.api_keys.create(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                name="CI pipeline",
                expires_at="2027-01-01T00:00:00Z",
            )
            print(api_key.secret)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const apiKey = await client.workspaces.apiKeys.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
              name: 'CI pipeline',
              expiresAt: '2027-01-01T00:00:00Z',
            });

            console.log(apiKey.secureKey);
        - lang: go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/openlayer-ai/openlayer-go\"\n)\n\nclient := openlayer.NewClient()\napiKey, err := client.Workspaces.APIKeys.New(\n\tcontext.TODO(),\n\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\topenlayer.WorkspaceAPIKeyNewParams{\n\t\tName:      openlayer.F(\"CI pipeline\"),\n\t\tExpiresAt: openlayer.F(time.Date(2027, 1, 1, 0, 0, 0, 0, time.UTC)),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", apiKey.Secret)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.workspaces.apikeys.ApiKeyCreateParams;
            import com.openlayer.api.models.workspaces.apikeys.ApiKeyCreateResponse;
            import java.time.OffsetDateTime;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ApiKeyCreateParams params = ApiKeyCreateParams.builder()
                .workspaceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .name("CI pipeline key")
                .expiresAt(OffsetDateTime.parse("2027-01-01T00:00:00Z"))
                .build();
            ApiKeyCreateResponse apiKey = client.workspaces().apiKeys().create(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            api_key = openlayer.workspaces.api_keys.create(
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              name: "Secret Key",
              expires_at: "2027-01-01T00:00:00Z"
            )

            puts(api_key.secure_key)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/workspaces/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/api-keys \
              --header 'Authorization: Bearer <token>' \
              --data '{
                "name": "My API Key",
                "expiresAt": "2027-01-01T00:00:00Z"
              }'
  '/workspaces/{workspaceId}/api-keys/{apiKeyId}':
    get:
      summary: Retrieve an API key
      description: Retrieve an API key.
      operationId: getApiKey
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - $ref: '#/components/parameters/apiKeyId'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKey'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            api_key = client.workspaces.api_keys.retrieve(
                "3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b",
                workspace_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(api_key.status)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const apiKey = await client.workspaces.apiKeys.retrieve('3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b', {
              workspaceId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            });

            console.log(apiKey.name);
        - 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()\napiKey, err := client.Workspaces.APIKeys.Get(\n\tcontext.TODO(),\n\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\"3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b\",\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", apiKey.Status)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.workspaces.apikeys.ApiKeyRetrieveParams;
            import com.openlayer.api.models.workspaces.apikeys.ApiKeyRetrieveResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ApiKeyRetrieveParams params = ApiKeyRetrieveParams.builder()
                .workspaceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .apiKeyId("3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b")
                .build();
            ApiKeyRetrieveResponse apiKey = client.workspaces().apiKeys().retrieve(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            api_key = openlayer.workspaces.api_keys.retrieve(
              "3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b",
              workspace_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
            )

            puts(api_key)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/workspaces/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/api-keys/3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b \
              --header 'Authorization: Bearer <token>'
    put:
      summary: Update an API key
      description: Rename an API key.
      operationId: updateApiKey
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - $ref: '#/components/parameters/apiKeyId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  $ref: '#/components/schemas/ApiKey/properties/name'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKey'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            api_key = client.workspaces.api_keys.update(
                "3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b",
                workspace_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                name="CI pipeline (prod)",
            )
            print(api_key.name)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const apiKey = await client.workspaces.apiKeys.update('3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b', {
              workspaceId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              name: 'CI pipeline (prod)',
            });

            console.log(apiKey.name);
        - 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()\napiKey, err := client.Workspaces.APIKeys.Update(\n\tcontext.TODO(),\n\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\"3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b\",\n\topenlayer.WorkspaceAPIKeyUpdateParams{\n\t\tName: openlayer.F(\"CI pipeline (prod)\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", apiKey.Name)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.workspaces.apikeys.ApiKeyUpdateParams;
            import com.openlayer.api.models.workspaces.apikeys.ApiKeyUpdateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ApiKeyUpdateParams params = ApiKeyUpdateParams.builder()
                .workspaceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .apiKeyId("3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b")
                .name("CI pipeline key (prod)")
                .build();
            ApiKeyUpdateResponse apiKey = client.workspaces().apiKeys().update(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            api_key = openlayer.workspaces.api_keys.update(
              "3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b",
              workspace_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              name: "Production key"
            )

            puts(api_key)
        - lang: curl
          source: |
            curl --request PUT \
              --url https://api.openlayer.com/v1/workspaces/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/api-keys/3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b \
              --header 'Authorization: Bearer <token>' \
              --data '{"name": "Production ingest"}'
    delete:
      summary: Delete an API key
      description: Delete an API key.
      operationId: deleteApiKey
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - $ref: '#/components/parameters/apiKeyId'
      responses:
        '200':
          description: 'Key deleted. All of its secrets stop working immediately, including a previous secret still in its rotation grace period.'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            client.workspaces.api_keys.delete(
                "3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b",
                workspace_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            await client.workspaces.apiKeys.delete('3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b', {
              workspaceId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            });
        - lang: go
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/openlayer-ai/openlayer-go\"\n)\n\nclient := openlayer.NewClient()\nerr := client.Workspaces.APIKeys.Delete(\n\tcontext.TODO(),\n\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\"3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b\",\n)\nif err != nil {\n\tpanic(err.Error())\n}\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.workspaces.apikeys.ApiKeyDeleteParams;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ApiKeyDeleteParams params = ApiKeyDeleteParams.builder()
                .workspaceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .apiKeyId("3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b")
                .build();
            client.workspaces().apiKeys().delete(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            openlayer.workspaces.api_keys.delete(
              "3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b",
              workspace_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
            )
        - lang: curl
          source: |
            curl --request DELETE \
              --url https://api.openlayer.com/v1/workspaces/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/api-keys/3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b \
              --header 'Authorization: Bearer <token>'
  '/workspaces/{workspaceId}/api-keys/{apiKeyId}/rotate':
    post:
      summary: Rotate an API key
      description: Replace an API key's secret.
      operationId: rotateApiKey
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - $ref: '#/components/parameters/apiKeyId'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                gracePeriodHours:
                  type: integer
                  minimum: 0
                  maximum: 168
                  default: 0
                  example: 24
                  description: 'Hours the previous secret keeps authenticating. The default of 0 retires it immediately. It never outlives `expiresAt`. Only one previous secret is kept, so rotating again during a grace period retires the older one immediately.'
                expiresAt:
                  $ref: '#/components/schemas/ApiKey/properties/expiresAt'
      responses:
        '200':
          description: 'The rotated key. It keeps its id and name, and the new secret is in `secret`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKey'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            api_key = client.workspaces.api_keys.rotate(
                "3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b",
                workspace_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                grace_period_hours=24,
            )
            print(api_key.secret)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const apiKey = await client.workspaces.apiKeys.rotate('3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b', {
              workspaceId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              gracePeriodHours: 24,
            });

            console.log(apiKey.secureKey);
        - 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()\napiKey, err := client.Workspaces.APIKeys.Rotate(\n\tcontext.TODO(),\n\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\"3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b\",\n\topenlayer.WorkspaceAPIKeyRotateParams{\n\t\tGracePeriodHours: openlayer.Int(24),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", apiKey.Secret)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.workspaces.apikeys.ApiKeyRotateParams;
            import com.openlayer.api.models.workspaces.apikeys.ApiKeyRotateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ApiKeyRotateParams params = ApiKeyRotateParams.builder()
                .workspaceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .apiKeyId("3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b")
                .gracePeriodHours(24L)
                .build();
            ApiKeyRotateResponse rotated = client.workspaces().apiKeys().rotate(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            api_key = openlayer.workspaces.api_keys.rotate(
              "3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b",
              workspace_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              grace_period_hours: 24
            )

            puts(api_key.secure_key)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/workspaces/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/api-keys/3f2b9c1e-8a4d-4e6f-9b7a-1c2d3e4f5a6b/rotate \
              --header 'Authorization: Bearer <token>' \
              --data '{"gracePeriodHours": 24, "expiresAt": "2027-06-01T00:00:00Z"}'
  '/workspaces/{workspaceId}/invites':
    get:
      summary: List invites
      operationId: getInvitesByWorkspace
      description: List the invites in a workspace.
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
      responses:
        '200':
          description: Status OK.
          headers:
            x-next:
              description: A link to the next page of responses
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Invite'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            invites = client.workspaces.invites.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
            print(invites.items)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const invites = await client.workspaces.invites.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { page: 1, perPage: 25 });

            console.log(invites.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()\ninvites, err := client.Workspaces.Invites.List(\n\tcontext.TODO(),\n\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\topenlayer.WorkspaceInviteListParams{},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", invites.Items)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.workspaces.invites.InviteListParams;
            import com.openlayer.api.models.workspaces.invites.InviteListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            InviteListParams params = InviteListParams.builder()
                .workspaceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .perPage(25L)
                .build();
            InviteListResponse invites = client.workspaces().invites().list(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            invites = openlayer.workspaces.invites.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")

            puts(invites)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/workspaces/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/invites \
              --header 'Authorization: Bearer <token>'
    post:
      summary: Invite users to a workspace
      operationId: inviteUsersToWorkspace
      description: Invite users to a workspace.
      parameters:
        - $ref: '#/components/parameters/workspaceId'
      responses:
        '201':
          description: Status OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Invite'
        default:
          $ref: '#/components/responses/UnexpectedError'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                emails:
                  type: array
                  items:
                    $ref: '#/components/schemas/Member/properties/email'
                role:
                  $ref: '#/components/schemas/Member/properties/membership/properties/role'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            invites = client.workspaces.invites.create(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                emails=["jane@example.com", "john@example.com"],
                role="MEMBER",
            )
            print(invites.items)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const invites = await client.workspaces.invites.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
              emails: ['jane@example.com', 'john@example.com'],
              role: 'MEMBER',
            });

            console.log(invites.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()\ninvites, err := client.Workspaces.Invites.New(\n\tcontext.TODO(),\n\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\topenlayer.WorkspaceInviteNewParams{\n\t\tEmails: openlayer.F([]string{\"jane@example.com\", \"john@example.com\"}),\n\t\tRole:   openlayer.F(openlayer.WorkspaceInviteNewParamsRoleMember),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", invites.Items)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.workspaces.invites.InviteCreateParams;
            import com.openlayer.api.models.workspaces.invites.InviteCreateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            InviteCreateParams params = InviteCreateParams.builder()
                .workspaceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .addEmail("teammate@example.com")
                .role(InviteCreateParams.Role.MEMBER)
                .build();
            InviteCreateResponse invite = client.workspaces().invites().create(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            invites = openlayer.workspaces.invites.create(
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              emails: ["user@email.com"],
              role: :MEMBER
            )

            puts(invites)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/workspaces/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e/invites \
              --header 'Authorization: Bearer <token>' \
              --data '{
                "emails": ["john@doe.com", "jane@doe.com"],
                "role": "ADMIN"
              }'
  /projects:
    get:
      summary: List projects
      operationId: listProjects
      description: List your workspace's projects.
      parameters:
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
        - $ref: '#/components/parameters/projectName'
        - $ref: '#/components/parameters/taskType'
      responses:
        '200':
          description: Status OK.
          headers:
            x-next:
              description: A link to the next page of responses
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Project'
        '500':
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            projects = client.projects.list(task_type="llm-base")
            for project in projects.items:
                print(project.id, project.name)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const projects = await client.projects.list({ taskType: 'llm-base' });

            console.log(projects.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()\nprojects, err := client.Projects.List(context.TODO(), openlayer.ProjectListParams{\n\tTaskType: openlayer.F(openlayer.ProjectListParamsTaskTypeLlmBase),\n})\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", projects.Items)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.projects.ProjectListParams;
            import com.openlayer.api.models.projects.ProjectListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ProjectListParams params = ProjectListParams.builder()
                .taskType(ProjectListParams.TaskType.LLM_BASE)
                .build();
            ProjectListResponse projects = client.projects().list(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            projects = openlayer.projects.list(task_type: :"llm-base")

            puts(projects)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/projects \
              --header 'Authorization: Bearer <token>'
    post:
      tags:
        - Projects
      summary: Create project
      operationId: createProject
      description: Create a project in your workspace.
      responses:
        '201':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
        default:
          $ref: '#/components/responses/UnexpectedError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Project'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            project = client.projects.create(
                name="Customer support chatbot",
                task_type="llm-base",
                description="Answers customer questions about billing.",
            )
            print(project.id)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const project = await client.projects.create({
              name: 'My Project',
              taskType: 'llm-base',
              description: 'My project description.',
            });

            console.log(project.id);
        - 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()\nproject, err := client.Projects.New(context.TODO(), openlayer.ProjectNewParams{\n\tName:     openlayer.F(\"My Project\"),\n\tTaskType: openlayer.F(openlayer.ProjectNewParamsTaskTypeLlmBase),\n})\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", project.ID)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.core.JsonMissing;
            import com.openlayer.api.models.projects.ProjectCreateParams;
            import com.openlayer.api.models.projects.ProjectCreateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ProjectCreateParams params = ProjectCreateParams.builder()
                .name("My Project")
                .taskType(ProjectCreateParams.TaskType.LLM_BASE)
                .description("My project description.")
                // Server-assigned fields the Java SDK marks as required: leave them out of the request.
                .id(JsonMissing.of())
                .workspaceId(JsonMissing.of())
                .creatorId(JsonMissing.of())
                .dateCreated(JsonMissing.of())
                .dateUpdated(JsonMissing.of())
                .source(JsonMissing.of())
                .versionCount(JsonMissing.of())
                .inferencePipelineCount(JsonMissing.of())
                .goalCount(JsonMissing.of())
                .developmentGoalCount(JsonMissing.of())
                .monitoringGoalCount(JsonMissing.of())
                .links(JsonMissing.of())
                .build();
            ProjectCreateResponse project = client.projects().create(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            project = openlayer.projects.create(
              name: "My Project",
              task_type: :"llm-base",
              description: "My project description."
            )

            puts(project)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/projects \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "name": "My Project",
                "description": "My project description.",
                "taskType": "llm-base"
              }'
  '/projects/{projectId}':
    patch:
      tags:
        - Projects
      summary: Update project
      operationId: updateProject
      description: Update a project's metadata.
      security:
        - apiKey: []
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/projectId'
      responses:
        '200':
          description: Response OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
        default:
          $ref: '#/components/responses/UnexpectedError'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                name:
                  $ref: '#/components/schemas/Project/properties/name'
                description:
                  $ref: '#/components/schemas/Project/properties/description'
                purpose:
                  $ref: '#/components/schemas/Project/properties/purpose'
                modelTypes:
                  $ref: '#/components/schemas/Project/properties/modelTypes'
                modelDeveloper:
                  $ref: '#/components/schemas/Project/properties/modelDeveloper'
                dataRetentionDays:
                  $ref: '#/components/schemas/Project/properties/dataRetentionDays'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            project = client.projects.update(
                "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                name="Customer support chatbot",
                description="Answers customer questions about billing and refunds.",
            )
            print(project.name)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const project = await client.projects.update('3fa85f64-5717-4562-b3fc-2c963f66afa6', {
              name: 'My Renamed Project',
              description: 'An updated project description.',
            });

            console.log(project.name);
        - 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()\nproject, err := client.Projects.Update(\n\tcontext.TODO(),\n\t\"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n\topenlayer.ProjectUpdateParams{\n\t\tName:        openlayer.F(\"My Renamed Project\"),\n\t\tDescription: openlayer.F(\"An updated project description.\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", project.Name)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.projects.ProjectUpdateParams;
            import com.openlayer.api.models.projects.ProjectUpdateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ProjectUpdateParams params = ProjectUpdateParams.builder()
                .projectId("3fa85f64-5717-4562-b3fc-2c963f66afa6")
                .description("Customer support assistant.")
                .dataRetentionDays(90L)
                .build();
            ProjectUpdateResponse project = client.projects().update(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            project = openlayer.projects.update(
              "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              description: "My project description."
            )

            puts(project)
        - lang: curl
          source: |
            curl --request PATCH \
              --url https://api.openlayer.com/v1/projects/3fa85f64-5717-4562-b3fc-2c963f66afa6 \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "name": "My Renamed Project",
                "description": "An updated project description."
              }'
    delete:
      tags:
        - Projects
      summary: Delete project
      operationId: deleteProject
      description: Delete a project by its ID.
      security:
        - apiKey: []
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/projectId'
      responses:
        '200':
          description: Response OK.
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            client.projects.delete("3fa85f64-5717-4562-b3fc-2c963f66afa6")
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            await client.projects.delete('3fa85f64-5717-4562-b3fc-2c963f66afa6');
        - lang: go
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/openlayer-ai/openlayer-go\"\n)\n\nclient := openlayer.NewClient()\nerr := client.Projects.Delete(context.TODO(), \"3fa85f64-5717-4562-b3fc-2c963f66afa6\")\nif err != nil {\n\tpanic(err.Error())\n}\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            client.projects().delete("3fa85f64-5717-4562-b3fc-2c963f66afa6");
        - lang: ruby
          source: |
            require "openlayer"

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

            openlayer.projects.delete("3fa85f64-5717-4562-b3fc-2c963f66afa6")
        - lang: curl
          source: |
            curl --request DELETE \
              --url https://api.openlayer.com/v1/projects/3fa85f64-5717-4562-b3fc-2c963f66afa6 \
              --header 'Authorization: Bearer <token>'
  '/projects/{projectId}/versions':
    get:
      tags:
        - Development
      summary: List project commits
      operationId: listProjectVersionsByProject
      description: List the commits (project versions) in a project.
      parameters:
        - $ref: '#/components/parameters/projectId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
      responses:
        '200':
          description: Status OK.
          headers:
            x-next:
              description: A link to the next page of responses
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProjectVersion'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            commits = client.projects.commits.list("3fa85f64-5717-4562-b3fc-2c963f66afa6")
            for commit in commits.items:
                print(commit.id, commit.commit.message)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const commits = await client.projects.commits.list('3fa85f64-5717-4562-b3fc-2c963f66afa6');

            console.log(commits.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()\ncommits, err := client.Projects.Commits.List(\n\tcontext.TODO(),\n\t\"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n\topenlayer.ProjectCommitListParams{},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", commits.Items)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.projects.commits.CommitListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            CommitListResponse commits = client.projects().commits().list("3fa85f64-5717-4562-b3fc-2c963f66afa6");
        - lang: ruby
          source: |
            require "openlayer"

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

            commits = openlayer.projects.commits.list("3fa85f64-5717-4562-b3fc-2c963f66afa6")

            puts(commits)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/projects/{projectId}/versions \
              --header 'Authorization: Bearer <token>'
    post:
      tags:
        - Development
      summary: Create project commit
      operationId: createProjectVersion
      description: Create a new commit (project version) in a project.
      parameters:
        - $ref: '#/components/parameters/projectId'
      responses:
        '201':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectVersion'
        default:
          $ref: '#/components/responses/UnexpectedError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectVersion'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            commit = client.projects.commits.create(
                "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                commit={"message": "Updated the prompt"},
                storage_uri="s3://openlayer-bucket/commits/bundle.tar.gz",
            )
            print(commit.id, commit.status)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const commit = await client.projects.commits.create('3fa85f64-5717-4562-b3fc-2c963f66afa6', {
              commit: { message: 'Updated the prompt.' },
              storageUri: 's3://openlayer-bucket/commits/my-commit.tar.gz',
            });

            console.log(commit.id);
        - 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()\ncommit, err := client.Projects.Commits.New(\n\tcontext.TODO(),\n\t\"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n\topenlayer.ProjectCommitNewParams{\n\t\tCommit: openlayer.F(openlayer.ProjectCommitNewParamsCommit{\n\t\t\tMessage: openlayer.F(\"Updated the prompt.\"),\n\t\t}),\n\t\tStorageUri: openlayer.F(\"s3://openlayer-bucket/uploads/my-project/commit.tar.gz\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", commit.ID)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.core.JsonMissing;
            import com.openlayer.api.models.projects.commits.CommitCreateParams;
            import com.openlayer.api.models.projects.commits.CommitCreateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            CommitCreateParams params = CommitCreateParams.builder()
                .pathProjectId("3fa85f64-5717-4562-b3fc-2c963f66afa6")
                .storageUri("s3://openlayer-uploads/model_package.tar.gz")
                .commit(CommitCreateParams.Commit.builder()
                    .message("Updated the prompt.")
                    // Server-assigned fields the Java SDK marks as required: leave them out of the request.
                    .id(JsonMissing.of())
                    .authorId(JsonMissing.of())
                    .fileSize(JsonMissing.of())
                    .mlModelId(JsonMissing.of())
                    .storageUri(JsonMissing.of())
                    .trainingDatasetId(JsonMissing.of())
                    .validationDatasetId(JsonMissing.of())
                    .build())
                .id(JsonMissing.of())
                .bodyProjectId(JsonMissing.of())
                .dateCreated(JsonMissing.of())
                .dateArchived(JsonMissing.of())
                .status(JsonMissing.of())
                .statusMessage(JsonMissing.of())
                .mlModelId(JsonMissing.of())
                .trainingDatasetId(JsonMissing.of())
                .validationDatasetId(JsonMissing.of())
                .passingGoalCount(JsonMissing.of())
                .failingGoalCount(JsonMissing.of())
                .totalGoalCount(JsonMissing.of())
                .build();
            CommitCreateResponse commit = client.projects().commits().create(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            commit = openlayer.projects.commits.create(
              "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              commit: {message: "Updated the prompt."},
              storage_uri: "s3://my-bucket/commits/bundle.tar.gz"
            )

            puts(commit)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/projects/{projectId}/versions \
              --header 'Authorization: Bearer <token>' \
              --data '{"message": "Updated the prompt", "storageUri": "s3://..."}'
  '/projects/{projectId}/inference-pipelines':
    get:
      tags:
        - Monitoring
      summary: List inference pipelines
      operationId: listInferencePipelinesByProject
      description: List the inference pipelines in a project.
      parameters:
        - $ref: '#/components/parameters/projectId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
        - name: name
          in: query
          description: Filter list of items by name.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Status OK.
          headers:
            x-next:
              description: A link to the next page of responses
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/InferencePipeline'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            inference_pipelines = client.projects.inference_pipelines.list("3fa85f64-5717-4562-b3fc-2c963f66afa6")
            for inference_pipeline in inference_pipelines.items:
                print(inference_pipeline.id, inference_pipeline.name)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const inferencePipelines = await client.projects.inferencePipelines.list('3fa85f64-5717-4562-b3fc-2c963f66afa6');

            console.log(inferencePipelines.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()\npipelines, err := client.Projects.InferencePipelines.List(\n\tcontext.TODO(),\n\t\"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n\topenlayer.ProjectInferencePipelineListParams{\n\t\tName: openlayer.F(\"production\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", pipelines.Items)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.projects.inferencepipelines.InferencePipelineListParams;
            import com.openlayer.api.models.projects.inferencepipelines.InferencePipelineListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            InferencePipelineListParams params = InferencePipelineListParams.builder()
                .projectId("3fa85f64-5717-4562-b3fc-2c963f66afa6")
                .name("production")
                .build();
            InferencePipelineListResponse inferencePipelines = client.projects().inferencePipelines().list(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            inference_pipelines = openlayer.projects.inference_pipelines.list("3fa85f64-5717-4562-b3fc-2c963f66afa6")

            puts(inference_pipelines)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/projects/{projectId}/inference-pipelines \
              --header 'Authorization: Bearer <token>'
    post:
      tags:
        - Monitoring
      summary: Create inference pipeline
      description: Create an inference pipeline in a project.
      operationId: createInferencePipelineInProject
      parameters:
        - $ref: '#/components/parameters/projectId'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferencePipeline'
        default:
          $ref: '#/components/responses/UnexpectedError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InferencePipeline'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            inference_pipeline = client.projects.inference_pipelines.create(
                "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                name="production",
                description="Production traffic from the support chatbot.",
            )
            print(inference_pipeline.id)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const inferencePipeline = await client.projects.inferencePipelines.create('3fa85f64-5717-4562-b3fc-2c963f66afa6', {
              name: 'production',
              description: 'Production traffic for the support chatbot.',
            });

            console.log(inferencePipeline.id);
        - 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()\npipeline, err := client.Projects.InferencePipelines.New(\n\tcontext.TODO(),\n\t\"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n\topenlayer.ProjectInferencePipelineNewParams{\n\t\tName:        openlayer.F(\"production\"),\n\t\tDescription: openlayer.F(\"My production inference pipeline.\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", pipeline.ID)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.core.JsonMissing;
            import com.openlayer.api.models.projects.inferencepipelines.InferencePipelineCreateParams;
            import com.openlayer.api.models.projects.inferencepipelines.InferencePipelineCreateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            InferencePipelineCreateParams params = InferencePipelineCreateParams.builder()
                .pathProjectId("3fa85f64-5717-4562-b3fc-2c963f66afa6")
                .name("production")
                .description("This pipeline is used for production.")
                // Server-assigned fields the Java SDK marks as required: leave them out of the request.
                .id(JsonMissing.of())
                .bodyProjectId(JsonMissing.of())
                .dateCreated(JsonMissing.of())
                .dateUpdated(JsonMissing.of())
                .dateLastSampleReceived(JsonMissing.of())
                .dateLastEvaluated(JsonMissing.of())
                .dateOfNextEvaluation(JsonMissing.of())
                .passingGoalCount(JsonMissing.of())
                .failingGoalCount(JsonMissing.of())
                .totalGoalCount(JsonMissing.of())
                .status(JsonMissing.of())
                .statusMessage(JsonMissing.of())
                .links(JsonMissing.of())
                .build();
            InferencePipelineCreateResponse inferencePipeline = client.projects().inferencePipelines().create(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            inference_pipeline = openlayer.projects.inference_pipelines.create(
              "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              name: "production",
              description: "This pipeline is used for production."
            )

            puts(inference_pipeline)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/projects/{projectId}/inference-pipelines \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
              "name": "production",
              "description": "My production inference pipeline."
            }'
  '/versions/{projectVersionId}':
    get:
      description: Retrieve a project commit.
      operationId: getVersionById
      summary: Retrieve a project commit
      security:
        - apiKey: []
        - bearerAuth: []
      parameters:
        - $ref: '#/components/parameters/projectVersionId'
      responses:
        '200':
          description: Response OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectVersion'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            commit = client.commits.retrieve("b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20")
            print(commit.status, commit.passing_goal_count, commit.total_goal_count)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const commit = await client.commits.retrieve('b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20');

            console.log(commit.status);
        - 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()\ncommit, err := client.Commits.Get(context.TODO(), \"b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20\")\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", commit.Status)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.commits.CommitRetrieveResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            CommitRetrieveResponse commit = client.commits().retrieve("b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20");
        - lang: ruby
          source: |
            require "openlayer"

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

            commit = openlayer.commits.retrieve("b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20")

            puts(commit)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/versions/182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --header 'Authorization: Bearer <token>'
  '/projects/{projectId}/tests':
    post:
      tags:
        - Projects
      description: Create a test in a project.
      summary: Create a test
      operationId: createTest
      parameters:
        - $ref: '#/components/parameters/projectId'
      responses:
        '201':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestBase'
        default:
          $ref: '#/components/responses/UnexpectedError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestBase'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            test = client.projects.tests.create(
                "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                name="No duplicate rows",
                description="Fails if the data contains duplicate rows.",
                type="integrity",
                subtype="duplicateRowCount",
                thresholds=[
                    {
                        "insight_name": "duplicateRowCount",
                        "measurement": "duplicateRowCount",
                        "operator": "<=",
                        "value": 0,
                    }
                ],
                uses_production_data=True,
                evaluation_window=3600,
            )
            print(test.id)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const test = await client.projects.tests.create('3fa85f64-5717-4562-b3fc-2c963f66afa6', {
              name: 'No duplicate rows',
              description: 'This test checks for duplicate rows in the dataset.',
              type: 'integrity',
              subtype: 'duplicateRowCount',
              thresholds: [
                {
                  insightName: 'duplicateRowCount',
                  measurement: 'duplicateRowCount',
                  operator: '<=',
                  value: 0,
                },
              ],
            });

            console.log(test.id);
        - lang: go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openlayer-ai/openlayer-go\"\n\t\"github.com/openlayer-ai/openlayer-go/shared\"\n)\n\nclient := openlayer.NewClient()\ntest, err := client.Projects.Tests.New(\n\tcontext.TODO(),\n\t\"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n\topenlayer.ProjectTestNewParams{\n\t\tName:        openlayer.F(\"No duplicate rows\"),\n\t\tDescription: openlayer.F[any](\"This test checks for duplicate rows in the dataset.\"),\n\t\tType:        openlayer.F(openlayer.ProjectTestNewParamsTypeIntegrity),\n\t\tSubtype:     openlayer.F(openlayer.ProjectTestNewParamsSubtypeDuplicateRowCount),\n\t\tThresholds: openlayer.F([]openlayer.ProjectTestNewParamsThreshold{{\n\t\t\tInsightName: openlayer.F(openlayer.ProjectTestNewParamsThresholdsInsightNameDuplicateRowCount),\n\t\t\tMeasurement: openlayer.F(\"duplicateRowCount\"),\n\t\t\tOperator:    openlayer.F(openlayer.ProjectTestNewParamsThresholdsOperatorLessOrEquals),\n\t\t\tValue:       openlayer.F[openlayer.ProjectTestNewParamsThresholdsValueUnion](shared.UnionFloat(0)),\n\t\t}}),\n\t\tUsesProductionData: openlayer.F(true),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", test.ID)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.core.JsonMissing;
            import com.openlayer.api.core.JsonValue;
            import com.openlayer.api.models.projects.tests.TestCreateParams;
            import com.openlayer.api.models.projects.tests.TestCreateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            TestCreateParams params = TestCreateParams.builder()
                .projectId("3fa85f64-5717-4562-b3fc-2c963f66afa6")
                .name("No duplicate rows")
                .description(JsonValue.from("This test checks for duplicate rows in the dataset."))
                .type(TestCreateParams.Type.INTEGRITY)
                .subtype(TestCreateParams.Subtype.DUPLICATE_ROW_COUNT)
                .addThreshold(TestCreateParams.Threshold.builder()
                    .insightName(TestCreateParams.Threshold.InsightName.DUPLICATE_ROW_COUNT)
                    .measurement("duplicateRowCount")
                    .operator(TestCreateParams.Threshold.Operator.LESS_OR_EQUALS)
                    .value(0.0)
                    .build())
                // Server-assigned fields the Java SDK marks as required: leave them out of the request.
                .id(JsonMissing.of())
                .number(JsonMissing.of())
                .creatorId(JsonMissing.of())
                .originProjectVersionId(JsonMissing.of())
                .dateCreated(JsonMissing.of())
                .dateUpdated(JsonMissing.of())
                .dateArchived(JsonMissing.of())
                .suggested(JsonMissing.of())
                .commentCount(JsonMissing.of())
                .build();
            TestCreateResponse test = client.projects().tests().create(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            test = openlayer.projects.tests.create(
              "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              name: "No duplicate rows",
              description: "This test checks for duplicate rows in the dataset.",
              type: :integrity,
              subtype: :duplicateRowCount,
              thresholds: [
                {
                  insight_name: :duplicateRowCount,
                  measurement: "duplicateRowCount",
                  operator: :<=,
                  value: 0.0
                }
              ]
            )

            puts(test)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/projects/{projectId}/tests \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "name": "No duplicate rows",
                "description": "This test checks for duplicate rows in the dataset.",
                "type": "integrity",
                "subtype": "duplicateRowCount",
                "thresholds": [
                  {
                    "insightName": "duplicateRowCount",
                    "measurement": "duplicateRowCount",
                    "operator": "<=",
                    "value": 0
                  }
                ],
                "usesProductionData": true,
                "evaluationWindow": 3600,
                "delayWindow": 0,
                "usesTrainingDataset": false,
                "usesValidationDataset": false,
              }'
    get:
      tags:
        - Projects
      description: List the tests in a project.
      summary: List tests
      operationId: listTests
      parameters:
        - $ref: '#/components/parameters/projectId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
        - $ref: '#/components/parameters/goalType'
        - name: suggested
          in: query
          description: Filter for suggested tests.
          schema:
            type: boolean
            default: false
        - $ref: '#/components/parameters/includeArchived'
        - name: originVersionId
          in: query
          description: Retrive tests created by a specific project version.
          schema:
            type: string
            format: uuid
            readOnly: false
            description: The project version (commit) id.
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            nullable: true
        - name: usesProductionData
          in: query
          description: Retrive tests with usesProductionData (monitoring).
          schema:
            type: boolean
            nullable: true
      responses:
        '200':
          description: Status OK.
          headers:
            x-next:
              description: A link to the next page of responses
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/TestBase'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            tests = client.projects.tests.list(
                "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                type="integrity",
            )
            for test in tests.items:
                print(test.id, test.name)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const tests = await client.projects.tests.list('3fa85f64-5717-4562-b3fc-2c963f66afa6', { type: 'integrity' });

            console.log(tests.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()\ntests, err := client.Projects.Tests.List(\n\tcontext.TODO(),\n\t\"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n\topenlayer.ProjectTestListParams{\n\t\tType: openlayer.F(openlayer.ProjectTestListParamsTypeIntegrity),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", tests.Items)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.projects.tests.TestListParams;
            import com.openlayer.api.models.projects.tests.TestListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            TestListParams params = TestListParams.builder()
                .projectId("3fa85f64-5717-4562-b3fc-2c963f66afa6")
                .usesProductionData(true)
                .build();
            TestListResponse tests = client.projects().tests().list(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            tests = openlayer.projects.tests.list("3fa85f64-5717-4562-b3fc-2c963f66afa6", type: :integrity)

            puts(tests)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/projects/{projectId}/tests \
              --header 'Authorization: Bearer <token>'
    put:
      tags:
        - Projects
      summary: Update tests
      description: Update tests in a project.
      parameters:
        - $ref: '#/components/parameters/projectId'
      responses:
        '202':
          description: Response OK. Task queued.
          content:
            application/json:
              schema:
                type: object
                properties:
                  taskResultUrl:
                    type: string
                  taskResultId:
                    type: string
        default:
          $ref: '#/components/responses/UnexpectedError'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - payloads
              properties:
                payloads:
                  type: array
                  maxLength: 400
                  items:
                    type: object
                    required:
                      - id
                    properties:
                      id:
                        type: string
                        format: uuid
                      name:
                        $ref: '#/components/schemas/TestBase/properties/name'
                      description:
                        $ref: '#/components/schemas/TestBase/properties/description'
                      archived:
                        $ref: '#/components/schemas/TestBase/properties/archived'
                      thresholds:
                        $ref: '#/components/schemas/TestBase/properties/thresholds'
                      suggested:
                        type: boolean
                        enum:
                          - false
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            response = client.projects.tests.update(
                "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                payloads=[
                    {
                        "id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
                        "name": "No duplicate rows",
                        "thresholds": [
                            {
                                "insight_name": "duplicateRowCount",
                                "measurement": "duplicateRowCount",
                                "operator": "<=",
                                "value": 5,
                            }
                        ],
                    }
                ],
            )
            print(response.task_result_id)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const response = await client.projects.tests.update('3fa85f64-5717-4562-b3fc-2c963f66afa6', {
              payloads: [
                {
                  id: '9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d',
                  name: 'No duplicate rows',
                  archived: false,
                },
              ],
            });

            console.log(response);
        - 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()\ntask, err := client.Projects.Tests.Update(\n\tcontext.TODO(),\n\t\"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n\topenlayer.ProjectTestUpdateParams{\n\t\tPayloads: openlayer.F([]openlayer.ProjectTestUpdateParamsPayload{{\n\t\t\tID:       openlayer.F(\"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d\"),\n\t\t\tName:     openlayer.F(\"No duplicate rows (strict)\"),\n\t\t\tArchived: openlayer.F(false),\n\t\t}}),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", task.TaskResultID)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.projects.tests.TestUpdateParams;
            import com.openlayer.api.models.projects.tests.TestUpdateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            TestUpdateParams params = TestUpdateParams.builder()
                .projectId("3fa85f64-5717-4562-b3fc-2c963f66afa6")
                .addPayload(TestUpdateParams.Payload.builder()
                    .id("9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d")
                    .name("No duplicate rows")
                    .archived(false)
                    .build())
                .build();
            TestUpdateResponse response = client.projects().tests().update(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            response = openlayer.projects.tests.update(
              "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              payloads: [{id: "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d", name: "No duplicate rows", archived: false}]
            )

            puts(response)
        - lang: curl
          source: |
            curl --request PUT \
              --url https://api.openlayer.com/v1/projects/3fa85f64-5717-4562-b3fc-2c963f66afa6/tests \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "payloads": [
                  {
                    "id": "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
                    "name": "No PII in responses",
                    "archived": false
                  }
                ]
              }'
  '/versions/{projectVersionId}/results':
    get:
      tags:
        - Development
      summary: List commit test results
      operationId: listTestResultsByProjectVersion
      description: List the test results for a project commit (project version).
      parameters:
        - $ref: '#/components/parameters/projectVersionId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
        - $ref: '#/components/parameters/goalType'
        - $ref: '#/components/parameters/includeArchived'
        - $ref: '#/components/parameters/goalStatus'
      responses:
        '200':
          description: Status OK.
          headers:
            x-next:
              description: A link to the next page of responses
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/GoalResult'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            test_results = client.commits.test_results.list(
                "b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20",
                status="failing",
            )
            for test_result in test_results.items:
                print(test_result.id, test_result.status)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const testResults = await client.commits.testResults.list('b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20', {
              status: 'failing',
            });

            console.log(testResults.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()\nresults, err := client.Commits.TestResults.List(\n\tcontext.TODO(),\n\t\"b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20\",\n\topenlayer.CommitTestResultListParams{\n\t\tStatus: openlayer.F(openlayer.CommitTestResultListParamsStatusFailing),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", results.Items)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.commits.testresults.TestResultListParams;
            import com.openlayer.api.models.commits.testresults.TestResultListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            TestResultListParams params = TestResultListParams.builder()
                .projectVersionId("b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20")
                .status(TestResultListParams.Status.FAILING)
                .build();
            TestResultListResponse testResults = client.commits().testResults().list(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            test_results = openlayer.commits.test_results.list(
              "b4dd9ab3-0dd8-41cd-a56c-15b8fcc5ff20",
              status: :failing
            )

            puts(test_results)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/versions/{projectVersionId}/results \
              --header 'Authorization: Bearer <token>'
  '/inference-pipelines/{inferencePipelineId}':
    get:
      tags:
        - Monitoring
      summary: Retrieve an inference pipeline
      description: Retrieve an inference pipeline.
      parameters:
        - $ref: '#/components/parameters/inferencePipelineId'
        - name: expand
          in: query
          description: Expand specific nested objects.
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - project
                - workspace
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferencePipeline'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            inference_pipeline = client.inference_pipelines.retrieve(
                "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                expand=["project"],
            )
            print(inference_pipeline.name, inference_pipeline.status)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const inferencePipeline = await client.inferencePipelines.retrieve('c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f', {
              expand: ['project'],
            });

            console.log(inferencePipeline.name);
        - 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()\npipeline, err := client.InferencePipelines.Get(\n\tcontext.TODO(),\n\t\"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\",\n\topenlayer.InferencePipelineGetParams{\n\t\tExpand: openlayer.F([]openlayer.InferencePipelineGetParamsExpand{openlayer.InferencePipelineGetParamsExpandProject}),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", pipeline.Name)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.inferencepipelines.InferencePipelineRetrieveParams;
            import com.openlayer.api.models.inferencepipelines.InferencePipelineRetrieveResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            InferencePipelineRetrieveParams params = InferencePipelineRetrieveParams.builder()
                .inferencePipelineId("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f")
                .addExpand(InferencePipelineRetrieveParams.Expand.PROJECT)
                .build();
            InferencePipelineRetrieveResponse inferencePipeline = client.inferencePipelines().retrieve(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            inference_pipeline = openlayer.inference_pipelines.retrieve(
              "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
              expand: [:project]
            )

            puts(inference_pipeline)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/projects/{projectId}/inference-pipelines/{inferencePipelineId} \
              --header 'Authorization: Bearer <token>'
    put:
      tags:
        - Monitoring
      summary: Update an inference pipeline
      description: Update an inference pipeline.
      parameters:
        - $ref: '#/components/parameters/inferencePipelineId'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InferencePipeline'
        default:
          $ref: '#/components/responses/UnexpectedError'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  $ref: '#/components/schemas/InferencePipeline/properties/name'
                description:
                  $ref: '#/components/schemas/InferencePipeline/properties/description'
                referenceDatasetUri:
                  type: string
                  maxLength: 1000
                  nullable: true
                  writeOnly: true
                  description: The storage uri of your reference dataset. We recommend using the Python SDK or the UI to handle your reference dataset updates.
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            inference_pipeline = client.inference_pipelines.update(
                "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                name="production",
                description="Production traffic from the support chatbot.",
            )
            print(inference_pipeline.name)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const inferencePipeline = await client.inferencePipelines.update('c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f', {
              name: 'production',
              description: 'Production traffic for the support chatbot.',
            });

            console.log(inferencePipeline.name);
        - 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()\npipeline, err := client.InferencePipelines.Update(\n\tcontext.TODO(),\n\t\"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\",\n\topenlayer.InferencePipelineUpdateParams{\n\t\tName:        openlayer.F(\"production-v2\"),\n\t\tDescription: openlayer.F(\"Production traffic for the support chatbot.\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", pipeline.Name)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.inferencepipelines.InferencePipelineUpdateParams;
            import com.openlayer.api.models.inferencepipelines.InferencePipelineUpdateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            InferencePipelineUpdateParams params = InferencePipelineUpdateParams.builder()
                .inferencePipelineId("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f")
                .name("production")
                .description("This pipeline is used for production.")
                .build();
            InferencePipelineUpdateResponse inferencePipeline = client.inferencePipelines().update(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            inference_pipeline = openlayer.inference_pipelines.update(
              "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
              name: "production",
              description: "This pipeline is used for production."
            )

            puts(inference_pipeline)
        - lang: curl
          source: |
            curl --request PUT \
              --url https://api.openlayer.com/v1/projects/{projectId}/inference-pipelines/{inferencePipelineId} \
              --header 'Authorization: Bearer <token>' \
              --data '{"name": "New Name"}'
    delete:
      tags:
        - Monitoring
      summary: Delete an inference pipeline
      description: Delete an inference pipeline.
      parameters:
        - $ref: '#/components/parameters/inferencePipelineId'
      responses:
        '200':
          description: Response OK.
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            client.inference_pipelines.delete("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f")
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            await client.inferencePipelines.delete('c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f');
        - lang: go
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/openlayer-ai/openlayer-go\"\n)\n\nclient := openlayer.NewClient()\nerr := client.InferencePipelines.Delete(context.TODO(), \"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\")\nif err != nil {\n\tpanic(err.Error())\n}\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            client.inferencePipelines().delete("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f");
        - lang: ruby
          source: |
            require "openlayer"

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

            openlayer.inference_pipelines.delete("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f")
        - lang: curl
          source: |
            curl --request DELETE \
              --url https://api.openlayer.com/v1/projects/{projectId}/inference-pipelines/{inferencePipelineId} \
              --header 'Authorization: Bearer <token>'
  '/inference-pipelines/{inferencePipelineId}/data-stream':
    post:
      tags:
        - Monitoring
      summary: Publish inference
      operationId: streamData
      description: Publish an inference data point to an inference pipeline.
      parameters:
        - $ref: '#/components/parameters/inferencePipelineId'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
        '500':
          $ref: '#/components/responses/UnexpectedError'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                rows:
                  type: array
                  description: A list of inference data points with inputs and outputs
                  example:
                    - user_query: what is the meaning of life?
                      output: '42'
                      tokens: 7
                      cost: 0.02
                      timestamp: 1620000000
                  nullable: false
                  items:
                    type: object
                    additionalProperties: true
                config:
                  oneOf:
                    - $ref: '#/components/schemas/LLMData'
                    - $ref: '#/components/schemas/TabularClassificationData'
                    - $ref: '#/components/schemas/TabularRegressionData'
                    - $ref: '#/components/schemas/TextClassificationData'
                  example:
                    prompt:
                      - role: user
                        content: '{{ user_query }}'
                    inputVariableNames:
                      - user_query
                    outputColumnName: output
                    timestampColumnName: timestamp
                    costColumnName: cost
                    numOfTokenColumnName: tokens
                  description: Configuration for the data stream. Depends on your **Openlayer project task type**.
              required:
                - rows
                - config
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            response = client.inference_pipelines.data.stream(
                "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                config={
                    "input_variable_names": ["user_query"],
                    "output_column_name": "output",
                    "num_of_token_column_name": "tokens",
                    "cost_column_name": "cost",
                    "timestamp_column_name": "timestamp",
                },
                rows=[
                    {
                        "user_query": "What is the meaning of life?",
                        "output": "42",
                        "tokens": 7,
                        "cost": 0.02,
                        "timestamp": 1620000000,
                    }
                ],
            )
            print(response.success)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const response = await client.inferencePipelines.data.stream('c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f', {
              config: {
                inputVariableNames: ['user_query'],
                outputColumnName: 'output',
                numOfTokenColumnName: 'tokens',
                costColumnName: 'cost',
                timestampColumnName: 'timestamp',
              },
              rows: [
                {
                  user_query: 'What is the meaning of life?',
                  output: '42',
                  tokens: 7,
                  cost: 0.02,
                  timestamp: 1610000000,
                },
              ],
            });

            console.log(response.success);
        - 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()\nresponse, err := client.InferencePipelines.Data.Stream(\n\tcontext.TODO(),\n\t\"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\",\n\topenlayer.InferencePipelineDataStreamParams{\n\t\tConfig: openlayer.F[openlayer.InferencePipelineDataStreamParamsConfigUnion](openlayer.InferencePipelineDataStreamParamsConfigLlmData{\n\t\t\tInputVariableNames:   openlayer.F([]string{\"user_query\"}),\n\t\t\tOutputColumnName:     openlayer.F(\"output\"),\n\t\t\tNumOfTokenColumnName: openlayer.F(\"tokens\"),\n\t\t\tCostColumnName:       openlayer.F(\"cost\"),\n\t\t\tTimestampColumnName:  openlayer.F(\"timestamp\"),\n\t\t}),\n\t\tRows: openlayer.F([]map[string]interface{}{{\n\t\t\t\"user_query\": \"What is the meaning of life?\",\n\t\t\t\"output\":     \"42\",\n\t\t\t\"tokens\":     7,\n\t\t\t\"cost\":       0.02,\n\t\t\t\"timestamp\":  1710000000,\n\t\t}}),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", response.Success)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.core.JsonValue;
            import com.openlayer.api.models.inferencepipelines.data.DataStreamParams;
            import com.openlayer.api.models.inferencepipelines.data.DataStreamResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            DataStreamParams params = DataStreamParams.builder()
                .inferencePipelineId("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f")
                .config(DataStreamParams.Config.LlmData.builder()
                    .addInputVariableName("user_query")
                    .outputColumnName("output")
                    .numOfTokenColumnName("tokens")
                    .costColumnName("cost")
                    .timestampColumnName("timestamp")
                    .build())
                .addRow(DataStreamParams.Row.builder()
                    .putAdditionalProperty("user_query", JsonValue.from("what is the meaning of life?"))
                    .putAdditionalProperty("output", JsonValue.from("42"))
                    .putAdditionalProperty("tokens", JsonValue.from(7))
                    .putAdditionalProperty("cost", JsonValue.from(0.02))
                    .putAdditionalProperty("timestamp", JsonValue.from(1610000000))
                    .build())
                .build();
            DataStreamResponse response = client.inferencePipelines().data().stream(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            response = openlayer.inference_pipelines.data.stream(
              "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
              config: {
                inputVariableNames: ["user_query"],
                outputColumnName: "output",
                numOfTokenColumnName: "tokens",
                costColumnName: "cost",
                timestampColumnName: "timestamp"
              },
              rows: [
                {
                  user_query: "what is the meaning of life?",
                  output: "42",
                  tokens: 7,
                  cost: 0.02,
                  timestamp: 1610000000
                }
              ]
            )

            puts(response.success)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/inference-pipelines/{inferencePipelineId}/data-stream \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
              "rows": [
                {
                  "user_query": "what is the meaning of life?",
                  "output": "42",
                  "tokens": 7,
                  "cost": 0.02,
                  "timestamp": 1620000000
                }
              ],
              "config": {
                "prompt": [
                  {
                    "role": "user",
                    "content": "{{ user_query }}"
                  }
                ],
                "inputVariableNames": [
                  "user_query"
                ],
                        "outputColumnName": "output",
                        "timestampColumnName": "timestamp",
                        "costColumnName": "cost",
                        "numOfTokenColumnName": "tokens"
              }
            }'
  '/inference-pipelines/{inferencePipelineId}/rows':
    post:
      tags:
        - Monitoring
      summary: List rows
      description: List the rows in an inference pipeline.
      parameters:
        - $ref: '#/components/parameters/inferencePipelineId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
        - name: sortColumn
          in: query
          description: Name of the column to sort on
          required: false
          schema:
            type: string
        - name: asc
          in: query
          description: Whether or not to sort on the sortColumn in ascending order.
          required: false
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: Status OK.
          headers:
            x-next:
              description: A link to the next page of responses
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                  - _meta
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProdRow'
        '202':
          description: Response OK. Mounting dataset.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
        default:
          $ref: '#/components/responses/UnexpectedError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DatasetFilter'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            rows = client.inference_pipelines.rows.list(
                "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                per_page=50,
                search_query_and=["refund"],
            )
            print(rows.items)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const rows = await client.inferencePipelines.rows.list('c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f', {
              perPage: 50,
              searchQueryAnd: ['refund'],
            });

            console.log(rows.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()\nrows, err := client.InferencePipelines.Rows.List(\n\tcontext.TODO(),\n\t\"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\",\n\topenlayer.InferencePipelineRowListParams{\n\t\tSearchQueryOr: openlayer.F([]string{\"refund\"}),\n\t\tPerPage:       openlayer.Int(50),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", rows.Items)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.inferencepipelines.rows.RowListParams;
            import com.openlayer.api.models.inferencepipelines.rows.RowListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            RowListParams params = RowListParams.builder()
                .inferencePipelineId("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f")
                .addSearchQueryOr("refund")
                .perPage(50L)
                .build();
            RowListResponse rows = client.inferencePipelines().rows().list(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            rows = openlayer.inference_pipelines.rows.list(
              "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
              per_page: 50,
              search_query_or: ["refund"]
            )

            puts(rows)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/inference-pipelines/{inferencePipelineId}/rows \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{}'
    put:
      tags:
        - Monitoring
      summary: Update a row
      description: Update a row in an inference pipeline.
      parameters:
        - $ref: '#/components/parameters/inferencePipelineId'
        - name: inferenceId
          in: query
          description: Specify the inference id as a query param.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
        default:
          $ref: '#/components/responses/UnexpectedError'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                row:
                  type: object
                  minProperties: 1
                  maxProperties: 100
                config:
                  $ref: '#/components/schemas/DatastreamConfigUpdate'
                  nullable: true
              required:
                - row
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            response = client.inference_pipelines.rows.update(
                "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                inference_id="0f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
                row={"ground_truth": "The sun is about 93 million miles from the earth."},
                config={"ground_truth_column_name": "ground_truth"},
            )
            print(response.success)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const response = await client.inferencePipelines.rows.update('c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f', {
              inferenceId: '0f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f',
              row: { human_feedback: 'thumbs_up' },
              config: { humanFeedbackColumnName: 'human_feedback' },
            });

            console.log(response.success);
        - 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()\nresponse, err := client.InferencePipelines.Rows.Update(\n\tcontext.TODO(),\n\t\"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\",\n\topenlayer.InferencePipelineRowUpdateParams{\n\t\tInferenceID: openlayer.F(\"0f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f\"),\n\t\tRow: openlayer.F[any](map[string]interface{}{\n\t\t\t\"ground_truth\": \"42\",\n\t\t}),\n\t\tConfig: openlayer.F(openlayer.InferencePipelineRowUpdateParamsConfig{\n\t\t\tGroundTruthColumnName: openlayer.F(\"ground_truth\"),\n\t\t}),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", response.Success)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.core.JsonValue;
            import com.openlayer.api.models.inferencepipelines.rows.RowUpdateParams;
            import com.openlayer.api.models.inferencepipelines.rows.RowUpdateResponse;
            import java.util.Map;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            RowUpdateParams params = RowUpdateParams.builder()
                .inferencePipelineId("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f")
                .inferenceId("0f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f")
                .row(JsonValue.from(Map.of("human_feedback", "thumbs_up")))
                .config(RowUpdateParams.Config.builder()
                    .humanFeedbackColumnName("human_feedback")
                    .build())
                .build();
            RowUpdateResponse response = client.inferencePipelines().rows().update(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            response = openlayer.inference_pipelines.rows.update(
              "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
              inference_id: "0f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
              row: {human_feedback: "thumbs_up"},
              config: {human_feedback_column_name: "human_feedback"}
            )

            puts(response)
        - lang: curl
          source: |
            curl --request PUT \
            --url https://api.openlayer.com/v1/inference-pipelines/{inferencePipelineId}/rows?inferenceId=832y98d3 \
            --header 'Authorization: Bearer <token>' \
            --header 'Content-Type: application/json' \
            --data '{
              "row": {
                "ground_truth": "The sun is 94.471 million miles from the earth."
              },
              "config": {
                "groundTruthColumnName": "ground_truth",
              }
            }'
  '/inference-pipelines/{inferencePipelineId}/rows/{inferenceId}':
    get:
      tags:
        - Monitoring
      summary: Retrieve a row
      description: 'Retrieve a row by inference ID, including OTel steps.'
      parameters:
        - $ref: '#/components/parameters/inferencePipelineId'
        - name: inferenceId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                type: object
                properties:
                  row:
                    type: object
                  success:
                    type: boolean
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            response = client.inference_pipelines.rows.retrieve(
                "0f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
                inference_pipeline_id="c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
            )
            print(response.row)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const row = await client.inferencePipelines.rows.retrieve('0f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f', {
              inferencePipelineId: 'c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f',
            });

            console.log(row);
        - 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()\nrow, err := client.InferencePipelines.Rows.Get(\n\tcontext.TODO(),\n\t\"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\",\n\t\"0f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f\",\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", row.Row)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.inferencepipelines.rows.RowRetrieveParams;
            import com.openlayer.api.models.inferencepipelines.rows.RowRetrieveResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            RowRetrieveParams params = RowRetrieveParams.builder()
                .inferencePipelineId("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f")
                .inferenceId("0f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f")
                .build();
            RowRetrieveResponse row = client.inferencePipelines().rows().retrieve(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            row = openlayer.inference_pipelines.rows.retrieve(
              "0f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
              inference_pipeline_id: "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
            )

            puts(row)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/inference-pipelines/{inferencePipelineId}/rows/{inferenceId} \
              --header 'Authorization: Bearer <token>'
    delete:
      tags:
        - Monitoring
      summary: Delete a row
      description: Delete a row by inference ID.
      parameters:
        - $ref: '#/components/parameters/inferencePipelineId'
        - name: inferenceId
          in: path
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Row successfully deleted.
        '403':
          description: Forbidden. Only project admins can delete rows.
        '404':
          description: Row not found.
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            client.inference_pipelines.rows.delete(
                "0f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
                inference_pipeline_id="c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            await client.inferencePipelines.rows.delete('0f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f', {
              inferencePipelineId: 'c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f',
            });
        - lang: go
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/openlayer-ai/openlayer-go\"\n)\n\nclient := openlayer.NewClient()\nerr := client.InferencePipelines.Rows.Delete(\n\tcontext.TODO(),\n\t\"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\",\n\t\"0f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f\",\n)\nif err != nil {\n\tpanic(err.Error())\n}\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.inferencepipelines.rows.RowDeleteParams;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            RowDeleteParams params = RowDeleteParams.builder()
                .inferencePipelineId("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f")
                .inferenceId("0f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f")
                .build();
            client.inferencePipelines().rows().delete(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            openlayer.inference_pipelines.rows.delete(
              "0f1e2d3c-4b5a-4968-8776-5a4b3c2d1e0f",
              inference_pipeline_id: "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
            )
        - lang: curl
          source: |
            curl --request DELETE \
              --url https://api.openlayer.com/v1/inference-pipelines/{inferencePipelineId}/rows/{inferenceId} \
              --header 'Authorization: Bearer <token>'
  '/inference-pipelines/{inferencePipelineId}/results':
    get:
      tags:
        - Monitoring
      summary: List pipeline test results
      operationId: listTestResultsByInferencePipeline
      description: List the latest test results for an inference pipeline.
      parameters:
        - $ref: '#/components/parameters/inferencePipelineId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
        - $ref: '#/components/parameters/goalType'
        - $ref: '#/components/parameters/goalStatus'
      responses:
        '200':
          description: Status OK.
          headers:
            x-next:
              description: A link to the next page of responses
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/GoalResult'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            test_results = client.inference_pipelines.test_results.list(
                "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                status="failing",
            )
            for test_result in test_results.items:
                print(test_result.id, test_result.status)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const testResults = await client.inferencePipelines.testResults.list('c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f', {
              status: 'failing',
            });

            console.log(testResults.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()\nresults, err := client.InferencePipelines.TestResults.List(\n\tcontext.TODO(),\n\t\"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\",\n\topenlayer.InferencePipelineTestResultListParams{\n\t\tStatus: openlayer.F(openlayer.InferencePipelineTestResultListParamsStatusFailing),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", results.Items)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.inferencepipelines.testresults.TestResultListParams;
            import com.openlayer.api.models.inferencepipelines.testresults.TestResultListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            TestResultListParams params = TestResultListParams.builder()
                .inferencePipelineId("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f")
                .status(TestResultListParams.Status.FAILING)
                .build();
            TestResultListResponse testResults = client.inferencePipelines().testResults().list(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            test_results = openlayer.inference_pipelines.test_results.list(
              "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
              status: :failing
            )

            puts(test_results)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/inference-pipelines/{inferencePipelineId}/results \
              --header 'Authorization: Bearer <token>'
  '/inference-pipelines/{inferencePipelineId}/users':
    post:
      tags:
        - Monitoring
      summary: List users
      description: 'List the users of an inference pipeline, with their stats.'
      parameters:
        - $ref: '#/components/parameters/inferencePipelineId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
        - name: sortColumn
          in: query
          description: Name of the column to sort on
          required: false
          schema:
            type: string
        - name: asc
          in: query
          description: Whether or not to sort on the sortColumn in ascending order.
          required: false
          schema:
            type: boolean
            default: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DatasetFilter'
      responses:
        '200':
          description: Response OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/UserAggregation'
                    description: Array of user aggregation data
        '202':
          description: 'Request accepted, data is being loaded.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            users = client.inference_pipelines.retrieve_users(
                "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                per_page=50,
            )
            print(users.items)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const users = await client.inferencePipelines.retrieveUsers('c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f', { perPage: 50 });

            console.log(users.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()\nusers, err := client.InferencePipelines.GetUsers(\n\tcontext.TODO(),\n\t\"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\",\n\topenlayer.InferencePipelineGetUsersParams{\n\t\tPerPage: openlayer.Int(25),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", users.Items)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.inferencepipelines.InferencePipelineRetrieveUsersParams;
            import com.openlayer.api.models.inferencepipelines.InferencePipelineRetrieveUsersResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            InferencePipelineRetrieveUsersParams params = InferencePipelineRetrieveUsersParams.builder()
                .inferencePipelineId("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f")
                .perPage(50L)
                .build();
            InferencePipelineRetrieveUsersResponse users = client.inferencePipelines().retrieveUsers(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            users = openlayer.inference_pipelines.retrieve_users("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f", per_page: 50)

            puts(users)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/inference-pipelines/{inferencePipelineId}/users \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{}'
  '/inference-pipelines/{inferencePipelineId}/sessions':
    post:
      tags:
        - Monitoring
      summary: List sessions
      description: 'List the sessions in an inference pipeline, with their stats.'
      parameters:
        - $ref: '#/components/parameters/inferencePipelineId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
        - name: sortColumn
          in: query
          description: Name of the column to sort on
          required: false
          schema:
            type: string
        - name: asc
          in: query
          description: Whether or not to sort on the sortColumn in ascending order.
          required: false
          schema:
            type: boolean
            default: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DatasetFilter'
      responses:
        '200':
          description: Response OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/SessionAggregation'
                    description: Array of session aggregation data
        '202':
          description: 'Request accepted, data is being loaded.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            sessions = client.inference_pipelines.retrieve_sessions(
                "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
                per_page=50,
            )
            print(sessions.items)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const sessions = await client.inferencePipelines.retrieveSessions('c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f', { perPage: 50 });

            console.log(sessions.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()\nsessions, err := client.InferencePipelines.GetSessions(\n\tcontext.TODO(),\n\t\"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\",\n\topenlayer.InferencePipelineGetSessionsParams{\n\t\tPerPage: openlayer.Int(25),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", sessions.Items)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.inferencepipelines.InferencePipelineRetrieveSessionsParams;
            import com.openlayer.api.models.inferencepipelines.InferencePipelineRetrieveSessionsResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            InferencePipelineRetrieveSessionsParams params = InferencePipelineRetrieveSessionsParams.builder()
                .inferencePipelineId("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f")
                .perPage(50L)
                .build();
            InferencePipelineRetrieveSessionsResponse sessions = client.inferencePipelines().retrieveSessions(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            sessions = openlayer.inference_pipelines.retrieve_sessions("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f", per_page: 50)

            puts(sessions)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/inference-pipelines/{inferencePipelineId}/sessions \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{}'
  /storage/presigned-url:
    get:
      tags:
        - Storage
      summary: Retrieve a download url
      operationId: getPresignedUrlForDownload
      description: Get a short-lived download url for a stored object.
      parameters:
        - name: storageUri
          in: query
          required: true
          description: 'The object''s storage uri, for example `outputs.storageUri` from a framework export''s background task.'
          schema:
            type: string
      responses:
        '200':
          description: Response OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - url
                properties:
                  url:
                    description: The presigned url. Short-lived -- download promptly.
                    type: string
                    format: url
        '404':
          description: 'No such object, or it isn''t owned by the workspace of your API key.'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            presigned_url = client.storage.presigned_url.retrieve(
                storage_uri="s3://openlayer-bucket/evidence/policy.pdf",
            )
            print(presigned_url.url)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const presignedURL = await client.storage.presignedURL.retrieve({
              storageUri: 's3://openlayer-bucket/evidence/report.pdf',
            });

            console.log(presignedURL.url);
        - 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()\npresigned, err := client.Storage.PresignedURL.Get(context.TODO(), openlayer.StoragePresignedURLGetParams{\n\tStorageUri: openlayer.F(\"s3://openlayer-bucket/uploads/my-project/commit.tar.gz\"),\n})\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", presigned.URL)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.storage.presignedurl.PresignedUrlRetrieveParams;
            import com.openlayer.api.models.storage.presignedurl.PresignedUrlRetrieveResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            PresignedUrlRetrieveParams params = PresignedUrlRetrieveParams.builder()
                .storageUri("s3://openlayer-uploads/model_package.tar.gz")
                .build();
            PresignedUrlRetrieveResponse presignedUrl = client.storage().presignedUrl().retrieve(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            presigned_url = openlayer.storage.presigned_url.retrieve(
              storage_uri: "s3://my-bucket/commits/bundle.tar.gz"
            )

            puts(presigned_url.url)
        - lang: curl
          source: |
            curl --request GET \
              --url 'https://api.openlayer.com/v1/storage/presigned-url?storageUri=s3%3A%2F%2Fopenlayer-storage%2Fexports%2Fsoc2-2026-09-15.zip' \
              --header 'Authorization: Bearer <token>'
    post:
      tags:
        - Storage
      summary: Create an upload url
      description: Get a presigned url to upload a file.
      parameters:
        - name: objectName
          in: query
          required: true
          description: The name of the object.
          schema:
            type: string
      responses:
        '200':
          description: Response OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - url
                  - storageUri
                properties:
                  url:
                    description: The presigned url.
                    type: string
                    format: url
                  fields:
                    description: Fields to include in the body of the upload. Only needed by s3
                    type: object
                  storageUri:
                    description: The storage URI to send back to the backend after the upload was completed.
                    type: string
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            presigned_url = client.storage.presigned_url.create(
                object_name="policy.pdf",
            )
            print(presigned_url.url, presigned_url.storage_uri)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const presignedURL = await client.storage.presignedURL.create({
              objectName: 'report.pdf',
            });

            console.log(presignedURL.url, presignedURL.storageUri);
        - 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()\npresigned, err := client.Storage.PresignedURL.New(context.TODO(), openlayer.StoragePresignedURLNewParams{\n\tObjectName: openlayer.F(\"commit.tar.gz\"),\n})\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", presigned.StorageUri)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.storage.presignedurl.PresignedUrlCreateParams;
            import com.openlayer.api.models.storage.presignedurl.PresignedUrlCreateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            PresignedUrlCreateParams params = PresignedUrlCreateParams.builder()
                .objectName("model_package.tar.gz")
                .build();
            PresignedUrlCreateResponse presignedUrl = client.storage().presignedUrl().create(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            presigned_url = openlayer.storage.presigned_url.create(object_name: "bundle.tar.gz")

            puts(presigned_url.url)
            puts(presigned_url.storage_uri)
        - lang: curl
          source: |
            curl --request POST \
              --url 'https://api.openlayer.com/v1/storage/presigned-url?objectName=dataset.csv' \
              --header 'Authorization: Bearer <token>'
  '/tests/{testId}/evaluate':
    post:
      tags:
        - Monitoring
      summary: Evaluate a test over a time range
      description: Evaluate a test over a custom time range.
      security:
        - bearerAuth: []
        - apiKey: []
      parameters:
        - $ref: '#/components/parameters/testId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - startTimestamp
                - endTimestamp
              properties:
                startTimestamp:
                  type: integer
                  format: int64
                  description: Start timestamp in seconds (Unix epoch)
                  example: 1699920000
                endTimestamp:
                  type: integer
                  format: int64
                  description: End timestamp in seconds (Unix epoch)
                  example: 1700006400
                inferencePipelineId:
                  type: string
                  format: uuid
                  description: 'ID of the inference pipeline to evaluate. If not provided, all inference pipelines the test applies to will be evaluated.'
                  example: 123e4567-e89b-12d3-a456-426614174000
                overwriteResults:
                  type: boolean
                  description: Whether to overwrite existing test results
                  example: false
                  default: false
      responses:
        '202':
          description: Evaluation task queued successfully. Timestamps will be aligned to evaluation window boundaries during execution.
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                  - pipelineCount
                  - requestedStartTimestamp
                  - requestedEndTimestamp
                  - tasks
                properties:
                  message:
                    type: string
                    example: Evaluation task queued successfully
                  pipelineCount:
                    type: integer
                    description: Number of inference pipelines the test was queued for evaluation on
                    example: 2
                  requestedStartTimestamp:
                    type: integer
                    format: int64
                    description: The start timestamp you requested (in seconds)
                    example: 1699920000
                  requestedEndTimestamp:
                    type: integer
                    format: int64
                    description: The end timestamp you requested (in seconds)
                    example: 1700006400
                  tasks:
                    type: array
                    description: Array of background task information for each pipeline evaluation
                    items:
                      type: object
                      required:
                        - taskResultUrl
                        - taskResultId
                        - pipelineId
                      properties:
                        taskResultUrl:
                          type: string
                          description: URL to check the status of this background task
                        taskResultId:
                          type: string
                          format: uuid
                          description: ID of the background task
                        pipelineId:
                          type: string
                          format: uuid
                          description: ID of the inference pipeline this task is for
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            response = client.tests.evaluate(
                "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
                start_timestamp=1699920000,
                end_timestamp=1700006400,
                inference_pipeline_id="c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
            )
            print(response.message)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const response = await client.tests.evaluate('9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d', {
              startTimestamp: 1699920000,
              endTimestamp: 1700006400,
              inferencePipelineId: 'c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f',
            });

            console.log(response);
        - 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()\nresponse, err := client.Tests.Evaluate(\n\tcontext.TODO(),\n\t\"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d\",\n\topenlayer.TestEvaluateParams{\n\t\tStartTimestamp:      openlayer.Int(1699920000),\n\t\tEndTimestamp:        openlayer.Int(1700006400),\n\t\tInferencePipelineID: openlayer.F(\"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", response.Message)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.tests.TestEvaluateParams;
            import com.openlayer.api.models.tests.TestEvaluateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            TestEvaluateParams params = TestEvaluateParams.builder()
                .testId("9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d")
                .startTimestamp(1699920000L)
                .endTimestamp(1700006400L)
                .inferencePipelineId("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f")
                .build();
            TestEvaluateResponse response = client.tests().evaluate(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            response = openlayer.tests.evaluate(
              "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
              start_timestamp: 1699920000,
              end_timestamp: 1700006400,
              inference_pipeline_id: "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
            )

            puts(response)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/tests/{testId}/evaluate \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "startTimestamp": 1699920000,
                "endTimestamp": 1700006400
              }'
  '/tests/{testId}/results':
    get:
      tags:
        - Tests
      security:
        - apiKey: []
        - bearerAuth: []
      operationId: listTestResultsByTest
      summary: List a test's results
      description: List the test results for a test.
      parameters:
        - $ref: '#/components/parameters/testId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
        - name: projectVersionId
          in: query
          description: Retrive test results for a specific project version.
          schema:
            type: string
            format: uuid
            nullable: true
        - name: inferencePipelineId
          in: query
          description: Retrive test results for a specific inference pipeline.
          schema:
            type: string
            format: uuid
            nullable: true
        - name: includeInsights
          in: query
          description: Include the insights linked to each test result
          schema:
            type: boolean
        - name: status
          in: query
          required: false
          description: Filter by status(es).
          schema:
            type: array
            items:
              type: string
        - name: startTimestamp
          in: query
          required: false
          description: Filter for results that use data ending after the start timestamp.
          schema:
            type: number
            format: integer
        - name: endTimestamp
          in: query
          required: false
          description: Filter for results that use data starting before the end timestamp.
          schema:
            type: number
            format: integer
      responses:
        '200':
          description: Status OK.
          headers:
            x-next:
              description: A link to the next page of responses
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/GoalResult'
                  lastUnskippedResult:
                    nullable: true
                    $ref: '#/components/schemas/GoalResult'
        '202':
          description: Status OK. Resource is not ready yet.
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            test_results = client.tests.list_results(
                "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
                inference_pipeline_id="c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
            )
            for test_result in test_results.items:
                print(test_result.id, test_result.status)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const testResults = await client.tests.listResults('9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d', {
              inferencePipelineId: 'c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f',
            });

            console.log(testResults.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()\nresults, err := client.Tests.ListResults(\n\tcontext.TODO(),\n\t\"9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d\",\n\topenlayer.TestListResultsParams{\n\t\tInferencePipelineID: openlayer.F(\"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\"),\n\t\tIncludeInsights:     openlayer.F(true),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", results.Items)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.tests.TestListResultsParams;
            import com.openlayer.api.models.tests.TestListResultsResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            TestListResultsParams params = TestListResultsParams.builder()
                .testId("9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d")
                .inferencePipelineId("c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f")
                .addStatus("failing")
                .build();
            TestListResultsResponse testResults = client.tests().listResults(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            test_results = openlayer.tests.list_results(
              "9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d",
              inference_pipeline_id: "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
            )

            puts(test_results)
        - lang: curl
          source: |
            curl --request GET \
              --url 'https://api.openlayer.com/v1/tests/9a8b7c6d-5e4f-4a3b-2c1d-0e9f8a7b6c5d/results?page=1&perPage=25' \
              --header 'Authorization: Bearer <token>'
  '/workspaces/{workspaceId}/frameworks':
    get:
      tags:
        - Governance
      summary: List frameworks
      operationId: listFrameworks
      description: List the frameworks in a workspace.
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
        - $ref: '#/components/parameters/searchQuery'
        - $ref: '#/components/parameters/projectIdFilter'
        - $ref: '#/components/parameters/asc'
        - $ref: '#/components/parameters/includeRuleStats'
        - name: enabled
          in: query
          description: Only include frameworks that are enabled (or disabled).
          required: false
          schema:
            type: boolean
        - name: tags
          in: query
          description: Only include frameworks carrying all of these tags.
          required: false
          schema:
            type: array
            items:
              type: string
        - name: sortColumn
          in: query
          description: The column to sort on.
          required: false
          schema:
            type: string
            enum:
              - name
              - enabled
              - dateCreated
              - dateUpdated
              - overallCompletion
              - projectCompletionBuckets
        - name: completionOperator
          in: query
          description: |
            How to compare each framework's completion percentage with `completionValue`. Must be sent together with `completionValue`.
          required: false
          schema:
            type: string
            enum:
              - is
              - '>'
              - '>='
              - <
              - <=
              - '!='
        - name: completionValue
          in: query
          description: 'The completion percentage to compare against, from 0 to 100.'
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 100
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Framework'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            frameworks = client.governance.frameworks.list(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                enabled=True,
            )
            for framework in frameworks.items:
                print(framework.id, framework.name)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const frameworks = await client.governance.frameworks.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
              enabled: true,
            });

            console.log(frameworks.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()\nframeworks, err := client.Governance.Frameworks.List(\n\tcontext.TODO(),\n\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\topenlayer.GovernanceFrameworkListParams{\n\t\tEnabled: openlayer.F(true),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", frameworks.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.FrameworkListParams;
            import com.openlayer.api.models.governance.frameworks.FrameworkListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            FrameworkListParams params = FrameworkListParams.builder()
                .workspaceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .enabled(true)
                .build();
            FrameworkListResponse frameworks = client.governance().frameworks().list(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            frameworks = openlayer.governance.frameworks.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", enabled: true)

            puts(frameworks)
        - lang: curl
          source: |
            curl --request GET \
              --url 'https://api.openlayer.com/v1/workspaces/3fa85f64-5717-4562-b3fc-2c963f66afa6/frameworks?enabled=true' \
              --header 'Authorization: Bearer <token>'
    post:
      tags:
        - Governance
      summary: Create a framework
      operationId: createFramework
      description: Create a custom framework in a workspace.
      parameters:
        - $ref: '#/components/parameters/workspaceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  $ref: '#/components/schemas/Framework/properties/name'
                description:
                  $ref: '#/components/schemas/Framework/properties/description'
                enabled:
                  $ref: '#/components/schemas/Framework/properties/enabled'
                projectSelector:
                  $ref: '#/components/schemas/Framework/properties/projectSelector'
                tags:
                  $ref: '#/components/schemas/Framework/properties/tags'
      responses:
        '201':
          description: Framework created. It starts with no rules; map rules to it from the Openlayer app.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Framework'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            framework = client.governance.frameworks.create(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                name="Internal AI policy",
                description="Controls every production AI system must meet.",
                tags=["internal"],
            )
            print(framework.id)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const framework = await client.governance.frameworks.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
              name: 'EU AI Act',
              description: 'Requirements for high-risk AI systems under the EU AI Act.',
              tags: ['regulation', 'eu'],
            });

            console.log(framework.id);
        - 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()\nframework, err := client.Governance.Frameworks.New(\n\tcontext.TODO(),\n\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\topenlayer.GovernanceFrameworkNewParams{\n\t\tName:        openlayer.F(\"EU AI Act\"),\n\t\tDescription: openlayer.F(\"Controls for high-risk AI systems.\"),\n\t\tTags:        openlayer.F([]string{\"regulatory\"}),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", framework.ID)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.governance.frameworks.FrameworkCreateParams;
            import com.openlayer.api.models.governance.frameworks.FrameworkCreateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            FrameworkCreateParams params = FrameworkCreateParams.builder()
                .workspaceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .name("EU AI Act")
                .description("Requirements for high-risk AI systems under the EU AI Act.")
                .addTag("regulation")
                .build();
            FrameworkCreateResponse framework = client.governance().frameworks().create(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            framework = openlayer.governance.frameworks.create(
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              name: "EU AI Act",
              description: "Requirements for high-risk AI systems under the EU AI Act."
            )

            puts(framework)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/workspaces/3fa85f64-5717-4562-b3fc-2c963f66afa6/frameworks \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "name": "Internal AI Policy",
                "enabled": true,
                "tags": ["internal", "policy"],
                "projectSelector": {
                  "match": [
                    { "property": "riskLevel", "value": ["high", "critical"] }
                  ]
                }
              }'
  '/frameworks/{frameworkId}':
    get:
      tags:
        - Governance
      summary: Retrieve a framework
      operationId: getFrameworkById
      description: Retrieve a framework.
      parameters:
        - $ref: '#/components/parameters/frameworkId'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Framework'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            framework = client.governance.frameworks.retrieve("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b")
            print(framework.name, framework.enabled)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const framework = await client.governance.frameworks.retrieve('5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b');

            console.log(framework.name);
        - 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()\nframework, err := client.Governance.Frameworks.Get(context.TODO(), \"5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b\")\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", framework.Name)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.governance.frameworks.FrameworkRetrieveResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            FrameworkRetrieveResponse framework = client.governance().frameworks().retrieve("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b");
        - lang: ruby
          source: |
            require "openlayer"

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

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

            puts(framework)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/frameworks/9f1b3c2d-4e5a-4f60-8a71-2b3c4d5e6f70 \
              --header 'Authorization: Bearer <token>'
    put:
      tags:
        - Governance
      summary: Update a framework
      operationId: updateFramework
      description: Update a framework.
      parameters:
        - $ref: '#/components/parameters/frameworkId'
      requestBody:
        description: Only the fields you send are changed.
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  $ref: '#/components/schemas/Framework/properties/name'
                description:
                  $ref: '#/components/schemas/Framework/properties/description'
                enabled:
                  $ref: '#/components/schemas/Framework/properties/enabled'
                projectSelector:
                  $ref: '#/components/schemas/Framework/properties/projectSelector'
                tags:
                  $ref: '#/components/schemas/Framework/properties/tags'
                avatar:
                  $ref: '#/components/schemas/Framework/properties/avatar'
                extendedDescription:
                  $ref: '#/components/schemas/Framework/properties/extendedDescription'
                href:
                  $ref: '#/components/schemas/Framework/properties/href'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Framework'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            framework = client.governance.frameworks.update(
                "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
                name="Internal AI policy",
                enabled=True,
            )
            print(framework.name)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const framework = await client.governance.frameworks.update('5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b', {
              name: 'EU AI Act (2026)',
              enabled: true,
            });

            console.log(framework.name);
        - 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()\nframework, err := client.Governance.Frameworks.Update(\n\tcontext.TODO(),\n\t\"5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b\",\n\topenlayer.GovernanceFrameworkUpdateParams{\n\t\tEnabled:     openlayer.F(true),\n\t\tDescription: openlayer.F(\"Controls for high-risk AI systems.\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", framework.Enabled)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.governance.frameworks.FrameworkUpdateParams;
            import com.openlayer.api.models.governance.frameworks.FrameworkUpdateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            FrameworkUpdateParams params = FrameworkUpdateParams.builder()
                .frameworkId("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b")
                .name("EU AI Act")
                .enabled(true)
                .build();
            FrameworkUpdateResponse framework = client.governance().frameworks().update(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            framework = openlayer.governance.frameworks.update(
              "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
              name: "EU AI Act",
              enabled: true
            )

            puts(framework)
        - lang: curl
          source: |
            curl --request PUT \
              --url https://api.openlayer.com/v1/frameworks/9f1b3c2d-4e5a-4f60-8a71-2b3c4d5e6f70 \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{"enabled": true}'
  '/frameworks/{frameworkId}/export':
    post:
      tags:
        - Governance
      summary: Export a framework
      operationId: exportFramework
      description: Export a framework as an audit-ready zip archive.
      parameters:
        - $ref: '#/components/parameters/frameworkId'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                projectId:
                  type: string
                  format: uuid
                  nullable: true
                  description: 'Scope the export to this project. It must belong to the framework. Omit it for the workspace-wide view across every project in the framework, including workspace-scoped rules.'
                  example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
      responses:
        '202':
          description: 'Export queued. Poll `taskResultUrl` for the archive. If an identical export is still queued, that task is returned instead of a new one. The archive holds every evidence file uploaded against the framework''s evidence rules, a markdown report of the framework''s progress and rule statuses (by documentation section when the framework has documents), and CSV manifests of rules and evidence with SHA-256 checksums.'
          content:
            application/json:
              schema:
                type: object
                required:
                  - taskResultUrl
                  - taskResultId
                properties:
                  taskResultUrl:
                    type: string
                    description: |
                      The path to poll for this export's status and result. Already `/v1`-prefixed, so it is relative to the API host rather than to the `/v1` base url -- or just pass `taskResultId` to `GET /background-tasks/{taskId}`.
                    example: /v1/background-tasks/3fa85f64-5717-4562-b3fc-2c963f66afa6
                  taskResultId:
                    type: string
                    format: uuid
                    description: 'The background task id, for `GET /background-tasks/{taskId}`.'
                    example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        '400':
          description: The project is not part of this framework.
        '403':
          description: You may not export this framework.
        '404':
          description: No such framework or project.
        '429':
          description: Too many export requests. The limit is 2 per minute per framework.
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            export = client.governance.frameworks.export(
                "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
                project_id="3fa85f64-5717-4562-b3fc-2c963f66afa6",
            )
            print(export.task_result_url)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const response = await client.governance.frameworks.export('5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b', {
              projectId: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
            });

            console.log(response);
        - 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()\nexport, err := client.Governance.Frameworks.Export(\n\tcontext.TODO(),\n\t\"5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b\",\n\topenlayer.GovernanceFrameworkExportParams{\n\t\tProjectID: openlayer.F(\"3fa85f64-5717-4562-b3fc-2c963f66afa6\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", export.TaskResultURL)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.governance.frameworks.FrameworkExportParams;
            import com.openlayer.api.models.governance.frameworks.FrameworkExportResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            FrameworkExportParams params = FrameworkExportParams.builder()
                .frameworkId("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b")
                .projectId("3fa85f64-5717-4562-b3fc-2c963f66afa6")
                .build();
            FrameworkExportResponse export = client.governance().frameworks().export(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            response = openlayer.governance.frameworks.export(
              "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
              project_id: "3fa85f64-5717-4562-b3fc-2c963f66afa6"
            )

            puts(response)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/frameworks/9f1b3c2d-4e5a-4f60-8a71-2b3c4d5e6f70/export \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{"projectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"}'
  '/frameworks/{frameworkId}/rules':
    get:
      tags:
        - Governance
      summary: List a framework's rules
      operationId: listFrameworkRules
      description: List the rules in a framework.
      parameters:
        - $ref: '#/components/parameters/frameworkId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Rule'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            rules = client.governance.frameworks.list_rules("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b")
            for rule in rules.items:
                print(rule.id, rule.name)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const rules = await client.governance.frameworks.listRules('5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b');

            console.log(rules.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()\nrules, err := client.Governance.Frameworks.ListRules(\n\tcontext.TODO(),\n\t\"5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b\",\n\topenlayer.GovernanceFrameworkListRulesParams{},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", rules.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.FrameworkListRulesResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            FrameworkListRulesResponse rules = client.governance().frameworks().listRules("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b");
        - lang: ruby
          source: |
            require "openlayer"

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

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

            puts(rules)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/frameworks/9f1b3c2d-4e5a-4f60-8a71-2b3c4d5e6f70/rules \
              --header 'Authorization: Bearer <token>'
  '/frameworks/{frameworkId}/projects':
    get:
      tags:
        - Governance
      summary: List a framework's projects
      operationId: listFrameworkProjects
      description: List the projects a framework applies to.
      parameters:
        - $ref: '#/components/parameters/frameworkId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Project'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            projects = client.governance.frameworks.list_projects("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b")
            for project in projects.items:
                print(project.id, project.name)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const projects = await client.governance.frameworks.listProjects('5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b');

            console.log(projects.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()\nprojects, err := client.Governance.Frameworks.ListProjects(\n\tcontext.TODO(),\n\t\"5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b\",\n\topenlayer.GovernanceFrameworkListProjectsParams{},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", projects.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.FrameworkListProjectsResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            FrameworkListProjectsResponse projects = client.governance().frameworks().listProjects("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b");
        - lang: ruby
          source: |
            require "openlayer"

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

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

            puts(projects)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/frameworks/9f1b3c2d-4e5a-4f60-8a71-2b3c4d5e6f70/projects \
              --header 'Authorization: Bearer <token>'
  '/frameworks/{frameworkId}/project-rule-stats':
    get:
      tags:
        - Governance
      summary: List a framework's per-project compliance
      operationId: listFrameworkProjectRuleStats
      description: List a framework's compliance stats per project.
      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>'
  '/frameworks/{frameworkId}/documents':
    get:
      tags:
        - Governance
      summary: List a framework's documents
      operationId: listFrameworkDocuments
      description: List the documents attached to a framework.
      parameters:
        - $ref: '#/components/parameters/frameworkId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/FrameworkDocument'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            documents = client.governance.frameworks.documents.list("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b")
            for document in documents.items:
                print(document.id, document.title)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const documents = await client.governance.frameworks.documents.list('5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b');

            console.log(documents.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()\ndocuments, err := client.Governance.Frameworks.Documents.List(\n\tcontext.TODO(),\n\t\"5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b\",\n\topenlayer.GovernanceFrameworkDocumentListParams{},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", documents.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.documents.DocumentListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            DocumentListResponse documents = client.governance().frameworks().documents().list("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b");
        - lang: ruby
          source: |
            require "openlayer"

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

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

            puts(documents)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/frameworks/9f1b3c2d-4e5a-4f60-8a71-2b3c4d5e6f70/documents \
              --header 'Authorization: Bearer <token>'
  '/frameworks/{frameworkId}/documents/{documentId}':
    get:
      tags:
        - Governance
      summary: Retrieve a framework document
      operationId: getFrameworkDocumentById
      description: Retrieve a framework document with its sections and rules.
      parameters:
        - $ref: '#/components/parameters/frameworkId'
        - $ref: '#/components/parameters/documentId'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FrameworkDocument'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            document = client.governance.frameworks.documents.retrieve(
                "7b8c9d0e-1f2a-4b3c-9d4e-5f6a7b8c9d0e",
                framework_id="5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
            )
            print(document.title)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const document = await client.governance.frameworks.documents.retrieve('7b8c9d0e-1f2a-4b3c-9d4e-5f6a7b8c9d0e', {
              frameworkId: '5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b',
            });

            console.log(document);
        - 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()\ndocument, err := client.Governance.Frameworks.Documents.Get(\n\tcontext.TODO(),\n\t\"5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b\",\n\t\"7b8c9d0e-1f2a-4b3c-9d4e-5f6a7b8c9d0e\",\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", document.Title)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.governance.frameworks.documents.DocumentRetrieveParams;
            import com.openlayer.api.models.governance.frameworks.documents.DocumentRetrieveResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            DocumentRetrieveParams params = DocumentRetrieveParams.builder()
                .frameworkId("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b")
                .documentId("7b8c9d0e-1f2a-4b3c-9d4e-5f6a7b8c9d0e")
                .build();
            DocumentRetrieveResponse document = client.governance().frameworks().documents().retrieve(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            document = openlayer.governance.frameworks.documents.retrieve(
              "7b8c9d0e-1f2a-4b3c-9d4e-5f6a7b8c9d0e",
              framework_id: "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b"
            )

            puts(document)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/frameworks/9f1b3c2d-4e5a-4f60-8a71-2b3c4d5e6f70/documents/4a6c8e0f-1b2d-4e3f-9a5b-6c7d8e9f0a1b \
              --header 'Authorization: Bearer <token>'
  '/frameworks/{frameworkId}/sections/{sectionId}/rules':
    get:
      tags:
        - Governance
      summary: List a section's rules
      operationId: listFrameworkSectionRules
      description: List the rules mapped to a document section.
      parameters:
        - $ref: '#/components/parameters/frameworkId'
        - $ref: '#/components/parameters/sectionId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
        - $ref: '#/components/parameters/includeResults'
        - $ref: '#/components/parameters/projectIdFilter'
        - $ref: '#/components/parameters/ruleStatus'
        - name: includeSubsectionRules
          in: query
          description: Whether to also include the rules mapped to the section's subsections.
          required: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Rule'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            rules = client.governance.frameworks.sections.list_rules(
                "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
                framework_id="5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
                include_subsection_rules=True,
            )
            for rule in rules.items:
                print(rule.id, rule.name)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const rules = await client.governance.frameworks.sections.listRules('2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f', {
              frameworkId: '5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b',
              includeSubsectionRules: true,
            });

            console.log(rules.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()\nrules, err := client.Governance.Frameworks.Sections.ListRules(\n\tcontext.TODO(),\n\t\"5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b\",\n\t\"2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f\",\n\topenlayer.GovernanceFrameworkSectionListRulesParams{\n\t\tIncludeSubsectionRules: openlayer.F(true),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", rules.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.sections.SectionListRulesParams;
            import com.openlayer.api.models.governance.frameworks.sections.SectionListRulesResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            SectionListRulesParams params = SectionListRulesParams.builder()
                .frameworkId("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b")
                .sectionId("2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f")
                .includeResults(true)
                .build();
            SectionListRulesResponse rules = client.governance().frameworks().sections().listRules(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            rules = openlayer.governance.frameworks.sections.list_rules(
              "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
              framework_id: "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
              include_results: true
            )

            puts(rules)
        - lang: curl
          source: |
            curl --request GET \
              --url 'https://api.openlayer.com/v1/frameworks/9f1b3c2d-4e5a-4f60-8a71-2b3c4d5e6f70/sections/2e4f6a8c-9b1d-4c3e-8f5a-7b9c0d1e2f3a/rules?includeSubsectionRules=true&includeResults=true' \
              --header 'Authorization: Bearer <token>'
  '/frameworks/{frameworkId}/subsections/{subsectionId}/rules':
    get:
      tags:
        - Governance
      summary: List a subsection's rules
      operationId: listFrameworkSubsectionRules
      description: List the rules mapped to a document subsection.
      parameters:
        - $ref: '#/components/parameters/frameworkId'
        - $ref: '#/components/parameters/subsectionId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
        - $ref: '#/components/parameters/includeResults'
        - $ref: '#/components/parameters/projectIdFilter'
        - $ref: '#/components/parameters/ruleStatus'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Rule'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            rules = client.governance.frameworks.subsections.list_rules(
                "8d9e0f1a-2b3c-4d4e-8f5a-6b7c8d9e0f1a",
                framework_id="5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
            )
            for rule in rules.items:
                print(rule.id, rule.name)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const rules = await client.governance.frameworks.subsections.listRules('8d9e0f1a-2b3c-4d4e-8f5a-6b7c8d9e0f1a', {
              frameworkId: '5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b',
            });

            console.log(rules.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()\nrules, err := client.Governance.Frameworks.Subsections.ListRules(\n\tcontext.TODO(),\n\t\"5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b\",\n\t\"8d9e0f1a-2b3c-4d4e-8f5a-6b7c8d9e0f1a\",\n\topenlayer.GovernanceFrameworkSubsectionListRulesParams{\n\t\tIncludeResults: openlayer.F(true),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", rules.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.subsections.SubsectionListRulesParams;
            import com.openlayer.api.models.governance.frameworks.subsections.SubsectionListRulesResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            SubsectionListRulesParams params = SubsectionListRulesParams.builder()
                .frameworkId("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b")
                .subsectionId("8d9e0f1a-2b3c-4d4e-8f5a-6b7c8d9e0f1a")
                .includeResults(true)
                .build();
            SubsectionListRulesResponse rules = client.governance().frameworks().subsections().listRules(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            rules = openlayer.governance.frameworks.subsections.list_rules(
              "8d9e0f1a-2b3c-4d4e-8f5a-6b7c8d9e0f1a",
              framework_id: "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
              include_results: true
            )

            puts(rules)
        - lang: curl
          source: |
            curl --request GET \
              --url 'https://api.openlayer.com/v1/frameworks/9f1b3c2d-4e5a-4f60-8a71-2b3c4d5e6f70/subsections/1d3f5a7b-8c9e-4b2d-9f6a-0c1e2d3f4a5b/rules?includeResults=true' \
              --header 'Authorization: Bearer <token>'
  '/workspaces/{workspaceId}/rules':
    get:
      tags:
        - Governance
      summary: List rules
      operationId: listRules
      description: List the rules in a workspace.
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
        - $ref: '#/components/parameters/frameworkIdFilter'
        - $ref: '#/components/parameters/projectIdFilter'
        - $ref: '#/components/parameters/ruleScope'
        - $ref: '#/components/parameters/ruleType'
        - $ref: '#/components/parameters/ruleStatus'
        - $ref: '#/components/parameters/enabledFrameworkOnly'
        - $ref: '#/components/parameters/includeUnframed'
        - $ref: '#/components/parameters/includeResults'
        - $ref: '#/components/parameters/searchQuery'
        - $ref: '#/components/parameters/asc'
        - name: sortBy
          in: query
          description: The field to sort on.
          required: false
          schema:
            type: string
            enum:
              - name
              - status
              - frameworks
              - scope
              - dateCreated
        - name: tags
          in: query
          description: |
            Only include rules carrying all of these rule tags. Pass tag ids, which you can look up with [List rule tags](/api-reference/rest/governance/list-rule-tags).
          required: false
          schema:
            type: array
            items:
              type: string
              format: uuid
        - name: deactivated
          in: query
          description: Only include rules that are deactivated (or active).
          required: false
          schema:
            type: boolean
        - name: assigneeId
          in: query
          description: Only include rules assigned to this user.
          required: false
          schema:
            type: string
            format: uuid
        - name: group
          in: query
          description: |
            Only include rules in one bucket of the compliance workflow. `open` covers rules that still need attention, `done` covers rules that are fully satisfied, and `excluded` covers rules that have been deactivated.
          required: false
          schema:
            type: string
            enum:
              - open
              - excluded
              - done
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Rule'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            rules = client.governance.rules.list(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                framework_id="5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
                status="failing",
            )
            for rule in rules.items:
                print(rule.id, rule.name)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const rules = await client.governance.rules.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
              status: 'failing',
            });

            console.log(rules.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()\nrules, err := client.Governance.Rules.List(\n\tcontext.TODO(),\n\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\topenlayer.GovernanceRuleListParams{\n\t\tFrameworkID: openlayer.F(\"5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", rules.Items)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.governance.rules.RuleListParams;
            import com.openlayer.api.models.governance.rules.RuleListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            RuleListParams params = RuleListParams.builder()
                .workspaceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .frameworkId("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b")
                .status(RuleListParams.Status.FAILING)
                .build();
            RuleListResponse rules = client.governance().rules().list(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            rules = openlayer.governance.rules.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", framework_id: "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b")

            puts(rules)
        - lang: curl
          source: |
            curl --request GET \
              --url 'https://api.openlayer.com/v1/workspaces/3fa85f64-5717-4562-b3fc-2c963f66afa6/rules?type=evidence&status=failing' \
              --header 'Authorization: Bearer <token>'
    post:
      tags:
        - Governance
      summary: Create a rule
      operationId: createRule
      description: Create a rule in a workspace.
      parameters:
        - $ref: '#/components/parameters/workspaceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - scope
                - type
              properties:
                name:
                  $ref: '#/components/schemas/Rule/properties/name'
                description:
                  $ref: '#/components/schemas/Rule/properties/description'
                scope:
                  $ref: '#/components/schemas/Rule/properties/scope'
                type:
                  $ref: '#/components/schemas/Rule/properties/type'
                evidenceType:
                  $ref: '#/components/schemas/Rule/properties/evidenceType'
                renewalCadenceDays:
                  $ref: '#/components/schemas/Rule/properties/renewalCadenceDays'
                automationType:
                  $ref: '#/components/schemas/Rule/properties/automationType'
                automationParams:
                  $ref: '#/components/schemas/Rule/properties/automationParams'
                deactivated:
                  $ref: '#/components/schemas/Rule/properties/deactivated'
                assigneeId:
                  $ref: '#/components/schemas/Rule/properties/assigneeId'
                tagIds:
                  $ref: '#/components/schemas/Rule/properties/tagIds'
      responses:
        '201':
          description: Rule created. It belongs to no framework until you map it to one in the Openlayer app.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Rule'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            rule = client.governance.rules.create(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                name="Model card is published",
                scope="project",
                type="evidence",
                evidence_type="document",
                renewal_cadence_days=365,
            )
            print(rule.id)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const rule = await client.governance.rules.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
              name: 'Monitoring enabled',
              scope: 'project',
              type: 'platform',
              automationType: 'monitoring_mode_enabled',
              description: 'Each project must have Openlayer monitoring mode enabled.',
            });

            console.log(rule.id);
        - 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()\nrule, err := client.Governance.Rules.New(\n\tcontext.TODO(),\n\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\topenlayer.GovernanceRuleNewParams{\n\t\tName:               openlayer.F(\"Model card is up to date\"),\n\t\tScope:              openlayer.F(openlayer.GovernanceRuleNewParamsScopeProject),\n\t\tType:               openlayer.F(openlayer.GovernanceRuleNewParamsTypeEvidence),\n\t\tEvidenceType:       openlayer.F(openlayer.GovernanceRuleNewParamsEvidenceTypeDocument),\n\t\tRenewalCadenceDays: openlayer.Int(90),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", rule.ID)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.governance.rules.RuleCreateParams;
            import com.openlayer.api.models.governance.rules.RuleCreateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            RuleCreateParams params = RuleCreateParams.builder()
                .workspaceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .name("Model risk assessment")
                .scope(RuleCreateParams.Scope.PROJECT)
                .type(RuleCreateParams.Type.EVIDENCE)
                .evidenceType(RuleCreateParams.EvidenceType.DOCUMENT)
                .renewalCadenceDays(90L)
                .build();
            RuleCreateResponse rule = client.governance().rules().create(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            rule = openlayer.governance.rules.create(
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              name: "Monitoring enabled",
              scope: :project,
              type: :platform,
              description: "Each project must have Openlayer monitoring mode enabled.",
              automation_type: "monitoring_mode_enabled"
            )

            puts(rule)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/workspaces/3fa85f64-5717-4562-b3fc-2c963f66afa6/rules \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "name": "Annual model risk review",
                "description": "Each high-risk project is reviewed and signed off once a year.",
                "scope": "project",
                "type": "evidence",
                "evidenceType": "document",
                "renewalCadenceDays": 365
              }'
  '/rules/{ruleId}':
    get:
      tags:
        - Governance
      summary: Retrieve a rule
      operationId: getRuleById
      description: Retrieve a rule with its frameworks and tags.
      parameters:
        - $ref: '#/components/parameters/ruleId'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Rule'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            rule = client.governance.rules.retrieve("4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d")
            print(rule.name, rule.type)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const rule = await client.governance.rules.retrieve('4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d');

            console.log(rule.name);
        - 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()\nrule, err := client.Governance.Rules.Get(context.TODO(), \"4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d\")\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", rule.Name)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.governance.rules.RuleRetrieveResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            RuleRetrieveResponse rule = client.governance().rules().retrieve("4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d");
        - lang: ruby
          source: |
            require "openlayer"

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

            rule = openlayer.governance.rules.retrieve("4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d")

            puts(rule)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/rules/7c9a1e2b-3d4f-4a5b-8c6d-7e8f9a0b1c2d \
              --header 'Authorization: Bearer <token>'
    put:
      tags:
        - Governance
      summary: Update a rule
      operationId: updateRule
      description: Update a rule.
      parameters:
        - $ref: '#/components/parameters/ruleId'
      requestBody:
        description: Only the fields you send are changed.
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  $ref: '#/components/schemas/Rule/properties/name'
                description:
                  $ref: '#/components/schemas/Rule/properties/description'
                renewalCadenceDays:
                  $ref: '#/components/schemas/Rule/properties/renewalCadenceDays'
                deactivated:
                  $ref: '#/components/schemas/Rule/properties/deactivated'
                assigneeId:
                  $ref: '#/components/schemas/Rule/properties/assigneeId'
                tagIds:
                  $ref: '#/components/schemas/Rule/properties/tagIds'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Rule'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            rule = client.governance.rules.update(
                "4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d",
                assignee_id="d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f7a",
                renewal_cadence_days=180,
            )
            print(rule.renewal_cadence_days)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const rule = await client.governance.rules.update('4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d', {
              renewalCadenceDays: 90,
              tagIds: ['3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f'],
            });

            console.log(rule.name);
        - 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()\nrule, err := client.Governance.Rules.Update(\n\tcontext.TODO(),\n\t\"4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d\",\n\topenlayer.GovernanceRuleUpdateParams{\n\t\tRenewalCadenceDays: openlayer.Int(30),\n\t\tAssigneeID:         openlayer.F(\"d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f7a\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", rule.RenewalCadenceDays)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.governance.rules.RuleUpdateParams;
            import com.openlayer.api.models.governance.rules.RuleUpdateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            RuleUpdateParams params = RuleUpdateParams.builder()
                .ruleId("4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d")
                .assigneeId("d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f7a")
                .renewalCadenceDays(180L)
                .build();
            RuleUpdateResponse rule = client.governance().rules().update(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            rule = openlayer.governance.rules.update(
              "4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d",
              name: "Monitoring enabled",
              renewal_cadence_days: 90
            )

            puts(rule)
        - lang: curl
          source: |
            curl --request PUT \
              --url https://api.openlayer.com/v1/rules/7c9a1e2b-3d4f-4a5b-8c6d-7e8f9a0b1c2d \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{"deactivated": true}'
    delete:
      tags:
        - Governance
      summary: Delete a rule
      operationId: deleteRule
      description: Delete a rule and its results.
      parameters:
        - $ref: '#/components/parameters/ruleId'
      responses:
        '204':
          description: Rule deleted. No content.
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            client.governance.rules.delete("4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d")
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            await client.governance.rules.delete('4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d');
        - lang: go
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/openlayer-ai/openlayer-go\"\n)\n\nclient := openlayer.NewClient()\nerr := client.Governance.Rules.Delete(context.TODO(), \"4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d\")\nif err != nil {\n\tpanic(err.Error())\n}\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            client.governance().rules().delete("4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d");
        - lang: ruby
          source: |
            require "openlayer"

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

            openlayer.governance.rules.delete("4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d")
        - lang: curl
          source: |
            curl --request DELETE \
              --url https://api.openlayer.com/v1/rules/7c9a1e2b-3d4f-4a5b-8c6d-7e8f9a0b1c2d \
              --header 'Authorization: Bearer <token>'
  '/workspaces/{workspaceId}/rule-results':
    get:
      tags:
        - Governance
      summary: List rule results
      operationId: listRuleResults
      description: List the rule results in a workspace.
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
        - $ref: '#/components/parameters/frameworkIdFilter'
        - $ref: '#/components/parameters/projectIdFilter'
        - $ref: '#/components/parameters/ruleScope'
        - $ref: '#/components/parameters/ruleType'
        - $ref: '#/components/parameters/ruleStatus'
        - $ref: '#/components/parameters/enabledFrameworkOnly'
        - $ref: '#/components/parameters/includeUnframed'
        - $ref: '#/components/parameters/searchQuery'
        - name: ruleId
          in: query
          description: Only include results of this rule.
          required: false
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/RuleResult'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            rule_results = client.governance.rule_results.list(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                rule_id="4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d",
            )
            for rule_result in rule_results.items:
                print(rule_result.id, rule_result.status)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const ruleResults = await client.governance.ruleResults.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
              ruleId: '4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d',
            });

            console.log(ruleResults.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()\nresults, err := client.Governance.RuleResults.List(\n\tcontext.TODO(),\n\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\topenlayer.GovernanceRuleResultListParams{\n\t\tRuleID: openlayer.F(\"4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", results.Items)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.governance.ruleresults.RuleResultListParams;
            import com.openlayer.api.models.governance.ruleresults.RuleResultListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            RuleResultListParams params = RuleResultListParams.builder()
                .workspaceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .ruleId("4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d")
                .status(RuleResultListParams.Status.FAILING)
                .build();
            RuleResultListResponse ruleResults = client.governance().ruleResults().list(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            rule_results = openlayer.governance.rule_results.list(
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              rule_id: "4a5b6c7d-8e9f-4a0b-9c1d-2e3f4a5b6c7d"
            )

            puts(rule_results)
        - lang: curl
          source: |
            curl --request GET \
              --url 'https://api.openlayer.com/v1/workspaces/3fa85f64-5717-4562-b3fc-2c963f66afa6/rule-results?frameworkId=9f1b3c2d-4e5a-4f60-8a71-2b3c4d5e6f70&status=failing&perPage=100' \
              --header 'Authorization: Bearer <token>'
  '/rule-results/{ruleResultId}':
    get:
      tags:
        - Governance
      summary: Retrieve a rule result
      operationId: getRuleResultById
      description: Retrieve a rule result.
      parameters:
        - $ref: '#/components/parameters/ruleResultId'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleResult'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            rule_result = client.governance.rule_results.retrieve("6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c")
            print(rule_result.status)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const ruleResult = await client.governance.ruleResults.retrieve('6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c');

            console.log(ruleResult.status);
        - 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()\nresult, err := client.Governance.RuleResults.Get(context.TODO(), \"6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c\")\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", result.Status)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.governance.ruleresults.RuleResultRetrieveResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            RuleResultRetrieveResponse ruleResult = client.governance().ruleResults().retrieve("6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c");
        - lang: ruby
          source: |
            require "openlayer"

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

            rule_result = openlayer.governance.rule_results.retrieve("6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c")

            puts(rule_result)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/rule-results/5b7d9f1a-2c3e-4d5f-8a6b-9c0d1e2f3a4b \
              --header 'Authorization: Bearer <token>'
    patch:
      tags:
        - Governance
      summary: Update a rule result
      operationId: updateRuleResult
      description: Update a rule result.
      parameters:
        - $ref: '#/components/parameters/ruleResultId'
      requestBody:
        description: Only the fields you send are changed.
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                deactivated:
                  $ref: '#/components/schemas/RuleResult/properties/deactivated'
                deactivatedReason:
                  $ref: '#/components/schemas/RuleResult/properties/deactivatedReason'
                assigneeId:
                  $ref: '#/components/schemas/RuleResult/properties/assigneeId'
                blockedBy:
                  $ref: '#/components/schemas/RuleResult/properties/blockedBy'
                blocking:
                  $ref: '#/components/schemas/RuleResult/properties/blocking'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleResult'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            rule_result = client.governance.rule_results.update(
                "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
                deactivated=True,
                deactivated_reason="This project does not process personal data.",
            )
            print(rule_result.deactivated)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const ruleResult = await client.governance.ruleResults.update('6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c', {
              deactivated: true,
              deactivatedReason: 'Not applicable to internal tools.',
            });

            console.log(ruleResult.status);
        - 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()\nresult, err := client.Governance.RuleResults.Update(\n\tcontext.TODO(),\n\t\"6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c\",\n\topenlayer.GovernanceRuleResultUpdateParams{\n\t\tAssigneeID: openlayer.F(\"d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f7a\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", result.AssigneeID)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.governance.ruleresults.RuleResultUpdateParams;
            import com.openlayer.api.models.governance.ruleresults.RuleResultUpdateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            RuleResultUpdateParams params = RuleResultUpdateParams.builder()
                .ruleResultId("6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c")
                .assigneeId("d4e5f6a7-b8c9-4d0e-8f1a-2b3c4d5e6f7a")
                .build();
            RuleResultUpdateResponse ruleResult = client.governance().ruleResults().update(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            rule_result = openlayer.governance.rule_results.update(
              "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
              deactivated: true,
              deactivated_reason: "Not applicable to this project."
            )

            puts(rule_result)
        - lang: curl
          source: |
            curl --request PATCH \
              --url https://api.openlayer.com/v1/rule-results/2c4e6a8b-1d3f-4b5c-9e7a-0f1b2c3d4e5f \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "deactivated": true,
                "deactivatedReason": "Not applicable to this project."
              }'
  '/rule-results/{ruleResultId}/evidence':
    get:
      tags:
        - Governance
      summary: List a rule result's evidence
      operationId: listRuleResultEvidence
      description: List the evidence attached to a rule result.
      parameters:
        - $ref: '#/components/parameters/ruleResultId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Evidence'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            evidence = client.governance.rule_results.list_evidence("6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c")
            for item in evidence.items:
                print(item.id, item.name)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const evidence = await client.governance.ruleResults.listEvidence('6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c');

            console.log(evidence.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()\nevidence, err := client.Governance.RuleResults.ListEvidence(\n\tcontext.TODO(),\n\t\"6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c\",\n\topenlayer.GovernanceRuleResultListEvidenceParams{},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", evidence.Items)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.governance.ruleresults.RuleResultListEvidenceResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            RuleResultListEvidenceResponse evidence = client.governance().ruleResults().listEvidence("6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c");
        - lang: ruby
          source: |
            require "openlayer"

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

            evidence = openlayer.governance.rule_results.list_evidence("6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c")

            puts(evidence)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/rule-results/5b7d9f1a-2c3e-4d5f-8a6b-9c0d1e2f3a4b/evidence \
              --header 'Authorization: Bearer <token>'
    post:
      tags:
        - Governance
      summary: Attach evidence to a rule result
      operationId: createRuleResultEvidence
      description: Attach evidence to a rule result.
      parameters:
        - $ref: '#/components/parameters/ruleResultId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  $ref: '#/components/schemas/Evidence/properties/name'
                description:
                  $ref: '#/components/schemas/Evidence/properties/description'
                storageUri:
                  $ref: '#/components/schemas/Evidence/properties/storageUri'
                text:
                  $ref: '#/components/schemas/Evidence/properties/text'
                url:
                  $ref: '#/components/schemas/Evidence/properties/url'
      responses:
        '201':
          description: 'Evidence created. The rule result is re-evaluated, and its renewal window restarts from this evidence.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Evidence'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            evidence = client.governance.rule_results.create_evidence(
                "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
                name="Model card",
                url="https://example.com/model-card",
            )
            print(evidence.id)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const evidence = await client.governance.ruleResults.createEvidence('6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c', {
              name: 'Model risk assessment 2026',
              url: 'https://example.com/model-risk-assessment.pdf',
            });

            console.log(evidence.id);
        - 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()\nevidence, err := client.Governance.RuleResults.NewEvidence(\n\tcontext.TODO(),\n\t\"6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c\",\n\topenlayer.GovernanceRuleResultNewEvidenceParams{\n\t\tName: openlayer.F(\"Model card v3\"),\n\t\tURL:  openlayer.F(\"https://example.com/model-card-v3.pdf\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", evidence.ID)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.governance.ruleresults.RuleResultCreateEvidenceParams;
            import com.openlayer.api.models.governance.ruleresults.RuleResultCreateEvidenceResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            RuleResultCreateEvidenceParams params = RuleResultCreateEvidenceParams.builder()
                .ruleResultId("6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c")
                .name("Model risk assessment 2026")
                .url("https://example.com/model-risk-assessment-2026.pdf")
                .build();
            RuleResultCreateEvidenceResponse evidence = client.governance().ruleResults().createEvidence(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            evidence = openlayer.governance.rule_results.create_evidence(
              "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
              name: "Model risk assessment 2026",
              url: "https://openlayer.com/evidence"
            )

            puts(evidence)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/rule-results/2c4e6a8b-1d3f-4b5c-9e7a-0f1b2c3d4e5f/evidence \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "name": "2026 model risk review",
                "description": "Signed off by the risk committee.",
                "url": "https://example.com/reviews/2026-model-risk.pdf"
              }'
  '/workspaces/{workspaceId}/rule-stats':
    get:
      tags:
        - Governance
      summary: Retrieve workspace compliance statistics
      operationId: getWorkspaceRuleStats
      description: Get compliance statistics for a workspace.
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - $ref: '#/components/parameters/frameworkIdFilter'
        - $ref: '#/components/parameters/projectIdFilter'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleStatistic'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            stats = client.governance.rule_stats.retrieve(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                framework_id="5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
            )
            print(stats.rule_results)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const ruleStats = await client.governance.ruleStats.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
              frameworkId: '5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b',
            });

            console.log(ruleStats);
        - 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.RuleStats.Get(\n\tcontext.TODO(),\n\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\topenlayer.GovernanceRuleStatGetParams{\n\t\tFrameworkID: openlayer.F(\"5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", stats.Rules)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.governance.rulestats.RuleStatRetrieveParams;
            import com.openlayer.api.models.governance.rulestats.RuleStatRetrieveResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            RuleStatRetrieveParams params = RuleStatRetrieveParams.builder()
                .workspaceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .frameworkId("5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b")
                .build();
            RuleStatRetrieveResponse stats = client.governance().ruleStats().retrieve(params);
        - lang: ruby
          source: |
            require "openlayer"

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

            rule_stats = openlayer.governance.rule_stats.retrieve(
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              framework_id: "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b"
            )

            puts(rule_stats)
        - lang: curl
          source: |
            curl --request GET \
              --url 'https://api.openlayer.com/v1/workspaces/3fa85f64-5717-4562-b3fc-2c963f66afa6/rule-stats?frameworkId=9f1b3c2d-4e5a-4f60-8a71-2b3c4d5e6f70' \
              --header 'Authorization: Bearer <token>'
  '/workspaces/{workspaceId}/rule-tags':
    get:
      tags:
        - Governance
      summary: List rule tags
      operationId: listRuleTags
      description: List the rule tags in a workspace.
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/perPage'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/RuleTag'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            rule_tags = client.governance.rule_tags.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
            for rule_tag in rule_tags.items:
                print(rule_tag.id, rule_tag.name)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const ruleTags = await client.governance.ruleTags.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');

            console.log(ruleTags.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()\ntags, err := client.Governance.RuleTags.List(\n\tcontext.TODO(),\n\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\topenlayer.GovernanceRuleTagListParams{},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", tags.Items)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.governance.ruletags.RuleTagListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            RuleTagListResponse ruleTags = client.governance().ruleTags().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
        - lang: ruby
          source: |
            require "openlayer"

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

            rule_tags = openlayer.governance.rule_tags.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")

            puts(rule_tags)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/workspaces/3fa85f64-5717-4562-b3fc-2c963f66afa6/rule-tags \
              --header 'Authorization: Bearer <token>'
  '/background-tasks/{taskId}':
    get:
      tags:
        - Background Tasks
      summary: Retrieve a background task
      operationId: getBackgroundTaskById
      description: Retrieve a background task's status and outputs.
      parameters:
        - $ref: '#/components/parameters/taskId'
      responses:
        '200':
          description: Status OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackgroundTask'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            task = client.background_tasks.retrieve("1e2f3a4b-5c6d-4e7f-9a8b-0c1d2e3f4a5b")
            print(task.complete, task.progress)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer();

            const task = await client.backgroundTasks.retrieve('1e2f3a4b-5c6d-4e7f-9a8b-0c1d2e3f4a5b');

            console.log(task.complete);
        - 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()\ntask, err := client.BackgroundTasks.Get(context.TODO(), \"1e2f3a4b-5c6d-4e7f-9a8b-0c1d2e3f4a5b\")\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", task.Complete)\n"
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.backgroundtasks.BackgroundTaskRetrieveResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            BackgroundTaskRetrieveResponse task = client.backgroundTasks().retrieve("1e2f3a4b-5c6d-4e7f-9a8b-0c1d2e3f4a5b");
        - lang: ruby
          source: |
            require "openlayer"

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

            task = openlayer.background_tasks.retrieve("1e2f3a4b-5c6d-4e7f-9a8b-0c1d2e3f4a5b")

            puts(task)
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/background-tasks/3fa85f64-5717-4562-b3fc-2c963f66afa6 \
              --header 'Authorization: Bearer <token>'
components:
  headers: {}
  responses:
    UnexpectedError:
      description: Unexpected error.
      content:
        application/json:
          schema:
            type: object
            required:
              - code
              - error
            properties:
              code:
                type: integer
                format: int32
              error:
                type: string
  parameters:
    inferencePipelineId:
      name: inferencePipelineId
      in: path
      description: The inference pipeline id (a UUID).
      required: true
      schema:
        type: string
        format: uuid
    projectId:
      name: projectId
      in: path
      description: The project id.
      required: true
      schema:
        type: string
        format: uuid
    projectVersionId:
      name: projectVersionId
      in: path
      description: The project version (commit) id.
      required: true
      schema:
        type: string
        format: uuid
    workspaceId:
      name: workspaceId
      in: path
      description: The workspace id.
      required: true
      schema:
        type: string
        format: uuid
    apiKeyId:
      name: apiKeyId
      in: path
      description: The API key id.
      required: true
      schema:
        type: string
        format: uuid
    testId:
      name: testId
      in: path
      description: The test id.
      required: true
      schema:
        type: string
        format: uuid
    frameworkId:
      name: frameworkId
      in: path
      description: The framework id.
      required: true
      schema:
        type: string
        format: uuid
    documentId:
      name: documentId
      in: path
      description: The framework document id.
      required: true
      schema:
        type: string
        format: uuid
    sectionId:
      name: sectionId
      in: path
      description: The framework document section id.
      required: true
      schema:
        type: string
        format: uuid
    subsectionId:
      name: subsectionId
      in: path
      description: The framework document subsection id.
      required: true
      schema:
        type: string
        format: uuid
    ruleId:
      name: ruleId
      in: path
      description: The rule id.
      required: true
      schema:
        type: string
        format: uuid
    ruleResultId:
      name: ruleResultId
      in: path
      description: The rule result id.
      required: true
      schema:
        type: string
        format: uuid
    taskId:
      name: taskId
      in: path
      description: The background task 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
    taskType:
      name: taskType
      in: query
      description: Filter list of items by task type.
      required: false
      schema:
        type: string
        enum:
          - llm-base
          - tabular-classification
          - tabular-regression
          - text-classification
    projectName:
      name: name
      in: query
      description: Filter list of items by project name.
      required: false
      schema:
        type: string
    goalStatus:
      name: status
      in: query
      description: 'Filter list of test results by status. Available statuses are `running`, `passing`, `failing`, `skipped`, and `error`.'
      required: false
      schema:
        $ref: '#/components/schemas/GoalResult/properties/status'
    goalType:
      name: type
      in: query
      description: 'Filter objects by test type. Available types are `integrity`, `consistency`, `performance`, `fairness`, and `robustness`.'
      required: false
      schema:
        type: string
        enum:
          - integrity
          - consistency
          - performance
          - fairness
          - robustness
    includeArchived:
      name: includeArchived
      in: query
      description: Filter for archived tests.
      schema:
        type: boolean
        default: false
    frameworkIdFilter:
      name: frameworkId
      in: query
      description: Only include items belonging to this framework.
      required: false
      schema:
        type: string
        format: uuid
    projectIdFilter:
      name: projectId
      in: query
      description: Only include items that apply to this project.
      required: false
      schema:
        type: string
        format: uuid
    ruleStatus:
      name: status
      in: query
      description: Only include items whose rule result has this compliance status.
      required: false
      schema:
        $ref: '#/components/schemas/RuleResult/properties/status'
    ruleScope:
      name: scope
      in: query
      description: Only include rules with this scope.
      required: false
      schema:
        $ref: '#/components/schemas/Rule/properties/scope'
    ruleType:
      name: type
      in: query
      description: Only include rules of this type.
      required: false
      schema:
        $ref: '#/components/schemas/Rule/properties/type'
    searchQuery:
      name: searchQuery
      in: query
      description: Filter by a free-text search over names and descriptions.
      required: false
      schema:
        type: string
    asc:
      name: asc
      in: query
      description: Whether to sort in ascending order.
      required: false
      schema:
        type: boolean
        default: true
    enabledFrameworkOnly:
      name: enabledFrameworkOnly
      in: query
      description: Only include items belonging to at least one enabled framework.
      required: false
      schema:
        type: boolean
        default: false
    includeUnframed:
      name: includeUnframed
      in: query
      description: Whether to include rules that are not part of any framework.
      required: false
      schema:
        type: boolean
        default: true
    includeResults:
      name: includeResults
      in: query
      description: 'Whether to include each rule''s results inline, in a `results` array.'
      required: false
      schema:
        type: boolean
        default: false
    includeRuleStats:
      name: includeRuleStats
      in: query
      description: |
        Whether to include a `ruleStats` object on each framework, with its rule result status counts and its per-project completion buckets. Computed over the returned page only.
      required: false
      schema:
        type: boolean
        default: false
  schemas:
    ApiKey:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The API key id.
          readOnly: true
        name:
          type: string
          nullable: true
          maxLength: 120
          example: Secret Key
          description: The API key name.
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The API key creation date.
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The API key last update date.
        dateLastUsed:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: The API key last use date.
        secureKey:
          type: string
          example: sk-o...5PW0
          maxLength: 120
          readOnly: true
          description: 'An obfuscated hint of the API key value. When a key is created or rotated this also holds the full secret, for backward compatibility; prefer `secret`.'
        secret:
          type: string
          readOnly: true
          example: sk-ol-Xq3v9Rk2mPz8TnW4yL7bC1dF5hJ6
          description: 'The full API key. Only present in the response that creates or rotates the key, and never shown again.'
        status:
          type: string
          enum:
            - active
            - rotating
            - expired
          readOnly: true
          example: active
          description: 'The key''s lifecycle state. `active`: the current secret authenticates. `rotating`: the key was rotated and the previous secret still authenticates until `previousKeyExpiresAt`. `expired`: `expiresAt` has passed, no secret authenticates, and the key can''t be rotated.'
        expiresAt:
          type: string
          format: date-time
          nullable: true
          example: '2027-01-01T00:00:00Z'
          description: 'When the key stops authenticating. `null` means the key never expires. Set when the key is created or rotated, and must be in the future. When the request is authenticated with an API key that expires, the result can''t be later than that key''s expiry. On create, omit it to inherit that expiry. On rotate, omit it to keep the current one. It can''t be changed with an update; rotate the key instead.'
        lastRotatedAt:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: When the key was last rotated.
        previousKeyExpiresAt:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: 'While `status` is `rotating`, when the previous secret stops authenticating.'
      required:
        - id
        - dateCreated
        - dateUpdated
        - dateLastUsed
        - secureKey
        - status
    DatasetFilter:
      type: object
      nullable: true
      properties:
        columnFilters:
          type: array
          nullable: true
          maxItems: 5
          items:
            oneOf:
              - title: SetColumnFilter
                type: object
                example:
                  measurement: openlayer_token_set
                  operator: contains_none
                  value:
                    - cat
                required:
                  - measurement
                  - operator
                  - value
                properties:
                  measurement:
                    type: string
                    description: The name of the column.
                  operator:
                    type: string
                    enum:
                      - contains_none
                      - contains_any
                      - contains_all
                      - one_of
                      - none_of
                  value:
                    type: array
                    items:
                      oneOf:
                        - type: string
                        - type: number
              - title: NumericColumnFilter
                type: object
                example:
                  measurement: Age
                  operator: '>='
                  value: 25
                required:
                  - measurement
                  - operator
                  - value
                properties:
                  measurement:
                    type: string
                    description: The name of the column.
                  operator:
                    type: string
                    enum:
                      - '>'
                      - '>='
                      - is
                      - <
                      - <=
                      - '!='
                  value:
                    type: number
                    format: float
                    nullable: true
                    example: 0.93
              - title: StringColumnFilter
                type: object
                example:
                  measurement: Geography
                  operator: is
                  value: Germany
                required:
                  - measurement
                  - operator
                  - value
                properties:
                  measurement:
                    type: string
                    description: The name of the column.
                  operator:
                    type: string
                    enum:
                      - is
                      - '!='
                  value:
                    oneOf:
                      - type: string
                        example: Germany
                      - type: boolean
        searchQueryOr:
          type: array
          items:
            type: string
            maxLength: 300
          nullable: true
        searchQueryAnd:
          type: array
          items:
            type: string
            maxLength: 300
          nullable: true
        notSearchQueryOr:
          type: array
          items:
            type: string
            maxLength: 300
          nullable: true
        notSearchQueryAnd:
          type: array
          items:
            type: string
            maxLength: 300
          nullable: true
        rowIdList:
          type: array
          nullable: true
          items:
            type: integer
        excludeRowIdList:
          type: array
          nullable: true
          items:
            type: integer
    GitRepo:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        gitId:
          type: integer
        dateConnected:
          type: string
          format: date-time
          readOnly: true
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
        branch:
          type: string
        name:
          type: string
          readOnly: true
        private:
          type: boolean
          readOnly: true
        slug:
          type: string
          readOnly: true
        url:
          type: string
          format: url
          readOnly: true
        rootDir:
          type: string
        projectId:
          type: string
          format: uuid
          readOnly: true
        gitAccountId:
          type: string
          format: uuid
      required:
        - id
        - gitId
        - dateConnected
        - dateUpdated
        - name
        - private
        - slug
        - url
        - projectId
        - gitAccountId
    GoalBase:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The test id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        number:
          type: integer
          readOnly: true
          description: The test number.
          example: 1
        name:
          type: string
          maxLength: 100
          description: The test name.
          example: No duplicate rows
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The creation date.
          example: '2024-03-22T11:31:01.185Z'
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The last updated date.
          example: '2024-03-22T11:31:01.185Z'
        description:
          oneOf:
            - type: object
            - type: string
              nullable: true
          description: The test description.
          example: This test checks for duplicate rows in the dataset.
          x-stainless-override-schema:
            type: object
            nullable: true
            description: The test description.
            example: This test checks for duplicate rows in the dataset.
        evaluationWindow:
          type: number
          nullable: true
          maximum: 2592000
          description: The evaluation window in seconds. Only applies to tests that use production data.
          example: 3600
        delayWindow:
          type: number
          nullable: true
          minimum: 0
          maximum: 2592000
          description: The delay window in seconds. Only applies to tests that use production data.
          example: 0
        type:
          type: string
          description: The test type.
          example: integrity
          enum:
            - integrity
            - consistency
            - performance
        subtype:
          type: string
          description: The test subtype.
          example: duplicateRowCount
          enum:
            - anomalousColumnCount
            - characterLength
            - classImbalanceRatio
            - expectColumnAToBeInColumnB
            - columnAverage
            - columnDrift
            - columnStatistic
            - columnValuesMatch
            - conflictingLabelRowCount
            - containsPii
            - containsValidUrl
            - correlatedFeatureCount
            - customMetricThreshold
            - duplicateRowCount
            - emptyFeature
            - emptyFeatureCount
            - driftedFeatureCount
            - featureMissingValues
            - featureValueValidation
            - greatExpectations
            - groupByColumnStatsCheck
            - illFormedRowCount
            - isCode
            - isJson
            - llmRubricThresholdV2
            - labelDrift
            - metricThreshold
            - newCategoryCount
            - newLabelCount
            - nullRowCount
            - rowCount
            - ppScoreValueValidation
            - quasiConstantFeature
            - quasiConstantFeatureCount
            - sqlQuery
            - dtypeValidation
            - sentenceLength
            - sizeRatio
            - specialCharactersRatio
            - stringValidation
            - trainValLeakageRowCount
        creatorId:
          type: string
          format: uuid
          readOnly: true
          nullable: true
          description: The test creator id.
          example: 589ece63-49a2-41b4-98e1-10547761d4b0
        originProjectVersionId:
          type: string
          format: uuid
          readOnly: true
          nullable: true
          description: The project version (commit) id where the test was created.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        thresholds:
          type: array
          required:
            - measurement
            - insightName
            - operator
            - value
          items:
            type: object
            properties:
              measurement:
                type: string
                description: The measurement to be evaluated.
                example: duplicateRowCount
              insightName:
                type: string
                description: The insight name to be evaluated.
                example: duplicateRowCount
                enum:
                  - characterLength
                  - classImbalance
                  - expectColumnAToBeInColumnB
                  - columnAverage
                  - columnDrift
                  - columnValuesMatch
                  - confidenceDistribution
                  - conflictingLabelRowCount
                  - containsPii
                  - containsValidUrl
                  - correlatedFeatures
                  - customMetric
                  - duplicateRowCount
                  - emptyFeatures
                  - featureDrift
                  - featureProfile
                  - greatExpectations
                  - groupByColumnStatsCheck
                  - illFormedRowCount
                  - isCode
                  - isJson
                  - llmRubricV2
                  - labelDrift
                  - metrics
                  - newCategories
                  - newLabels
                  - nullRowCount
                  - ppScore
                  - quasiConstantFeatures
                  - sentenceLength
                  - sizeRatio
                  - specialCharacters
                  - stringValidation
                  - trainValLeakageRowCount
              insightParameters:
                type: array
                nullable: true
                description: 'The insight parameters. Required only for some test subtypes. For example, for tests that require a column name, the insight parameters will be [{''name'': ''column_name'', ''value'': ''Age''}]'
                items:
                  type: object
                  required:
                    - name
                    - value
                  properties:
                    name:
                      type: string
                      description: The name of the insight filter.
                      example: column_name
                    value:
                      example: Age
              thresholdMode:
                type: string
                enum:
                  - automatic
                  - manual
                description: Whether to use automatic anomaly detection or manual thresholds
                default: manual
              operator:
                type: string
                description: The operator to be used for the evaluation.
                example: <=
                enum:
                  - is
                  - '>'
                  - '>='
                  - <
                  - <=
                  - '!='
              value:
                description: The value to be compared.
                example: 0
                oneOf:
                  - type: number
                  - type: boolean
                  - type: string
                  - type: array
                    items:
                      type: string
        archived:
          type: boolean
          description: Whether the test is archived.
          example: false
        dateArchived:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: The date the test was archived.
          example: '2024-03-22T11:31:01.185Z'
        suggested:
          type: boolean
          readOnly: true
          description: Whether the test is suggested or user-created.
          example: false
        commentCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of comments on the test.
          example: 0
        usesMlModel:
          type: boolean
          description: Whether the test uses an ML model.
          example: false
        usesValidationDataset:
          type: boolean
          description: Whether the test uses a validation dataset.
          example: true
        usesTrainingDataset:
          type: boolean
          description: Whether the test uses a training dataset.
          example: false
        usesReferenceDataset:
          type: boolean
          description: Whether the test uses a reference dataset (monitoring mode only).
          example: false
        usesProductionData:
          type: boolean
          description: Whether the test uses production data (monitoring mode only).
          example: false
      required:
        - id
        - number
        - name
        - dateCreated
        - dateUpdated
        - description
        - type
        - subtype
        - creatorId
        - originProjectVersionId
        - thresholds
        - dateArchived
        - suggested
        - commentCount
    TestBase:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The test id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        number:
          type: integer
          readOnly: true
          description: The test number.
          example: 1
        name:
          type: string
          maxLength: 100
          description: The test name.
          example: No duplicate rows
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The creation date.
          example: '2024-03-22T11:31:01.185Z'
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The last updated date.
          example: '2024-03-22T11:31:01.185Z'
        description:
          oneOf:
            - type: object
            - type: string
              nullable: true
          description: The test description.
          example: This test checks for duplicate rows in the dataset.
          x-stainless-override-schema:
            type: object
            nullable: true
            description: The test description.
            example: This test checks for duplicate rows in the dataset.
        evaluationWindow:
          type: number
          nullable: true
          maximum: 2592000
          description: The evaluation window in seconds. Only applies to tests that use production data.
          example: 3600
        delayWindow:
          type: number
          nullable: true
          minimum: 0
          maximum: 2592000
          description: The delay window in seconds. Only applies to tests that use production data.
          example: 0
        type:
          type: string
          description: The test type.
          example: integrity
          enum:
            - integrity
            - consistency
            - performance
        subtype:
          type: string
          description: The test subtype.
          example: duplicateRowCount
          enum:
            - anomalousColumnCount
            - characterLength
            - classImbalanceRatio
            - expectColumnAToBeInColumnB
            - columnAverage
            - columnDrift
            - columnStatistic
            - columnValuesMatch
            - conflictingLabelRowCount
            - containsPii
            - containsValidUrl
            - correlatedFeatureCount
            - customMetricThreshold
            - duplicateRowCount
            - emptyFeature
            - emptyFeatureCount
            - driftedFeatureCount
            - featureMissingValues
            - featureValueValidation
            - greatExpectations
            - groupByColumnStatsCheck
            - illFormedRowCount
            - isCode
            - isJson
            - llmRubricThresholdV2
            - labelDrift
            - metricThreshold
            - newCategoryCount
            - newLabelCount
            - nullRowCount
            - rowCount
            - ppScoreValueValidation
            - quasiConstantFeature
            - quasiConstantFeatureCount
            - sqlQuery
            - dtypeValidation
            - sentenceLength
            - sizeRatio
            - specialCharactersRatio
            - stringValidation
            - trainValLeakageRowCount
        creatorId:
          type: string
          format: uuid
          readOnly: true
          nullable: true
          description: The test creator id.
          example: 589ece63-49a2-41b4-98e1-10547761d4b0
        originProjectVersionId:
          type: string
          format: uuid
          readOnly: true
          nullable: true
          description: The project version (commit) id where the test was created.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        thresholds:
          type: array
          required:
            - measurement
            - insightName
            - operator
            - value
          items:
            type: object
            properties:
              measurement:
                type: string
                description: The measurement to be evaluated.
                example: duplicateRowCount
              insightName:
                type: string
                description: The insight name to be evaluated.
                example: duplicateRowCount
                enum:
                  - characterLength
                  - classImbalance
                  - expectColumnAToBeInColumnB
                  - columnAverage
                  - columnDrift
                  - columnValuesMatch
                  - confidenceDistribution
                  - conflictingLabelRowCount
                  - containsPii
                  - containsValidUrl
                  - correlatedFeatures
                  - customMetric
                  - duplicateRowCount
                  - emptyFeatures
                  - featureDrift
                  - featureProfile
                  - greatExpectations
                  - groupByColumnStatsCheck
                  - illFormedRowCount
                  - isCode
                  - isJson
                  - llmRubricV2
                  - labelDrift
                  - metrics
                  - newCategories
                  - newLabels
                  - nullRowCount
                  - ppScore
                  - quasiConstantFeatures
                  - sentenceLength
                  - sizeRatio
                  - specialCharacters
                  - stringValidation
                  - trainValLeakageRowCount
              insightParameters:
                type: array
                nullable: true
                description: 'The insight parameters. Required only for some test subtypes. For example, for tests that require a column name, the insight parameters will be [{''name'': ''column_name'', ''value'': ''Age''}]'
                items:
                  type: object
                  required:
                    - name
                    - value
                  properties:
                    name:
                      type: string
                      description: The name of the insight filter.
                      example: column_name
                    value:
                      example: Age
              thresholdMode:
                type: string
                enum:
                  - automatic
                  - manual
                description: Whether to use automatic anomaly detection or manual thresholds
                default: manual
              operator:
                type: string
                description: The operator to be used for the evaluation.
                example: <=
                enum:
                  - is
                  - '>'
                  - '>='
                  - <
                  - <=
                  - '!='
              value:
                description: The value to be compared.
                example: 0
                oneOf:
                  - type: number
                  - type: boolean
                  - type: string
                  - type: array
                    items:
                      type: string
        archived:
          type: boolean
          description: Whether the test is archived.
          example: false
        dateArchived:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: The date the test was archived.
          example: '2024-03-22T11:31:01.185Z'
        suggested:
          type: boolean
          readOnly: true
          description: Whether the test is suggested or user-created.
          example: false
        commentCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of comments on the test.
          example: 0
        usesMlModel:
          type: boolean
          description: Whether the test uses an ML model.
          example: false
        usesValidationDataset:
          type: boolean
          description: Whether the test uses a validation dataset.
          example: true
        usesTrainingDataset:
          type: boolean
          description: Whether the test uses a training dataset.
          example: false
        usesReferenceDataset:
          type: boolean
          description: Whether the test uses a reference dataset (monitoring mode only).
          example: false
        usesProductionData:
          type: boolean
          description: Whether the test uses production data (monitoring mode only).
          example: false
        includeHistoricalData:
          type: boolean
          nullable: true
          default: false
          description: Whether to include historical data in the test result. Only applies to tests that use production data.
        defaultToAllPipelines:
          type: boolean
          nullable: true
          default: true
          description: Whether to apply the test to all pipelines (data sources) or to a specific set of pipelines. Only applies to tests that use production data.
        includePipelines:
          type: array
          nullable: true
          items:
            type: string
            format: uuid
          description: Array of pipelines (data sources) to which the test should be applied. Only applies to tests that use production data.
        excludePipelines:
          type: array
          nullable: true
          items:
            type: string
            format: uuid
          description: Array of pipelines (data sources) to which the test should not be applied. Only applies to tests that use production data.
      required:
        - id
        - number
        - name
        - dateCreated
        - dateUpdated
        - description
        - type
        - subtype
        - creatorId
        - originProjectVersionId
        - thresholds
        - dateArchived
        - suggested
        - commentCount
    GoalResult:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Project version (commit) id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        goal:
          $ref: '#/components/schemas/GoalBase'
        goalId:
          type: string
          format: uuid
          readOnly: true
          nullable: true
          description: The test id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        projectVersionId:
          type: string
          format: uuid
          readOnly: true
          nullable: true
          description: The project version (commit) id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        inferencePipelineId:
          type: string
          format: uuid
          readOnly: true
          nullable: true
          description: The inference pipeline id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The creation date.
          example: '2024-03-22T11:31:01.185Z'
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The last updated date.
          example: '2024-03-22T11:31:01.185Z'
        dateDataStarts:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: The data start date.
          example: '2024-03-22T11:31:01.185Z'
        dateDataEnds:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: The data end date.
          example: '2024-03-22T11:31:01.185Z'
        status:
          type: string
          enum:
            - running
            - passing
            - failing
            - skipped
            - error
          description: The status of the test.
          example: passing
        statusMessage:
          type: string
          nullable: true
          description: The status message.
          example: Test successfully processed.
        expectedValues:
          type: array
          items:
            type: object
            properties:
              measurement:
                type: string
                description: One of the `measurement` values in the test's thresholds
              upperThreshold:
                type: number
                format: float
                description: The upper threshold for the expected value
                nullable: true
              lowerThreshold:
                type: number
                format: float
                description: the lower threshold for the expected value
                nullable: true
        rows:
          type: string
          example: 'https://api.openlayer.com/v1/versions/3fa85f64-5717-4562-b3fc-2c963f66afa6/rows?label=validation'
          description: The URL to the rows of the test result.
        rowsBody:
          $ref: '#/components/schemas/DatasetFilter'
          description: The body of the rows request.
      required:
        - id
        - projectVersionId
        - inferencePipelineId
        - dateCreated
        - dateUpdated
        - dateDataStarts
        - dateDataEnds
        - status
        - statusMessage
    InferencePipeline:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The inference pipeline id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        projectId:
          type: string
          format: uuid
          readOnly: true
          description: The project id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        workspaceId:
          type: string
          format: uuid
          readOnly: true
          description: The workspace id.
          example: 055fddb1-261f-4654-8598-f6347ee46a09
        project:
          nullable: true
          $ref: '#/components/schemas/Project'
        workspace:
          nullable: true
          $ref: '#/components/schemas/Workspace'
        name:
          type: string
          maxLength: 100
          description: The inference pipeline name.
          example: production
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The creation date.
          example: '2024-03-22T11:31:01.185Z'
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The last updated date.
          example: '2024-03-22T11:31:01.185Z'
        dateLastSampleReceived:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: The last data sample received date.
          example: '2024-03-22T11:31:01.185Z'
        dateLastPolled:
          type: string
          format: date-time
          description: The last time the data was polled.
          nullable: true
          readOnly: true
        totalRecordsCount:
          type: integer
          minimum: 0
          nullable: true
          readOnly: true
          description: The total number of records in the data backend.
          example: 1000
        description:
          type: string
          maxLength: 500
          nullable: true
          description: The inference pipeline description.
          example: This pipeline is used for production.
        dateLastEvaluated:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: The last test evaluation date.
          example: '2024-03-22T11:31:01.185Z'
        dateOfNextEvaluation:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: The next test evaluation date.
          example: '2024-03-22T11:31:01.185Z'
        passingGoalCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of tests passing.
          example: 5
        failingGoalCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of tests failing.
          example: 1
        totalGoalCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The total number of tests.
          example: 6
        status:
          type: string
          readOnly: true
          description: The status of test evaluation for the inference pipeline.
          example: completed
          enum:
            - queued
            - running
            - paused
            - failed
            - completed
            - unknown
        statusMessage:
          type: string
          nullable: true
          readOnly: true
          description: The status message of test evaluation for the inference pipeline.
          example: Tests successfully evaluated
        links:
          type: object
          readOnly: true
          required:
            - app
          properties:
            app:
              type: string
              example: 'https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6/inference-pipeline/3fa85f64-5717-4562-b3fc-2c963f66afa6'
        dataBackend:
          $ref: '#/components/schemas/DataBackend'
          nullable: true
      required:
        - id
        - name
        - dateCreated
        - dateUpdated
        - dateLastSampleReceived
        - dateLastEvaluated
        - dateOfNextEvaluation
        - description
        - projectId
        - passingGoalCount
        - failingGoalCount
        - totalGoalCount
        - status
        - statusMessage
        - links
    InsightBase:
      type: object
      properties:
        dateCreated:
          type: string
          format: date-time
          readOnly: true
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
        dateDataStarts:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        dateDataEnds:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 64
        status:
          type: string
          nullable: true
          enum:
            - null
            - completed
        statusMessage:
          type: string
          nullable: true
        presentOnCreate:
          type: boolean
        projectVersionId:
          type: string
          format: uuid
          readOnly: true
          nullable: true
        inferencePipelineId:
          type: string
          format: uuid
          readOnly: true
          nullable: true
        subpopulationFilters:
          $ref: '#/components/schemas/DatasetFilter'
        insightParameters:
          type: array
          nullable: true
          items:
            type: object
            required:
              - name
              - value
            properties:
              name:
                type: string
                description: The name of the insight filter.
                example: xFilter
              value:
                example: Age
        types:
          type: array
          items:
            type: string
          nullable: true
        usesMlModel:
          type: boolean
          readOnly: true
        usesTrainingDataset:
          type: boolean
          readOnly: true
        usesValidationDataset:
          type: boolean
          readOnly: true
        usesReferenceDataset:
          type: boolean
          readOnly: true
        usesProductionData:
          type: boolean
          readOnly: true
        value:
          readOnly: true
        rows:
          type: string
          example: 'http://localhost:8080/v1/versions/3fa85f64-5717-4562-b3fc-2c963f66afa6/rows?label=validation'
        rowsBody:
          $ref: '#/components/schemas/DatasetFilter'
      required:
        - dateCreated
        - dateUpdated
        - dateDataStarts
        - dateDataEnds
        - id
        - name
        - status
        - statusMessage
        - presentOnCreate
        - projectVersionId
        - subpopulationFilters
        - types
        - usesMlModel
        - usesTrainingDataset
        - usesValidationDataset
        - usesReferenceDataset
        - usesProductionData
        - value
    Project:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The project id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        workspaceId:
          type: string
          nullable: true
          format: uuid
          readOnly: true
          description: The workspace id.
          example: 055fddb1-261f-4654-8598-f6347ee46a09
        creatorId:
          type: string
          nullable: true
          format: uuid
          readOnly: true
          description: The project creator id.
          example: 589ece63-49a2-41b4-98e1-10547761d4b0
        name:
          type: string
          maxLength: 64
          description: The project name.
          example: My Project
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The project creation date.
          example: '2024-03-22T11:31:01.185Z'
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The project last updated date.
          example: '2024-03-22T11:31:01.185Z'
        description:
          type: string
          maxLength: 280
          nullable: true
          description: The project description.
          example: My project description.
        purpose:
          type: string
          nullable: true
          description: What the system in this project is intended to do.
          example: Answer customer billing questions.
        modelTypes:
          type: array
          nullable: true
          items:
            type: string
          description: The kinds of model used in this project.
          example:
            - llm
        modelDeveloper:
          type: string
          nullable: true
          description: Who developed the model used in this project.
          example: Acme AI
        dataRetentionDays:
          type: integer
          nullable: true
          minimum: 3
          description: |
            Number of days to retain monitoring data for this project. Null means data is retained indefinitely.
          example: 30
        source:
          type: string
          readOnly: true
          nullable: true
          enum:
            - web
            - api
            - null
          description: The source of the project.
        taskType:
          type: string
          enum:
            - llm-base
            - tabular-classification
            - tabular-regression
            - text-classification
          description: The task type of the project.
        versionCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of versions (commits) in the project.
          example: 2
        inferencePipelineCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of inference pipelines in the project.
          example: 1
        goalCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The total number of tests in the project.
          example: 10
        developmentGoalCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of tests in the development mode of the project.
          example: 5
        monitoringGoalCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of tests in the monitoring mode of the project.
          example: 5
        links:
          type: object
          readOnly: true
          required:
            - app
          properties:
            app:
              type: string
              example: 'https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6'
          description: Links to the project.
        gitRepo:
          $ref: '#/components/schemas/GitRepo'
          readOnly: true
          nullable: true
      required:
        - id
        - workspaceId
        - creatorId
        - name
        - dateCreated
        - dateUpdated
        - source
        - taskType
        - versionCount
        - inferencePipelineCount
        - goalCount
        - developmentGoalCount
        - monitoringGoalCount
        - links
    ProjectVersion:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The project version (commit) id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The project version (commit) creation date.
          example: '2024-03-22T11:31:01.185Z'
        status:
          type: string
          readOnly: true
          enum:
            - queued
            - running
            - paused
            - failed
            - completed
            - unknown
          description: 'The commit status. Initially, the commit is `queued`, then, it switches to `running`. Finally, it can be `paused`, `failed`, or `completed`.'
          example: completed
        statusMessage:
          type: string
          nullable: true
          readOnly: true
          description: The commit status message.
          example: Commit successfully processed.
        projectId:
          type: string
          format: uuid
          readOnly: true
          description: The project id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        storageUri:
          type: string
          nullable: false
          writeOnly: true
          description: The storage URI where the commit bundle is stored.
          example: 's3://...'
        commit:
          type: object
          required:
            - id
            - authorId
            - message
            - mlModelId
            - validationDatasetId
            - trainingDatasetId
            - fileSize
            - storageUri
          description: The details of a commit (project version).
          properties:
            id:
              type: string
              format: uuid
              readOnly: true
              description: The commit id.
              example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            authorId:
              type: string
              format: uuid
              readOnly: true
              description: The author id of the commit.
              example: 589ece63-49a2-41b4-98e1-10547761d4b0
            dateCreated:
              type: string
              format: date-time
              readOnly: true
              description: The commit creation date.
              example: '2024-03-22T11:31:01.185Z'
            fileSize:
              type: integer
              readOnly: true
              nullable: true
              description: The size of the commit bundle in bytes.
              example: 1024
            message:
              type: string
              description: The commit message.
              example: Updated the prompt.
            mlModelId:
              type: string
              format: uuid
              nullable: true
              readOnly: true
              description: The model id.
              example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            validationDatasetId:
              type: string
              format: uuid
              nullable: true
              readOnly: true
              description: The validation dataset id.
              example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            trainingDatasetId:
              type: string
              format: uuid
              nullable: true
              readOnly: true
              description: The training dataset id.
              example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            storageUri:
              type: string
              nullable: false
              readOnly: true
              description: The storage URI where the commit bundle is stored.
              example: 's3://...'
            gitCommitSha:
              type: integer
              readOnly: true
              description: The SHA of the corresponding git commit.
              example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            gitCommitRef:
              type: string
              readOnly: true
              description: The ref of the corresponding git commit.
              example: main
            gitCommitUrl:
              type: string
              readOnly: true
              description: The URL of the corresponding git commit.
        deploymentStatus:
          type: string
          maxLength: 30
          description: The deployment status associated with the commit's model.
          example: Deployed
        mlModelId:
          type: string
          format: uuid
          nullable: true
          readOnly: true
          description: The model id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        validationDatasetId:
          type: string
          format: uuid
          nullable: true
          readOnly: true
          description: The validation dataset id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        trainingDatasetId:
          type: string
          format: uuid
          nullable: true
          readOnly: true
          description: The training dataset id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        archived:
          type: boolean
          nullable: true
          description: Whether the commit is archived.
          example: false
        dateArchived:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: The commit archive date.
          example: '2024-03-22T11:31:01.185Z'
        passingGoalCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of tests that are passing for the commit.
          example: 5
        failingGoalCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of tests that are failing for the commit.
          example: 1
        totalGoalCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The total number of tests for the commit.
          example: 6
        links:
          type: object
          readOnly: true
          required:
            - app
          properties:
            app:
              type: string
              example: 'https://app.openlayer.com/myWorkspace/3fa85f64-5717-4562-b3fc-2c963f66afa6'
      required:
        - id
        - dateCreated
        - status
        - statusMessage
        - projectId
        - commit
        - storageUri
        - mlModelId
        - validationDatasetId
        - trainingDatasetId
        - dateArchived
        - passingGoalCount
        - failingGoalCount
        - totalGoalCount
    CollectionMeta:
      type: object
      properties:
        page:
          type: integer
          minimum: 1
          default: 1
          description: The current page.
        perPage:
          type: integer
          minimum: 1
          maximum: 100
          default: 25
          description: The number of items per page.
        totalItems:
          type: integer
          minimum: 0
          description: The total number of items.
        totalPages:
          type: integer
          minimum: 0
          description: The total number of pages.
      required:
        - page
        - perPage
        - totalItems
        - totalPages
    LLMData:
      title: LLM
      type: object
      properties:
        numOfTokenColumnName:
          type: string
          description: Name of the column with the total number of tokens.
          example: num_tokens
          nullable: true
        contextColumnName:
          type: string
          description: Name of the column with the context retrieved. Applies to RAG use cases. Providing the context enables RAG-specific metrics.
          example: context
        costColumnName:
          type: string
          description: Name of the column with the cost associated with each row.
          example: cost
        groundTruthColumnName:
          type: string
          description: Name of the column with the ground truths.
          example: ground_truth
        inferenceIdColumnName:
          type: string
          description: 'Name of the column with the inference ids. This is useful if you want to update rows at a later point in time. If not provided, a unique id is generated by Openlayer.'
          example: id
        inputVariableNames:
          type: array
          description: Array of input variable names. Each input variable should be a dataset column.
          example:
            - user_query
          items:
            type: string
        latencyColumnName:
          type: string
          description: Name of the column with the latencies.
          example: latency
        metadata:
          type: object
          description: Object with metadata.
        outputColumnName:
          type: string
          description: Name of the column with the model outputs.
          example: output
        prompt:
          type: array
          description: Prompt for the LLM.
          example:
            - role: user
              content: '{{ user_query }}'
          items:
            type: object
            properties:
              role:
                type: string
                description: Role of the prompt.
                example: user
              content:
                type: string
                description: Content of the prompt.
                example: '{{ user_query }}'
        questionColumnName:
          type: string
          description: Name of the column with the questions. Applies to RAG use cases. Providing the question enables RAG-specific metrics.
          example: question
        timestampColumnName:
          type: string
          description: 'Name of the column with the timestamps. Timestamps must be in UNIX sec format. If not provided, the upload timestamp is used.'
          example: timestamp
        userIdColumnName:
          type: string
          description: Name of the column with the user id.
          nullable: true
          example: user_id
        sessionIdColumnName:
          type: string
          description: Name of the column with the session id.
          nullable: true
          example: session_id
      required:
        - outputColumnName
    TabularClassificationData:
      title: Tabular classification
      type: object
      properties:
        categoricalFeatureNames:
          type: array
          description: 'Array with the names of all categorical features in the dataset. E.g. ["Age", "Geography"].'
          example:
            - Geography
          items:
            type: string
        classNames:
          type: array
          description: 'List of class names indexed by label integer in the dataset. E.g. ["Retained", "Exited"] when 0, 1 are in your label column.'
          example:
            - Retained
            - Exited
          items:
            type: string
        featureNames:
          type: array
          description: Array with all input feature names.
          example:
            - Age
            - Geography
          items:
            type: string
        inferenceIdColumnName:
          type: string
          description: 'Name of the column with the inference ids. This is useful if you want to update rows at a later point in time. If not provided, a unique id is generated by Openlayer.'
          example: id
        labelColumnName:
          type: string
          description: 'Name of the column with the labels. The data in this column must be **zero-indexed integers**, matching the list provided in `classNames`.'
          example: label
        latencyColumnName:
          type: string
          description: Name of the column with the latencies.
          example: latency
        metadata:
          type: object
          description: Object with metadata.
        predictionsColumnName:
          type: string
          description: Name of the column with the model's predictions as **zero-indexed integers**.
          example: prediction
        predictionScoresColumnName:
          type: string
          description: Name of the column with the model's predictions as **lists of class probabilities**.
          example: prediction_scores
        timestampColumnName:
          type: string
          description: 'Name of the column with the timestamps. Timestamps must be in UNIX sec format. If not provided, the upload timestamp is used.'
          example: timestamp
      required:
        - classNames
    TabularRegressionData:
      title: Tabular regression
      type: object
      properties:
        categoricalFeatureNames:
          type: array
          description: 'Array with the names of all categorical features in the dataset. E.g. ["Gender", "Geography"].'
          example:
            - Gender
            - Geography
          items:
            type: string
        featureNames:
          type: array
          description: Array with all input feature names.
          items:
            type: string
        inferenceIdColumnName:
          type: string
          description: 'Name of the column with the inference ids. This is useful if you want to update rows at a later point in time. If not provided, a unique id is generated by Openlayer.'
          example: id
        latencyColumnName:
          type: string
          description: Name of the column with the latencies.
          example: latency
        metadata:
          type: object
          description: Object with metadata.
        predictionsColumnName:
          type: string
          description: Name of the column with the model's predictions.
          example: prediction
        targetColumnName:
          type: string
          description: Name of the column with the targets (ground truth values).
          example: target
        timestampColumnName:
          type: string
          description: 'Name of the column with the timestamps. Timestamps must be in UNIX sec format. If not provided, the upload timestamp is used.'
          example: timestamp
    TextClassificationData:
      title: Text classification
      type: object
      properties:
        classNames:
          type: array
          description: 'List of class names indexed by label integer in the dataset. E.g. ["Retained", "Exited"] when 0, 1 are in your label column.'
          example:
            - Retained
            - Exited
          items:
            type: string
        inferenceIdColumnName:
          type: string
          description: 'Name of the column with the inference ids. This is useful if you want to update rows at a later point in time. If not provided, a unique id is generated by Openlayer.'
          example: id
        labelColumnName:
          type: string
          description: 'Name of the column with the labels. The data in this column must be **zero-indexed integers**, matching the list provided in `classNames`.'
          example: label
        latencyColumnName:
          type: string
          description: Name of the column with the latencies.
          example: latency
        metadata:
          type: object
          description: Object with metadata.
        predictionsColumnName:
          type: string
          description: Name of the column with the model's predictions as **zero-indexed integers**.
          example: prediction
        predictionScoresColumnName:
          type: string
          description: Name of the column with the model's predictions as **lists of class probabilities**.
          example: prediction_scores
        textColumnName:
          type: string
          description: Name of the column with the text data.
          example: user_query
        timestampColumnName:
          type: string
          description: 'Name of the column with the timestamps. Timestamps must be in UNIX sec format. If not provided, the upload timestamp is used.'
          example: timestamp
      required:
        - classNames
    DatastreamConfigUpdate:
      type: object
      properties:
        inferenceIdColumnName:
          type: string
          description: 'Name of the column with the inference ids. This is useful if you want to update rows at a later point in time. If not provided, a unique id is generated by Openlayer.'
          example: id
          writeOnly: true
          nullable: true
        latencyColumnName:
          type: string
          description: Name of the column with the latencies.
          example: latency
          nullable: true
        timestampColumnName:
          type: string
          nullable: true
          description: 'Name of the column with the timestamps. Timestamps must be in UNIX sec format. If not provided, the upload timestamp is used.'
          example: timestamp
        groundTruthColumnName:
          type: string
          description: Name of the column with the ground truths.
          example: ground_truth
          nullable: true
        humanFeedbackColumnName:
          type: string
          description: Name of the column with human feedback.
          example: human_feedback
          nullable: true
    Workspace:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The workspace id.
          readOnly: true
        name:
          type: string
          maxLength: 80
          example: Openlayer
          description: The workspace name.
        slug:
          type: string
          maxLength: 32
          example: openlayer
          pattern: '^[a-z0-9]+(?:-[a-z0-9]+)*$'
          description: The workspace slug.
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The workspace creation date.
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The workspace last updated date.
        creatorId:
          type: string
          format: uuid
          nullable: true
          readOnly: true
          description: The workspace creator id.
        inviteCode:
          type: string
          nullable: false
          writeOnly: true
          description: The workspace invite code.
        wildcardDomains:
          type: array
          items:
            type: string
        projectCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of projects in the workspace.
        memberCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of members in the workspace.
        monthlyUsage:
          type: array
          readOnly: true
          items:
            type: object
            properties:
              monthYear:
                type: string
                format: date
              predictionCount:
                type: integer
                minimum: 0
              executionTimeMs:
                type: integer
                nullable: true
                minimum: 0
        inviteCount:
          type: integer
          minimum: 0
          readOnly: true
          description: The number of invites in the workspace.
        periodStartDate:
          type: string
          nullable: true
          format: date-time
          readOnly: true
          description: The start date of the current billing period.
        periodEndDate:
          type: string
          nullable: true
          format: date-time
          readOnly: true
          description: The end date of the current billing period.
        samlOnlyAccess:
          type: boolean
          description: Whether the workspace only allows SAML authentication.
        status:
          type: string
          enum:
            - active
            - past_due
            - unpaid
            - canceled
            - incomplete
            - incomplete_expired
            - trialing
            - paused
          readOnly: true
      required:
        - id
        - name
        - slug
        - dateCreated
        - dateUpdated
        - creatorId
        - projectCount
        - memberCount
        - inviteCount
        - periodStartDate
        - periodEndDate
        - status
    Invite:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The invite id.
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The invite creation date.
        creator:
          type: object
          properties:
            id:
              type: string
              format: uuid
              readOnly: true
              description: The invite creator id.
            username:
              type: string
              nullable: true
              maxLength: 64
              example: user123
              description: The invite creator username.
            name:
              type: string
              nullable: true
              maxLength: 120
              example: Rishab Ramanathan
              description: The invite creator name.
        status:
          type: string
          enum:
            - accepted
            - pending
          description: The invite status.
        workspace:
          type: object
          readOnly: true
          required:
            - id
            - name
            - slug
            - dateCreated
            - memberCount
          properties:
            id:
              type: string
              format: uuid
              readOnly: true
            name:
              type: string
              maxLength: 20
              example: Openlayer
            slug:
              type: string
              maxLength: 20
              example: openlayer
              pattern: '^[a-z0-9]+(?:-[a-z0-9]+)*$'
            dateCreated:
              type: string
              format: date-time
              readOnly: true
            memberCount:
              type: integer
              minimum: 0
              readOnly: true
        email:
          type: string
          format: email
          maxLength: 120
          example: user@email.com
          description: The invite email.
        role:
          type: string
          enum:
            - ADMIN
            - MEMBER
            - VIEWER
          description: The invite role.
      required:
        - id
        - dateCreated
        - creator
        - status
        - workspace
        - email
        - role
    Member:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The member id.
        name:
          type: string
          nullable: true
          maxLength: 120
          readOnly: true
          description: The member name.
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: The member creation date.
        email:
          type: string
          format: email
          maxLength: 120
          example: user@email.com
          description: The member email.
        membership:
          type: object
          required:
            - role
            - username
            - dateCreated
            - dateUpdated
          properties:
            role:
              type: string
              enum:
                - ADMIN
                - MEMBER
                - VIEWER
              description: The member role.
            username:
              type: string
              maxLength: 64
              example: user123
              description: The member username.
            dateCreated:
              type: string
              format: date-time
              readOnly: true
              description: The member creation date.
            dateUpdated:
              type: string
              format: date-time
              readOnly: true
              description: The member update date.
      required:
        - id
        - name
        - dateCreated
        - email
        - membership
    DataBackend:
      oneOf:
        - title: BigQueryDataBackend
          type: object
          properties:
            backendType:
              type: string
              nullable: false
              enum:
                - bigquery
            bigqueryConnectionId:
              type: string
              format: uuid
              nullable: true
            projectId:
              type: string
              nullable: false
              maxLength: 120
              example: my-project
            datasetId:
              type: string
              nullable: false
              maxLength: 120
              example: my-dataset
            tableId:
              type: string
              nullable: true
              maxLength: 120
              example: my-table
            partitionType:
              type: string
              nullable: true
              enum:
                - DAY
                - MONTH
                - YEAR
            config:
              $ref: '#/components/schemas/DatastreamConfigUpdate'
              writeOnly: true
          required:
            - backendType
            - bigqueryConnectionId
            - projectId
            - datasetId
            - tableId
            - config
        - title: DefaultDataBackend
          type: object
          properties:
            backendType:
              type: string
              nullable: false
              enum:
                - default
          required:
            - backendType
        - title: SnowflakeDataBackend
          type: object
          properties:
            backendType:
              type: string
              nullable: false
              enum:
                - snowflake
            snowflakeConnectionId:
              type: string
              format: uuid
              nullable: true
            database:
              type: string
              nullable: false
              maxLength: 120
              example: my-database
            schema:
              type: string
              nullable: false
              maxLength: 120
              example: my-schema
            table:
              type: string
              nullable: true
              maxLength: 120
              example: my-table
            config:
              $ref: '#/components/schemas/DatastreamConfigUpdate'
              writeOnly: true
          required:
            - backendType
            - snowflakeConnectionId
            - database
            - schema
            - table
            - config
        - title: DatabricksDtlDataBackend
          type: object
          properties:
            backendType:
              type: string
              nullable: false
              enum:
                - databricks_dtl
            databricksDtlConnectionId:
              type: string
              format: uuid
              nullable: true
            tableId:
              type: string
              nullable: true
              maxLength: 120
              example: my-table
            config:
              $ref: '#/components/schemas/DatastreamConfigUpdate'
              writeOnly: true
          required:
            - backendType
            - databricksDtlConnectionId
            - tableId
            - config
        - title: RedshiftDataBackend
          type: object
          properties:
            backendType:
              type: string
              nullable: false
              enum:
                - redshift
            redshiftConnectionId:
              type: string
              format: uuid
              nullable: true
            schemaName:
              type: string
              nullable: false
            tableName:
              type: string
              nullable: false
            config:
              $ref: '#/components/schemas/DatastreamConfigUpdate'
              writeOnly: true
          required:
            - backendType
            - redshiftConnectionId
            - schemaName
            - tableName
            - config
        - title: PostgresDataBackend
          type: object
          properties:
            backendType:
              type: string
              nullable: false
              enum:
                - postgres
            postgresConnectionId:
              type: string
              format: uuid
              nullable: true
            database:
              type: string
              nullable: false
              maxLength: 120
              example: my-database
            schema:
              type: string
              nullable: false
              maxLength: 120
              example: my-schema
            table:
              type: string
              nullable: true
              maxLength: 120
              example: my-table
            config:
              $ref: '#/components/schemas/DatastreamConfigUpdate'
              writeOnly: true
          required:
            - backendType
            - postgresConnectionId
            - database
            - schema
            - table
            - config
    UserAggregation:
      type: object
      description: 'A user who has interacted with an inference pipeline, with their activity stats: session and record counts, token usage, and cost.'
      required:
        - id
        - dateOfFirstRecord
        - dateOfLastRecord
        - sessions
        - records
        - tokens
        - cost
      properties:
        id:
          type: string
          description: The unique user identifier
          example: user123
        dateOfFirstRecord:
          type: string
          format: date-time
          description: Timestamp of the user's first event/trace
          example: '2021-12-31T08:00:00Z'
        dateOfLastRecord:
          type: string
          format: date-time
          description: Timestamp of the user's last event/trace
          example: '2022-01-02T08:00:00Z'
        sessions:
          type: integer
          description: Count of unique sessions for this user
          example: 3
        records:
          type: integer
          description: Total number of traces/rows for this user
          example: 15
        tokens:
          type: number
          format: float
          description: Total token count for this user
          example: 5250
        cost:
          type: number
          format: float
          description: Total cost for this user
          example: 0.125
    Framework:
      type: object
      description: |
        A set of rules, drawn from a regulation, a standard, or your own internal policy, that Openlayer tracks compliance against. Openlayer ships built-in frameworks, and you can create your own.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The framework id.
          example: 9f1b3c2d-4e5a-4f60-8a71-2b3c4d5e6f70
        workspaceId:
          type: string
          format: uuid
          readOnly: true
          description: The id of the workspace the framework belongs to.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        creatorId:
          type: string
          format: uuid
          nullable: true
          readOnly: true
          description: The user who created the framework. `null` for built-in frameworks.
        name:
          type: string
          maxLength: 255
          description: The framework name.
          example: EU AI Act
        description:
          type: string
          nullable: true
          maxLength: 5000
          description: A short description of the framework.
          example: Requirements for high-risk AI systems under the EU AI Act.
        extendedDescription:
          type: object
          nullable: true
          additionalProperties: true
          description: 'A longer, rich-text description, as a TipTap JSON document.'
        href:
          type: string
          nullable: true
          maxLength: 2048
          description: A link to the external standard or regulation the framework is based on.
        enabled:
          type: boolean
          default: false
          description: |
            Whether the framework is active. Rules of a disabled framework are not evaluated and do not count towards compliance.
        avatar:
          type: object
          nullable: true
          description: The icon shown for the framework.
          required:
            - type
            - value
          properties:
            type:
              type: string
              enum:
                - emoji
                - imageUrl
                - builtinImage
              example: emoji
            value:
              type: string
              example: "\U0001F9ED"
        builtInSlug:
          type: string
          nullable: true
          description: |
            Identifies a framework that ships with Openlayer, for example `eu_ai_act`, `iso_42001`, `nist_ai_rmf`, or `traiga`. `null` for frameworks you create yourself.
          example: eu_ai_act
        immutable:
          type: boolean
          readOnly: true
          description: |
            Whether the framework definition is managed by Openlayer. For these frameworks only `enabled`, `tags`, and `projectSelector` can be changed.
        projectSelector:
          type: object
          nullable: true
          description: |
            Determines which projects the framework applies to. An empty or `null` `match` array applies the framework to every project in the workspace.
          properties:
            match:
              type: array
              nullable: true
              maxItems: 10
              description: 'Match criteria, ANDed together.'
              items:
                type: object
                required:
                  - property
                  - value
                properties:
                  property:
                    type: string
                    description: The project property to match against.
                    enum:
                      - taskType
                      - riskLevel
                      - riskTotalScore
                      - name
                      - ownerId
                      - modelTypes
                  operator:
                    type: string
                    default: equals
                    description: |
                      How to compare the project property with `value`. One of `equals`, `notEquals`, `contains`, `notContains`, `startsWith`, `endsWith`, `in`, `notIn`, `greaterThan`, `greaterThanOrEqual`, `lessThan`, `lessThanOrEqual`, `equalsIgnoreCase`, `containsIgnoreCase`, `matches`, `exists`, or `notExists`.
                  value:
                    nullable: true
                    description: |
                      The value to match against. Pass an array to match any of several values, or `null` to match projects where the property is unset. Omit it for `exists` and `notExists`.
              example:
                - property: riskLevel
                  value:
                    - high
                    - critical
        tags:
          type: array
          default: []
          description: Free-form labels on the framework.
          items:
            type: string
          example:
            - regulation
            - eu
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The creation date.
          example: '2026-03-22T11:31:01.185Z'
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The last update date.
          example: '2026-03-22T11:31:01.185Z'
        ruleStats:
          readOnly: true
          description: |
            Compliance roll-up for the framework. Present only on `GET /workspaces/{workspaceId}/frameworks` when the request sets `includeRuleStats=true`.
          allOf:
            - $ref: '#/components/schemas/FrameworkRuleStats'
      required:
        - id
        - workspaceId
        - name
        - enabled
        - tags
        - dateCreated
        - dateUpdated
    FrameworkRuleStats:
      type: object
      properties:
        ruleResults:
          description: |
            Rule result counts by status for this framework, matching what `/workspaces/{workspaceId}/rule-stats?frameworkId=<id>` reports. Narrowed to a single project when the request also carries `projectId`.
          allOf:
            - $ref: '#/components/schemas/RuleResultStatusCounts'
        projectCompletion:
          type: object
          description: |
            How many of the framework's projects fall into each completion band, where a project's completion is the share of its rule results that are passing or skipped. Projects with no evaluated results count as `low`.

            Zeroed when the request carries `projectId`: the bands compare a framework's projects against each other, which says nothing about a single project.
          properties:
            high:
              type: integer
              minimum: 0
              description: Projects at 80% completion or above.
            mid:
              type: integer
              minimum: 0
              description: Projects at or above 20% but below 80% completion.
            low:
              type: integer
              minimum: 0
              description: Projects below 20% completion.
          required:
            - high
            - mid
            - low
      required:
        - ruleResults
        - projectCompletion
    FrameworkDocument:
      type: object
      description: |
        The text of the standard a framework is based on, split into sections and subsections, with the rules mapped to each part.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The document id.
          example: 4a6c8e0f-1b2d-4e3f-9a5b-6c7d8e9f0a1b
        frameworkId:
          type: string
          format: uuid
          readOnly: true
          description: The framework the document belongs to.
        title:
          type: string
          maxLength: 512
          description: The document title.
          example: EU AI Act -- Regulation (EU) 2024/1689
        sections:
          type: array
          readOnly: true
          description: |
            The document's sections, in display order. Only returned when retrieving a single document.
          items:
            $ref: '#/components/schemas/FrameworkDocumentSection'
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The creation date.
          example: '2026-03-22T11:31:01.185Z'
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The last update date.
          example: '2026-03-22T11:31:01.185Z'
      required:
        - id
        - frameworkId
        - title
        - dateCreated
        - dateUpdated
    FrameworkDocumentSection:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The section id.
          example: 2e4f6a8c-9b1d-4c3e-8f5a-7b9c0d1e2f3a
        documentId:
          type: string
          format: uuid
          readOnly: true
          description: The document the section belongs to.
        number:
          type: string
          maxLength: 64
          description: The section number as it appears in the source standard.
          example: Article 9
        title:
          type: string
          maxLength: 512
          description: The section title.
          example: Risk management system
        text:
          type: string
          nullable: true
          description: The section text.
        sortOrder:
          type: integer
          default: 0
          description: The position of the section within the document.
        ruleCount:
          type: integer
          minimum: 0
          readOnly: true
          description: |
            How many rules are linked to this section, including its subsections. Use it to decide whether to fetch the section's rules.
        rules:
          type: array
          readOnly: true
          description: The rules linked directly to this section.
          items:
            $ref: '#/components/schemas/FrameworkDocumentRule'
        subsections:
          type: array
          readOnly: true
          description: 'The section''s subsections, in display order.'
          items:
            $ref: '#/components/schemas/FrameworkDocumentSubsection'
      required:
        - id
        - documentId
        - number
        - title
        - sortOrder
    FrameworkDocumentSubsection:
      type: object
      description: |
        A subsection usually states one individual requirement of the standard, so it is where you see which rules cover a specific clause.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The subsection id.
          example: 1d3f5a7b-8c9e-4b2d-9f6a-0c1e2d3f4a5b
        sectionId:
          type: string
          format: uuid
          readOnly: true
          description: The section the subsection belongs to.
        number:
          type: string
          maxLength: 64
          description: The subsection number as it appears in the source standard.
          example: '9.2'
        title:
          type: string
          maxLength: 512
          description: The subsection title.
          example: Identification of known and foreseeable risks
        text:
          type: string
          nullable: true
          description: The subsection text. This is the requirement your rules are mapped against.
        sortOrder:
          type: integer
          default: 0
          description: The position of the subsection within its section.
        ruleCount:
          type: integer
          minimum: 0
          readOnly: true
          description: How many rules are linked to this subsection.
        rules:
          type: array
          readOnly: true
          description: The rules linked to this subsection.
          items:
            $ref: '#/components/schemas/FrameworkDocumentRule'
      required:
        - id
        - sectionId
        - number
        - title
        - sortOrder
    FrameworkDocumentRule:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/Rule/properties/id'
        name:
          $ref: '#/components/schemas/Rule/properties/name'
        description:
          $ref: '#/components/schemas/Rule/properties/description'
        scope:
          $ref: '#/components/schemas/Rule/properties/scope'
        type:
          $ref: '#/components/schemas/Rule/properties/type'
        evidenceType:
          $ref: '#/components/schemas/Rule/properties/evidenceType'
        renewalCadenceDays:
          $ref: '#/components/schemas/Rule/properties/renewalCadenceDays'
        automationType:
          $ref: '#/components/schemas/Rule/properties/automationType'
        automationParams:
          $ref: '#/components/schemas/Rule/properties/automationParams'
        deactivated:
          $ref: '#/components/schemas/Rule/properties/deactivated'
        immutable:
          $ref: '#/components/schemas/Rule/properties/immutable'
        dateCreated:
          $ref: '#/components/schemas/Rule/properties/dateCreated'
        dateUpdated:
          $ref: '#/components/schemas/Rule/properties/dateUpdated'
      required:
        - id
        - name
        - scope
        - type
    Rule:
      type: object
      description: |
        A single requirement Openlayer tracks. `platform` rules are evaluated automatically from the state of your workspace, and `evidence` rules are satisfied by attaching evidence. A rule can belong to several frameworks, or to none.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The rule id.
          example: 7c9a1e2b-3d4f-4a5b-8c6d-7e8f9a0b1c2d
        workspaceId:
          type: string
          format: uuid
          readOnly: true
          description: The id of the workspace the rule belongs to.
        name:
          type: string
          maxLength: 255
          description: The rule name.
          example: Monitoring enabled
        description:
          type: string
          nullable: true
          description: What the rule requires.
          example: Each project must have Openlayer monitoring mode enabled.
        scope:
          type: string
          enum:
            - project
            - workspace
          description: |
            Whether the rule is evaluated once for the whole workspace, or once per project the rule's frameworks apply to. Must be `project` for platform rules. Fixed once the rule is created.
          example: project
        type:
          type: string
          enum:
            - platform
            - evidence
          description: |
            `platform` rules are evaluated automatically from the state of your Openlayer workspace. `evidence` rules are satisfied by attaching evidence. Fixed once the rule is created.
          example: platform
        evidenceType:
          type: string
          nullable: true
          enum:
            - document
            - text
            - url
            - categoryValue
            - null
          description: |
            The kind of evidence that satisfies the rule. Set it for evidence rules; omit or `null` for platform rules. Fixed once the rule is created.
        renewalCadenceDays:
          type: integer
          nullable: true
          minimum: 1
          description: |
            How often evidence must be renewed, in days. Once evidence is older than this, the rule result becomes `due_soon` and then `failing`. The window restarts whenever evidence is attached. Omit or `null` for platform rules.
          example: 90
        automationType:
          type: string
          nullable: true
          description: |
            Which workspace signal a platform rule checks, for example `monitoring_mode_enabled`, `test_setup`, or `project_owner_set`. Set it for platform rules; omit or `null` for evidence rules. Fixed once the rule is created.
          example: monitoring_mode_enabled
        automationParams:
          type: object
          nullable: true
          additionalProperties: true
          description: |
            Configuration for the platform check, when the automation takes parameters. Omit or `null` for evidence rules. Fixed once the rule is created.
        deactivated:
          type: boolean
          default: false
          description: Whether the rule is excluded from compliance calculations.
        assigneeId:
          type: string
          format: uuid
          nullable: true
          description: The user responsible for satisfying the rule.
        tagIds:
          type: array
          nullable: true
          writeOnly: true
          description: |
            The ids of the rule tags to associate with the rule. Replaces the rule's tags. Read them back from `tags`, and list the tags available in the workspace with `GET /workspaces/{workspaceId}/rule-tags`.
          items:
            type: string
            format: uuid
        tags:
          type: array
          nullable: true
          readOnly: true
          description: The rule tags associated with the rule.
          items:
            $ref: '#/components/schemas/RuleTag'
        frameworks:
          type: array
          readOnly: true
          description: The frameworks that include this rule.
          items:
            type: object
            required:
              - id
              - name
              - avatar
              - builtInSlug
              - enabled
            properties:
              id:
                $ref: '#/components/schemas/Framework/properties/id'
              name:
                $ref: '#/components/schemas/Framework/properties/name'
              avatar:
                $ref: '#/components/schemas/Framework/properties/avatar'
              builtInSlug:
                $ref: '#/components/schemas/Framework/properties/builtInSlug'
              enabled:
                $ref: '#/components/schemas/Framework/properties/enabled'
        results:
          type: array
          readOnly: true
          description: |
            The rule's results, one per entity the rule is evaluated against. Only returned when `includeResults` is `true`.
          items:
            $ref: '#/components/schemas/RuleResult'
        resultsSummary:
          type: object
          nullable: true
          readOnly: true
          description: |
            Pass-rate counts across all of the rule's entities, independent of any status filter applied to the request.
          properties:
            passing:
              type: integer
              minimum: 0
            total:
              type: integer
              minimum: 0
        immutable:
          type: boolean
          readOnly: true
          description: |
            Whether the rule is managed by Openlayer. These rules can't be renamed or deleted; set `deactivated` to exclude one from compliance instead.
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The creation date.
          example: '2026-03-22T11:31:01.185Z'
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The last update date.
          example: '2026-03-22T11:31:01.185Z'
      required:
        - id
        - workspaceId
        - name
        - scope
        - type
        - dateCreated
        - dateUpdated
    RuleTag:
      type: object
      description: 'A label that groups rules across frameworks, for example by team or control family.'
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The rule tag id.
          example: 6e8a0c2d-4f5b-4a3c-9d7e-8f0a1b2c3d4e
        workspaceId:
          type: string
          format: uuid
          readOnly: true
          description: The id of the workspace the tag belongs to.
        creatorId:
          type: string
          format: uuid
          nullable: true
          readOnly: true
          description: The user who created the tag. `null` for tags that ship with Openlayer.
        name:
          type: string
          maxLength: 255
          description: The tag name.
          example: Evaluation
        color:
          type: string
          maxLength: 50
          nullable: true
          description: The color the tag is displayed with.
        immutable:
          type: boolean
          default: false
          readOnly: true
          description: Whether the tag is managed by Openlayer. These tags can't be deleted.
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The creation date.
          example: '2026-03-22T11:31:01.185Z'
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The last update date.
          example: '2026-03-22T11:31:01.185Z'
      required:
        - id
        - workspaceId
        - creatorId
        - name
        - immutable
        - dateCreated
        - dateUpdated
    RuleResult:
      type: object
      description: |
        The compliance status of one rule for one entity: a project for project-scoped rules, or the workspace for workspace-scoped rules.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The rule result id.
          example: 5b7d9f1a-2c3e-4d5f-8a6b-9c0d1e2f3a4b
        workspaceId:
          type: string
          format: uuid
          readOnly: true
          description: The id of the workspace the rule result belongs to.
        ruleId:
          type: string
          format: uuid
          readOnly: true
          description: The rule this result belongs to.
        projectId:
          type: string
          format: uuid
          nullable: true
          readOnly: true
          description: The project this result was evaluated for. `null` for workspace-scoped rules.
        status:
          type: string
          enum:
            - running
            - passing
            - failing
            - skipped
            - error
            - pending
            - due_soon
          description: |
            The compliance status of the rule for this entity. Computed by Openlayer and can't be set directly.
          example: passing
        statusMessage:
          type: string
          nullable: true
          description: A human-readable explanation of the status.
        dateLastEvaluated:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: When the rule was last evaluated. Platform rules only.
        dateOfNextEvaluation:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: When the rule will next be evaluated. Platform rules only.
        dateOfLatestEvidence:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: When the most recent piece of evidence was attached. Evidence rules only.
        dateOfRenewal:
          type: string
          format: date-time
          nullable: true
          readOnly: true
          description: When the evidence must be renewed. Evidence rules with a renewal cadence only.
        deactivated:
          type: boolean
          default: false
          description: |
            Whether this result is excluded from compliance calculations. Excludes just this result, without deactivating the rule everywhere.
        deactivatedReason:
          type: string
          nullable: true
          description: Why the result was excluded. Required when setting `deactivated` to `true`.
        assigneeId:
          type: string
          format: uuid
          nullable: true
          description: The user responsible for this result.
        blockedBy:
          type: array
          default: []
          description: Rule results that must pass before this one can be satisfied.
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              status:
                $ref: '#/components/schemas/RuleResult/properties/status'
        blocking:
          type: array
          default: []
          description: Rule results that this one blocks.
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              status:
                $ref: '#/components/schemas/RuleResult/properties/status'
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The creation date.
          example: '2026-03-22T11:31:01.185Z'
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The last update date.
          example: '2026-03-22T11:31:01.185Z'
      required:
        - id
        - workspaceId
        - ruleId
        - status
        - deactivated
        - dateCreated
        - dateUpdated
    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
    RuleStatistic:
      type: object
      description: |
        Counts of rules and their results by status. Narrowed by the request's filters, so `frameworkId` gives one framework's compliance and `projectId` gives one project's.
      properties:
        rules:
          type: object
          description: 'Counts of the rules themselves, after any filters in the request.'
          properties:
            total:
              type: integer
              minimum: 0
              description: The total number of rules.
            byType:
              type: object
              description: Rule counts by type.
              properties:
                platform:
                  type: integer
                  minimum: 0
                evidence:
                  type: integer
                  minimum: 0
            byScope:
              type: object
              description: Rule counts by scope.
              properties:
                project:
                  type: integer
                  minimum: 0
                workspace:
                  type: integer
                  minimum: 0
        ruleResults:
          description: |
            Counts of rule results, after any filters in the request, with breakdowns by the type and scope of the rule each result belongs to.
          allOf:
            - $ref: '#/components/schemas/RuleResultStatusCounts'
            - type: object
              properties:
                byRuleType:
                  type: object
                  properties:
                    platform:
                      $ref: '#/components/schemas/RuleResultStatusCounts'
                    evidence:
                      $ref: '#/components/schemas/RuleResultStatusCounts'
                byRuleScope:
                  type: object
                  properties:
                    project:
                      $ref: '#/components/schemas/RuleResultStatusCounts'
                    workspace:
                      $ref: '#/components/schemas/RuleResultStatusCounts'
      required:
        - rules
        - ruleResults
    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
    Evidence:
      type: object
      description: |
        Evidence attached to a rule result to satisfy an evidence rule. Which field holds it depends on the rule's `evidenceType`: `storageUri` for a document, `text` for a written statement, or `url` for a link.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The evidence id.
        name:
          type: string
          nullable: true
          maxLength: 120
          description: The evidence name.
          example: Model risk assessment 2026
        description:
          type: string
          nullable: true
          description: A description of what the evidence shows.
        storageUri:
          type: string
          nullable: true
          description: |
            Where the uploaded file is stored. Set when the rule's `evidenceType` is `document`. Upload the file first with `POST /storage/presigned-url` and send the storage URI it returns.
          example: 's3://openlayer-evidence/evidence.pdf'
        text:
          type: string
          nullable: true
          description: The evidence text. Set when the rule's `evidenceType` is `text`.
        url:
          type: string
          format: uri
          nullable: true
          description: A link to the evidence. Set when the rule's `evidenceType` is `url`.
          example: 'https://openlayer.com/evidence'
        creatorId:
          type: string
          format: uuid
          nullable: true
          readOnly: true
          description: The user who attached the evidence.
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The creation date.
          example: '2026-03-22T11:31:01.185Z'
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The last update date.
          example: '2026-03-22T11:31:01.185Z'
      required:
        - id
        - creatorId
        - dateCreated
        - dateUpdated
    SessionAggregation:
      type: object
      description: 'A session in an inference pipeline, with its activity stats: record counts, token usage, cost, latency, and its first and last records.'
      required:
        - id
        - dateCreated
        - dateOfFirstRecord
        - dateOfLastRecord
        - duration
        - records
        - userIds
        - tokens
        - cost
        - latency
        - firstRecord
        - lastRecord
      properties:
        id:
          type: string
          description: The unique session identifier
          example: session456
        dateCreated:
          type: string
          format: date-time
          description: Latest/most recent timestamp in the session
          example: '2022-01-02T08:00:00Z'
        dateOfFirstRecord:
          type: string
          format: date-time
          description: Timestamp of the first request in the session
          example: '2022-01-02T07:58:20Z'
        dateOfLastRecord:
          type: string
          format: date-time
          description: Timestamp of the last request in the session
          example: '2022-01-02T08:00:00Z'
        duration:
          type: number
          format: float
          description: Duration between first and last request (in milliseconds)
          example: 100576.341
        records:
          type: integer
          description: Total number of records/traces in the session
          example: 15
        userIds:
          type: array
          items:
            type: string
          description: List of unique user IDs that participated in this session
          example:
            - user123
            - user456
        tokens:
          type: number
          format: float
          description: Total token count for the session
          example: 1250
        cost:
          type: number
          format: float
          description: Total cost for the session
          example: 0.025
        latency:
          type: number
          format: float
          description: Total latency for the session (in milliseconds)
          example: 1250.5
        firstRecord:
          type: object
          description: The complete first record in the session
          additionalProperties: true
        lastRecord:
          type: object
          description: The complete last record in the session
          additionalProperties: true
    ProdRow:
      type: object
      readOnly: true
      properties:
        openlayer_row_id:
          type: integer
          minimum: 0
      required:
        - openlayer_row_id
    BackgroundTask:
      type: object
      description: |
        A job queued by an endpoint that can't answer within one request, such as a framework export. Poll it until `complete` is `true`, then read what it produced from `outputs`.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The background task id.
          example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
        name:
          type: string
          readOnly: true
          description: 'The task''s internal name, including the arguments it was queued with.'
          example: 'ExportFrameworkRunner(framework_id=9f1b3c2d-4e5a-4f60-8a71-2b3c4d5e6f70, project_id=None)'
        progress:
          type: number
          format: float
          minimum: 0
          maximum: 100
          description: 'How far along the task is, from 0 to 100.'
          example: 95
        complete:
          type: boolean
          description: Whether the task has finished. Check this before reading `outputs`.
        error:
          type: string
          nullable: true
          description: 'Why the task failed, or `null` if it has not failed.'
        outputs:
          type: object
          nullable: true
          description: |
            Whatever the task produced, keyed by name. `null` until the task completes. A framework export returns `storageUri` -- pass it to `GET /storage/presigned-url` to download the archive -- along with `filename`, `controlCount`, `evidenceCount` and `missingEvidenceCount`.
          example:
            storageUri: 's3://openlayer-storage/exports/soc2-2026-09-15.zip'
            filename: soc2-2026-09-15.zip
            controlCount: 64
            evidenceCount: 51
            missingEvidenceCount: 13
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: When the task was queued.
          example: '2026-09-15T11:31:01.185Z'
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: When the task last reported progress.
          example: '2026-09-15T11:33:47.902Z'
      required:
        - id
        - name
        - progress
        - complete
        - dateCreated
        - dateUpdated
  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.
