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 by its ID.
      operationId: getWorkspaceById
      description: Retrieve a workspace by its ID.
      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()
            client.workspaces.retrieve(workspace_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            await openlayer.workspaces.retrieve({workspaceId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"})
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            lient.Workspaces.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.WorkspaceGetParams;
            import com.openlayer.api.models.WorkspaceGetResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            WorkspaceGetParams params = WorkspaceGetParams.builder().build();
            WorkspaceGetResponse response = client.workspaces().get(params);
        - 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()
            client.workspaces.update(
              workspace_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              name="My Workspace",
              slug="my-workspace"
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            await openlayer.workspaces.update(
              {workspaceId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", name: "My Workspace", slug: "my-workspace"}
            )
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            client.Workspaces.Update(
              context.TODO(),
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              openlayer.WorkspaceUpdateParams{
                Name: openlayer.F("My Workspace"),
                Slug: openlayer.F("my-workspace"),
              },
            )
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.WorkspaceUpdateParams;
            import com.openlayer.api.models.WorkspaceUpdateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            WorkspaceUpdateParams params = WorkspaceUpdateParams.builder().build();
            WorkspaceUpdateResponse response = client.workspaces().update(params);
        - 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':
    post:
      summary: Create a new API key in a workspace.
      description: Create a new API key in a workspace.
      operationId: createApiKeyInWorkspace
      parameters:
        - $ref: '#/components/parameters/workspaceId'
      responses:
        '201':
          description: Status Created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKey'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  $ref: '#/components/schemas/ApiKey/properties/name'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()
            api_key = client.workspaces.api_keys.create(
              workspace_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              name="My API Key"
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            apiKey = await openlayer.workspaces.apiKeys.create(
              {workspace_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", name: "My API Key"}
            )
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            apiKey, err := client.Workspaces.APIKeys.New(
              context.TODO(),
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              openlayer.WorkspaceAPIKeyNewParams{
                Name: openlayer.F("My API Key"),
              },
            )
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.WorkspaceAPIKeyNewParams;
            import com.openlayer.api.models.WorkspaceAPIKeyNewResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            WorkspaceAPIKeyNewParams params = WorkspaceAPIKeyNewParams.builder().build();
            WorkspaceAPIKeyNewResponse response = client.workspaces().apiKeys().new(params);
        - 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"
              }'
  '/workspaces/{workspaceId}/invites':
    get:
      summary: Retrieve a list of invites in a workspace.
      operationId: getInvitesByWorkspace
      description: Retrieve a list of 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()
            client.workspaces.invites.list(
              workspace_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            await openlayer.workspaces.invites.list(
              {workspaceId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}
            )
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            client.Workspaces.Invites.List(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.WorkspaceInvitesListParams;
            import com.openlayer.api.models.WorkspaceInvitesListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            WorkspaceInvitesListParams params = WorkspaceInvitesListParams.builder().build();
            WorkspaceInvitesListResponse response = client.workspaces().invites().list(params);
        - 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()
            client.workspaces.invites.create(
              workspace_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              emails=["john@doe.com", "jane@doe.com"],
              role="ADMIN"
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            await openlayer.workspaces.invites.create(
              {workspaceId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", emails: ["john@doe.com", "jane@doe.com"], role: "ADMIN"}
            )
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            client.Workspaces.Invites.New(
              context.TODO(),
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              openlayer.WorkspaceInviteNewParams{
                Emails: []string{"john@doe.com", "jane@doe.com"},
                Role: "ADMIN",
              },
            )
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.WorkspaceInviteNewParams;
            import com.openlayer.api.models.WorkspaceInviteNewResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            WorkspaceInviteNewParams params = WorkspaceInviteNewParams.builder().build();
            WorkspaceInviteNewResponse response = client.workspaces().invites().new(params);
        - 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()
            client.projects.list()
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            await openlayer.projects.list();
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            client.Projects.List(context.TODO(), openlayer.ProjectListParams{})
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.ProjectListParams;
            import com.openlayer.api.models.ProjectListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ProjectListParams params = ProjectListParams.builder().build();
            ProjectListResponse response = client.projects().list(params);
        - 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="My Project",
              description="My project description.",
              taskType="llm-base"
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            const project = await openlayer.projects.create({
              name: 'My Project',
              description: 'My project description.',
              taskType: 'llm-base'
            });
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            project, err := client.Projects.New(context.TODO(), openlayer.ProjectNewParams{
              Name: openlayer.F("My Project"),
              TaskType: openlayer.F(openlayer.ProjectNewParamsTaskTypeLlmBase),
            })
            if err != nil {
              panic(err.Error())
            }
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.ProjectCreateParams;
            import com.openlayer.api.models.ProjectCreateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ProjectCreateParams params = ProjectCreateParams.builder()
                .name("My Project")
                .description("My project description.")
                .taskType(ProjectCreateParams.TaskType.LLM_BASE)
                .build();

            ProjectCreateResponse project = client.projects().create(params);
        - 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(
                project_id="3fa85f64-5717-4562-b3fc-2c963f66afa6",
                name="My Renamed Project",
                description="An updated project description.",
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            const project = await openlayer.projects.update(
              '3fa85f64-5717-4562-b3fc-2c963f66afa6',
              {
                name: 'My Renamed Project',
                description: 'An updated project description.'
              }
            );
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            project, err := client.Projects.Update(
              context.TODO(),
              "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              openlayer.ProjectUpdateParams{
                Name: openlayer.F("My Renamed Project"),
                Description: openlayer.F("An updated project description."),
              },
            )
            if err != nil {
              panic(err.Error())
            }
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.ProjectUpdateParams;
            import com.openlayer.api.models.ProjectUpdateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ProjectUpdateParams params = ProjectUpdateParams.builder()
                .projectId("3fa85f64-5717-4562-b3fc-2c963f66afa6")
                .name("My Renamed Project")
                .description("An updated project description.")
                .build();

            ProjectUpdateResponse response = client.projects().update(params);
        - 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'
  '/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()
            client.projects.commits.list(
              project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            await openlayer.projects.commits.list({
              projectId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            });
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            client.Projects.Commits.List(
              context.TODO(),
              projectId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              openlayer.ProjectCommitListParams{},
            )
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.ProjectListCommitsParams;
            import com.openlayer.api.models.ProjectListCommitsResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ProjectListCommitsResponse response = client.projects().commits().list(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                ProjectListCommitsParams.builder()
                    .page(1L)
                    .perPage(10L)
                    .build()
            );
        - 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()
            client.projects.commits.create(
              project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              commit={"message": "Updated the prompt"},
              storage_uri="s3://..."
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            await openlayer.projects.commits.create({
              projectId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              commit: {"message": "Updated the prompt"},
              storageUri: "s3://..."
            });
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            client.Projects.Commits.New(
              context.TODO(),
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              openlayer.ProjectCommitNewParams{
                Commit: openlayer.F(openlayer.ProjectCommitNewParamsCommit{
                  Message: openlayer.F("Updated the prompt."),
                }),
                StorageUri: openlayer.F("s3://..."),
            )
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.ProjectCreateCommitParams;
            import com.openlayer.api.models.ProjectCreateCommitResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ProjectCreateCommitResponse response = client.projects().commits().create(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                ProjectCreateCommitParams.builder()
                    .commit(ProjectCreateCommitParamsCommit.builder()
                        .message("Updated the prompt.")
                        .build())
                    .storageUri("s3://...")
                    .build()
            );
        - 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()
            client.projects.inference_pipelines.list(
              project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            await openlayer.projects.inferencePipelines.list(
              projectId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            );
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            client.Projects.InferencePipelines.List(
              context.TODO(),
              projectId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              openlayer.ProjectInferencePipelineListParams{},
            )
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.ProjectInferencePipelineListParams;
            import com.openlayer.api.models.ProjectInferencePipelineListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ProjectInferencePipelineListParams params = ProjectInferencePipelineListParams.builder()
                .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .build();

            ProjectInferencePipelineListResponse response = client.projects().inferencePipelines().list(params);
        - 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(
              project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              name="production",
              description="My production inference pipeline.",
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            const inferencePipelineCreateResponse = await openlayer.projects.inferencePipelines.create(
              {
                projectId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
                name: 'production'
                description: 'My production inference pipeline.',
              },
            );
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            inferencePipeline, err := client.Projects.InferencePipelines.New(
              context.TODO(),
              projectId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              openlayer.ProjectInferencePipelineNewParams{
                Description: openlayer.F("My production inference pipeline."),
                Name: openlayer.F("production"),
              },
            )
            if err != nil {
              panic(err.Error())
            }
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.ProjectInferencePipelineListParams;
            import com.openlayer.api.models.ProjectInferencePipelineListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ProjectInferencePipelineCreateParams params = ProjectInferencePipelineCreateParams.builder()
                .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .name("production")
                .description("My production inference pipeline.")
                .build();

            ProjectInferencePipelineCreateResponse response = client.projects().inferencePipelines().create(params);
        - 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 version (commit) by its id.
      operationId: getVersionById
      summary: Retrieve 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()
            client.commits.retrieve(project_version_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            await openlayer.commits.retrieve({projectVersionId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"})
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            client.Commits.Get(context.TODO(), "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.ProjectVersionGetParams;
            import com.openlayer.api.models.ProjectVersionGetResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ProjectVersionGetParams params = ProjectVersionGetParams.builder().build();
            ProjectVersionGetResponse response = client.commits().get(params);
        - 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.
      summary: Create a test in a project.
      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: |
            import os
            from openlayer import Openlayer

            client = Openlayer()
            test = client.projects.tests.create(
                project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                name="No duplicate rows",
                description="This test checks for duplicate rows in the dataset.",
                type="integrity",
                subtype="duplicateRowCount",
                thresholds=[
                  {
                    "insightName": "duplicateRowCount",
                    "measurement": "duplicateRowCount", # Using the absolute row count
                    "operator": "<=",
                    "value": 0 # Integer
                  }
                ],
                uses_production_data=True, # For monitoring mode
                evaluation_window=3600, # 1 hour
                delay_window=0,
                uses_training_dataset=False,
                uses_validation_dataset=False,

            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            const project = await openlayer.projects.tests.create({
              projectId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              name: "No duplicate rows",
              description: "This test checks for duplicate rows in the dataset.",
              type: "integrity",
              subtype: "duplicateRowCount",
              thresholds: [
                {
                  insightName: "duplicateRowCount",
                  measurement: "duplicateRowCount",  // Using the absolute row count
                  operator: "<=",
                  value: 0  // Integer
                }
              ],
              usesProductionData: true, // For monitoring mode
              evaluationWindow: 3600, // 1 hour
              delayWindow: 0,
              usesTrainingDataset: false,
              usesValidationDataset: false,
            });
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            project, err := client.Projects.Tests.New(
              context.TODO(),
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              openlayer.ProjectTestNewParams{
                Name: openlayer.F("No duplicate rows"),
                Description: openlayer.F("This test checks for duplicate rows in the dataset."),
                Type: openlayer.F(openlayer.ProjectTestNewParamsTypeIntegrity),
                Subtype: openlayer.F(openlayer.ProjectTestNewParamsSubtypeDuplicateRowCount),
                Thresholds: []openlayer.ProjectTestNewParamsThreshold{
                  {
                    InsightName: openlayer.F("duplicateRowCount"),
                    Measurement: openlayer.F("duplicateRowCount"),
                    Operator: openlayer.F(openlayer.ProjectTestNewParamsOperatorLessThanOrEqual),
                    Value: openlayer.F(0),
                  }
                },
                UsesProductionData: true,
                EvaluationWindow: 3600,
                DelayWindow: 0,
                UsesTrainingDataset: false,
                UsesValidationDataset: false,
              })
            if err != nil {
              panic(err.Error())
            }
        - 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 tests under a project.
      summary: List tests in a project.
      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: |
            import os
            from openlayer import Openlayer

            client = Openlayer()
            tests = client.projects.tests.list(
              project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            const tests = await openlayer.projects.tests.list({
              projectId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            });
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            tests, err := client.Projects.Tests.List(
              context.TODO(),
              "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )

            if err != nil {
              panic(err.Error())
            }
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/projects/{projectId}/tests \
              --header 'Authorization: Bearer <token>'
    put:
      tags:
        - Projects
      description: Update tests.
      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
  '/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()
            client.commits.test_results.list(
              project_version_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            await openlayer.commits.testResults.list(
              {projectVersionId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'},
            );
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            client.Commits.TestResults.List(
              context.TODO(),
              projectVersionId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              openlayer.CommitTestResultListParams{},
            )
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.CommitTestResultListParams;
            import com.openlayer.api.models.CommitTestResultListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            CommitTestResultListResponse response = client.commits().testResults().list(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                CommitTestResultListParams.builder()
                    .build()
            );
        - 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
      description: Retrieve 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(
                inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            await openlayer.inferencePipelines.retrieve(
              inferencePipelineId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            );
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            client.Projects.InferencePipelines.Get(
              context.TODO(),
              inferencePipelineId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.ProjectInferencePipelineGetParams;
            import com.openlayer.api.models.ProjectInferencePipelineGetResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ProjectInferencePipelineGetParams params = ProjectInferencePipelineGetParams.builder()
                .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .build();

            ProjectInferencePipelineGetResponse response = client.projects().inferencePipelines().get(params);
        - lang: curl
          source: |
            curl --request GET \
              --url https://api.openlayer.com/v1/projects/{projectId}/inference-pipelines/{inferencePipelineId} \
              --header 'Authorization: Bearer <token>'
    put:
      tags:
        - Monitoring
      description: Update 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(
                inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                name="New Name",
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            await openlayer.inferencePipelines.update(
              inferencePipelineId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              option.WithName("New Name"),
            );
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            client.Projects.InferencePipelines.Update(
              context.TODO(),
              inferencePipelineId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              option.WithName("New Name"),
            )
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.ProjectInferencePipelineUpdateParams;
            import com.openlayer.api.models.ProjectInferencePipelineUpdateResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ProjectInferencePipelineUpdateParams params = ProjectInferencePipelineUpdateParams.builder()
                .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .name("New Name")
                .build();

            ProjectInferencePipelineUpdateResponse response = client.projects().inferencePipelines().update(params);
        - 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
      description: Delete 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()
            inference_pipeline = client.inference_pipelines.delete(
                inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            await openlayer.inferencePipelines.delete(
              inferencePipelineId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            );
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            client.Projects.InferencePipelines.Delete(
              context.TODO(),
              inferencePipelineId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.ProjectInferencePipelineDeleteParams;
            import com.openlayer.api.models.ProjectInferencePipelineDeleteResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            ProjectInferencePipelineDeleteParams params = ProjectInferencePipelineDeleteParams.builder()
                .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .build();

            ProjectInferencePipelineDeleteResponse response = client.projects().inferencePipelines().delete(params);
        - 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

            # Let's say we want to stream the following row, which represents a model prediction:
            data = {
              "user_query": "what's the meaning of life?",
              "output": "42",
              "tokens": 7,
              "cost": 0.02,
              "timestamp": 1620000000
            }

            # Prepare the config for the data, which depends on your project's task type. In this
            # case, we have an LLM project:
            from openlayer.types.inference_pipelines import data_stream_params

            config = data_stream_params.ConfigLlmData(
                input_variable_names=["user_query"],
                output_column_name="output",
                num_of_token_column_name="tokens",
                cost_column_name="cost",
                timestamp_column_name="timestamp",
                prompt=[{"role": "user", "content": "{{ user_query }}"}],
            )

            client = Openlayer()
            data_stream_response = client.inference_pipelines.data.stream(
                inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                rows=[data],
                config=config,
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();

            await openlayer.inferencePipelines.data.stream(
              {
                inferencePipelineId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
                config: {
                  inputVariableNames: ['user_query'],
                  outputColumnName: 'output',
                  numOfTokenColumnName: 'tokens',
                  costColumnName: 'cost',
                  timestampColumnName: 'timestamp',
                  prompt: [{ role: 'user', content: '{{ user_query }}' }],
                },
                rows: [
                  {
                    user_query: "what's the meaning of life?",
                    output: '42',
                    tokens: 7,
                    cost: 0.02,
                    timestamp: 1620000000,
                  },
                ],
              },
            );
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            inferencePipelineDataStreamResponse, err := client.InferencePipelines.Data.Stream(
                  context.TODO(),
                  inferencePipelineId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                  openlayer.InferencePipelineDataStreamParams{
                    Config: openlayer.F[openlayer.InferencePipelineDataStreamParamsConfigUnion](openlayer.InferencePipelineDataStreamParamsConfigLlmData{
                      OutputColumnName: openlayer.F("output"),
                      NumOfTokenColumnName: openlayer.F("tokens"),
                      CostColumnName: openlayer.F("cost"),
                      TimestampColumnName: openlayer.F("timestamp"),
                    }),
                    Rows: openlayer.F([]map[string]interface{}{map[string]interface{}{
                      "user_query": "what's the meaning of life?",
                      "output": "42",
                      "tokens": 7,
                      "cost": 0.02,
                      "timestamp": 1620000000,
                    }}),
                },
            )
            if err != nil {
              panic(err.Error())
            }
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.InferencePipelineDataStreamParams;
            import com.openlayer.api.models.InferencePipelineDataStreamResponse;
            import java.util.List;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            // Let's say this is the row with the relevant fields
            InferencePipelineDataStreamParams.Row row = InferencePipelineDataStreamParams.Row.builder()
                    .putAdditionalProperty("user_query", JsonString.of("what's the meaning of life?"))
                    .putAdditionalProperty("output", JsonString.of("42"))
                    .putAdditionalProperty("tokens", JsonNumber.of(7))
                    .putAdditionalProperty("cost", JsonNumber.of(0.02))
                    .build();

            // Create Inference Pipeline Data Stream Parameters
            InferencePipelineDataStreamParams params = InferencePipelineDataStreamParams.builder()
              .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
              .config(InferencePipelineDataStreamParams.Config.ofLlmData(InferencePipelineDataStreamParams.Config.LlmData.builder()
                  .outputColumnName("output")
                  .costColumnName("cost")
                  .inputVariableNames(List.of("user_query"))
                  .numOfTokenColumnName("tokens")
                  .timestampColumnName("timestamp")
                  .build()))
              .row(List.of(InferencePipelineDataStreamParams.Row.builder().build()))
              .build();

            // Make the request
            InferencePipelineDataStreamResponse inferencePipelineDataStreamResponse =
                    client.inferencePipelines().data().stream(params);
        - 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
      description: A list of rows for 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: |
            import os
            from openlayer import Openlayer

            client = Openlayer(
                api_key=os.environ.get("OPENLAYER_API_KEY"),
            )
            rows = client.inference_pipelines.rows.list(
                inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(rows.items)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer({
              apiKey: process.env['OPENLAYER_API_KEY'],
            });

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

            console.log(rows.items);
        - lang: go
          source: |
            package main

            import (
              "context"
              "fmt"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            func main() {
              client := openlayer.NewClient(
                option.WithAPIKey("My API Key"),
              )
              rows, err := client.InferencePipelines.Rows.List(
                context.TODO(),
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                openlayer.InferencePipelineRowListParams{},
              )
              if err != nil {
                panic(err.Error())
              }
              fmt.Printf("%+v\n", rows.Items)
            }
        - lang: java
          source: |
            package com.openlayer.api.example;

            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;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

                    RowListResponse rows = client.inferencePipelines().rows().list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
                }
            }
        - lang: ruby
          source: |
            require "openlayer"

            openlayer = Openlayer::Client.new(api_key: "My API Key")

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

            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
      description: Update an inference data point 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
            from openlayer.types.inference_pipelines import row_update_params

            row_updates = {
              "ground_truth": "The sun is 94.471 million miles from the earth."
            }
            config = row_update_params.Config(
              ground_truth_column_name="ground_truth"
            )

            client = Openlayer()
            client.inference_pipelines.rows.update(
                inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                inference_id="832y98d3",
                row=row_updates,
                config=config,
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();

            await openlayer.inferencePipelines.rows.update(
              {
                inferencePipelineId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
                inferenceId='832y98d3',
                config: {
                  groundTruthColumnName: 'ground_truth',
                },
                row: {
                    ground_truth: "The sun is 94.471 million miles from the earth.",
                },
              },
            );
        - 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
      description: 'Fetch a single inference pipeline 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: |
            import os
            from openlayer import Openlayer

            client = Openlayer(
                api_key=os.environ.get("OPENLAYER_API_KEY"),
            )
            result = client.inference_pipelines.rows.retrieve(
                inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                inference_id="832y98d3",
            )
            print(result.row)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer({
              apiKey: process.env['OPENLAYER_API_KEY'],
            });

            const result = await client.inferencePipelines.rows.retrieve(
              '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              '832y98d3',
            );

            console.log(result.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
      description: Delete a single inference pipeline row by inference ID. Only project admins can perform this action.
      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: |
            import os
            from openlayer import Openlayer

            client = Openlayer(
                api_key=os.environ.get("OPENLAYER_API_KEY"),
            )
            client.inference_pipelines.rows.delete(
                inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                inference_id="832y98d3",
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer({
              apiKey: process.env['OPENLAYER_API_KEY'],
            });

            await client.inferencePipelines.rows.delete(
              '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              '832y98d3',
            );
        - 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()
            client.inference_pipelines.test_results.list(
              inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const openlayer = new Openlayer();
            await openlayer.inferencePipelines.testResults.list(
              {
                'inferencePipelineId': '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'
              },
            );
        - lang: go
          source: |
            package main

            import (
              "context"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            client := openlayer.NewClient()
            client.InferencePipelines.TestResults.List(
              context.TODO(),
              inferencePipelineId: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              openlayer.InferencePipelineTestResultListParams{},
            )
        - lang: java
          source: |
            import com.openlayer.api.client.OpenlayerClient;
            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;
            import com.openlayer.api.models.InferencePipelineTestResultListParams;
            import com.openlayer.api.models.InferencePipelineTestResultListResponse;

            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

            InferencePipelineTestResultListParams params = InferencePipelineTestResultListParams.builder()
                .inferencePipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .page(1L)
                .perPage(100L)
                .build();

            InferencePipelineTestResultListResponse response = client.inferencePipelines().testResults().list(params);
        - 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
      description: |
        Get aggregated user data for an inference pipeline with pagination and metadata.

        Returns a list of users who have interacted with the inference pipeline, including
        their activity statistics such as session counts, record counts, token usage, and costs.
      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: |
            import os
            from openlayer import Openlayer

            client = Openlayer(
                api_key=os.environ.get("OPENLAYER_API_KEY"),
            )
            response = client.inference_pipelines.retrieve_users(
                inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(response.items)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer({
              apiKey: process.env['OPENLAYER_API_KEY'],
            });

            const response = await client.inferencePipelines.retrieveUsers(
              '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            );

            console.log(response.items);
        - lang: go
          source: |
            package main

            import (
              "context"
              "fmt"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            func main() {
              client := openlayer.NewClient(
                option.WithAPIKey("My API Key"),
              )
              response, err := client.InferencePipelines.GetUsers(
                context.TODO(),
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                openlayer.InferencePipelineGetUsersParams{},
              )
              if err != nil {
                panic(err.Error())
              }
              fmt.Printf("%+v\n", response.Items)
            }
        - lang: java
          source: |
            package com.openlayer.api.example;

            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;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

                    InferencePipelineRetrieveUsersResponse response = client.inferencePipelines().retrieveUsers("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
                }
            }
        - lang: ruby
          source: |
            require "openlayer"

            openlayer = Openlayer::Client.new(api_key: "My API Key")

            response = openlayer.inference_pipelines.retrieve_users("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")

            puts(response)
        - 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
      description: |
        Get aggregated session data for an inference pipeline with pagination and metadata.

        Returns a list of sessions for the inference pipeline, including activity statistics
        such as record counts, token usage, cost, latency, and the first and last records.
      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: |
            import os
            from openlayer import Openlayer

            client = Openlayer(
                api_key=os.environ.get("OPENLAYER_API_KEY"),
            )
            response = client.inference_pipelines.retrieve_sessions(
                inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(response.items)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer({
              apiKey: process.env['OPENLAYER_API_KEY'],
            });

            const response = await client.inferencePipelines.retrieveSessions(
              '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            );

            console.log(response.items);
        - lang: go
          source: |
            package main

            import (
              "context"
              "fmt"

              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            func main() {
              client := openlayer.NewClient(
                option.WithAPIKey("My API Key"),
              )
              response, err := client.InferencePipelines.GetSessions(
                context.TODO(),
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                openlayer.InferencePipelineGetSessionsParams{},
              )
              if err != nil {
                panic(err.Error())
              }
              fmt.Printf("%+v\n", response.Items)
            }
        - lang: java
          source: |
            package com.openlayer.api.example;

            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;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();

                    InferencePipelineRetrieveSessionsResponse response = client.inferencePipelines().retrieveSessions("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
                }
            }
        - lang: ruby
          source: |
            require "openlayer"

            openlayer = Openlayer::Client.new(api_key: "My API Key")

            response = openlayer.inference_pipelines.retrieve_sessions("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")

            puts(response)
        - 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:
    post:
      tags:
        - Storage
      description: Retrieve a presigned url to post storage artifacts.
      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'
  '/tests/{testId}/evaluate':
    post:
      tags:
        - Monitoring
      summary: Trigger test evaluation for custom timestamp range
      description: |
        Triggers one-off evaluation of a specific monitoring test for a custom timestamp range.
        This allows evaluating tests for historical data or custom time periods outside
        the regular evaluation window schedule. It also allows overwriting the existing test results.
      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: |
            import os

            from openlayer import Openlayer

            client = Openlayer(
                api_key=os.environ.get("OPENLAYER_API_KEY"),  # This is the default and can be omitted
            )
            response = client.tests.evaluate(
                test_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                end_timestamp=1700006400,
                start_timestamp=1699920000,
            )
            print(response.message)
        - lang: typescript
          source: |
            import Openlayer from 'openlayer';

            const client = new Openlayer({
              apiKey: process.env['OPENLAYER_API_KEY'], // This is the default and can be omitted
            });
            const response = await client.tests.evaluate('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
              endTimestamp: 1700006400,
              startTimestamp: 1699920000,
            });
            console.log(response.message);
        - lang: go
          source: |
            package main

            import (
              "context"
              "fmt"
              "github.com/openlayer-ai/openlayer-go"
              "github.com/openlayer-ai/openlayer-go/option"
            )

            func main() {
              client := openlayer.NewClient(
                option.WithAPIKey("My API Key"),
              )
              response, err := client.Tests.Evaluate(
                context.TODO(),
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                openlayer.TestEvaluateParams{
                  EndTimestamp: openlayer.F(int64(1700006400)),
                  StartTimestamp: openlayer.F(int64(1699920000)),
                },
              )
              if err != nil {
                panic(err.Error())
              }
              fmt.Printf("%+v\n", response.Message)
            }
        - 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("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                .endTimestamp(1700006400L)
                .startTimestamp(1699920000L)
                .build();
            TestEvaluateResponse response = client.tests().evaluate(params);
        - 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 test results for a test.
      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'
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
    testId:
      name: testId
      in: path
      description: The test 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
  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-ol-*************************5PW0
          maxLength: 120
          readOnly: true
          description: The API key value.
      required:
        - id
        - dateCreated
        - dateUpdated
        - dateLastUsed
        - secureKey
    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:
          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:
          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:
          $ref: '#/components/schemas/Project/properties/id'
        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
      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
    SessionAggregation:
      type: object
      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
  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.
