@basetenlabs/client - v0.5.0
    Preparing search index...

    Class ApiClient

    Index
    cleanupImages createSandbox createSandboxPreview createSandboxPreviewToken createSandboxVolume deleteApiKeys deleteChains deleteChainsDeployments deleteGatewayEndpoints deleteGridConnections deleteGridMachineUsers deleteGridMachineUsersApiKeys deleteGridRoutes deleteImage deleteImageTag deleteLibraryListings deleteLibraryListingsVersions deleteModels deleteModelsDeployments deleteModelsDeploymentsReplicas deleteModelsEnvironments deleteSandbox deleteSandboxPreview deleteSandboxPreviewToken deleteSandboxVolume deleteSecrets deleteTeamsSecrets deleteTrainingProjects deleteTrainingProjectsJobs deleteVolumes deleteVolumesTags deleteVolumesVersions getApiKeys getAuditLogs getBillingModelApis getBillingToolCallUsage getBillingUsageSummary getBlobsCredentialsModel getBlobsCredentialsTrain getChains getChainsAuditLogs getChainsChainId getChainsDeployments getChainsDeploymentsChainDeploymentId getChainsDeploymentsChainletsLogs getChainsEnvironments getChainsEnvironmentsEnvName getEnvironmentGroups getEnvironmentGroupsEnvName getExploreMetadata getGatewayEndpoints getGatewayEndpointsEndpointId getGatewayEvents getGatewayGroups getGatewayGroupsApiKeys getGatewayGroupsApiKeysApiKeyPrefix getGatewayGroupsGroupId getGridClassifiers getGridClassifiersClassifierId getGridConnections getGridConnectionsConnectionId getGridMachineUsers getGridMachineUsersApiKeys getGridMachineUsersMachineUserId getGridRouteClassifiers getGridRouteClassifiersRouteClassifierId getGridRoutes getGridRoutesRouteId getGridRoutesUsage getGridTeamSettings getGridTeamSettingsUsers getGridTeamSettingsUsersUserId getImage getImageBuildLogs getInstanceTypePrices getInstanceTypes getLibraryListings getLibraryListingsUserDefinedListingId getLibraryListingsVersions getLibraryListingsVersionsVersionTag getLoopsCapabilities getLoopsCheckpoints getLoopsCheckpointsFiles getLoopsCheckpointsSource getLoopsDeployments getLoopsDeploymentsDebugArchiveFiles getLoopsDeploymentsDeploymentId getLoopsDeploymentsLogs getLoopsRuns getLoopsRunsRunId getLoopsSamplers getLoopsSamplersSamplerId getLoopsSessions getLoopsUserConfig getModelApis getModelApisMetrics getModelApisModelApiName getModelApisUsage getModels getModelsAuditLogs getModelsDeployments getModelsDeploymentsConfig getModelsDeploymentsDeploymentId getModelsDeploymentsDevelopment getModelsDeploymentsDownload getModelsDeploymentsLogs getModelsDeploymentsMetrics getModelsDeploymentsPatchesState getModelsDeploymentsProduction getModelsDeploymentsStartups getModelsDeploymentsStartupsSummary getModelsEnvironments getModelsEnvironmentsEnvName getModelsEnvironmentsLogs getModelsEnvironmentsMetrics getModelsEnvironmentsStartups getModelsEnvironmentsStartupsSummary getModelsModelId getOrganizationsMe getRegions getSandbox getSandboxConfiguration getSandboxLogs getSandboxMetrics getSandboxPreview getSandboxVolume getSecrets getTeams getTeamsEnvironmentGroups getTeamsEnvironmentGroupsEnvName getTeamsLoopsRuns getTeamsLoopsSamplers getTeamsModels getTeamsRegions getTeamsSecrets getTeamsTeamId getTrainingCapacity getTrainingJobsQueueContext getTrainingProjects getTrainingProjectsCacheSummary getTrainingProjectsJobs getTrainingProjectsJobsAuthCodes getTrainingProjectsJobsCheckpointFiles getTrainingProjectsJobsCheckpoints getTrainingProjectsJobsDownload getTrainingProjectsJobsLogs getTrainingProjectsJobsMetrics getTrainingProjectsJobsTrainingJobId getTrainingProjectsTrainingProjectId getUsers getUsersMe getUsersUserId getVolumes getVolumesNamespaces getVolumesSyncs getVolumesSyncsVolumeSyncId getVolumesVersions getVolumesVersionsVolumeVersion getVolumesVolumeName listImages listImageTags listSandboxes listSandboxLibraryImages listSandboxPreviews listSandboxPreviewTokens listSandboxVolumes patchChainsEnvironments patchChainsEnvironmentsChainletSettingsAutoscalingSettings patchEnvironmentGroups patchGatewayEndpoints patchGatewayGroups patchGridConnections patchGridMachineUsers patchGridRoutes patchGridTeamSettings patchGridTeamSettingsUsers patchLibraryListings patchLibraryListingsVersions patchLoopsUserConfig patchModels patchModelsDeployments patchModelsDeploymentsAutoscalingSettings patchModelsDeploymentsDevelopmentAutoscalingSettings patchModelsDeploymentsProductionAutoscalingSettings patchModelsDeploymentsRequestBackpressureSettings patchModelsEnvironments patchTeamsEnvironmentGroups patchTrainingCapacity patchTrainingProjectsJobs patchTrainingProjectsJobsInteractiveSessions patchVolumes postApiKeys postChainsDeploymentsDeactivate postChainsEnvironments postChainsEnvironmentsChainletSettingsInstanceTypesUpdate postChainsEnvironmentsPromote postGatewayEndpoints postGatewayGroups postGatewayGroupsApiKeys postGatewayGroupsApiKeysRegister postGridConnections postGridMachineUsers postGridMachineUsersApiKeys postGridRoutes postGridToken postLibraryListings postLibraryListingsVersions postLlmModels postLlmModelsDeployments postLoopsCheckpointsDeploy postLoopsCheckpointsValidate postLoopsDeploymentsDeactivate postLoopsDeploymentsMetrics postLoopsRuns postLoopsRunsDeactivate postLoopsSamplers postLoopsSamplersDeactivate postLoopsSessions postLoopsTrainers postModels postModelsDeployments postModelsDeploymentsActivate postModelsDeploymentsDeactivate postModelsDeploymentsDevelopmentActivate postModelsDeploymentsDevelopmentDeactivate postModelsDeploymentsDevelopmentPromote postModelsDeploymentsDevelopmentRetry postModelsDeploymentsLogs postModelsDeploymentsPatches postModelsDeploymentsPatchesSync postModelsDeploymentsProductionActivate postModelsDeploymentsProductionDeactivate postModelsDeploymentsProductionRetry postModelsDeploymentsPromote postModelsDeploymentsRetry postModelsDeploymentsSshSign postModelsEnvironments postModelsEnvironmentsActivate postModelsEnvironmentsCancelPromotion postModelsEnvironmentsDeactivate postModelsEnvironmentsForceCancelPromotion postModelsEnvironmentsForceRollForwardPromotion postModelsEnvironmentsPausePromotion postModelsEnvironmentsPromote postModelsEnvironmentsResumePromotion postPrepareModelUpload postSecrets postTeamsApiKeys postTeamsLlmModels postTeamsLoopsRuns postTeamsLoopsSamplers postTeamsLoopsSessions postTeamsLoopsTrainers postTeamsModels postTeamsSecrets postTeamsTrainingProjects postToken postTrainingJobsSearch postTrainingProjects postTrainingProjectsJobs postTrainingProjectsJobsLogs postTrainingProjectsJobsMetrics postTrainingProjectsJobsRecreate postTrainingProjectsJobsSshSign postTrainingProjectsJobsStop postVolumesSyncs postVolumesSyncsCancel postVolumesTags postVolumesToken postVolumesVersionsRestore pushImage updateSandbox updateSandboxPreview updateSandboxVolume
    • Parameters

      • options: {
            baseUrl: string;
            fetch?: {
                (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
                (input: string | URL | Request, init?: RequestInit): Promise<Response>;
            };
            headers: Record<string, string>;
        }
        • baseUrl: string
        • Optionalfetch?: {
              (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
              (input: string | URL | Request, init?: RequestInit): Promise<Response>;
          }
        • headers: Record<string, string>

      Returns ApiClient

    • Clean up unused images

      Parameters

      • Optionalparams: { params?: { team_id?: string } }

      Returns Promise<
          {
              deleted: number;
              has_more?: boolean;
              message: string;
              remaining?: number;
          },
      >

    • Create a sandbox

      Parameters

      • params: {
            params?: { team_id?: string };
            request: {
                cpu?: number;
                create_if_not_exists?: boolean;
                envs?: { name?: string; secret?: boolean; value?: string }[];
                external_id?: string;
                filesystem?: { max_memory_usage?: string | number };
                image?: string;
                labels?: { [key: string]: string };
                lifecycle?: {
                    expiration_policies?: (
                        | { action: "DELETE"; type: "TTL_IDLE"; value: string }
                        | { action: "DELETE"; type: "TTL_MAX_AGE"; value: string }
                        | { action: "DELETE"; type: "DATE"; value: string }
                    )[];
                    terminated_retention?: string;
                };
                memory?: number;
                name?: string;
                ports?: {
                    name?: string;
                    protocol?: "HTTP"
                    | "TCP"
                    | "UDP"
                    | "TLS";
                    target: number;
                }[];
                region?: string;
                volumes?: { mount_path: string; name: string; read_only?: boolean }[];
            };
        }

      Returns Promise<
          {
              cpu?: number;
              envs?: { name?: string; secret?: boolean; value?: string }[];
              external_id?: string;
              filesystem?: { max_memory_usage?: string | number };
              image?: string;
              labels?: { [key: string]: string };
              lifecycle?: {
                  expiration_policies?: (
                      | { action: "DELETE"; type: "TTL_IDLE"; value: string }
                      | { action: "DELETE"; type: "TTL_MAX_AGE"; value: string }
                      | { action: "DELETE"; type: "DATE"; value: string }
                  )[];
                  terminated_retention?: string;
              };
              memory?: number;
              ports?: {
                  name?: string;
                  protocol?: "HTTP"
                  | "TCP"
                  | "UDP"
                  | "TLS";
                  target: number;
              }[];
              region?: string;
              volumes?: { mount_path: string; name: string; read_only?: boolean }[];
          } & {
              created_at: string;
              created_by?: string;
              expires_in?: number;
              last_used_at?: string;
              name: string;
              status: | "DEPLOYED"
              | "FAILED"
              | "DEPLOYING"
              | "DELETING"
              | "DEACTIVATING"
              | "DEACTIVATED"
              | "TERMINATED"
              | "ARCHIVING"
              | "ARCHIVED"
              | "UNARCHIVING"
              | "BUILDING"
              | "UPLOADING";
              updated_at?: string;
              updated_by?: string;
              url: string;
          },
      >

    • Create a sandbox preview

      Parameters

      • params: {
            params?: { team_id?: string };
            request: {
                expires_at?: string;
                public?: boolean;
                request_headers?: { [key: string]: string };
                response_headers?: { [key: string]: string };
            } & {
                create_if_not_exists?: boolean;
                name?: string;
                port: number;
                ttl?: string;
            };
            sandbox_name: string;
        }

      Returns Promise<
          {
              expires_at?: string;
              public?: boolean;
              request_headers?: { [key: string]: string };
              response_headers?: { [key: string]: string };
          } & {
              created_at?: string;
              created_by?: string;
              name: string;
              port: number;
              region?: string;
              status: "DEPLOYED"
              | "FAILED"
              | "DEPLOYING"
              | "DELETING"
              | "TERMINATED";
              updated_at?: string;
              updated_by?: string;
              url: string;
          },
      >

    • Create a preview token

      Parameters

      • params: {
            params?: { team_id?: string };
            preview_name: string;
            request: { create_if_not_exists?: boolean; expires_at: string };
            sandbox_name: string;
        }

      Returns Promise<{ expired: boolean; expires_at: string; name: string; token: string }>

    • Create a volume

      Parameters

      • params: {
            params?: { team_id?: string };
            request: {
                labels?: { [key: string]: string };
                name?: string;
                region?: string;
                size: string | number;
            };
        }

      Returns Promise<
          {
              attached_to?: string;
              created_at?: string;
              created_by?: string;
              labels?: { [key: string]: string };
              name: string;
              region: string;
              size: string | number;
              status: "DEPLOYED" | "FAILED" | "DEPLOYING" | "DELETING";
              updated_at?: string;
              updated_by?: string;
          },
      >

    • Deletes a chain by ID

      Parameters

      • params: { chain_id: string }

      Returns Promise<{ deleted: boolean; id: string }>

    • Deletes a chain deployment by ID

      Parameters

      • params: { chain_deployment_id: string; chain_id: string }

      Returns Promise<{ chain_id: string; deleted: boolean; id: string }>

    • Deletes a Gateway endpoint

      Parameters

      • params: { endpoint_id: string }

      Returns Promise<{ id: string; slug: string }>

    • Deletes a machine user

      Parameters

      • params: { machine_user_id: string }

      Returns Promise<{ id: string }>

    • Revokes a machine user's API key

      Parameters

      • params: { api_key_prefix: string; machine_user_id: string }

      Returns Promise<{ prefix: string }>

    • Deletes a route

      Parameters

      • params: { route_id: string }

      Returns Promise<{ id: string; name: string }>

    • Delete a sandbox image

      Parameters

      • params: { image_name: string; params?: { team_id?: string } }

      Returns Promise<
          {
              created_at?: string;
              last_deployed_at?: string;
              name: string;
              size?: number;
              status: "FAILED"
              | "BUILDING"
              | "UPLOADING"
              | "BUILT";
              tag_count?: number;
              updated_at?: string;
          },
      >

    • Delete an image tag

      Parameters

      • params: { image_name: string; params?: { team_id?: string }; tag_name: string }

      Returns Promise<
          {
              created_at?: string;
              last_deployed_at?: string;
              name: string;
              size?: number;
              status: "FAILED"
              | "BUILDING"
              | "UPLOADING"
              | "BUILT";
              tag_count?: number;
              updated_at?: string;
          },
      >

    • Deletes a library listing

      Parameters

      • params: { user_defined_listing_id: string }

      Returns Promise<{ deleted: boolean; user_defined_id: string }>

    • Deletes a library listing version

      Parameters

      • params: { user_defined_listing_id: string; version_tag: string }

      Returns Promise<{ deleted: boolean; version_tag: string }>

    • Deletes a model by ID

      Parameters

      • params: { model_id: string }

      Returns Promise<{ deleted: boolean; id: string }>

    • Deletes a model's deployment by ID

      Parameters

      • params: { deployment_id: string; model_id: string }

      Returns Promise<{ deleted: boolean; id: string; model_id: string }>

    • Terminates a replica in a deployment

      Parameters

      • params: { deployment_id: string; model_id: string; replica_id: string }

      Returns Promise<{ success: boolean }>

    • Deletes an environment

      Parameters

      • params: { env_name: string; model_id: string }

      Returns Promise<{ deleted: boolean; model_id: string; name: string }>

    • Delete a sandbox

      Parameters

      • params: { params?: { team_id?: string }; sandbox_name: string }

      Returns Promise<
          {
              cpu?: number;
              envs?: { name?: string; secret?: boolean; value?: string }[];
              external_id?: string;
              filesystem?: { max_memory_usage?: string | number };
              image?: string;
              labels?: { [key: string]: string };
              lifecycle?: {
                  expiration_policies?: (
                      | { action: "DELETE"; type: "TTL_IDLE"; value: string }
                      | { action: "DELETE"; type: "TTL_MAX_AGE"; value: string }
                      | { action: "DELETE"; type: "DATE"; value: string }
                  )[];
                  terminated_retention?: string;
              };
              memory?: number;
              ports?: {
                  name?: string;
                  protocol?: "HTTP"
                  | "TCP"
                  | "UDP"
                  | "TLS";
                  target: number;
              }[];
              region?: string;
              volumes?: { mount_path: string; name: string; read_only?: boolean }[];
          } & {
              created_at: string;
              created_by?: string;
              expires_in?: number;
              last_used_at?: string;
              name: string;
              status: | "DEPLOYED"
              | "FAILED"
              | "DEPLOYING"
              | "DELETING"
              | "DEACTIVATING"
              | "DEACTIVATED"
              | "TERMINATED"
              | "ARCHIVING"
              | "ARCHIVED"
              | "UNARCHIVING"
              | "BUILDING"
              | "UPLOADING";
              updated_at?: string;
              updated_by?: string;
              url: string;
          },
      >

    • Delete a sandbox preview

      Parameters

      • params: { params?: { team_id?: string }; preview_name: string; sandbox_name: string }

      Returns Promise<
          {
              expires_at?: string;
              public?: boolean;
              request_headers?: { [key: string]: string };
              response_headers?: { [key: string]: string };
          } & {
              created_at?: string;
              created_by?: string;
              name: string;
              port: number;
              region?: string;
              status: "DEPLOYED"
              | "FAILED"
              | "DEPLOYING"
              | "DELETING"
              | "TERMINATED";
              updated_at?: string;
              updated_by?: string;
              url: string;
          },
      >

    • Delete a preview token

      Parameters

      • params: {
            params?: { team_id?: string };
            preview_name: string;
            sandbox_name: string;
            token_name: string;
        }

      Returns Promise<void>

    • Delete a volume

      Parameters

      • params: { params?: { team_id?: string }; volume_name: string }

      Returns Promise<
          {
              attached_to?: string;
              created_at?: string;
              created_by?: string;
              labels?: { [key: string]: string };
              name: string;
              region: string;
              size: string | number;
              status: "DEPLOYED" | "FAILED" | "DEPLOYING" | "DELETING";
              updated_at?: string;
              updated_by?: string;
          },
      >

    • Deletes a secret by name

      Parameters

      • params: { secret_name: string; team_id: string }

      Returns Promise<{ name: string }>

    • Deletes a training project

      Parameters

      • params: { training_project_id: string }

      Returns Promise<{ deleted: boolean; id: string }>

    • Deletes a training job

      Parameters

      • params: { training_job_id: string; training_project_id: string }

      Returns Promise<{ deleted: boolean; id: string; training_project_id: string }>

    • Deletes a volume

      Parameters

      • params: {
            request: { expected_sequence?: number | null };
            volume_name: string;
            volume_namespace: string;
        }

      Returns Promise<
          {
              name: string;
              namespace: string;
              versions_deleted: number;
              volume_sequence: number;
          },
      >

    • Deletes a volume tag

      Parameters

      • params: {
            request: { expected_sequence?: number | null };
            volume_name: string;
            volume_namespace: string;
            volume_tag: string;
        }

      Returns Promise<
          {
              deleted: boolean;
              namespace: string;
              tag: string;
              volume: string;
              volume_sequence: number;
          },
      >

    • Deletes one version of a volume

      Parameters

      • params: {
            request: { expected_sequence?: number | null };
            volume_name: string;
            volume_namespace: string;
            volume_version: string;
        }

      Returns Promise<
          {
              delete_after: string;
              digest: string;
              lifecycle: string;
              namespace: string;
              version_ref: string;
              volume: string;
              volume_sequence: number;
          },
      >

    • Lists API keys (metadata only, no plain text keys)

      Parameters

      • Optionalparams: {
            params?: {
                created_by_me?: boolean;
                type?:
                    | "PERSONAL"
                    | "GRID"
                    | "WORKSPACE_MANAGE_ALL"
                    | "WORKSPACE_EXPORT_METRICS"
                    | "WORKSPACE_INVOKE"
                    | "WORKSPACE_MANAGE_API_KEYS"
                    | null;
            };
        }

      Returns Promise<
          {
              keys: {
                  created_at: string;
                  expires_at: string
                  | null;
                  last_used_at: string | null;
                  model_ids: string[] | null;
                  name: string | null;
                  owner:
                      | { email: string
                      | null; name: string | null; user_id: string }
                      | null;
                  prefix: string;
                  team_name: string | null;
                  type:
                      | "PERSONAL"
                      | "GRID"
                      | "WORKSPACE_MANAGE_ALL"
                      | "WORKSPACE_EXPORT_METRICS"
                      | "WORKSPACE_INVOKE"
                      | "WORKSPACE_MANAGE_API_KEYS";
              }[];
          },
      >

    • Gets the audit log for the workspace

      Parameters

      • Optionalparams: {
            params?: {
                chain_deployment_ids?: string[];
                cursor?: string | null;
                deployment_ids?: string[];
                direction?: "DESC" | "ASC";
                end_epoch_millis?: number | null;
                environment_names?: string[];
                event_type_groups?: (
                    | "GRID"
                    | "DEPLOYED"
                    | "PROMOTED"
                    | "ACTIVATED_DEACTIVATED"
                    | "AUTOSCALING_SETTINGS"
                    | "REQUEST_BACKPRESSURE_SETTINGS"
                    | "INSTANCE_TYPE_CHANGED"
                    | "ENVIRONMENT_SETTINGS"
                    | "REPLICA_TERMINATED"
                    | "DELETED"
                    | "METADATA"
                    | "SECRETS"
                    | "API_KEYS"
                    | "GATEWAY"
                    | "WEBHOOK_SIGNING_SECRETS"
                    | "USER_MANAGEMENT"
                    | "DIRECTORY_GROUP_MANAGEMENT"
                    | "SSH"
                    | "TELEMETRY_EXPORT"
                )[];
                limit?: number;
                search?: string
                | null;
                sources?: ("UI" | "API" | "MCP" | "SYSTEM" | "OTHER")[];
                start_epoch_millis?: number | null;
                user_ids?: string[];
            };
        }

      Returns Promise<
          {
              items: {
                  actor: {
                      api_key_name: string
                      | null;
                      api_key_prefix: string | null;
                      email: string | null;
                      type:
                          | "USER"
                          | "API_KEY"
                          | "BASETEN_USER"
                          | "BASETEN_SYSTEM"
                          | "TOMBSTONE_USER";
                  };
                  client_name: string
                  | null;
                  client_session_id: string | null;
                  client_version: string | null;
                  created: string;
                  event_data:
                      | {
                          autoscaling_schedule_settings_update: | {
                              delete_schedule_ids: string[];
                              schedules: {
                                  autoscaling_window: (...)
                                  | (...);
                                  cadence: string;
                                  concurrency_target: (...) | (...);
                                  enabled: boolean;
                                  end_at: (...) | (...);
                                  end_hour: (...) | (...);
                                  end_minute: (...) | (...);
                                  max_replica: number;
                                  max_scale_down_rate: (...) | (...);
                                  min_replica: number;
                                  scale_down_delay: (...) | (...);
                                  schedule_id: (...) | (...);
                                  schedule_name: string;
                                  start_at: (...) | (...);
                                  start_hour: (...) | (...);
                                  start_minute: (...) | (...);
                                  target_in_flight_tokens: (...) | (...);
                                  target_utilization_percentage: (...) | (...);
                                  timezone: (...) | (...);
                                  weekdays: (...) | (...);
                              }[];
                              timezone: string
                              | null;
                          }
                          | null;
                          autoscaling_settings_update: | {
                              autoscaling_window: number
                              | null;
                              concurrency_target: number | null;
                              max_replica: number | null;
                              max_scale_down_rate: number | null;
                              min_replica: number | null;
                              scale_down_delay: number | null;
                              target_in_flight_tokens: number | null;
                              target_utilization_percentage: number | null;
                          }
                          | null;
                          deployment_id: string;
                          deployment_name: string;
                          environment_name: string
                          | null;
                          event_type: "MODEL_DEPLOYED";
                          instance_type_id_update: string | null;
                          model_id: string;
                          model_name: string;
                          promotion_settings_override:
                              | {
                                  max_surge_percent: number
                                  | null;
                                  max_unavailable_percent: number | null;
                                  promotion_cleanup_strategy: string | null;
                                  redeploy_on_promotion: boolean | null;
                                  replica_overhead_percent: number | null;
                                  rolling_deploy: boolean | null;
                                  rolling_deploy_strategy: string | null;
                                  stabilization_time_seconds: number | null;
                              }
                              | null;
                          publish: boolean;
                          region_update: string
                          | null;
                          request_backpressure_settings_update: { policy: string | null } | null;
                          scale_previous_to_zero: boolean;
                          trusted: boolean;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_ACTIVATED";
                          model_id: string;
                          model_name: string;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_DEACTIVATED";
                          model_id: string;
                          model_name: string;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_RETRIED";
                          model_id: string;
                          model_name: string;
                          retried: boolean;
                      }
                      | {
                          autoscaling_schedule_settings_update: | {
                              delete_schedule_ids: string[];
                              schedules: {
                                  autoscaling_window: (...)
                                  | (...);
                                  cadence: string;
                                  concurrency_target: (...) | (...);
                                  enabled: boolean;
                                  end_at: (...) | (...);
                                  end_hour: (...) | (...);
                                  end_minute: (...) | (...);
                                  max_replica: number;
                                  max_scale_down_rate: (...) | (...);
                                  min_replica: number;
                                  scale_down_delay: (...) | (...);
                                  schedule_id: (...) | (...);
                                  schedule_name: string;
                                  start_at: (...) | (...);
                                  start_hour: (...) | (...);
                                  start_minute: (...) | (...);
                                  target_in_flight_tokens: (...) | (...);
                                  target_utilization_percentage: (...) | (...);
                                  timezone: (...) | (...);
                                  weekdays: (...) | (...);
                              }[];
                              timezone: string
                              | null;
                          }
                          | null;
                          autoscaling_settings_update: | {
                              autoscaling_window: number
                              | null;
                              concurrency_target: number | null;
                              max_replica: number | null;
                              max_scale_down_rate: number | null;
                              min_replica: number | null;
                              scale_down_delay: number | null;
                              target_in_flight_tokens: number | null;
                              target_utilization_percentage: number | null;
                          }
                          | null;
                          deployment_id: string;
                          deployment_name: string;
                          environment_id: string
                          | null;
                          environment_name: string | null;
                          event_type: "MODEL_DEPLOYMENT_PROMOTED";
                          instance_type_id_update: string | null;
                          model_id: string;
                          model_name: string;
                          promotion_settings_override:
                              | {
                                  max_surge_percent: number
                                  | null;
                                  max_unavailable_percent: number | null;
                                  promotion_cleanup_strategy: string | null;
                                  redeploy_on_promotion: boolean | null;
                                  replica_overhead_percent: number | null;
                                  rolling_deploy: boolean | null;
                                  rolling_deploy_strategy: string | null;
                                  stabilization_time_seconds: number | null;
                              }
                              | null;
                          region_update: string
                          | null;
                          request_backpressure_settings_update: { policy: string | null } | null;
                      }
                      | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          deployment_id: string;
                          deployment_name: string;
                          deployment_type: string | null;
                          event_type: "MODEL_DEPLOYMENT_AUTOSCALING_SETTINGS_CHANGED";
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          model_id: string;
                          model_name: string;
                          previous_settings:
                              | {
                                  autoscaling_window: number
                                  | null;
                                  concurrency_target: number;
                                  max_replica: number;
                                  max_scale_down_rate: number | null;
                                  min_replica: number;
                                  scale_down_delay: number | null;
                                  target_in_flight_tokens: number | null;
                                  target_utilization_percentage: number | null;
                              }
                              | null;
                          scale_down_delay: number
                          | null;
                          schedules:
                              | {
                                  action: "DELETED"
                                  | "CREATED"
                                  | "UPDATED"
                                  | "UNCHANGED";
                                  current:
                                      | {
                                          autoscaling_window: ...;
                                          cadence: ...;
                                          concurrency_target: ...;
                                          enabled: ...;
                                          end_at: ...;
                                          end_hour: ...;
                                          end_minute: ...;
                                          max_replica: ...;
                                          max_scale_down_rate: ...;
                                          min_replica: ...;
                                          scale_down_delay: ...;
                                          schedule_name: ...;
                                          start_at: ...;
                                          start_hour: ...;
                                          start_minute: ...;
                                          target_in_flight_tokens: ...;
                                          target_utilization_percentage: ...;
                                          timezone: ...;
                                          weekdays: ...;
                                      }
                                      | null;
                                  previous: | {
                                      autoscaling_window: ...;
                                      cadence: ...;
                                      concurrency_target: ...;
                                      enabled: ...;
                                      end_at: ...;
                                      end_hour: ...;
                                      end_minute: ...;
                                      max_replica: ...;
                                      max_scale_down_rate: ...;
                                      min_replica: ...;
                                      scale_down_delay: ...;
                                      schedule_name: ...;
                                      start_at: ...;
                                      start_hour: ...;
                                      start_minute: ...;
                                      target_in_flight_tokens: ...;
                                      target_utilization_percentage: ...;
                                      timezone: ...;
                                      weekdays: ...;
                                  }
                                  | null;
                                  schedule_id: string;
                              }[]
                              | null;
                          target_in_flight_tokens: number
                          | null;
                          target_utilization_percentage: number | null;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_REQUEST_BACKPRESSURE_SETTINGS_CHANGED";
                          model_id: string;
                          model_name: string;
                          policy: string
                          | null;
                          previous_policy: string | null;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_INSTANCE_TYPE_CHANGED";
                          instance_type_name: string;
                          model_id: string;
                          model_name: string;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_DELETED";
                          model_id: string;
                          model_name: string;
                      }
                      | { event_type: "MODEL_DELETED"; model_id: string; model_name: string }
                      | {
                          event_type: "MODEL_RENAMED";
                          model_id: string;
                          model_name: string;
                          previous_name: string | null;
                      }
                      | {
                          chain_deployment_id: string;
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          event_type: "CHAIN_DEPLOYED";
                          is_primary: boolean;
                          publish: boolean;
                      }
                      | {
                          chain_deployment_id: string;
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          event_type: "CHAIN_DEPLOYMENT_ACTIVATED";
                      }
                      | {
                          chain_deployment_id: string;
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          event_type: "CHAIN_DEPLOYMENT_DEACTIVATED";
                      }
                      | {
                          chain_deployment_id: string;
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          environment_id: string | null;
                          environment_name: string | null;
                          event_type: "CHAIN_DEPLOYMENT_PROMOTED";
                      }
                      | {
                          autoscaling_window: number
                          | null;
                          chain_deployment_id: string;
                          chain_deployment_name: string | null;
                          chain_id: string;
                          chain_name: string;
                          chainlet_id: string;
                          chainlet_name: string;
                          concurrency_target: number;
                          event_type: "CHAINLET_AUTOSCALING_SETTINGS_CHANGED";
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          previous_settings:
                              | {
                                  autoscaling_window: number
                                  | null;
                                  concurrency_target: number;
                                  max_replica: number;
                                  max_scale_down_rate: number | null;
                                  min_replica: number;
                                  scale_down_delay: number | null;
                                  target_in_flight_tokens: number | null;
                                  target_utilization_percentage: number | null;
                              }
                              | null;
                          scale_down_delay: number
                          | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | {
                          chain_deployment_id: string;
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          chainlet_id: string;
                          chainlet_name: string;
                          event_type: "CHAINLET_INSTANCE_TYPE_CHANGED";
                          instance_type_name: string;
                      }
                      | {
                          chain_deployment_id: string;
                          chain_id: string;
                          chain_name: string;
                          deployment_name: string
                          | null;
                          event_type: "CHAIN_DEPLOYMENT_DELETED";
                      }
                      | {
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          event_type: "CHAIN_DELETED";
                      }
                      | {
                          chain_id: string;
                          chain_name: string;
                          environment_name: string;
                          event_type: "CHAIN_ENVIRONMENT_CREATED";
                          ramp_up_duration_seconds: number
                          | null;
                          ramp_up_while_promoting: boolean | null;
                          redeploy_on_promotion: boolean | null;
                      }
                      | {
                          chain_id: string;
                          chain_name: string;
                          environment_name: string;
                          event_type: "CHAIN_ENVIRONMENT_UPDATED";
                          ramp_up_duration_seconds: number
                          | null;
                          ramp_up_while_promoting: boolean | null;
                          redeploy_on_promotion: boolean | null;
                      }
                      | {
                          event_type: "SECRET_UPDATED";
                          secret_id: string;
                          secret_name: string;
                      }
                      | {
                          event_type: "SECRET_DELETED";
                          secret_id: string;
                          secret_name: string;
                      }
                      | {
                          api_key_id: string;
                          api_key_type: | "PERSONAL"
                          | "CREATOR_SERVICE_ACCOUNT"
                          | "MANAGE_API_KEYS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_ALLOWED_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_SCOPED_ENVS_AND_MODELS_SERVICE_ACCOUNT"
                          | "EXPORT_METRICS_ALL_MODELS_SERVICE_ACCOUNT"
                          | "EXPORT_METRICS_ALLOWED_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_SHARED_ENDPOINTS_SERVICE_ACCOUNT"
                          | "INVOKE_ALLOWED_SHARED_ENDPOINTS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_ROUTES";
                          event_type: "API_KEY_CREATED";
                          prefix: string;
                      }
                      | {
                          api_key_id: string;
                          api_key_type: | "PERSONAL"
                          | "CREATOR_SERVICE_ACCOUNT"
                          | "MANAGE_API_KEYS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_ALLOWED_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_SCOPED_ENVS_AND_MODELS_SERVICE_ACCOUNT"
                          | "EXPORT_METRICS_ALL_MODELS_SERVICE_ACCOUNT"
                          | "EXPORT_METRICS_ALLOWED_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_SHARED_ENDPOINTS_SERVICE_ACCOUNT"
                          | "INVOKE_ALLOWED_SHARED_ENDPOINTS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_ROUTES";
                          event_type: "API_KEY_DELETED";
                          prefix: string;
                          revocation_reason: "INACTIVITY"
                          | null;
                      }
                      | {
                          event_type: "API_KEY_LIFETIME_LIMITS_UPDATED";
                          new_personal_limit_days: number
                          | null;
                          new_team_limit_days: number | null;
                          organization_id: string;
                          previous_personal_limit_days: number | null;
                          previous_team_limit_days: number | null;
                      }
                      | {
                          event_type: "GATEWAY_ENDPOINT_CREATED";
                          gateway_endpoint_id: string;
                          slug: string;
                      }
                      | {
                          event_type: "GATEWAY_ENDPOINT_UPDATED";
                          gateway_endpoint_id: string;
                          previous_slug: string
                          | null;
                          slug: string;
                      }
                      | {
                          event_type: "GATEWAY_ENDPOINT_DELETED";
                          gateway_endpoint_id: string;
                          slug: string;
                      }
                      | {
                          event_type: "PROVIDER_CONNECTION_CREATED";
                          provider: string;
                          provider_connection_id: string;
                          secret_name: string;
                      }
                      | {
                          event_type: "PROVIDER_CONNECTION_UPDATED";
                          provider: string;
                          provider_connection_id: string;
                          secret_name: string;
                      }
                      | {
                          event_type: "PROVIDER_CONNECTION_DELETED";
                          provider: string;
                          provider_connection_id: string;
                          secret_name: string;
                      }
                      | {
                          event_type: "GRID_MACHINE_USER_CREATED";
                          machine_user_id: string;
                          machine_user_name: string;
                          team_id: string;
                          team_name: string;
                      }
                      | {
                          event_type: "GRID_MACHINE_USER_UPDATED";
                          machine_user_id: string;
                          machine_user_name: string;
                          previous_machine_user_name: string;
                          team_id: string;
                          team_name: string;
                      }
                      | {
                          event_type: "GRID_MACHINE_USER_DELETED";
                          machine_user_id: string;
                          machine_user_name: string;
                          team_id: string;
                          team_name: string;
                      }
                      | {
                          event_type: "USER_INVITED";
                          invited_user_email: string;
                          role_name: string;
                      }
                      | {
                          event_type: "USER_JOINED_ORGANIZATION";
                          new_user_email: string;
                          user_id: string;
                      }
                      | {
                          event_type: "WEBHOOK_SIGNING_SECRET_CREATED";
                          webhook_signing_secret_id: string;
                      }
                      | {
                          event_type: "WEBHOOK_SIGNING_SECRET_ROTATED";
                          webhook_signing_secret_id: string;
                      }
                      | {
                          event_type: "WEBHOOK_SIGNING_SECRET_DELETED";
                          webhook_signing_secret_id: string;
                      }
                      | {
                          event_type: "USER_ROLE_UPDATED";
                          new_role_name: string;
                          user_email: string;
                          user_id: string;
                      }
                      | {
                          event_type: "USER_TEAM_ROLE_UPDATED";
                          new_role_name: string;
                          team_id: string;
                          team_name: string;
                          user_email: string;
                          user_id: string;
                      }
                      | { event_type: "USER_REMOVED"; removed_user_email: string }
                      | {
                          directory_group_id: string;
                          directory_group_name: string;
                          event_type: "DIRECTORY_GROUP_ROLE_UPDATED";
                          new_role_name: string;
                          team_id: string | null;
                          team_name: string | null;
                      }
                      | {
                          event_type: "REQUIRE_GROUP_BASED_ADMINS_ENABLED";
                          organization_id: string;
                      }
                      | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          deployment_type: string | null;
                          environment_name: string;
                          event_type: "ENVIRONMENT_CREATED";
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          max_surge_percent: number | null;
                          max_unavailable_percent: number | null;
                          min_replica: number;
                          model_id: string;
                          model_name: string;
                          promotion_cleanup_strategy: string | null;
                          ramp_up_duration_seconds: number | null;
                          ramp_up_step_size: number | null;
                          ramp_up_while_promoting: boolean | null;
                          redeploy_on_promotion: boolean | null;
                          replica_overhead_percent: number | null;
                          request_backpressure_policy: string | null;
                          rolling_deploy: boolean | null;
                          rolling_deploy_strategy: string | null;
                          scale_down_delay: number | null;
                          stabilization_time_seconds: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          deployment_type: string | null;
                          environment_name: string;
                          event_type: "ENVIRONMENT_UPDATED";
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          max_surge_percent: number | null;
                          max_unavailable_percent: number | null;
                          min_replica: number;
                          model_id: string;
                          model_name: string;
                          previous_settings:
                              | {
                                  autoscaling_window: number
                                  | null;
                                  concurrency_target: number;
                                  max_replica: number;
                                  max_scale_down_rate: number | null;
                                  max_surge_percent: number | null;
                                  max_unavailable_percent: number | null;
                                  min_replica: number;
                                  promotion_cleanup_strategy: string | null;
                                  ramp_up_duration_seconds: number | null;
                                  ramp_up_step_size: number | null;
                                  ramp_up_while_promoting: boolean | null;
                                  redeploy_on_promotion: boolean | null;
                                  replica_overhead_percent: number | null;
                                  request_backpressure_policy: string | null;
                                  rolling_deploy: boolean | null;
                                  rolling_deploy_strategy: string | null;
                                  scale_down_delay: number | null;
                                  stabilization_time_seconds: number | null;
                                  target_in_flight_tokens: number | null;
                                  target_utilization_percentage: number | null;
                              }
                              | null;
                          promotion_cleanup_strategy: string
                          | null;
                          ramp_up_duration_seconds: number | null;
                          ramp_up_step_size: number | null;
                          ramp_up_while_promoting: boolean | null;
                          redeploy_on_promotion: boolean | null;
                          replica_overhead_percent: number | null;
                          request_backpressure_policy: string | null;
                          rolling_deploy: boolean | null;
                          rolling_deploy_strategy: string | null;
                          scale_down_delay: number | null;
                          schedules:
                              | {
                                  action: "DELETED"
                                  | "CREATED"
                                  | "UPDATED"
                                  | "UNCHANGED";
                                  current:
                                      | {
                                          autoscaling_window: ...;
                                          cadence: ...;
                                          concurrency_target: ...;
                                          enabled: ...;
                                          end_at: ...;
                                          end_hour: ...;
                                          end_minute: ...;
                                          max_replica: ...;
                                          max_scale_down_rate: ...;
                                          min_replica: ...;
                                          scale_down_delay: ...;
                                          schedule_name: ...;
                                          start_at: ...;
                                          start_hour: ...;
                                          start_minute: ...;
                                          target_in_flight_tokens: ...;
                                          target_utilization_percentage: ...;
                                          timezone: ...;
                                          weekdays: ...;
                                      }
                                      | null;
                                  previous: | {
                                      autoscaling_window: ...;
                                      cadence: ...;
                                      concurrency_target: ...;
                                      enabled: ...;
                                      end_at: ...;
                                      end_hour: ...;
                                      end_minute: ...;
                                      max_replica: ...;
                                      max_scale_down_rate: ...;
                                      min_replica: ...;
                                      scale_down_delay: ...;
                                      schedule_name: ...;
                                      start_at: ...;
                                      start_hour: ...;
                                      start_minute: ...;
                                      target_in_flight_tokens: ...;
                                      target_utilization_percentage: ...;
                                      timezone: ...;
                                      weekdays: ...;
                                  }
                                  | null;
                                  schedule_id: string;
                              }[]
                              | null;
                          stabilization_time_seconds: number
                          | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | {
                          environment_name: string;
                          event_type: "ENVIRONMENT_DELETED";
                          model_id: string;
                          model_name: string;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "REPLICA_TERMINATED";
                          model_id: string;
                          model_name: string;
                          replica_id: string;
                      }
                      | {
                          action: | "PAUSE"
                          | "RESUME"
                          | "FORCE_CANCEL"
                          | "FORCE_ROLL_FORWARD"
                          | "GRACEFUL_CANCEL";
                          deployment_id: string;
                          deployment_name: string;
                          environment_id: string
                          | null;
                          environment_name: string;
                          event_type: "MODEL_PROMOTION_CONTROL_ACTION";
                          model_id: string;
                          model_name: string;
                      }
                      | {
                          event_type: "SSH_CERTIFICATE_SIGNED";
                          expires_at: string;
                          project_id: string;
                          proxy_address: string;
                          replica_id: string;
                          workload_id: string;
                          workload_type: string;
                      }
                      | {
                          event_type: "VOLUME_DELETED";
                          namespace: string;
                          versions_deleted: number;
                          volume_name: string;
                          volume_ref: string;
                      }
                      | {
                          digest: string;
                          event_type: "VOLUME_VERSION_DELETED";
                          namespace: string;
                          version: string;
                          volume_name: string;
                          volume_ref: string;
                      }
                      | {
                          digest: string;
                          event_type: "VOLUME_VERSION_RESTORED";
                          namespace: string;
                          version: string;
                          volume_name: string;
                          volume_ref: string;
                      }
                      | {
                          digest: string;
                          event_type: "VOLUME_TAG_SET";
                          tag: string;
                          volume_ref: string;
                      }
                      | {
                          deleted: boolean;
                          event_type: "VOLUME_TAG_DELETED";
                          tag: string;
                          volume_ref: string;
                      }
                      | {
                          event_type: "VOLUME_UPDATED";
                          expires_at: string
                          | null;
                          previous_expires_at: string | null;
                          volume_ref: string;
                      }
                      | {
                          event_type: "TELEMETRY_EXPORT_CREATED";
                          telemetry_export_configuration_id: string;
                      }
                      | {
                          credential_rotated: boolean;
                          enabled: boolean
                          | null;
                          event_type: "TELEMETRY_EXPORT_UPDATED";
                          telemetry_export_configuration_id: string;
                      }
                      | {
                          event_type: "TELEMETRY_EXPORT_DELETED";
                          telemetry_export_configuration_id: string;
                      };
                  event_type: | "REPLICA_TERMINATED"
                  | "MODEL_DEPLOYED"
                  | "MODEL_DEPLOYMENT_ACTIVATED"
                  | "MODEL_DEPLOYMENT_DEACTIVATED"
                  | "MODEL_DEPLOYMENT_RETRIED"
                  | "MODEL_DEPLOYMENT_PROMOTED"
                  | "MODEL_DEPLOYMENT_AUTOSCALING_SETTINGS_CHANGED"
                  | "MODEL_DEPLOYMENT_REQUEST_BACKPRESSURE_SETTINGS_CHANGED"
                  | "MODEL_DEPLOYMENT_INSTANCE_TYPE_CHANGED"
                  | "MODEL_DEPLOYMENT_DELETED"
                  | "MODEL_DELETED"
                  | "MODEL_RENAMED"
                  | "CHAIN_DEPLOYED"
                  | "CHAIN_DEPLOYMENT_ACTIVATED"
                  | "CHAIN_DEPLOYMENT_DEACTIVATED"
                  | "CHAIN_DEPLOYMENT_PROMOTED"
                  | "CHAINLET_AUTOSCALING_SETTINGS_CHANGED"
                  | "CHAINLET_INSTANCE_TYPE_CHANGED"
                  | "CHAIN_DEPLOYMENT_DELETED"
                  | "CHAIN_DELETED"
                  | "CHAIN_ENVIRONMENT_CREATED"
                  | "CHAIN_ENVIRONMENT_UPDATED"
                  | "SECRET_UPDATED"
                  | "SECRET_DELETED"
                  | "API_KEY_CREATED"
                  | "API_KEY_DELETED"
                  | "API_KEY_LIFETIME_LIMITS_UPDATED"
                  | "GATEWAY_ENDPOINT_CREATED"
                  | "GATEWAY_ENDPOINT_UPDATED"
                  | "GATEWAY_ENDPOINT_DELETED"
                  | "PROVIDER_CONNECTION_CREATED"
                  | "PROVIDER_CONNECTION_UPDATED"
                  | "PROVIDER_CONNECTION_DELETED"
                  | "GRID_MACHINE_USER_CREATED"
                  | "GRID_MACHINE_USER_UPDATED"
                  | "GRID_MACHINE_USER_DELETED"
                  | "USER_INVITED"
                  | "USER_JOINED_ORGANIZATION"
                  | "WEBHOOK_SIGNING_SECRET_CREATED"
                  | "WEBHOOK_SIGNING_SECRET_ROTATED"
                  | "WEBHOOK_SIGNING_SECRET_DELETED"
                  | "USER_ROLE_UPDATED"
                  | "USER_TEAM_ROLE_UPDATED"
                  | "USER_REMOVED"
                  | "DIRECTORY_GROUP_ROLE_UPDATED"
                  | "REQUIRE_GROUP_BASED_ADMINS_ENABLED"
                  | "ENVIRONMENT_CREATED"
                  | "ENVIRONMENT_UPDATED"
                  | "ENVIRONMENT_DELETED"
                  | "MODEL_PROMOTION_CONTROL_ACTION"
                  | "SSH_CERTIFICATE_SIGNED"
                  | "VOLUME_DELETED"
                  | "VOLUME_VERSION_DELETED"
                  | "VOLUME_VERSION_RESTORED"
                  | "VOLUME_TAG_SET"
                  | "VOLUME_TAG_DELETED"
                  | "VOLUME_UPDATED"
                  | "TELEMETRY_EXPORT_CREATED"
                  | "TELEMETRY_EXPORT_UPDATED"
                  | "TELEMETRY_EXPORT_DELETED";
                  id: string;
                  source: "UI"
                  | "API"
                  | "MCP"
                  | "SYSTEM"
                  | "OTHER"
                  | null;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets daily Model APIs costs

      Parameters

      • Optionalparams: {
            params?: {
                api_key_prefixes?: string[];
                cursor?: string | null;
                end_date?: string | null;
                group_by?: ("api_key_prefix" | "user" | "model" | "service_tier" | "team")[];
                limit?: number;
                models?: string[];
                service_tiers?: string[];
                start_date?: string | null;
                team_ids?: string[];
                user_ids?: string[];
            };
        }

      Returns Promise<
          {
              items: {
                  date: string;
                  results?: {
                      api_key_prefixes: string[]
                      | null;
                      model: string | null;
                      service_tier: string | null;
                      subtotal: string;
                      team_id: string | null;
                      user_id: string | null;
                  }[];
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets server-side tool call usage

      Parameters

      • params: {
            params: {
                end_date?: string | null;
                group_by?: "TEAM"[];
                start_date: string;
                team_ids?: string[];
            };
        }

      Returns Promise<
          {
              items?: {
                  calls: number;
                  date: string;
                  model: string;
                  provider: string;
                  quantity: number;
                  sku: string;
                  team_id: string
                  | null;
              }[];
          },
      >

    • Gets billing usage summary for a date range

      Parameters

      • params: { params: { end_date: string; start_date: string } }

      Returns Promise<
          {
              dedicated_usage: | {
                  breakdown?: {
                      billable_resource: {
                          base_model: string
                          | null;
                          chain_metadata:
                              | {
                                  chain_deployment_id: string;
                                  chain_id: string;
                                  chain_name: (...)
                                  | (...);
                              }
                              | null;
                          environment_name: string
                          | null;
                          id: string;
                          instance_type: string | null;
                          is_deleted: boolean;
                          kind:
                              | "LOOPS_RUN"
                              | "LOOPS_SAMPLER"
                              | "LOOPS_TRAINER"
                              | "MODEL_DEPLOYMENT"
                              | "TRAINING_JOB"
                              | "CHAINLET";
                          model_id: string
                          | null;
                          model_name: string | null;
                          name: string | null;
                          team_id: string | null;
                          team_name: string | null;
                      };
                      compute_cost: string
                      | number;
                      daily?: {
                          compute_cost: (...) | (...);
                          date: string;
                          inference_requests: number;
                          minutes: number;
                          subtotal: (...) | (...);
                          surcharge_cost: (...) | (...);
                      }[];
                      inference_requests: number;
                      minutes: number;
                      subtotal: string
                      | number;
                      surcharge_cost: string | number;
                  }[];
                  credits_used: string
                  | number;
                  minutes: number;
                  subtotal: string | number;
                  total: string | number;
              }
              | null;
              loops_usage: | {
                  breakdown?: {
                      base_model: string;
                      breakdown?: {
                          billable_resource: {
                              base_model: ...;
                              chain_metadata: ...;
                              environment_name: ...;
                              id: ...;
                              instance_type: ...;
                              is_deleted: ...;
                              kind: ...;
                              model_id: ...;
                              model_name: ...;
                              name: ...;
                              team_id: ...;
                              team_name: ...;
                          };
                          cached_prefill: { subtotal: ...; tokens: ... };
                          daily?: (...) | (...);
                          sample: { subtotal: ...; tokens: ... };
                          subtotal: (...) | (...);
                          train: { subtotal: ...; tokens: ... };
                          uncached_prefill: { subtotal: ...; tokens: ... };
                      }[];
                      cached_prefill: { subtotal: string
                      | number; tokens: number };
                      daily?: {
                          cached_prefill: { subtotal: ...; tokens: ... };
                          date: string;
                          sample: { subtotal: ...; tokens: ... };
                          subtotal: (...) | (...);
                          train: { subtotal: ...; tokens: ... };
                          uncached_prefill: { subtotal: ...; tokens: ... };
                      }[];
                      sample: { subtotal: string
                      | number; tokens: number };
                      subtotal: string | number;
                      train: { subtotal: string | number; tokens: number };
                      uncached_prefill: { subtotal: string | number; tokens: number };
                  }[];
                  credits_used: string
                  | number;
                  subtotal: string | number;
                  total: string | number;
              }
              | null;
              model_apis_usage: | {
                  breakdown?: {
                      cached_input_tokens: number;
                      daily?: {
                          cached_input_tokens: number;
                          date: string;
                          input_tokens: number;
                          output_tokens: number;
                          subtotal: (...)
                          | (...);
                      }[];
                      input_tokens: number;
                      model_family: string
                      | null;
                      model_name: string;
                      output_tokens: number;
                      subtotal: string | number;
                  }[];
                  credits_used: string
                  | number;
                  subtotal: string | number;
                  total: string | number;
              }
              | null;
              training_usage: | {
                  breakdown?: {
                      billable_resource: {
                          base_model: string
                          | null;
                          chain_metadata:
                              | {
                                  chain_deployment_id: string;
                                  chain_id: string;
                                  chain_name: (...)
                                  | (...);
                              }
                              | null;
                          environment_name: string
                          | null;
                          id: string;
                          instance_type: string | null;
                          is_deleted: boolean;
                          kind:
                              | "LOOPS_RUN"
                              | "LOOPS_SAMPLER"
                              | "LOOPS_TRAINER"
                              | "MODEL_DEPLOYMENT"
                              | "TRAINING_JOB"
                              | "CHAINLET";
                          model_id: string
                          | null;
                          model_name: string | null;
                          name: string | null;
                          team_id: string | null;
                          team_name: string | null;
                      };
                      daily?: { date: string; minutes: number; subtotal: (...)
                      | (...) }[];
                      minutes: number;
                      subtotal: string | number;
                  }[];
                  credits_used: string
                  | number;
                  minutes: number;
                  subtotal: string | number;
                  total: string | number;
              }
              | null;
          },
      >

    • Gets blob credentials for models

      Returns Promise<
          {
              creds: {
                  aws_access_key_id: string;
                  aws_secret_access_key: string;
                  aws_session_token: string;
              };
              s3_bucket: string;
              s3_key: string;
          },
      >

    • Gets blob credentials for training

      Returns Promise<
          {
              creds: {
                  aws_access_key_id: string;
                  aws_secret_access_key: string;
                  aws_session_token: string;
              };
              s3_bucket: string;
              s3_key: string;
          },
      >

    • Gets all chains

      Returns Promise<
          {
              chains: {
                  created_at: string;
                  deployments_count: number;
                  id: string;
                  name: string;
                  team_name: string;
              }[];
          },
      >

    • Gets the audit log for a chain

      Parameters

      • params: {
            chain_id: string;
            params?: {
                chain_deployment_ids?: string[];
                cursor?: string | null;
                deployment_ids?: string[];
                direction?: "DESC" | "ASC";
                end_epoch_millis?: number | null;
                environment_names?: string[];
                event_type_groups?: (
                    | "GRID"
                    | "DEPLOYED"
                    | "PROMOTED"
                    | "ACTIVATED_DEACTIVATED"
                    | "AUTOSCALING_SETTINGS"
                    | "REQUEST_BACKPRESSURE_SETTINGS"
                    | "INSTANCE_TYPE_CHANGED"
                    | "ENVIRONMENT_SETTINGS"
                    | "REPLICA_TERMINATED"
                    | "DELETED"
                    | "METADATA"
                    | "SECRETS"
                    | "API_KEYS"
                    | "GATEWAY"
                    | "WEBHOOK_SIGNING_SECRETS"
                    | "USER_MANAGEMENT"
                    | "DIRECTORY_GROUP_MANAGEMENT"
                    | "SSH"
                    | "TELEMETRY_EXPORT"
                )[];
                limit?: number;
                search?: string
                | null;
                sources?: ("UI" | "API" | "MCP" | "SYSTEM" | "OTHER")[];
                start_epoch_millis?: number | null;
                user_ids?: string[];
            };
        }

      Returns Promise<
          {
              items: {
                  actor: {
                      api_key_name: string
                      | null;
                      api_key_prefix: string | null;
                      email: string | null;
                      type:
                          | "USER"
                          | "API_KEY"
                          | "BASETEN_USER"
                          | "BASETEN_SYSTEM"
                          | "TOMBSTONE_USER";
                  };
                  client_name: string
                  | null;
                  client_session_id: string | null;
                  client_version: string | null;
                  created: string;
                  event_data:
                      | {
                          autoscaling_schedule_settings_update: | {
                              delete_schedule_ids: string[];
                              schedules: {
                                  autoscaling_window: (...)
                                  | (...);
                                  cadence: string;
                                  concurrency_target: (...) | (...);
                                  enabled: boolean;
                                  end_at: (...) | (...);
                                  end_hour: (...) | (...);
                                  end_minute: (...) | (...);
                                  max_replica: number;
                                  max_scale_down_rate: (...) | (...);
                                  min_replica: number;
                                  scale_down_delay: (...) | (...);
                                  schedule_id: (...) | (...);
                                  schedule_name: string;
                                  start_at: (...) | (...);
                                  start_hour: (...) | (...);
                                  start_minute: (...) | (...);
                                  target_in_flight_tokens: (...) | (...);
                                  target_utilization_percentage: (...) | (...);
                                  timezone: (...) | (...);
                                  weekdays: (...) | (...);
                              }[];
                              timezone: string
                              | null;
                          }
                          | null;
                          autoscaling_settings_update: | {
                              autoscaling_window: number
                              | null;
                              concurrency_target: number | null;
                              max_replica: number | null;
                              max_scale_down_rate: number | null;
                              min_replica: number | null;
                              scale_down_delay: number | null;
                              target_in_flight_tokens: number | null;
                              target_utilization_percentage: number | null;
                          }
                          | null;
                          deployment_id: string;
                          deployment_name: string;
                          environment_name: string
                          | null;
                          event_type: "MODEL_DEPLOYED";
                          instance_type_id_update: string | null;
                          model_id: string;
                          model_name: string;
                          promotion_settings_override:
                              | {
                                  max_surge_percent: number
                                  | null;
                                  max_unavailable_percent: number | null;
                                  promotion_cleanup_strategy: string | null;
                                  redeploy_on_promotion: boolean | null;
                                  replica_overhead_percent: number | null;
                                  rolling_deploy: boolean | null;
                                  rolling_deploy_strategy: string | null;
                                  stabilization_time_seconds: number | null;
                              }
                              | null;
                          publish: boolean;
                          region_update: string
                          | null;
                          request_backpressure_settings_update: { policy: string | null } | null;
                          scale_previous_to_zero: boolean;
                          trusted: boolean;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_ACTIVATED";
                          model_id: string;
                          model_name: string;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_DEACTIVATED";
                          model_id: string;
                          model_name: string;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_RETRIED";
                          model_id: string;
                          model_name: string;
                          retried: boolean;
                      }
                      | {
                          autoscaling_schedule_settings_update: | {
                              delete_schedule_ids: string[];
                              schedules: {
                                  autoscaling_window: (...)
                                  | (...);
                                  cadence: string;
                                  concurrency_target: (...) | (...);
                                  enabled: boolean;
                                  end_at: (...) | (...);
                                  end_hour: (...) | (...);
                                  end_minute: (...) | (...);
                                  max_replica: number;
                                  max_scale_down_rate: (...) | (...);
                                  min_replica: number;
                                  scale_down_delay: (...) | (...);
                                  schedule_id: (...) | (...);
                                  schedule_name: string;
                                  start_at: (...) | (...);
                                  start_hour: (...) | (...);
                                  start_minute: (...) | (...);
                                  target_in_flight_tokens: (...) | (...);
                                  target_utilization_percentage: (...) | (...);
                                  timezone: (...) | (...);
                                  weekdays: (...) | (...);
                              }[];
                              timezone: string
                              | null;
                          }
                          | null;
                          autoscaling_settings_update: | {
                              autoscaling_window: number
                              | null;
                              concurrency_target: number | null;
                              max_replica: number | null;
                              max_scale_down_rate: number | null;
                              min_replica: number | null;
                              scale_down_delay: number | null;
                              target_in_flight_tokens: number | null;
                              target_utilization_percentage: number | null;
                          }
                          | null;
                          deployment_id: string;
                          deployment_name: string;
                          environment_id: string
                          | null;
                          environment_name: string | null;
                          event_type: "MODEL_DEPLOYMENT_PROMOTED";
                          instance_type_id_update: string | null;
                          model_id: string;
                          model_name: string;
                          promotion_settings_override:
                              | {
                                  max_surge_percent: number
                                  | null;
                                  max_unavailable_percent: number | null;
                                  promotion_cleanup_strategy: string | null;
                                  redeploy_on_promotion: boolean | null;
                                  replica_overhead_percent: number | null;
                                  rolling_deploy: boolean | null;
                                  rolling_deploy_strategy: string | null;
                                  stabilization_time_seconds: number | null;
                              }
                              | null;
                          region_update: string
                          | null;
                          request_backpressure_settings_update: { policy: string | null } | null;
                      }
                      | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          deployment_id: string;
                          deployment_name: string;
                          deployment_type: string | null;
                          event_type: "MODEL_DEPLOYMENT_AUTOSCALING_SETTINGS_CHANGED";
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          model_id: string;
                          model_name: string;
                          previous_settings:
                              | {
                                  autoscaling_window: number
                                  | null;
                                  concurrency_target: number;
                                  max_replica: number;
                                  max_scale_down_rate: number | null;
                                  min_replica: number;
                                  scale_down_delay: number | null;
                                  target_in_flight_tokens: number | null;
                                  target_utilization_percentage: number | null;
                              }
                              | null;
                          scale_down_delay: number
                          | null;
                          schedules:
                              | {
                                  action: "DELETED"
                                  | "CREATED"
                                  | "UPDATED"
                                  | "UNCHANGED";
                                  current:
                                      | {
                                          autoscaling_window: ...;
                                          cadence: ...;
                                          concurrency_target: ...;
                                          enabled: ...;
                                          end_at: ...;
                                          end_hour: ...;
                                          end_minute: ...;
                                          max_replica: ...;
                                          max_scale_down_rate: ...;
                                          min_replica: ...;
                                          scale_down_delay: ...;
                                          schedule_name: ...;
                                          start_at: ...;
                                          start_hour: ...;
                                          start_minute: ...;
                                          target_in_flight_tokens: ...;
                                          target_utilization_percentage: ...;
                                          timezone: ...;
                                          weekdays: ...;
                                      }
                                      | null;
                                  previous: | {
                                      autoscaling_window: ...;
                                      cadence: ...;
                                      concurrency_target: ...;
                                      enabled: ...;
                                      end_at: ...;
                                      end_hour: ...;
                                      end_minute: ...;
                                      max_replica: ...;
                                      max_scale_down_rate: ...;
                                      min_replica: ...;
                                      scale_down_delay: ...;
                                      schedule_name: ...;
                                      start_at: ...;
                                      start_hour: ...;
                                      start_minute: ...;
                                      target_in_flight_tokens: ...;
                                      target_utilization_percentage: ...;
                                      timezone: ...;
                                      weekdays: ...;
                                  }
                                  | null;
                                  schedule_id: string;
                              }[]
                              | null;
                          target_in_flight_tokens: number
                          | null;
                          target_utilization_percentage: number | null;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_REQUEST_BACKPRESSURE_SETTINGS_CHANGED";
                          model_id: string;
                          model_name: string;
                          policy: string
                          | null;
                          previous_policy: string | null;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_INSTANCE_TYPE_CHANGED";
                          instance_type_name: string;
                          model_id: string;
                          model_name: string;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_DELETED";
                          model_id: string;
                          model_name: string;
                      }
                      | { event_type: "MODEL_DELETED"; model_id: string; model_name: string }
                      | {
                          event_type: "MODEL_RENAMED";
                          model_id: string;
                          model_name: string;
                          previous_name: string | null;
                      }
                      | {
                          chain_deployment_id: string;
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          event_type: "CHAIN_DEPLOYED";
                          is_primary: boolean;
                          publish: boolean;
                      }
                      | {
                          chain_deployment_id: string;
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          event_type: "CHAIN_DEPLOYMENT_ACTIVATED";
                      }
                      | {
                          chain_deployment_id: string;
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          event_type: "CHAIN_DEPLOYMENT_DEACTIVATED";
                      }
                      | {
                          chain_deployment_id: string;
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          environment_id: string | null;
                          environment_name: string | null;
                          event_type: "CHAIN_DEPLOYMENT_PROMOTED";
                      }
                      | {
                          autoscaling_window: number
                          | null;
                          chain_deployment_id: string;
                          chain_deployment_name: string | null;
                          chain_id: string;
                          chain_name: string;
                          chainlet_id: string;
                          chainlet_name: string;
                          concurrency_target: number;
                          event_type: "CHAINLET_AUTOSCALING_SETTINGS_CHANGED";
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          previous_settings:
                              | {
                                  autoscaling_window: number
                                  | null;
                                  concurrency_target: number;
                                  max_replica: number;
                                  max_scale_down_rate: number | null;
                                  min_replica: number;
                                  scale_down_delay: number | null;
                                  target_in_flight_tokens: number | null;
                                  target_utilization_percentage: number | null;
                              }
                              | null;
                          scale_down_delay: number
                          | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | {
                          chain_deployment_id: string;
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          chainlet_id: string;
                          chainlet_name: string;
                          event_type: "CHAINLET_INSTANCE_TYPE_CHANGED";
                          instance_type_name: string;
                      }
                      | {
                          chain_deployment_id: string;
                          chain_id: string;
                          chain_name: string;
                          deployment_name: string
                          | null;
                          event_type: "CHAIN_DEPLOYMENT_DELETED";
                      }
                      | {
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          event_type: "CHAIN_DELETED";
                      }
                      | {
                          chain_id: string;
                          chain_name: string;
                          environment_name: string;
                          event_type: "CHAIN_ENVIRONMENT_CREATED";
                          ramp_up_duration_seconds: number
                          | null;
                          ramp_up_while_promoting: boolean | null;
                          redeploy_on_promotion: boolean | null;
                      }
                      | {
                          chain_id: string;
                          chain_name: string;
                          environment_name: string;
                          event_type: "CHAIN_ENVIRONMENT_UPDATED";
                          ramp_up_duration_seconds: number
                          | null;
                          ramp_up_while_promoting: boolean | null;
                          redeploy_on_promotion: boolean | null;
                      }
                      | {
                          event_type: "SECRET_UPDATED";
                          secret_id: string;
                          secret_name: string;
                      }
                      | {
                          event_type: "SECRET_DELETED";
                          secret_id: string;
                          secret_name: string;
                      }
                      | {
                          api_key_id: string;
                          api_key_type: | "PERSONAL"
                          | "CREATOR_SERVICE_ACCOUNT"
                          | "MANAGE_API_KEYS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_ALLOWED_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_SCOPED_ENVS_AND_MODELS_SERVICE_ACCOUNT"
                          | "EXPORT_METRICS_ALL_MODELS_SERVICE_ACCOUNT"
                          | "EXPORT_METRICS_ALLOWED_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_SHARED_ENDPOINTS_SERVICE_ACCOUNT"
                          | "INVOKE_ALLOWED_SHARED_ENDPOINTS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_ROUTES";
                          event_type: "API_KEY_CREATED";
                          prefix: string;
                      }
                      | {
                          api_key_id: string;
                          api_key_type: | "PERSONAL"
                          | "CREATOR_SERVICE_ACCOUNT"
                          | "MANAGE_API_KEYS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_ALLOWED_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_SCOPED_ENVS_AND_MODELS_SERVICE_ACCOUNT"
                          | "EXPORT_METRICS_ALL_MODELS_SERVICE_ACCOUNT"
                          | "EXPORT_METRICS_ALLOWED_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_SHARED_ENDPOINTS_SERVICE_ACCOUNT"
                          | "INVOKE_ALLOWED_SHARED_ENDPOINTS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_ROUTES";
                          event_type: "API_KEY_DELETED";
                          prefix: string;
                          revocation_reason: "INACTIVITY"
                          | null;
                      }
                      | {
                          event_type: "API_KEY_LIFETIME_LIMITS_UPDATED";
                          new_personal_limit_days: number
                          | null;
                          new_team_limit_days: number | null;
                          organization_id: string;
                          previous_personal_limit_days: number | null;
                          previous_team_limit_days: number | null;
                      }
                      | {
                          event_type: "GATEWAY_ENDPOINT_CREATED";
                          gateway_endpoint_id: string;
                          slug: string;
                      }
                      | {
                          event_type: "GATEWAY_ENDPOINT_UPDATED";
                          gateway_endpoint_id: string;
                          previous_slug: string
                          | null;
                          slug: string;
                      }
                      | {
                          event_type: "GATEWAY_ENDPOINT_DELETED";
                          gateway_endpoint_id: string;
                          slug: string;
                      }
                      | {
                          event_type: "PROVIDER_CONNECTION_CREATED";
                          provider: string;
                          provider_connection_id: string;
                          secret_name: string;
                      }
                      | {
                          event_type: "PROVIDER_CONNECTION_UPDATED";
                          provider: string;
                          provider_connection_id: string;
                          secret_name: string;
                      }
                      | {
                          event_type: "PROVIDER_CONNECTION_DELETED";
                          provider: string;
                          provider_connection_id: string;
                          secret_name: string;
                      }
                      | {
                          event_type: "GRID_MACHINE_USER_CREATED";
                          machine_user_id: string;
                          machine_user_name: string;
                          team_id: string;
                          team_name: string;
                      }
                      | {
                          event_type: "GRID_MACHINE_USER_UPDATED";
                          machine_user_id: string;
                          machine_user_name: string;
                          previous_machine_user_name: string;
                          team_id: string;
                          team_name: string;
                      }
                      | {
                          event_type: "GRID_MACHINE_USER_DELETED";
                          machine_user_id: string;
                          machine_user_name: string;
                          team_id: string;
                          team_name: string;
                      }
                      | {
                          event_type: "USER_INVITED";
                          invited_user_email: string;
                          role_name: string;
                      }
                      | {
                          event_type: "USER_JOINED_ORGANIZATION";
                          new_user_email: string;
                          user_id: string;
                      }
                      | {
                          event_type: "WEBHOOK_SIGNING_SECRET_CREATED";
                          webhook_signing_secret_id: string;
                      }
                      | {
                          event_type: "WEBHOOK_SIGNING_SECRET_ROTATED";
                          webhook_signing_secret_id: string;
                      }
                      | {
                          event_type: "WEBHOOK_SIGNING_SECRET_DELETED";
                          webhook_signing_secret_id: string;
                      }
                      | {
                          event_type: "USER_ROLE_UPDATED";
                          new_role_name: string;
                          user_email: string;
                          user_id: string;
                      }
                      | {
                          event_type: "USER_TEAM_ROLE_UPDATED";
                          new_role_name: string;
                          team_id: string;
                          team_name: string;
                          user_email: string;
                          user_id: string;
                      }
                      | { event_type: "USER_REMOVED"; removed_user_email: string }
                      | {
                          directory_group_id: string;
                          directory_group_name: string;
                          event_type: "DIRECTORY_GROUP_ROLE_UPDATED";
                          new_role_name: string;
                          team_id: string | null;
                          team_name: string | null;
                      }
                      | {
                          event_type: "REQUIRE_GROUP_BASED_ADMINS_ENABLED";
                          organization_id: string;
                      }
                      | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          deployment_type: string | null;
                          environment_name: string;
                          event_type: "ENVIRONMENT_CREATED";
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          max_surge_percent: number | null;
                          max_unavailable_percent: number | null;
                          min_replica: number;
                          model_id: string;
                          model_name: string;
                          promotion_cleanup_strategy: string | null;
                          ramp_up_duration_seconds: number | null;
                          ramp_up_step_size: number | null;
                          ramp_up_while_promoting: boolean | null;
                          redeploy_on_promotion: boolean | null;
                          replica_overhead_percent: number | null;
                          request_backpressure_policy: string | null;
                          rolling_deploy: boolean | null;
                          rolling_deploy_strategy: string | null;
                          scale_down_delay: number | null;
                          stabilization_time_seconds: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          deployment_type: string | null;
                          environment_name: string;
                          event_type: "ENVIRONMENT_UPDATED";
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          max_surge_percent: number | null;
                          max_unavailable_percent: number | null;
                          min_replica: number;
                          model_id: string;
                          model_name: string;
                          previous_settings:
                              | {
                                  autoscaling_window: number
                                  | null;
                                  concurrency_target: number;
                                  max_replica: number;
                                  max_scale_down_rate: number | null;
                                  max_surge_percent: number | null;
                                  max_unavailable_percent: number | null;
                                  min_replica: number;
                                  promotion_cleanup_strategy: string | null;
                                  ramp_up_duration_seconds: number | null;
                                  ramp_up_step_size: number | null;
                                  ramp_up_while_promoting: boolean | null;
                                  redeploy_on_promotion: boolean | null;
                                  replica_overhead_percent: number | null;
                                  request_backpressure_policy: string | null;
                                  rolling_deploy: boolean | null;
                                  rolling_deploy_strategy: string | null;
                                  scale_down_delay: number | null;
                                  stabilization_time_seconds: number | null;
                                  target_in_flight_tokens: number | null;
                                  target_utilization_percentage: number | null;
                              }
                              | null;
                          promotion_cleanup_strategy: string
                          | null;
                          ramp_up_duration_seconds: number | null;
                          ramp_up_step_size: number | null;
                          ramp_up_while_promoting: boolean | null;
                          redeploy_on_promotion: boolean | null;
                          replica_overhead_percent: number | null;
                          request_backpressure_policy: string | null;
                          rolling_deploy: boolean | null;
                          rolling_deploy_strategy: string | null;
                          scale_down_delay: number | null;
                          schedules:
                              | {
                                  action: "DELETED"
                                  | "CREATED"
                                  | "UPDATED"
                                  | "UNCHANGED";
                                  current:
                                      | {
                                          autoscaling_window: ...;
                                          cadence: ...;
                                          concurrency_target: ...;
                                          enabled: ...;
                                          end_at: ...;
                                          end_hour: ...;
                                          end_minute: ...;
                                          max_replica: ...;
                                          max_scale_down_rate: ...;
                                          min_replica: ...;
                                          scale_down_delay: ...;
                                          schedule_name: ...;
                                          start_at: ...;
                                          start_hour: ...;
                                          start_minute: ...;
                                          target_in_flight_tokens: ...;
                                          target_utilization_percentage: ...;
                                          timezone: ...;
                                          weekdays: ...;
                                      }
                                      | null;
                                  previous: | {
                                      autoscaling_window: ...;
                                      cadence: ...;
                                      concurrency_target: ...;
                                      enabled: ...;
                                      end_at: ...;
                                      end_hour: ...;
                                      end_minute: ...;
                                      max_replica: ...;
                                      max_scale_down_rate: ...;
                                      min_replica: ...;
                                      scale_down_delay: ...;
                                      schedule_name: ...;
                                      start_at: ...;
                                      start_hour: ...;
                                      start_minute: ...;
                                      target_in_flight_tokens: ...;
                                      target_utilization_percentage: ...;
                                      timezone: ...;
                                      weekdays: ...;
                                  }
                                  | null;
                                  schedule_id: string;
                              }[]
                              | null;
                          stabilization_time_seconds: number
                          | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | {
                          environment_name: string;
                          event_type: "ENVIRONMENT_DELETED";
                          model_id: string;
                          model_name: string;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "REPLICA_TERMINATED";
                          model_id: string;
                          model_name: string;
                          replica_id: string;
                      }
                      | {
                          action: | "PAUSE"
                          | "RESUME"
                          | "FORCE_CANCEL"
                          | "FORCE_ROLL_FORWARD"
                          | "GRACEFUL_CANCEL";
                          deployment_id: string;
                          deployment_name: string;
                          environment_id: string
                          | null;
                          environment_name: string;
                          event_type: "MODEL_PROMOTION_CONTROL_ACTION";
                          model_id: string;
                          model_name: string;
                      }
                      | {
                          event_type: "SSH_CERTIFICATE_SIGNED";
                          expires_at: string;
                          project_id: string;
                          proxy_address: string;
                          replica_id: string;
                          workload_id: string;
                          workload_type: string;
                      }
                      | {
                          event_type: "VOLUME_DELETED";
                          namespace: string;
                          versions_deleted: number;
                          volume_name: string;
                          volume_ref: string;
                      }
                      | {
                          digest: string;
                          event_type: "VOLUME_VERSION_DELETED";
                          namespace: string;
                          version: string;
                          volume_name: string;
                          volume_ref: string;
                      }
                      | {
                          digest: string;
                          event_type: "VOLUME_VERSION_RESTORED";
                          namespace: string;
                          version: string;
                          volume_name: string;
                          volume_ref: string;
                      }
                      | {
                          digest: string;
                          event_type: "VOLUME_TAG_SET";
                          tag: string;
                          volume_ref: string;
                      }
                      | {
                          deleted: boolean;
                          event_type: "VOLUME_TAG_DELETED";
                          tag: string;
                          volume_ref: string;
                      }
                      | {
                          event_type: "VOLUME_UPDATED";
                          expires_at: string
                          | null;
                          previous_expires_at: string | null;
                          volume_ref: string;
                      }
                      | {
                          event_type: "TELEMETRY_EXPORT_CREATED";
                          telemetry_export_configuration_id: string;
                      }
                      | {
                          credential_rotated: boolean;
                          enabled: boolean
                          | null;
                          event_type: "TELEMETRY_EXPORT_UPDATED";
                          telemetry_export_configuration_id: string;
                      }
                      | {
                          event_type: "TELEMETRY_EXPORT_DELETED";
                          telemetry_export_configuration_id: string;
                      };
                  event_type: | "REPLICA_TERMINATED"
                  | "MODEL_DEPLOYED"
                  | "MODEL_DEPLOYMENT_ACTIVATED"
                  | "MODEL_DEPLOYMENT_DEACTIVATED"
                  | "MODEL_DEPLOYMENT_RETRIED"
                  | "MODEL_DEPLOYMENT_PROMOTED"
                  | "MODEL_DEPLOYMENT_AUTOSCALING_SETTINGS_CHANGED"
                  | "MODEL_DEPLOYMENT_REQUEST_BACKPRESSURE_SETTINGS_CHANGED"
                  | "MODEL_DEPLOYMENT_INSTANCE_TYPE_CHANGED"
                  | "MODEL_DEPLOYMENT_DELETED"
                  | "MODEL_DELETED"
                  | "MODEL_RENAMED"
                  | "CHAIN_DEPLOYED"
                  | "CHAIN_DEPLOYMENT_ACTIVATED"
                  | "CHAIN_DEPLOYMENT_DEACTIVATED"
                  | "CHAIN_DEPLOYMENT_PROMOTED"
                  | "CHAINLET_AUTOSCALING_SETTINGS_CHANGED"
                  | "CHAINLET_INSTANCE_TYPE_CHANGED"
                  | "CHAIN_DEPLOYMENT_DELETED"
                  | "CHAIN_DELETED"
                  | "CHAIN_ENVIRONMENT_CREATED"
                  | "CHAIN_ENVIRONMENT_UPDATED"
                  | "SECRET_UPDATED"
                  | "SECRET_DELETED"
                  | "API_KEY_CREATED"
                  | "API_KEY_DELETED"
                  | "API_KEY_LIFETIME_LIMITS_UPDATED"
                  | "GATEWAY_ENDPOINT_CREATED"
                  | "GATEWAY_ENDPOINT_UPDATED"
                  | "GATEWAY_ENDPOINT_DELETED"
                  | "PROVIDER_CONNECTION_CREATED"
                  | "PROVIDER_CONNECTION_UPDATED"
                  | "PROVIDER_CONNECTION_DELETED"
                  | "GRID_MACHINE_USER_CREATED"
                  | "GRID_MACHINE_USER_UPDATED"
                  | "GRID_MACHINE_USER_DELETED"
                  | "USER_INVITED"
                  | "USER_JOINED_ORGANIZATION"
                  | "WEBHOOK_SIGNING_SECRET_CREATED"
                  | "WEBHOOK_SIGNING_SECRET_ROTATED"
                  | "WEBHOOK_SIGNING_SECRET_DELETED"
                  | "USER_ROLE_UPDATED"
                  | "USER_TEAM_ROLE_UPDATED"
                  | "USER_REMOVED"
                  | "DIRECTORY_GROUP_ROLE_UPDATED"
                  | "REQUIRE_GROUP_BASED_ADMINS_ENABLED"
                  | "ENVIRONMENT_CREATED"
                  | "ENVIRONMENT_UPDATED"
                  | "ENVIRONMENT_DELETED"
                  | "MODEL_PROMOTION_CONTROL_ACTION"
                  | "SSH_CERTIFICATE_SIGNED"
                  | "VOLUME_DELETED"
                  | "VOLUME_VERSION_DELETED"
                  | "VOLUME_VERSION_RESTORED"
                  | "VOLUME_TAG_SET"
                  | "VOLUME_TAG_DELETED"
                  | "VOLUME_UPDATED"
                  | "TELEMETRY_EXPORT_CREATED"
                  | "TELEMETRY_EXPORT_UPDATED"
                  | "TELEMETRY_EXPORT_DELETED";
                  id: string;
                  source: "UI"
                  | "API"
                  | "MCP"
                  | "SYSTEM"
                  | "OTHER"
                  | null;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets a chain by ID

      Parameters

      • params: { chain_id: string }

      Returns Promise<
          {
              created_at: string;
              deployments_count: number;
              id: string;
              name: string;
              team_name: string;
          },
      >

    • Gets all chain deployments

      Parameters

      • params: { chain_id: string }

      Returns Promise<
          {
              deployments: {
                  chain_id: string;
                  chainlets: {
                      active_replica_count: number;
                      autoscaling_settings: | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          scale_down_delay: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | null;
                      id: string;
                      instance_type_name: string;
                      name: string;
                      status: | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
                  }[];
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  status:
                      | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
              }[];
          },
      >

    • Gets a chain deployment by ID

      Parameters

      • params: { chain_deployment_id: string; chain_id: string }

      Returns Promise<
          {
              chain_id: string;
              chainlets: {
                  active_replica_count: number;
                  autoscaling_settings: | {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  }
                  | null;
                  id: string;
                  instance_type_name: string;
                  name: string;
                  status: | "FAILED"
                  | "DEPLOYING"
                  | "DEACTIVATING"
                  | "BUILDING"
                  | "DEPLOY_FAILED"
                  | "LOADING_MODEL"
                  | "ACTIVE"
                  | "UNHEALTHY"
                  | "BUILD_FAILED"
                  | "BUILD_STOPPED"
                  | "INACTIVE"
                  | "UPDATING"
                  | "SCALED_TO_ZERO"
                  | "WAKING_UP";
              }[];
              created_at: string;
              environment: string
              | null;
              id: string;
              status:
                  | "FAILED"
                  | "DEPLOYING"
                  | "DEACTIVATING"
                  | "BUILDING"
                  | "DEPLOY_FAILED"
                  | "LOADING_MODEL"
                  | "ACTIVE"
                  | "UNHEALTHY"
                  | "BUILD_FAILED"
                  | "BUILD_STOPPED"
                  | "INACTIVE"
                  | "UPDATING"
                  | "SCALED_TO_ZERO"
                  | "WAKING_UP";
          },
      >

    • Gets the logs for a chainlet within a chain deployment

      Parameters

      • params: {
            chain_deployment_id: string;
            chain_id: string;
            chainlet_id: string;
            params?: {
                component?: string | null;
                direction?: "asc" | "desc" | null;
                end_epoch_millis?: number | null;
                excludes?: string[];
                includes?: string[];
                limit?: number | null;
                min_level?: "DEBUG" | "INFO" | "WARNING" | "ERROR" | null;
                replica?: string | null;
                request_id?: string | null;
                search_pattern?: string | null;
                start_epoch_millis?: number | null;
            };
        }

      Returns Promise<
          {
              logs: {
                  level: "DEBUG"
                  | "INFO"
                  | "WARNING"
                  | "ERROR"
                  | null;
                  message: string;
                  replica: string | null;
                  request_id: string | null;
                  timestamp: string;
              }[];
          },
      >

    • Gets all chain environments

      Parameters

      • params: { chain_id: string }

      Returns Promise<
          {
              environments: {
                  autoscaling_schedules: | {
                      applied_state: | {
                          autoscaling_settings: {
                              autoscaling_window: number
                              | null;
                              concurrency_target: number;
                              max_replica: number;
                              max_scale_down_rate: number | null;
                              min_replica: number;
                              scale_down_delay: number | null;
                              target_in_flight_tokens: number | null;
                              target_utilization_percentage: number | null;
                          };
                          schedule_id: string
                          | null;
                      }
                      | null;
                      schedules: (
                          | {
                              autoscaling_settings: {
                                  autoscaling_window: (...)
                                  | (...);
                                  concurrency_target: (...) | (...);
                                  max_replica: number;
                                  max_scale_down_rate: (...) | (...);
                                  min_replica: number;
                                  scale_down_delay: (...) | (...);
                                  target_in_flight_tokens: (...) | (...);
                                  target_utilization_percentage: (...) | (...);
                              };
                              cadence: "DAILY"
                              | "HOURLY";
                              enabled: boolean;
                              end_hour: number | null;
                              end_minute: number;
                              id: string;
                              name: string;
                              start_hour: number | null;
                              start_minute: number;
                              weekdays: ((...) | (...) | (...) | (...) | (...) | (...) | (...))[];
                          }
                          | {
                              autoscaling_settings: {
                                  autoscaling_window: (...)
                                  | (...);
                                  concurrency_target: (...) | (...);
                                  max_replica: number;
                                  max_scale_down_rate: (...) | (...);
                                  min_replica: number;
                                  scale_down_delay: (...) | (...);
                                  target_in_flight_tokens: (...) | (...);
                                  target_utilization_percentage: (...) | (...);
                              };
                              cadence: "ONE_TIME";
                              enabled: boolean;
                              end_at: string;
                              id: string;
                              name: string;
                              start_at: string;
                          }
                      )[];
                      timezone: string
                      | null;
                  }
                  | null;
                  autoscaling_settings: {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  };
                  candidate_deployment: | {
                      active_replica_count: number;
                      autoscaling_settings: | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          scale_down_delay: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | null;
                      created_at: string;
                      environment: string
                      | null;
                      id: string;
                      instance_type_name: string | null;
                      is_development: boolean;
                      is_production: boolean;
                      labels: { [key: string]: unknown } | null;
                      model_id: string;
                      name: string;
                      region: { display_name: string; slug: string } | null;
                      request_backpressure_settings: {
                          policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                      };
                      status: | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
                  }
                  | null;
                  created_at: string;
                  current_deployment: | {
                      active_replica_count: number;
                      autoscaling_settings: | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          scale_down_delay: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | null;
                      created_at: string;
                      environment: string
                      | null;
                      id: string;
                      instance_type_name: string | null;
                      is_development: boolean;
                      is_production: boolean;
                      labels: { [key: string]: unknown } | null;
                      model_id: string;
                      name: string;
                      region: { display_name: string; slug: string } | null;
                      request_backpressure_settings: {
                          policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                      };
                      status: | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
                  }
                  | null;
                  in_progress_promotion: | {
                      error_message: string
                      | null;
                      percent_traffic_to_new_version: number;
                      rolling_deploy: boolean | null;
                      status:
                          | "FAILED"
                          | "RELEASING"
                          | "RAMPING_UP"
                          | "RAMPING_DOWN"
                          | "PAUSED"
                          | "SUCCEEDED"
                          | "CANCELED";
                  }
                  | null;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number
                      | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
                  model_id: string;
                  name: string;
                  promotion_settings: {
                      promotion_cleanup_strategy: | "KEEP"
                      | "SCALE_TO_ZERO"
                      | "DEACTIVATE"
                      | null;
                      ramp_up_duration_seconds: number
                      | null;
                      ramp_up_while_promoting: boolean | null;
                      redeploy_on_promotion: boolean | null;
                      rolling_deploy: boolean | null;
                      rolling_deploy_config:
                          | {
                              max_surge_percent: number;
                              max_unavailable_percent: number;
                              replica_overhead_percent: number;
                              rolling_deploy_strategy: "REPLICA";
                              stabilization_time_seconds: number;
                          }
                          | null;
                  };
                  request_backpressure_settings: {
                      policy: "QUEUE_ON_FULL"
                      | "REJECT_ON_FULL"
                      | null;
                  };
                  traffic_routing: | {
                      rules: {
                          expires_at: string;
                          id: string;
                          percent_traffic: number;
                          propagate_client_cancellation: boolean;
                          sampling_mode: "RANDOM"
                          | "USER_SESSION";
                          targets: {
                              deployment_id: (...) | (...);
                              environment: (...) | (...);
                              model_id: string;
                          }[];
                          type: "SHADOW";
                      }[];
                  }
                  | null;
              }[];
          },
      >

    • Gets a chain environment's details

      Parameters

      • params: { chain_id: string; env_name: string }

      Returns Promise<
          {
              candidate_deployment: | {
                  chain_id: string;
                  chainlets: {
                      active_replica_count: number;
                      autoscaling_settings: | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          scale_down_delay: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | null;
                      id: string;
                      instance_type_name: string;
                      name: string;
                      status: | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
                  }[];
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  status:
                      | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
              }
              | null;
              chain_id: string;
              chainlet_settings: {
                  autoscaling_settings: | {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  }
                  | null;
                  chainlet_name: string;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number
                      | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
              }[];
              created_at: string;
              current_deployment: | {
                  chain_id: string;
                  chainlets: {
                      active_replica_count: number;
                      autoscaling_settings: | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          scale_down_delay: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | null;
                      id: string;
                      instance_type_name: string;
                      name: string;
                      status: | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
                  }[];
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  status:
                      | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
              }
              | null;
              in_progress_promotion: | {
                  error_message: string
                  | null;
                  percent_traffic_to_new_version: number;
                  rolling_deploy: boolean | null;
                  status:
                      | "FAILED"
                      | "RELEASING"
                      | "RAMPING_UP"
                      | "RAMPING_DOWN"
                      | "PAUSED"
                      | "SUCCEEDED"
                      | "CANCELED";
              }
              | null;
              name: string;
              promotion_settings: {
                  promotion_cleanup_strategy: | "KEEP"
                  | "SCALE_TO_ZERO"
                  | "DEACTIVATE"
                  | null;
                  ramp_up_duration_seconds: number
                  | null;
                  ramp_up_while_promoting: boolean | null;
                  redeploy_on_promotion: boolean | null;
                  rolling_deploy: boolean | null;
                  rolling_deploy_config:
                      | {
                          max_surge_percent: number;
                          max_unavailable_percent: number;
                          replica_overhead_percent: number;
                          rolling_deploy_strategy: "REPLICA";
                          stabilization_time_seconds: number;
                      }
                      | null;
              };
          },
      >

    • Lists environment groups

      Returns Promise<
          {
              items: {
                  manage_access: {
                      is_restricted: boolean;
                      users?: { email: string
                      | null; name: string | null; user_id: string }[];
                  };
                  name: string;
                  team_id: string;
                  team_name: string;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets an environment group by name

      Parameters

      • params: { env_name: string }

      Returns Promise<
          {
              manage_access: {
                  is_restricted: boolean;
                  users?: { email: string
                  | null; name: string | null; user_id: string }[];
              };
              name: string;
              team_id: string;
              team_name: string;
          },
      >

    • Lists model metadata

      Parameters

      • Optionalparams: {
            params?: {
                cursor?: string | null;
                limit?: number;
                provider?: string | null;
                q?: string | null;
            };
        }

      Returns Promise<
          {
              items: {
                  context_window: number
                  | null;
                  cost:
                      | {
                          cache_read: number
                          | null;
                          cache_write: number | null;
                          input: number | null;
                          long_context:
                              | {
                                  cache_read: number
                                  | null;
                                  cache_write: number | null;
                                  input: number | null;
                                  output: number | null;
                              }
                              | null;
                          output: number
                          | null;
                      }
                      | null;
                  display_name: string
                  | null;
                  input_modalities: string[];
                  max_output_tokens: number | null;
                  parallel_tool_calls: boolean | null;
                  provider: string | null;
                  reasoning_effort_levels: string[] | null;
                  release_date: string | null;
                  slug: string | null;
                  supported_api_formats:
                      | {
                          chat_completions: boolean;
                          messages: boolean;
                          responses: boolean;
                      }
                      | null;
                  tools: boolean
                  | null;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Lists Gateway endpoints

      Returns Promise<
          {
              items: {
                  created_at: string;
                  id: string;
                  region: "UNRESTRICTED"
                  | "EU";
                  slug: string;
                  targets: {
                      base_url: string | null;
                      environment_name: string | null;
                      model_id: string | null;
                      provider:
                          | "BASETEN_MODEL_API"
                          | "OPENAI"
                          | "ANTHROPIC"
                          | "XAI"
                          | "VERTEX"
                          | "OPENAI_COMPATIBLE"
                          | "BASETEN";
                      secret_id: string
                      | null;
                      target_model: string | null;
                      vertex_config: { location: string; project_id: string } | null;
                  }[];
                  updated_at: string;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets a Gateway endpoint

      Parameters

      • params: { endpoint_id: string }

      Returns Promise<
          {
              created_at: string;
              id: string;
              region: "UNRESTRICTED"
              | "EU";
              slug: string;
              targets: {
                  base_url: string | null;
                  environment_name: string | null;
                  model_id: string | null;
                  provider:
                      | "BASETEN_MODEL_API"
                      | "OPENAI"
                      | "ANTHROPIC"
                      | "XAI"
                      | "VERTEX"
                      | "OPENAI_COMPATIBLE"
                      | "BASETEN";
                  secret_id: string
                  | null;
                  target_model: string | null;
                  vertex_config: { location: string; project_id: string } | null;
              }[];
              updated_at: string;
          },
      >

    • Lists gateway events

      Parameters

      • Optionalparams: {
            params?: {
                api_keys?: string[];
                cursor?: string | null;
                end_time?: string | null;
                external_entity_ids?: string[];
                limit?: number | null;
                start_time?: string | null;
            };
        }

      Returns Promise<
          {
              items: {
                  apiKeyPrefix: string;
                  externalEntityId: string;
                  idempotencyKey: string;
                  modelSlug: string;
                  requestId: string;
                  timestamp: string;
                  tokens: {
                      cachedInputTokens: number;
                      inputTokens: number;
                      outputTokens: number;
                  };
                  type: string;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Lists groups

      Returns Promise<
          {
              items: {
                  created_at: string;
                  effective_models?: {
                      rate_limits?: {
                          source_group: string;
                          threshold: number;
                          type: (...)
                          | (...)
                          | (...)
                          | (...)
                          | (...);
                          unit: (...) | (...);
                      }[];
                      slug: string;
                      usage_limits?: {
                          source_group: string;
                          threshold: number;
                          type: (...)
                          | (...)
                          | (...)
                          | (...)
                          | (...);
                          unit: "DAY";
                      }[];
                  }[];
                  hierarchy: {
                      limit_enforcement: "CASCADING"
                      | "INDEPENDENT";
                      parent_group_id: string | null;
                  };
                  id: string;
                  metadata: { external_entity_id: string; name?: string
                  | null };
                  models?: {
                      rate_limits?: {
                          threshold: number;
                          type: (...) | (...) | (...) | (...) | (...);
                          unit: (...) | (...);
                      }[];
                      slug: string;
                      usage_limits?: {
                          threshold: number;
                          type: (...)
                          | (...)
                          | (...)
                          | (...)
                          | (...);
                          unit: "DAY";
                      }[];
                  }[];
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Lists API keys for a group

      Parameters

      • params: { group_id: string }

      Returns Promise<
          {
              items: { name: string
              | null; prefix: string }[];
              pagination: { cursor: string | null; has_more: boolean };
          },
      >

    • Gets an API key for a group

      Parameters

      • params: { api_key_prefix: string; group_id: string }

      Returns Promise<{ name: string | null; prefix: string }>

    • Gets a group

      Parameters

      • params: { group_id: string }

      Returns Promise<
          {
              created_at: string;
              effective_models?: {
                  rate_limits?: {
                      source_group: string;
                      threshold: number;
                      type: | "REQUEST"
                      | "TOKEN"
                      | "CONCURRENT_REQUEST"
                      | "UNCACHED_INPUT_TOKEN"
                      | "OUTPUT_TOKEN";
                      unit: "SECOND"
                      | "MINUTE";
                  }[];
                  slug: string;
                  usage_limits?: {
                      source_group: string;
                      threshold: number;
                      type: | "REQUEST"
                      | "TOKEN"
                      | "CONCURRENT_REQUEST"
                      | "UNCACHED_INPUT_TOKEN"
                      | "OUTPUT_TOKEN";
                      unit: "DAY";
                  }[];
              }[];
              hierarchy: {
                  limit_enforcement: "CASCADING"
                  | "INDEPENDENT";
                  parent_group_id: string | null;
              };
              id: string;
              metadata: { external_entity_id: string; name?: string
              | null };
              models?: {
                  rate_limits?: {
                      threshold: number;
                      type:
                          | "REQUEST"
                          | "TOKEN"
                          | "CONCURRENT_REQUEST"
                          | "UNCACHED_INPUT_TOKEN"
                          | "OUTPUT_TOKEN";
                      unit: "SECOND"
                      | "MINUTE";
                  }[];
                  slug: string;
                  usage_limits?: {
                      threshold: number;
                      type: | "REQUEST"
                      | "TOKEN"
                      | "CONCURRENT_REQUEST"
                      | "UNCACHED_INPUT_TOKEN"
                      | "OUTPUT_TOKEN";
                      unit: "DAY";
                  }[];
              }[];
          },
      >

    • Lists classifiers available for intelligent routes

      Parameters

      • Optionalparams: { params?: { cursor?: string | null; limit?: number } }

      Returns Promise<
          {
              items: { id: string; name: string }[];
              pagination: { cursor: string | null; has_more: boolean };
          },
      >

    • Gets a classifier available for intelligent routes

      Parameters

      • params: { classifier_id: string }

      Returns Promise<{ id: string; name: string }>

    • Lists connections

      Parameters

      • Optionalparams: { params?: { cursor?: string | null; limit?: number; team_id?: string | null } }

      Returns Promise<
          {
              items: {
                  config: | {
                      provider: "ANTHROPIC";
                      secret_id: string;
                      secret_name: string;
                  }
                  | { provider: "OPENAI"; secret_id: string; secret_name: string }
                  | { provider: "XAI"; secret_id: string; secret_name: string }
                  | {
                      location: string;
                      project_id: string;
                      provider: "VERTEX";
                      secret_id: string;
                      secret_name: string;
                  }
                  | {
                      auth: { method: "api_key" }
                      | { method: "access_keys" };
                      provider: "BEDROCK";
                      region: string;
                      secret_id: string;
                      secret_name: string;
                  };
                  created_at: string;
                  id: string;
                  team_id: string;
                  team_name: string;
                  updated_at: string;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets a connection

      Parameters

      • params: { connection_id: string }

      Returns Promise<
          {
              config: | {
                  provider: "ANTHROPIC";
                  secret_id: string;
                  secret_name: string;
              }
              | { provider: "OPENAI"; secret_id: string; secret_name: string }
              | { provider: "XAI"; secret_id: string; secret_name: string }
              | {
                  location: string;
                  project_id: string;
                  provider: "VERTEX";
                  secret_id: string;
                  secret_name: string;
              }
              | {
                  auth: { method: "api_key" }
                  | { method: "access_keys" };
                  provider: "BEDROCK";
                  region: string;
                  secret_id: string;
                  secret_name: string;
              };
              created_at: string;
              id: string;
              team_id: string;
              team_name: string;
              updated_at: string;
          },
      >

    • Lists machine users

      Parameters

      • Optionalparams: { params?: { cursor?: string | null; limit?: number; team_id?: string | null } }

      Returns Promise<
          {
              items: {
                  created_at: string;
                  created_by: string
                  | null;
                  id: string;
                  name: string;
                  team_id: string;
                  team_name: string;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Lists a machine user's API keys

      Parameters

      • params: { machine_user_id: string }

      Returns Promise<
          {
              keys: {
                  created_at: string;
                  expires_at: string
                  | null;
                  last_used_at: string | null;
                  model_ids: string[] | null;
                  name: string | null;
                  owner:
                      | { email: string
                      | null; name: string | null; user_id: string }
                      | null;
                  prefix: string;
                  team_name: string | null;
                  type:
                      | "PERSONAL"
                      | "GRID"
                      | "WORKSPACE_MANAGE_ALL"
                      | "WORKSPACE_EXPORT_METRICS"
                      | "WORKSPACE_INVOKE"
                      | "WORKSPACE_MANAGE_API_KEYS";
              }[];
          },
      >

    • Gets a machine user

      Parameters

      • params: { machine_user_id: string }

      Returns Promise<
          {
              created_at: string;
              created_by: string
              | null;
              id: string;
              name: string;
              team_id: string;
              team_name: string;
          },
      >

    • Lists route classifiers available for intelligent routes

      Parameters

      • Optionalparams: { params?: { cursor?: string | null; limit?: number } }

      Returns Promise<
          {
              items: {
                  decidable_models: string[];
                  id: string;
                  name: string;
                  supported_tradeoffs: ("cost" | "balanced" | "intelligence")[];
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets a route classifier available for intelligent routes

      Parameters

      • params: { route_classifier_id: string }

      Returns Promise<
          {
              decidable_models: string[];
              id: string;
              name: string;
              supported_tradeoffs: ("cost" | "balanced" | "intelligence")[];
          },
      >

    • Lists routes

      Parameters

      • Optionalparams: {
            params?: {
                cursor?: string | null;
                for_harnesses?: boolean;
                limit?: number;
                name?: string | null;
                team_id?: string | null;
            };
        }

      Returns Promise<
          {
              items: {
                  created_at: string;
                  description: string;
                  display_name: string;
                  id: string;
                  invoke_url: string;
                  metadata: | {
                      context_window: number
                      | null;
                      cost:
                          | {
                              cache_read: number
                              | null;
                              cache_write: number | null;
                              input: number | null;
                              long_context:
                                  | {
                                      cache_read: (...)
                                      | (...);
                                      cache_write: (...) | (...);
                                      input: (...) | (...);
                                      output: (...) | (...);
                                  }
                                  | null;
                              output: number
                              | null;
                          }
                          | null;
                      display_name: string
                      | null;
                      input_modalities: string[];
                      max_output_tokens: number | null;
                      parallel_tool_calls: boolean | null;
                      provider: string | null;
                      reasoning_effort_levels: string[] | null;
                      release_date: string | null;
                      slug: string | null;
                      supported_api_formats:
                          | {
                              chat_completions: boolean;
                              messages: boolean;
                              responses: boolean;
                          }
                          | null;
                      tools: boolean
                      | null;
                  }
                  | null;
                  name: string;
                  target: | { model: string; type: "BASETEN_MODEL_API" }
                  | { connection_id: string; model: string; type: "CONNECTION" }
                  | {
                      allowed_routes: { id: string; slug: string }[];
                      classifier: { id: string; name: string } | null;
                      default_route: { id: string; slug: string };
                      type: "CLASSIFIER";
                  }
                  | {
                      route_classifier: {
                          decidable_models: string[];
                          id: string;
                          name: string;
                          supported_tradeoffs: ("cost" | "balanced" | "intelligence")[];
                      };
                      tradeoff: "cost"
                      | "balanced"
                      | "intelligence";
                      type: "INTELLIGENT";
                  };
                  team_id: string;
                  team_name: string;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets a route

      Parameters

      • params: { route_id: string }

      Returns Promise<
          {
              created_at: string;
              description: string;
              display_name: string;
              id: string;
              invoke_url: string;
              metadata: | {
                  context_window: number
                  | null;
                  cost:
                      | {
                          cache_read: number
                          | null;
                          cache_write: number | null;
                          input: number | null;
                          long_context:
                              | {
                                  cache_read: number
                                  | null;
                                  cache_write: number | null;
                                  input: number | null;
                                  output: number | null;
                              }
                              | null;
                          output: number
                          | null;
                      }
                      | null;
                  display_name: string
                  | null;
                  input_modalities: string[];
                  max_output_tokens: number | null;
                  parallel_tool_calls: boolean | null;
                  provider: string | null;
                  reasoning_effort_levels: string[] | null;
                  release_date: string | null;
                  slug: string | null;
                  supported_api_formats:
                      | {
                          chat_completions: boolean;
                          messages: boolean;
                          responses: boolean;
                      }
                      | null;
                  tools: boolean
                  | null;
              }
              | null;
              name: string;
              target: | { model: string; type: "BASETEN_MODEL_API" }
              | { connection_id: string; model: string; type: "CONNECTION" }
              | {
                  allowed_routes: { id: string; slug: string }[];
                  classifier: { id: string; name: string } | null;
                  default_route: { id: string; slug: string };
                  type: "CLASSIFIER";
              }
              | {
                  route_classifier: {
                      decidable_models: string[];
                      id: string;
                      name: string;
                      supported_tradeoffs: ("cost" | "balanced" | "intelligence")[];
                  };
                  tradeoff: "cost"
                  | "balanced"
                  | "intelligence";
                  type: "INTELLIGENT";
              };
              team_id: string;
              team_name: string;
          },
      >

    • Gets daily Grid usage and estimated costs

      Parameters

      • Optionalparams: {
            params?: {
                cursor?: string | null;
                end_date?: string | null;
                group_by?: (
                    | "TEAM"
                    | "USER"
                    | "MODEL"
                    | "PROVIDER"
                    | "INTELLIGENT_ROUTE"
                    | "HARNESS"
                )[];
                harnesses?: ("CLAUDE_CODE" | "OPENCODE" | "CODEX" | "PI")[];
                limit?: number;
                models?: string[];
                providers?: (
                    | "BASETEN_MODEL_API"
                    | "OPENAI"
                    | "ANTHROPIC"
                    | "XAI"
                    | "VERTEX"
                    | "OPENAI_COMPATIBLE"
                    | "BEDROCK"
                )[];
                start_date?: string
                | null;
                team_id?: string | null;
                user_ids?: string[];
            };
        }

      Returns Promise<
          {
              items: {
                  date: string;
                  results: {
                      cached_input_tokens: number;
                      cost_usd: string;
                      harness: "CLAUDE_CODE"
                      | "OPENCODE"
                      | "CODEX"
                      | "PI"
                      | null;
                      input_tokens: number;
                      intelligent_route: string | null;
                      model: string | null;
                      output_tokens: number;
                      provider:
                          | "BASETEN_MODEL_API"
                          | "OPENAI"
                          | "ANTHROPIC"
                          | "XAI"
                          | "VERTEX"
                          | "OPENAI_COMPATIBLE"
                          | "BEDROCK"
                          | null;
                      requests: number;
                      team_id: string
                      | null;
                      team_name: string | null;
                      uncached_input_tokens: number;
                      user_id: string | null;
                  }[];
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets a team's Grid settings by team ID or your only team

      Parameters

      • Optionalparams: { params?: { team_id?: string | null } }

      Returns Promise<
          {
              harness_defaults: {
                  claude_code: {
                      background: | {
                          route: {
                              created_at: string;
                              description: string;
                              display_name: string;
                              id: string;
                              invoke_url: string;
                              metadata: | {
                                  context_window: number
                                  | null;
                                  cost:
                                      | {
                                          cache_read: ...;
                                          cache_write: ...;
                                          input: ...;
                                          long_context: ...;
                                          output: ...;
                                      }
                                      | null;
                                  display_name: string
                                  | null;
                                  input_modalities: string[];
                                  max_output_tokens: number | null;
                                  parallel_tool_calls: boolean | null;
                                  provider: string | null;
                                  reasoning_effort_levels: (...)[] | null;
                                  release_date: string | null;
                                  slug: string | null;
                                  supported_api_formats:
                                      | { chat_completions: ...; messages: ...; responses: ... }
                                      | null;
                                  tools: boolean | null;
                              }
                              | null;
                              name: string;
                              target: | { model: string; type: "BASETEN_MODEL_API" }
                              | { connection_id: string; model: string; type: "CONNECTION" }
                              | {
                                  allowed_routes: { id: ...; slug: ... }[];
                                  classifier: { id: ...; name: ... } | null;
                                  default_route: { id: string; slug: string };
                                  type: "CLASSIFIER";
                              }
                              | {
                                  route_classifier: {
                                      decidable_models: (...)[];
                                      id: string;
                                      name: string;
                                      supported_tradeoffs: (...)[];
                                  };
                                  tradeoff: "cost"
                                  | "balanced"
                                  | "intelligence";
                                  type: "INTELLIGENT";
                              };
                              team_id: string;
                              team_name: string;
                          };
                          source: "user"
                          | "team";
                      }
                      | null;
                      primary: | {
                          route: {
                              created_at: string;
                              description: string;
                              display_name: string;
                              id: string;
                              invoke_url: string;
                              metadata: | {
                                  context_window: number
                                  | null;
                                  cost:
                                      | {
                                          cache_read: ...;
                                          cache_write: ...;
                                          input: ...;
                                          long_context: ...;
                                          output: ...;
                                      }
                                      | null;
                                  display_name: string
                                  | null;
                                  input_modalities: string[];
                                  max_output_tokens: number | null;
                                  parallel_tool_calls: boolean | null;
                                  provider: string | null;
                                  reasoning_effort_levels: (...)[] | null;
                                  release_date: string | null;
                                  slug: string | null;
                                  supported_api_formats:
                                      | { chat_completions: ...; messages: ...; responses: ... }
                                      | null;
                                  tools: boolean | null;
                              }
                              | null;
                              name: string;
                              target: | { model: string; type: "BASETEN_MODEL_API" }
                              | { connection_id: string; model: string; type: "CONNECTION" }
                              | {
                                  allowed_routes: { id: ...; slug: ... }[];
                                  classifier: { id: ...; name: ... } | null;
                                  default_route: { id: string; slug: string };
                                  type: "CLASSIFIER";
                              }
                              | {
                                  route_classifier: {
                                      decidable_models: (...)[];
                                      id: string;
                                      name: string;
                                      supported_tradeoffs: (...)[];
                                  };
                                  tradeoff: "cost"
                                  | "balanced"
                                  | "intelligence";
                                  type: "INTELLIGENT";
                              };
                              team_id: string;
                              team_name: string;
                          };
                          source: "user"
                          | "team";
                      }
                      | null;
                  };
                  codex: {
                      background: | {
                          route: {
                              created_at: string;
                              description: string;
                              display_name: string;
                              id: string;
                              invoke_url: string;
                              metadata: | {
                                  context_window: number
                                  | null;
                                  cost:
                                      | {
                                          cache_read: ...;
                                          cache_write: ...;
                                          input: ...;
                                          long_context: ...;
                                          output: ...;
                                      }
                                      | null;
                                  display_name: string
                                  | null;
                                  input_modalities: string[];
                                  max_output_tokens: number | null;
                                  parallel_tool_calls: boolean | null;
                                  provider: string | null;
                                  reasoning_effort_levels: (...)[] | null;
                                  release_date: string | null;
                                  slug: string | null;
                                  supported_api_formats:
                                      | { chat_completions: ...; messages: ...; responses: ... }
                                      | null;
                                  tools: boolean | null;
                              }
                              | null;
                              name: string;
                              target: | { model: string; type: "BASETEN_MODEL_API" }
                              | { connection_id: string; model: string; type: "CONNECTION" }
                              | {
                                  allowed_routes: { id: ...; slug: ... }[];
                                  classifier: { id: ...; name: ... } | null;
                                  default_route: { id: string; slug: string };
                                  type: "CLASSIFIER";
                              }
                              | {
                                  route_classifier: {
                                      decidable_models: (...)[];
                                      id: string;
                                      name: string;
                                      supported_tradeoffs: (...)[];
                                  };
                                  tradeoff: "cost"
                                  | "balanced"
                                  | "intelligence";
                                  type: "INTELLIGENT";
                              };
                              team_id: string;
                              team_name: string;
                          };
                          source: "user"
                          | "team";
                      }
                      | null;
                      primary: | {
                          route: {
                              created_at: string;
                              description: string;
                              display_name: string;
                              id: string;
                              invoke_url: string;
                              metadata: | {
                                  context_window: number
                                  | null;
                                  cost:
                                      | {
                                          cache_read: ...;
                                          cache_write: ...;
                                          input: ...;
                                          long_context: ...;
                                          output: ...;
                                      }
                                      | null;
                                  display_name: string
                                  | null;
                                  input_modalities: string[];
                                  max_output_tokens: number | null;
                                  parallel_tool_calls: boolean | null;
                                  provider: string | null;
                                  reasoning_effort_levels: (...)[] | null;
                                  release_date: string | null;
                                  slug: string | null;
                                  supported_api_formats:
                                      | { chat_completions: ...; messages: ...; responses: ... }
                                      | null;
                                  tools: boolean | null;
                              }
                              | null;
                              name: string;
                              target: | { model: string; type: "BASETEN_MODEL_API" }
                              | { connection_id: string; model: string; type: "CONNECTION" }
                              | {
                                  allowed_routes: { id: ...; slug: ... }[];
                                  classifier: { id: ...; name: ... } | null;
                                  default_route: { id: string; slug: string };
                                  type: "CLASSIFIER";
                              }
                              | {
                                  route_classifier: {
                                      decidable_models: (...)[];
                                      id: string;
                                      name: string;
                                      supported_tradeoffs: (...)[];
                                  };
                                  tradeoff: "cost"
                                  | "balanced"
                                  | "intelligence";
                                  type: "INTELLIGENT";
                              };
                              team_id: string;
                              team_name: string;
                          };
                          source: "user"
                          | "team";
                      }
                      | null;
                  };
                  opencode: {
                      background: | {
                          route: {
                              created_at: string;
                              description: string;
                              display_name: string;
                              id: string;
                              invoke_url: string;
                              metadata: | {
                                  context_window: number
                                  | null;
                                  cost:
                                      | {
                                          cache_read: ...;
                                          cache_write: ...;
                                          input: ...;
                                          long_context: ...;
                                          output: ...;
                                      }
                                      | null;
                                  display_name: string
                                  | null;
                                  input_modalities: string[];
                                  max_output_tokens: number | null;
                                  parallel_tool_calls: boolean | null;
                                  provider: string | null;
                                  reasoning_effort_levels: (...)[] | null;
                                  release_date: string | null;
                                  slug: string | null;
                                  supported_api_formats:
                                      | { chat_completions: ...; messages: ...; responses: ... }
                                      | null;
                                  tools: boolean | null;
                              }
                              | null;
                              name: string;
                              target: | { model: string; type: "BASETEN_MODEL_API" }
                              | { connection_id: string; model: string; type: "CONNECTION" }
                              | {
                                  allowed_routes: { id: ...; slug: ... }[];
                                  classifier: { id: ...; name: ... } | null;
                                  default_route: { id: string; slug: string };
                                  type: "CLASSIFIER";
                              }
                              | {
                                  route_classifier: {
                                      decidable_models: (...)[];
                                      id: string;
                                      name: string;
                                      supported_tradeoffs: (...)[];
                                  };
                                  tradeoff: "cost"
                                  | "balanced"
                                  | "intelligence";
                                  type: "INTELLIGENT";
                              };
                              team_id: string;
                              team_name: string;
                          };
                          source: "user"
                          | "team";
                      }
                      | null;
                      primary: | {
                          route: {
                              created_at: string;
                              description: string;
                              display_name: string;
                              id: string;
                              invoke_url: string;
                              metadata: | {
                                  context_window: number
                                  | null;
                                  cost:
                                      | {
                                          cache_read: ...;
                                          cache_write: ...;
                                          input: ...;
                                          long_context: ...;
                                          output: ...;
                                      }
                                      | null;
                                  display_name: string
                                  | null;
                                  input_modalities: string[];
                                  max_output_tokens: number | null;
                                  parallel_tool_calls: boolean | null;
                                  provider: string | null;
                                  reasoning_effort_levels: (...)[] | null;
                                  release_date: string | null;
                                  slug: string | null;
                                  supported_api_formats:
                                      | { chat_completions: ...; messages: ...; responses: ... }
                                      | null;
                                  tools: boolean | null;
                              }
                              | null;
                              name: string;
                              target: | { model: string; type: "BASETEN_MODEL_API" }
                              | { connection_id: string; model: string; type: "CONNECTION" }
                              | {
                                  allowed_routes: { id: ...; slug: ... }[];
                                  classifier: { id: ...; name: ... } | null;
                                  default_route: { id: string; slug: string };
                                  type: "CLASSIFIER";
                              }
                              | {
                                  route_classifier: {
                                      decidable_models: (...)[];
                                      id: string;
                                      name: string;
                                      supported_tradeoffs: (...)[];
                                  };
                                  tradeoff: "cost"
                                  | "balanced"
                                  | "intelligence";
                                  type: "INTELLIGENT";
                              };
                              team_id: string;
                              team_name: string;
                          };
                          source: "user"
                          | "team";
                      }
                      | null;
                  };
                  pi: {
                      background: | {
                          route: {
                              created_at: string;
                              description: string;
                              display_name: string;
                              id: string;
                              invoke_url: string;
                              metadata: | {
                                  context_window: number
                                  | null;
                                  cost:
                                      | {
                                          cache_read: ...;
                                          cache_write: ...;
                                          input: ...;
                                          long_context: ...;
                                          output: ...;
                                      }
                                      | null;
                                  display_name: string
                                  | null;
                                  input_modalities: string[];
                                  max_output_tokens: number | null;
                                  parallel_tool_calls: boolean | null;
                                  provider: string | null;
                                  reasoning_effort_levels: (...)[] | null;
                                  release_date: string | null;
                                  slug: string | null;
                                  supported_api_formats:
                                      | { chat_completions: ...; messages: ...; responses: ... }
                                      | null;
                                  tools: boolean | null;
                              }
                              | null;
                              name: string;
                              target: | { model: string; type: "BASETEN_MODEL_API" }
                              | { connection_id: string; model: string; type: "CONNECTION" }
                              | {
                                  allowed_routes: { id: ...; slug: ... }[];
                                  classifier: { id: ...; name: ... } | null;
                                  default_route: { id: string; slug: string };
                                  type: "CLASSIFIER";
                              }
                              | {
                                  route_classifier: {
                                      decidable_models: (...)[];
                                      id: string;
                                      name: string;
                                      supported_tradeoffs: (...)[];
                                  };
                                  tradeoff: "cost"
                                  | "balanced"
                                  | "intelligence";
                                  type: "INTELLIGENT";
                              };
                              team_id: string;
                              team_name: string;
                          };
                          source: "user"
                          | "team";
                      }
                      | null;
                      primary: | {
                          route: {
                              created_at: string;
                              description: string;
                              display_name: string;
                              id: string;
                              invoke_url: string;
                              metadata: | {
                                  context_window: number
                                  | null;
                                  cost:
                                      | {
                                          cache_read: ...;
                                          cache_write: ...;
                                          input: ...;
                                          long_context: ...;
                                          output: ...;
                                      }
                                      | null;
                                  display_name: string
                                  | null;
                                  input_modalities: string[];
                                  max_output_tokens: number | null;
                                  parallel_tool_calls: boolean | null;
                                  provider: string | null;
                                  reasoning_effort_levels: (...)[] | null;
                                  release_date: string | null;
                                  slug: string | null;
                                  supported_api_formats:
                                      | { chat_completions: ...; messages: ...; responses: ... }
                                      | null;
                                  tools: boolean | null;
                              }
                              | null;
                              name: string;
                              target: | { model: string; type: "BASETEN_MODEL_API" }
                              | { connection_id: string; model: string; type: "CONNECTION" }
                              | {
                                  allowed_routes: { id: ...; slug: ... }[];
                                  classifier: { id: ...; name: ... } | null;
                                  default_route: { id: string; slug: string };
                                  type: "CLASSIFIER";
                              }
                              | {
                                  route_classifier: {
                                      decidable_models: (...)[];
                                      id: string;
                                      name: string;
                                      supported_tradeoffs: (...)[];
                                  };
                                  tradeoff: "cost"
                                  | "balanced"
                                  | "intelligence";
                                  type: "INTELLIGENT";
                              };
                              team_id: string;
                              team_name: string;
                          };
                          source: "user"
                          | "team";
                      }
                      | null;
                  };
              };
              spend_limit: {
                  per_member_monthly_limit_usd: string
                  | null;
                  team_wide_monthly_limit_usd: string | null;
              };
              team_id: string;
              team_name: string;
          },
      >

    • Lists members' Grid settings

      Parameters

      • Optionalparams: { params?: { cursor?: string | null; limit?: number; team_id?: string | null } }

      Returns Promise<
          {
              items: {
                  blocked_by: "team"
                  | "member"
                  | null;
                  email: string | null;
                  is_blocked: boolean;
                  month_spend_usd: string;
                  spend_limit: {
                      effective: {
                          monthly_limit_usd: string | null;
                          source: "user" | "team" | null;
                      };
                      month_override_usd: string
                      | null;
                      team_default:
                          | {
                              per_member_monthly_limit_usd: string;
                              team_id: string;
                              team_name: string;
                          }
                          | null;
                      team_wide_monthly_limit_usd: string
                      | null;
                      user_monthly_limit_usd: string | null;
                  };
                  team_id: string;
                  team_name: string;
                  user_id: string;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets a user's Grid settings by team ID or your only team

      Parameters

      • params: { params?: { team_id?: string | null }; user_id: string }

      Returns Promise<
          {
              blocked_by: "team"
              | "member"
              | null;
              email: string | null;
              is_blocked: boolean;
              month_spend_usd: string;
              spend_limit: {
                  effective: {
                      monthly_limit_usd: string | null;
                      source: "user" | "team" | null;
                  };
                  month_override_usd: string
                  | null;
                  team_default:
                      | {
                          per_member_monthly_limit_usd: string;
                          team_id: string;
                          team_name: string;
                      }
                      | null;
                  team_wide_monthly_limit_usd: string
                  | null;
                  user_monthly_limit_usd: string | null;
              };
              team_id: string;
              team_name: string;
              user_id: string;
          },
      >

    • Get a sandbox image

      Parameters

      • params: { image_name: string; params?: { team_id?: string } }

      Returns Promise<
          {
              created_at?: string;
              last_deployed_at?: string;
              name: string;
              size?: number;
              status: "FAILED"
              | "BUILDING"
              | "UPLOADING"
              | "BUILT";
              tag_count?: number;
              updated_at?: string;
          },
      >

    • Get image build logs

      Parameters

      • params: {
            image_name: string;
            params?: {
                end_time?: string;
                limit?: number;
                offset?: number;
                start_time?: string;
                team_id?: string;
            };
        }

      Returns Promise<
          {
              logs: { message: string; severity: number; timestamp: string }[];
              total_count: number;
          },
      >

    • Gets prices for available instance types

      Returns Promise<
          {
              instance_types: {
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number
                      | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
                  price: number;
              }[];
          },
      >

    • Gets all available instance types

      Returns Promise<
          {
              instance_types: {
                  gpu_count: number;
                  gpu_memory_limit_mib: number
                  | null;
                  gpu_type: string | null;
                  id: string;
                  memory_limit_mib: number;
                  millicpu_limit: number;
                  name: string;
              }[];
          },
      >

    • Gets all library listings

      Returns Promise<
          {
              listings: {
                  closed_source: boolean;
                  created_at: string;
                  display_name: string;
                  is_listed: boolean;
                  is_public: boolean;
                  metadata: | {
                      base_model?: string
                      | null;
                      context_length?: number | null;
                      description?: string | null;
                      input_modalities?: (
                          | "text"
                          | "image"
                          | "audio"
                          | "video"
                          | "embedding"
                          | "rerank"
                          | "decision"
                      )[];
                      license: string;
                      model_api_slug?: string
                      | null;
                      model_family?: string | null;
                      output_modalities?: (
                          | "text"
                          | "image"
                          | "audio"
                          | "video"
                          | "embedding"
                          | "rerank"
                          | "decision"
                      )[];
                      parameter_count?: number
                      | null;
                      publisher?: string | null;
                      release_date?: string | null;
                      trending?: boolean;
                      variant?: string | null;
                  }
                  | null;
                  modified_at: string;
                  trending: boolean
                  | null;
                  user_defined_id: string;
              }[];
          },
      >

    • Gets a library listing

      Parameters

      • params: { user_defined_listing_id: string }

      Returns Promise<
          {
              closed_source: boolean;
              created_at: string;
              display_name: string;
              is_listed: boolean;
              is_public: boolean;
              metadata: | {
                  base_model?: string
                  | null;
                  context_length?: number | null;
                  description?: string | null;
                  input_modalities?: (
                      | "text"
                      | "image"
                      | "audio"
                      | "video"
                      | "embedding"
                      | "rerank"
                      | "decision"
                  )[];
                  license: string;
                  model_api_slug?: string
                  | null;
                  model_family?: string | null;
                  output_modalities?: (
                      | "text"
                      | "image"
                      | "audio"
                      | "video"
                      | "embedding"
                      | "rerank"
                      | "decision"
                  )[];
                  parameter_count?: number
                  | null;
                  publisher?: string | null;
                  release_date?: string | null;
                  trending?: boolean;
                  variant?: string | null;
              }
              | null;
              modified_at: string;
              trending: boolean
              | null;
              user_defined_id: string;
          },
      >

    • Gets all versions for a library listing

      Parameters

      • params: { user_defined_listing_id: string }

      Returns Promise<
          {
              versions: {
                  allow_truss_download: boolean;
                  benchmark: | {
                      embedding?: | {
                          e2e_latency_ms_p50?: number
                          | null;
                          e2e_latency_ms_p99?: number | null;
                          input_tokens_per_sec?: number | null;
                          requests_per_sec?: number | null;
                      }
                      | null;
                      llm?: | {
                          cost_per_1m_tokens_usd?: number
                          | null;
                          max_concurrent_users_at_50ms_tpot?: number | null;
                          output_tokens_per_sec_per_user_p50?: number | null;
                          requests_per_sec_p50?: number | null;
                          ttft_ms_p50?: number | null;
                      }
                      | null;
                      measured_at: string;
                      profile?: string
                      | null;
                      replicas?: number | null;
                      run_id: string;
                      tts?:
                          | {
                              cost_per_audio_minute_usd?: number
                              | null;
                              max_concurrent_streams_at_rtf1?: number | null;
                              ttft_ms_p50?: number | null;
                              ttft_ms_p50_at_max_concurrency?: number | null;
                          }
                          | null;
                  }
                  | null;
                  created_at: string;
                  is_live: boolean;
                  modified_at: string;
                  oracle_version_id: string;
                  version_tag: string;
              }[];
          },
      >

    • Gets a library listing version

      Parameters

      • params: { user_defined_listing_id: string; version_tag: string }

      Returns Promise<
          {
              allow_truss_download: boolean;
              benchmark: | {
                  embedding?: | {
                      e2e_latency_ms_p50?: number
                      | null;
                      e2e_latency_ms_p99?: number | null;
                      input_tokens_per_sec?: number | null;
                      requests_per_sec?: number | null;
                  }
                  | null;
                  llm?: | {
                      cost_per_1m_tokens_usd?: number
                      | null;
                      max_concurrent_users_at_50ms_tpot?: number | null;
                      output_tokens_per_sec_per_user_p50?: number | null;
                      requests_per_sec_p50?: number | null;
                      ttft_ms_p50?: number | null;
                  }
                  | null;
                  measured_at: string;
                  profile?: string
                  | null;
                  replicas?: number | null;
                  run_id: string;
                  tts?:
                      | {
                          cost_per_audio_minute_usd?: number
                          | null;
                          max_concurrent_streams_at_rtf1?: number | null;
                          ttft_ms_p50?: number | null;
                          ttft_ms_p50_at_max_concurrency?: number | null;
                      }
                      | null;
              }
              | null;
              created_at: string;
              is_live: boolean;
              modified_at: string;
              oracle_version_id: string;
              version_tag: string;
          },
      >

    • Gets Loops server capabilities

      Parameters

      • Optionalparams: {
            params?: {
                enabled?: boolean | null;
                max_seq_len?: number | null;
                model?: string | null;
                use_case?: "rl" | "sft";
            };
        }

      Returns Promise<
          {
              supported_models: {
                  enabled: boolean;
                  enablement_details: | {
                      reason: string;
                      reason_detail: string;
                      remediation: string;
                  }
                  | null;
                  max_context_length: number;
                  max_enabled_seq_len: number;
                  max_seq_len: number;
                  model_name: string;
                  serverless: boolean
                  | null;
                  supports_vision_language: boolean;
              }[];
          },
      >

    • Lists Loops checkpoints

      Parameters

      • Optionalparams: {
            params?: {
                base_model?: string | null;
                checkpoint_path?: string | null;
                run_id?: string | null;
            };
        }

      Returns Promise<
          {
              checkpoints: {
                  base_model: string
                  | null;
                  checkpoint_id: string;
                  checkpoint_type: string;
                  created_at: string;
                  id: string;
                  lora_adapter_config: { [key: string]: unknown } | null;
                  lora_config:
                      | {
                          config_version: string;
                          expert_layout: "per_expert"
                          | "shared_outer"
                          | "shared_adapter"
                          | null;
                          targets: string[];
                      }
                      | null;
                  run_id: string;
                  size_bytes: number;
                  sync_status: string
                  | null;
                  target: "sampler" | "trainer";
              }[];
          },
      >

    • Gets Loops checkpoint files

      Parameters

      • params: { checkpoint_id: string; params?: { page_size?: number; page_token?: number } }

      Returns Promise<
          {
              next_page_token: number
              | null;
              presigned_urls: {
                  last_modified: string;
                  node_rank: number;
                  relative_file_name: string;
                  size_bytes: number;
                  url: string;
              }[];
              total_count: number;
          },
      >

    • Gets where a Loops checkpoint's files come from

      Parameters

      • params: { checkpoint_id: string }

      Returns Promise<
          {
              source: | { kind: "s3" }
              | { kind: "volume"; path: string; volume_ref: string };
          },
      >

    • Lists Loops deployments

      Parameters

      • Optionalparams: { params?: { scope?: string | null } }

      Returns Promise<
          {
              deployments: {
                  active_run_id: string
                  | null;
                  availability_model: "standard" | "spot";
                  base_checkpoint: string | null;
                  base_model: string;
                  base_url: string;
                  created_at: string;
                  id: string;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
                  latest_run_id: string
                  | null;
                  node_count: number;
                  sampler:
                      | {
                          base_checkpoint: string
                          | null;
                          base_model: string;
                          base_url: string;
                          created_at: string;
                          deployment_id: string | null;
                          id: string;
                          instance_type:
                              | {
                                  gpu_count: number;
                                  gpu_memory_limit_mib: number
                                  | null;
                                  gpu_type: string | null;
                                  id: string;
                                  memory_limit_mib: number;
                                  millicpu_limit: number;
                                  name: string;
                              }
                              | null;
                          model_id: string
                          | null;
                          node_count: number;
                          session_id: string;
                          status: {
                              name:
                                  | "FAILED"
                                  | "DEPLOYING"
                                  | "DEACTIVATING"
                                  | "BUILDING"
                                  | "DEPLOY_FAILED"
                                  | "LOADING_MODEL"
                                  | "ACTIVE"
                                  | "UNHEALTHY"
                                  | "BUILD_FAILED"
                                  | "BUILD_STOPPED"
                                  | "INACTIVE"
                                  | "UPDATING"
                                  | "SCALED_TO_ZERO"
                                  | "WAKING_UP";
                          };
                          user: { email: string
                          | null };
                      }
                      | null;
                  status: {
                      name: | "FAILED"
                      | "DEPLOYING"
                      | "CREATED"
                      | "SCALED_TO_ZERO"
                      | "RUNNING"
                      | "STOPPED"
                      | "PREEMPTED";
                  };
                  user: { email: string
                  | null };
              }[];
          },
      >

    • Gets Loops debug archive files

      Parameters

      • params: {
            deployment_id: string;
            params?: { page_size?: number; page_token?: string | null };
        }

      Returns Promise<
          {
              next_page_token: string
              | null;
              presigned_urls: {
                  last_modified: string;
                  node_rank: number;
                  relative_file_name: string;
                  size_bytes: number;
                  url: string;
              }[];
          },
      >

    • Gets a Loops deployment

      Parameters

      • params: { deployment_id: string }

      Returns Promise<
          {
              deployment: {
                  active_run_id: string
                  | null;
                  availability_model: "standard" | "spot";
                  base_checkpoint: string | null;
                  base_model: string;
                  base_url: string;
                  created_at: string;
                  id: string;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
                  latest_run_id: string
                  | null;
                  node_count: number;
                  sampler:
                      | {
                          base_checkpoint: string
                          | null;
                          base_model: string;
                          base_url: string;
                          created_at: string;
                          deployment_id: string | null;
                          id: string;
                          instance_type:
                              | {
                                  gpu_count: number;
                                  gpu_memory_limit_mib: number
                                  | null;
                                  gpu_type: string | null;
                                  id: string;
                                  memory_limit_mib: number;
                                  millicpu_limit: number;
                                  name: string;
                              }
                              | null;
                          model_id: string
                          | null;
                          node_count: number;
                          session_id: string;
                          status: {
                              name:
                                  | "FAILED"
                                  | "DEPLOYING"
                                  | "DEACTIVATING"
                                  | "BUILDING"
                                  | "DEPLOY_FAILED"
                                  | "LOADING_MODEL"
                                  | "ACTIVE"
                                  | "UNHEALTHY"
                                  | "BUILD_FAILED"
                                  | "BUILD_STOPPED"
                                  | "INACTIVE"
                                  | "UPDATING"
                                  | "SCALED_TO_ZERO"
                                  | "WAKING_UP";
                          };
                          user: { email: string
                          | null };
                      }
                      | null;
                  status: {
                      name: | "FAILED"
                      | "DEPLOYING"
                      | "CREATED"
                      | "SCALED_TO_ZERO"
                      | "RUNNING"
                      | "STOPPED"
                      | "PREEMPTED";
                  };
                  user: { email: string
                  | null };
              };
          },
      >

    • Gets logs for a Loops trainer deployment

      Parameters

      • params: {
            deployment_id: string;
            params?: {
                direction?: "asc" | "desc" | null;
                end_epoch_millis?: number | null;
                limit?: number | null;
                min_level?: "DEBUG" | "INFO" | "WARNING" | "ERROR" | null;
                start_epoch_millis?: number | null;
            };
        }

      Returns Promise<
          {
              logs: {
                  level: "DEBUG"
                  | "INFO"
                  | "WARNING"
                  | "ERROR"
                  | null;
                  message: string;
                  replica: string | null;
                  request_id: string | null;
                  timestamp: string;
              }[];
          },
      >

    • Lists Loops runs

      Parameters

      • Optionalparams: {
            params?: {
                base_model?: string | null;
                run_id?: string | null;
                scope?: string | null;
                session_id?: string | null;
            };
        }

      Returns Promise<
          {
              runs: {
                  base_checkpoint: string
                  | null;
                  base_model: string;
                  base_url: string;
                  created_at: string;
                  deployment_id: string | null;
                  id: string;
                  lora_config_version: string | null;
                  name: string;
                  sampler:
                      | {
                          base_checkpoint: string
                          | null;
                          base_model: string;
                          base_url: string;
                          created_at: string;
                          deployment_id: string | null;
                          id: string;
                          instance_type:
                              | {
                                  gpu_count: number;
                                  gpu_memory_limit_mib: number
                                  | null;
                                  gpu_type: string | null;
                                  id: string;
                                  memory_limit_mib: number;
                                  millicpu_limit: number;
                                  name: string;
                              }
                              | null;
                          model_id: string
                          | null;
                          node_count: number;
                          session_id: string;
                          status: {
                              name:
                                  | "FAILED"
                                  | "DEPLOYING"
                                  | "DEACTIVATING"
                                  | "BUILDING"
                                  | "DEPLOY_FAILED"
                                  | "LOADING_MODEL"
                                  | "ACTIVE"
                                  | "UNHEALTHY"
                                  | "BUILD_FAILED"
                                  | "BUILD_STOPPED"
                                  | "INACTIVE"
                                  | "UPDATING"
                                  | "SCALED_TO_ZERO"
                                  | "WAKING_UP";
                          };
                          user: { email: string
                          | null };
                      }
                      | null;
                  session_id: string;
                  status: { name: "ACTIVE"
                  | "INACTIVE" };
                  user: { email: string | null };
              }[];
          },
      >

    • Gets a Loops run

      Parameters

      • params: { run_id: string }

      Returns Promise<
          {
              run: {
                  base_checkpoint: string
                  | null;
                  base_model: string;
                  base_url: string;
                  created_at: string;
                  deployment_id: string | null;
                  id: string;
                  lora_config_version: string | null;
                  name: string;
                  sampler:
                      | {
                          base_checkpoint: string
                          | null;
                          base_model: string;
                          base_url: string;
                          created_at: string;
                          deployment_id: string | null;
                          id: string;
                          instance_type:
                              | {
                                  gpu_count: number;
                                  gpu_memory_limit_mib: number
                                  | null;
                                  gpu_type: string | null;
                                  id: string;
                                  memory_limit_mib: number;
                                  millicpu_limit: number;
                                  name: string;
                              }
                              | null;
                          model_id: string
                          | null;
                          node_count: number;
                          session_id: string;
                          status: {
                              name:
                                  | "FAILED"
                                  | "DEPLOYING"
                                  | "DEACTIVATING"
                                  | "BUILDING"
                                  | "DEPLOY_FAILED"
                                  | "LOADING_MODEL"
                                  | "ACTIVE"
                                  | "UNHEALTHY"
                                  | "BUILD_FAILED"
                                  | "BUILD_STOPPED"
                                  | "INACTIVE"
                                  | "UPDATING"
                                  | "SCALED_TO_ZERO"
                                  | "WAKING_UP";
                          };
                          user: { email: string
                          | null };
                      }
                      | null;
                  session_id: string;
                  status: { name: "ACTIVE"
                  | "INACTIVE" };
                  user: { email: string | null };
              };
          },
      >

    • Lists Loops samplers

      Parameters

      • Optionalparams: { params?: { scope?: string | null; session_id?: string | null } }

      Returns Promise<
          {
              samplers: {
                  base_checkpoint: string
                  | null;
                  base_model: string;
                  base_url: string;
                  created_at: string;
                  deployment_id: string | null;
                  id: string;
                  instance_type:
                      | {
                          gpu_count: number;
                          gpu_memory_limit_mib: number
                          | null;
                          gpu_type: string | null;
                          id: string;
                          memory_limit_mib: number;
                          millicpu_limit: number;
                          name: string;
                      }
                      | null;
                  model_id: string
                  | null;
                  node_count: number;
                  session_id: string;
                  status: {
                      name:
                          | "FAILED"
                          | "DEPLOYING"
                          | "DEACTIVATING"
                          | "BUILDING"
                          | "DEPLOY_FAILED"
                          | "LOADING_MODEL"
                          | "ACTIVE"
                          | "UNHEALTHY"
                          | "BUILD_FAILED"
                          | "BUILD_STOPPED"
                          | "INACTIVE"
                          | "UPDATING"
                          | "SCALED_TO_ZERO"
                          | "WAKING_UP";
                  };
                  user: { email: string
                  | null };
              }[];
          },
      >

    • Gets a Loops sampler

      Parameters

      • params: { sampler_id: string }

      Returns Promise<
          {
              sampler: {
                  base_checkpoint: string
                  | null;
                  base_model: string;
                  base_url: string;
                  created_at: string;
                  deployment_id: string | null;
                  id: string;
                  instance_type:
                      | {
                          gpu_count: number;
                          gpu_memory_limit_mib: number
                          | null;
                          gpu_type: string | null;
                          id: string;
                          memory_limit_mib: number;
                          millicpu_limit: number;
                          name: string;
                      }
                      | null;
                  model_id: string
                  | null;
                  node_count: number;
                  session_id: string;
                  status: {
                      name:
                          | "FAILED"
                          | "DEPLOYING"
                          | "DEACTIVATING"
                          | "BUILDING"
                          | "DEPLOY_FAILED"
                          | "LOADING_MODEL"
                          | "ACTIVE"
                          | "UNHEALTHY"
                          | "BUILD_FAILED"
                          | "BUILD_STOPPED"
                          | "INACTIVE"
                          | "UPDATING"
                          | "SCALED_TO_ZERO"
                          | "WAKING_UP";
                  };
                  user: { email: string
                  | null };
              };
          },
      >

    • Gets a Loops session

      Parameters

      • params: { session_id: string }

      Returns Promise<{ session: { id: string } }>

    • Gets the caller's Loops user config

      Returns Promise<
          {
              user_config: {
                  sampler_accelerator_priority: string[]
                  | null;
                  trainer_accelerator_priority: string[] | null;
              };
          },
      >

    • Lists Model APIs

      Parameters

      • Optionalparams: {
            params?: {
                added_only?: boolean;
                cursor?: string | null;
                limit?: number;
                team_ids?: string[];
            };
        }

      Returns Promise<
          {
              items: {
                  context_length: number;
                  cost_per_million_cached_input_tokens: string
                  | number
                  | null;
                  cost_per_million_input_tokens: string | number | null;
                  cost_per_million_output_tokens: string | number | null;
                  description: string;
                  display_name: string;
                  invoke_url: string;
                  model_family: string | null;
                  name: string;
                  org_details: { added_at: string; last_used_at: string | null } | null;
                  rate_limits: {
                      baseline_threshold: number;
                      is_pooled: boolean;
                      service_tier: "DEFAULT" | "FLEX" | "PRIORITY";
                      threshold: number;
                      type:
                          | "REQUEST"
                          | "TOKEN"
                          | "CONCURRENT_REQUEST"
                          | "UNCACHED_INPUT_TOKEN"
                          | "OUTPUT_TOKEN";
                      unit: "SECOND"
                      | "MINUTE";
                  }[];
                  release_date: string;
                  team_details?: {
                      added_at: string;
                      cost_per_million_input_tokens: string
                      | number
                      | null;
                      cost_per_million_output_tokens: string | number | null;
                      id: string;
                      last_used_at: string | null;
                      rate_limits: {
                          baseline_threshold: number;
                          is_pooled: boolean;
                          service_tier: "DEFAULT" | "FLEX" | "PRIORITY";
                          threshold: number;
                          type:
                              | "REQUEST"
                              | "TOKEN"
                              | "CONCURRENT_REQUEST"
                              | "UNCACHED_INPUT_TOKEN"
                              | "OUTPUT_TOKEN";
                          unit: "SECOND"
                          | "MINUTE";
                      }[];
                      team_id: string;
                      team_name: string;
                  }[];
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets the metrics for a Model API

      Parameters

      • params: {
            model_api_name: string;
            params?: {
                end_epoch_millis?: number | null;
                metrics?: string[];
                mode?: "CURRENT" | "SUMMARY" | "SERIES";
                start_epoch_millis?: number | null;
            };
        }

      Returns Promise<
          {
              end_epoch_millis: number;
              metric_descriptors: {
                  kind: "GAUGE"
                  | "COUNTER"
                  | "HISTOGRAM";
                  label_sets: { [key: string]: string }[];
                  name: string;
                  unit_hint:
                      | "PER_SECOND"
                      | "SECONDS"
                      | "BYTES"
                      | "MEBIBYTES"
                      | "COUNT"
                      | "RATIO"
                      | "CELSIUS"
                      | "WATTS";
              }[];
              metric_values: { start_epoch_millis: number; values: (number | null)[][] }[];
              mode: "CURRENT" | "SUMMARY" | "SERIES";
              start_epoch_millis: number;
              step_seconds: number | null;
          },
      >

    • Gets a Model API

      Parameters

      • params: { model_api_name: string; params?: { team_ids?: string[] } }

      Returns Promise<
          {
              context_length: number;
              cost_per_million_cached_input_tokens: string
              | number
              | null;
              cost_per_million_input_tokens: string | number | null;
              cost_per_million_output_tokens: string | number | null;
              description: string;
              display_name: string;
              invoke_url: string;
              model_family: string | null;
              name: string;
              org_details: { added_at: string; last_used_at: string | null } | null;
              rate_limits: {
                  baseline_threshold: number;
                  is_pooled: boolean;
                  service_tier: "DEFAULT" | "FLEX" | "PRIORITY";
                  threshold: number;
                  type:
                      | "REQUEST"
                      | "TOKEN"
                      | "CONCURRENT_REQUEST"
                      | "UNCACHED_INPUT_TOKEN"
                      | "OUTPUT_TOKEN";
                  unit: "SECOND"
                  | "MINUTE";
              }[];
              release_date: string;
              team_details?: {
                  added_at: string;
                  cost_per_million_input_tokens: string
                  | number
                  | null;
                  cost_per_million_output_tokens: string | number | null;
                  id: string;
                  last_used_at: string | null;
                  rate_limits: {
                      baseline_threshold: number;
                      is_pooled: boolean;
                      service_tier: "DEFAULT" | "FLEX" | "PRIORITY";
                      threshold: number;
                      type:
                          | "REQUEST"
                          | "TOKEN"
                          | "CONCURRENT_REQUEST"
                          | "UNCACHED_INPUT_TOKEN"
                          | "OUTPUT_TOKEN";
                      unit: "SECOND"
                      | "MINUTE";
                  }[];
                  team_id: string;
                  team_name: string;
              }[];
          },
      >

    • Gets Model APIs token usage in time buckets

      Parameters

      • Optionalparams: {
            params?: {
                api_keys?: string[];
                bucket_width?: "1m" | "1h" | "1d";
                cursor?: string | null;
                end_time?: string | null;
                group_by?: ("user" | "model" | "team" | "api_key")[];
                limit?: number | null;
                models?: string[];
                start_time?: string | null;
                team_ids?: string[];
                user_ids?: string[];
            };
        }

      Returns Promise<
          {
              items: {
                  end_time: string;
                  results?: {
                      api_key_prefix: string
                      | null;
                      cached_input_tokens: number;
                      input_tokens: number;
                      model: string | null;
                      output_tokens: number;
                      request_count: number;
                      team_id: string | null;
                      uncached_input_tokens: number;
                      user_id: string | null;
                  }[];
                  start_time: string;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets all models

      Parameters

      • Optionalparams: { params?: { name?: string | null } }

      Returns Promise<
          {
              models: {
                  created_at: string;
                  deployments_count: number;
                  development_deployment_id: string
                  | null;
                  id: string;
                  instance_type_name: string;
                  name: string;
                  production_deployment_id: string | null;
                  team_name: string;
              }[];
          },
      >

    • Gets the audit log for a model

      Parameters

      • params: {
            model_id: string;
            params?: {
                chain_deployment_ids?: string[];
                cursor?: string | null;
                deployment_ids?: string[];
                direction?: "DESC" | "ASC";
                end_epoch_millis?: number | null;
                environment_names?: string[];
                event_type_groups?: (
                    | "GRID"
                    | "DEPLOYED"
                    | "PROMOTED"
                    | "ACTIVATED_DEACTIVATED"
                    | "AUTOSCALING_SETTINGS"
                    | "REQUEST_BACKPRESSURE_SETTINGS"
                    | "INSTANCE_TYPE_CHANGED"
                    | "ENVIRONMENT_SETTINGS"
                    | "REPLICA_TERMINATED"
                    | "DELETED"
                    | "METADATA"
                    | "SECRETS"
                    | "API_KEYS"
                    | "GATEWAY"
                    | "WEBHOOK_SIGNING_SECRETS"
                    | "USER_MANAGEMENT"
                    | "DIRECTORY_GROUP_MANAGEMENT"
                    | "SSH"
                    | "TELEMETRY_EXPORT"
                )[];
                limit?: number;
                search?: string
                | null;
                sources?: ("UI" | "API" | "MCP" | "SYSTEM" | "OTHER")[];
                start_epoch_millis?: number | null;
                user_ids?: string[];
            };
        }

      Returns Promise<
          {
              items: {
                  actor: {
                      api_key_name: string
                      | null;
                      api_key_prefix: string | null;
                      email: string | null;
                      type:
                          | "USER"
                          | "API_KEY"
                          | "BASETEN_USER"
                          | "BASETEN_SYSTEM"
                          | "TOMBSTONE_USER";
                  };
                  client_name: string
                  | null;
                  client_session_id: string | null;
                  client_version: string | null;
                  created: string;
                  event_data:
                      | {
                          autoscaling_schedule_settings_update: | {
                              delete_schedule_ids: string[];
                              schedules: {
                                  autoscaling_window: (...)
                                  | (...);
                                  cadence: string;
                                  concurrency_target: (...) | (...);
                                  enabled: boolean;
                                  end_at: (...) | (...);
                                  end_hour: (...) | (...);
                                  end_minute: (...) | (...);
                                  max_replica: number;
                                  max_scale_down_rate: (...) | (...);
                                  min_replica: number;
                                  scale_down_delay: (...) | (...);
                                  schedule_id: (...) | (...);
                                  schedule_name: string;
                                  start_at: (...) | (...);
                                  start_hour: (...) | (...);
                                  start_minute: (...) | (...);
                                  target_in_flight_tokens: (...) | (...);
                                  target_utilization_percentage: (...) | (...);
                                  timezone: (...) | (...);
                                  weekdays: (...) | (...);
                              }[];
                              timezone: string
                              | null;
                          }
                          | null;
                          autoscaling_settings_update: | {
                              autoscaling_window: number
                              | null;
                              concurrency_target: number | null;
                              max_replica: number | null;
                              max_scale_down_rate: number | null;
                              min_replica: number | null;
                              scale_down_delay: number | null;
                              target_in_flight_tokens: number | null;
                              target_utilization_percentage: number | null;
                          }
                          | null;
                          deployment_id: string;
                          deployment_name: string;
                          environment_name: string
                          | null;
                          event_type: "MODEL_DEPLOYED";
                          instance_type_id_update: string | null;
                          model_id: string;
                          model_name: string;
                          promotion_settings_override:
                              | {
                                  max_surge_percent: number
                                  | null;
                                  max_unavailable_percent: number | null;
                                  promotion_cleanup_strategy: string | null;
                                  redeploy_on_promotion: boolean | null;
                                  replica_overhead_percent: number | null;
                                  rolling_deploy: boolean | null;
                                  rolling_deploy_strategy: string | null;
                                  stabilization_time_seconds: number | null;
                              }
                              | null;
                          publish: boolean;
                          region_update: string
                          | null;
                          request_backpressure_settings_update: { policy: string | null } | null;
                          scale_previous_to_zero: boolean;
                          trusted: boolean;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_ACTIVATED";
                          model_id: string;
                          model_name: string;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_DEACTIVATED";
                          model_id: string;
                          model_name: string;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_RETRIED";
                          model_id: string;
                          model_name: string;
                          retried: boolean;
                      }
                      | {
                          autoscaling_schedule_settings_update: | {
                              delete_schedule_ids: string[];
                              schedules: {
                                  autoscaling_window: (...)
                                  | (...);
                                  cadence: string;
                                  concurrency_target: (...) | (...);
                                  enabled: boolean;
                                  end_at: (...) | (...);
                                  end_hour: (...) | (...);
                                  end_minute: (...) | (...);
                                  max_replica: number;
                                  max_scale_down_rate: (...) | (...);
                                  min_replica: number;
                                  scale_down_delay: (...) | (...);
                                  schedule_id: (...) | (...);
                                  schedule_name: string;
                                  start_at: (...) | (...);
                                  start_hour: (...) | (...);
                                  start_minute: (...) | (...);
                                  target_in_flight_tokens: (...) | (...);
                                  target_utilization_percentage: (...) | (...);
                                  timezone: (...) | (...);
                                  weekdays: (...) | (...);
                              }[];
                              timezone: string
                              | null;
                          }
                          | null;
                          autoscaling_settings_update: | {
                              autoscaling_window: number
                              | null;
                              concurrency_target: number | null;
                              max_replica: number | null;
                              max_scale_down_rate: number | null;
                              min_replica: number | null;
                              scale_down_delay: number | null;
                              target_in_flight_tokens: number | null;
                              target_utilization_percentage: number | null;
                          }
                          | null;
                          deployment_id: string;
                          deployment_name: string;
                          environment_id: string
                          | null;
                          environment_name: string | null;
                          event_type: "MODEL_DEPLOYMENT_PROMOTED";
                          instance_type_id_update: string | null;
                          model_id: string;
                          model_name: string;
                          promotion_settings_override:
                              | {
                                  max_surge_percent: number
                                  | null;
                                  max_unavailable_percent: number | null;
                                  promotion_cleanup_strategy: string | null;
                                  redeploy_on_promotion: boolean | null;
                                  replica_overhead_percent: number | null;
                                  rolling_deploy: boolean | null;
                                  rolling_deploy_strategy: string | null;
                                  stabilization_time_seconds: number | null;
                              }
                              | null;
                          region_update: string
                          | null;
                          request_backpressure_settings_update: { policy: string | null } | null;
                      }
                      | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          deployment_id: string;
                          deployment_name: string;
                          deployment_type: string | null;
                          event_type: "MODEL_DEPLOYMENT_AUTOSCALING_SETTINGS_CHANGED";
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          model_id: string;
                          model_name: string;
                          previous_settings:
                              | {
                                  autoscaling_window: number
                                  | null;
                                  concurrency_target: number;
                                  max_replica: number;
                                  max_scale_down_rate: number | null;
                                  min_replica: number;
                                  scale_down_delay: number | null;
                                  target_in_flight_tokens: number | null;
                                  target_utilization_percentage: number | null;
                              }
                              | null;
                          scale_down_delay: number
                          | null;
                          schedules:
                              | {
                                  action: "DELETED"
                                  | "CREATED"
                                  | "UPDATED"
                                  | "UNCHANGED";
                                  current:
                                      | {
                                          autoscaling_window: ...;
                                          cadence: ...;
                                          concurrency_target: ...;
                                          enabled: ...;
                                          end_at: ...;
                                          end_hour: ...;
                                          end_minute: ...;
                                          max_replica: ...;
                                          max_scale_down_rate: ...;
                                          min_replica: ...;
                                          scale_down_delay: ...;
                                          schedule_name: ...;
                                          start_at: ...;
                                          start_hour: ...;
                                          start_minute: ...;
                                          target_in_flight_tokens: ...;
                                          target_utilization_percentage: ...;
                                          timezone: ...;
                                          weekdays: ...;
                                      }
                                      | null;
                                  previous: | {
                                      autoscaling_window: ...;
                                      cadence: ...;
                                      concurrency_target: ...;
                                      enabled: ...;
                                      end_at: ...;
                                      end_hour: ...;
                                      end_minute: ...;
                                      max_replica: ...;
                                      max_scale_down_rate: ...;
                                      min_replica: ...;
                                      scale_down_delay: ...;
                                      schedule_name: ...;
                                      start_at: ...;
                                      start_hour: ...;
                                      start_minute: ...;
                                      target_in_flight_tokens: ...;
                                      target_utilization_percentage: ...;
                                      timezone: ...;
                                      weekdays: ...;
                                  }
                                  | null;
                                  schedule_id: string;
                              }[]
                              | null;
                          target_in_flight_tokens: number
                          | null;
                          target_utilization_percentage: number | null;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_REQUEST_BACKPRESSURE_SETTINGS_CHANGED";
                          model_id: string;
                          model_name: string;
                          policy: string
                          | null;
                          previous_policy: string | null;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_INSTANCE_TYPE_CHANGED";
                          instance_type_name: string;
                          model_id: string;
                          model_name: string;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "MODEL_DEPLOYMENT_DELETED";
                          model_id: string;
                          model_name: string;
                      }
                      | { event_type: "MODEL_DELETED"; model_id: string; model_name: string }
                      | {
                          event_type: "MODEL_RENAMED";
                          model_id: string;
                          model_name: string;
                          previous_name: string | null;
                      }
                      | {
                          chain_deployment_id: string;
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          event_type: "CHAIN_DEPLOYED";
                          is_primary: boolean;
                          publish: boolean;
                      }
                      | {
                          chain_deployment_id: string;
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          event_type: "CHAIN_DEPLOYMENT_ACTIVATED";
                      }
                      | {
                          chain_deployment_id: string;
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          event_type: "CHAIN_DEPLOYMENT_DEACTIVATED";
                      }
                      | {
                          chain_deployment_id: string;
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          environment_id: string | null;
                          environment_name: string | null;
                          event_type: "CHAIN_DEPLOYMENT_PROMOTED";
                      }
                      | {
                          autoscaling_window: number
                          | null;
                          chain_deployment_id: string;
                          chain_deployment_name: string | null;
                          chain_id: string;
                          chain_name: string;
                          chainlet_id: string;
                          chainlet_name: string;
                          concurrency_target: number;
                          event_type: "CHAINLET_AUTOSCALING_SETTINGS_CHANGED";
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          previous_settings:
                              | {
                                  autoscaling_window: number
                                  | null;
                                  concurrency_target: number;
                                  max_replica: number;
                                  max_scale_down_rate: number | null;
                                  min_replica: number;
                                  scale_down_delay: number | null;
                                  target_in_flight_tokens: number | null;
                                  target_utilization_percentage: number | null;
                              }
                              | null;
                          scale_down_delay: number
                          | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | {
                          chain_deployment_id: string;
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          chainlet_id: string;
                          chainlet_name: string;
                          event_type: "CHAINLET_INSTANCE_TYPE_CHANGED";
                          instance_type_name: string;
                      }
                      | {
                          chain_deployment_id: string;
                          chain_id: string;
                          chain_name: string;
                          deployment_name: string
                          | null;
                          event_type: "CHAIN_DEPLOYMENT_DELETED";
                      }
                      | {
                          chain_deployment_name: string
                          | null;
                          chain_id: string;
                          chain_name: string;
                          event_type: "CHAIN_DELETED";
                      }
                      | {
                          chain_id: string;
                          chain_name: string;
                          environment_name: string;
                          event_type: "CHAIN_ENVIRONMENT_CREATED";
                          ramp_up_duration_seconds: number
                          | null;
                          ramp_up_while_promoting: boolean | null;
                          redeploy_on_promotion: boolean | null;
                      }
                      | {
                          chain_id: string;
                          chain_name: string;
                          environment_name: string;
                          event_type: "CHAIN_ENVIRONMENT_UPDATED";
                          ramp_up_duration_seconds: number
                          | null;
                          ramp_up_while_promoting: boolean | null;
                          redeploy_on_promotion: boolean | null;
                      }
                      | {
                          event_type: "SECRET_UPDATED";
                          secret_id: string;
                          secret_name: string;
                      }
                      | {
                          event_type: "SECRET_DELETED";
                          secret_id: string;
                          secret_name: string;
                      }
                      | {
                          api_key_id: string;
                          api_key_type: | "PERSONAL"
                          | "CREATOR_SERVICE_ACCOUNT"
                          | "MANAGE_API_KEYS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_ALLOWED_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_SCOPED_ENVS_AND_MODELS_SERVICE_ACCOUNT"
                          | "EXPORT_METRICS_ALL_MODELS_SERVICE_ACCOUNT"
                          | "EXPORT_METRICS_ALLOWED_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_SHARED_ENDPOINTS_SERVICE_ACCOUNT"
                          | "INVOKE_ALLOWED_SHARED_ENDPOINTS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_ROUTES";
                          event_type: "API_KEY_CREATED";
                          prefix: string;
                      }
                      | {
                          api_key_id: string;
                          api_key_type: | "PERSONAL"
                          | "CREATOR_SERVICE_ACCOUNT"
                          | "MANAGE_API_KEYS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_ALLOWED_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_SCOPED_ENVS_AND_MODELS_SERVICE_ACCOUNT"
                          | "EXPORT_METRICS_ALL_MODELS_SERVICE_ACCOUNT"
                          | "EXPORT_METRICS_ALLOWED_MODELS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_SHARED_ENDPOINTS_SERVICE_ACCOUNT"
                          | "INVOKE_ALLOWED_SHARED_ENDPOINTS_SERVICE_ACCOUNT"
                          | "INVOKE_ALL_ROUTES";
                          event_type: "API_KEY_DELETED";
                          prefix: string;
                          revocation_reason: "INACTIVITY"
                          | null;
                      }
                      | {
                          event_type: "API_KEY_LIFETIME_LIMITS_UPDATED";
                          new_personal_limit_days: number
                          | null;
                          new_team_limit_days: number | null;
                          organization_id: string;
                          previous_personal_limit_days: number | null;
                          previous_team_limit_days: number | null;
                      }
                      | {
                          event_type: "GATEWAY_ENDPOINT_CREATED";
                          gateway_endpoint_id: string;
                          slug: string;
                      }
                      | {
                          event_type: "GATEWAY_ENDPOINT_UPDATED";
                          gateway_endpoint_id: string;
                          previous_slug: string
                          | null;
                          slug: string;
                      }
                      | {
                          event_type: "GATEWAY_ENDPOINT_DELETED";
                          gateway_endpoint_id: string;
                          slug: string;
                      }
                      | {
                          event_type: "PROVIDER_CONNECTION_CREATED";
                          provider: string;
                          provider_connection_id: string;
                          secret_name: string;
                      }
                      | {
                          event_type: "PROVIDER_CONNECTION_UPDATED";
                          provider: string;
                          provider_connection_id: string;
                          secret_name: string;
                      }
                      | {
                          event_type: "PROVIDER_CONNECTION_DELETED";
                          provider: string;
                          provider_connection_id: string;
                          secret_name: string;
                      }
                      | {
                          event_type: "GRID_MACHINE_USER_CREATED";
                          machine_user_id: string;
                          machine_user_name: string;
                          team_id: string;
                          team_name: string;
                      }
                      | {
                          event_type: "GRID_MACHINE_USER_UPDATED";
                          machine_user_id: string;
                          machine_user_name: string;
                          previous_machine_user_name: string;
                          team_id: string;
                          team_name: string;
                      }
                      | {
                          event_type: "GRID_MACHINE_USER_DELETED";
                          machine_user_id: string;
                          machine_user_name: string;
                          team_id: string;
                          team_name: string;
                      }
                      | {
                          event_type: "USER_INVITED";
                          invited_user_email: string;
                          role_name: string;
                      }
                      | {
                          event_type: "USER_JOINED_ORGANIZATION";
                          new_user_email: string;
                          user_id: string;
                      }
                      | {
                          event_type: "WEBHOOK_SIGNING_SECRET_CREATED";
                          webhook_signing_secret_id: string;
                      }
                      | {
                          event_type: "WEBHOOK_SIGNING_SECRET_ROTATED";
                          webhook_signing_secret_id: string;
                      }
                      | {
                          event_type: "WEBHOOK_SIGNING_SECRET_DELETED";
                          webhook_signing_secret_id: string;
                      }
                      | {
                          event_type: "USER_ROLE_UPDATED";
                          new_role_name: string;
                          user_email: string;
                          user_id: string;
                      }
                      | {
                          event_type: "USER_TEAM_ROLE_UPDATED";
                          new_role_name: string;
                          team_id: string;
                          team_name: string;
                          user_email: string;
                          user_id: string;
                      }
                      | { event_type: "USER_REMOVED"; removed_user_email: string }
                      | {
                          directory_group_id: string;
                          directory_group_name: string;
                          event_type: "DIRECTORY_GROUP_ROLE_UPDATED";
                          new_role_name: string;
                          team_id: string | null;
                          team_name: string | null;
                      }
                      | {
                          event_type: "REQUIRE_GROUP_BASED_ADMINS_ENABLED";
                          organization_id: string;
                      }
                      | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          deployment_type: string | null;
                          environment_name: string;
                          event_type: "ENVIRONMENT_CREATED";
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          max_surge_percent: number | null;
                          max_unavailable_percent: number | null;
                          min_replica: number;
                          model_id: string;
                          model_name: string;
                          promotion_cleanup_strategy: string | null;
                          ramp_up_duration_seconds: number | null;
                          ramp_up_step_size: number | null;
                          ramp_up_while_promoting: boolean | null;
                          redeploy_on_promotion: boolean | null;
                          replica_overhead_percent: number | null;
                          request_backpressure_policy: string | null;
                          rolling_deploy: boolean | null;
                          rolling_deploy_strategy: string | null;
                          scale_down_delay: number | null;
                          stabilization_time_seconds: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          deployment_type: string | null;
                          environment_name: string;
                          event_type: "ENVIRONMENT_UPDATED";
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          max_surge_percent: number | null;
                          max_unavailable_percent: number | null;
                          min_replica: number;
                          model_id: string;
                          model_name: string;
                          previous_settings:
                              | {
                                  autoscaling_window: number
                                  | null;
                                  concurrency_target: number;
                                  max_replica: number;
                                  max_scale_down_rate: number | null;
                                  max_surge_percent: number | null;
                                  max_unavailable_percent: number | null;
                                  min_replica: number;
                                  promotion_cleanup_strategy: string | null;
                                  ramp_up_duration_seconds: number | null;
                                  ramp_up_step_size: number | null;
                                  ramp_up_while_promoting: boolean | null;
                                  redeploy_on_promotion: boolean | null;
                                  replica_overhead_percent: number | null;
                                  request_backpressure_policy: string | null;
                                  rolling_deploy: boolean | null;
                                  rolling_deploy_strategy: string | null;
                                  scale_down_delay: number | null;
                                  stabilization_time_seconds: number | null;
                                  target_in_flight_tokens: number | null;
                                  target_utilization_percentage: number | null;
                              }
                              | null;
                          promotion_cleanup_strategy: string
                          | null;
                          ramp_up_duration_seconds: number | null;
                          ramp_up_step_size: number | null;
                          ramp_up_while_promoting: boolean | null;
                          redeploy_on_promotion: boolean | null;
                          replica_overhead_percent: number | null;
                          request_backpressure_policy: string | null;
                          rolling_deploy: boolean | null;
                          rolling_deploy_strategy: string | null;
                          scale_down_delay: number | null;
                          schedules:
                              | {
                                  action: "DELETED"
                                  | "CREATED"
                                  | "UPDATED"
                                  | "UNCHANGED";
                                  current:
                                      | {
                                          autoscaling_window: ...;
                                          cadence: ...;
                                          concurrency_target: ...;
                                          enabled: ...;
                                          end_at: ...;
                                          end_hour: ...;
                                          end_minute: ...;
                                          max_replica: ...;
                                          max_scale_down_rate: ...;
                                          min_replica: ...;
                                          scale_down_delay: ...;
                                          schedule_name: ...;
                                          start_at: ...;
                                          start_hour: ...;
                                          start_minute: ...;
                                          target_in_flight_tokens: ...;
                                          target_utilization_percentage: ...;
                                          timezone: ...;
                                          weekdays: ...;
                                      }
                                      | null;
                                  previous: | {
                                      autoscaling_window: ...;
                                      cadence: ...;
                                      concurrency_target: ...;
                                      enabled: ...;
                                      end_at: ...;
                                      end_hour: ...;
                                      end_minute: ...;
                                      max_replica: ...;
                                      max_scale_down_rate: ...;
                                      min_replica: ...;
                                      scale_down_delay: ...;
                                      schedule_name: ...;
                                      start_at: ...;
                                      start_hour: ...;
                                      start_minute: ...;
                                      target_in_flight_tokens: ...;
                                      target_utilization_percentage: ...;
                                      timezone: ...;
                                      weekdays: ...;
                                  }
                                  | null;
                                  schedule_id: string;
                              }[]
                              | null;
                          stabilization_time_seconds: number
                          | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | {
                          environment_name: string;
                          event_type: "ENVIRONMENT_DELETED";
                          model_id: string;
                          model_name: string;
                      }
                      | {
                          deployment_id: string;
                          deployment_name: string;
                          event_type: "REPLICA_TERMINATED";
                          model_id: string;
                          model_name: string;
                          replica_id: string;
                      }
                      | {
                          action: | "PAUSE"
                          | "RESUME"
                          | "FORCE_CANCEL"
                          | "FORCE_ROLL_FORWARD"
                          | "GRACEFUL_CANCEL";
                          deployment_id: string;
                          deployment_name: string;
                          environment_id: string
                          | null;
                          environment_name: string;
                          event_type: "MODEL_PROMOTION_CONTROL_ACTION";
                          model_id: string;
                          model_name: string;
                      }
                      | {
                          event_type: "SSH_CERTIFICATE_SIGNED";
                          expires_at: string;
                          project_id: string;
                          proxy_address: string;
                          replica_id: string;
                          workload_id: string;
                          workload_type: string;
                      }
                      | {
                          event_type: "VOLUME_DELETED";
                          namespace: string;
                          versions_deleted: number;
                          volume_name: string;
                          volume_ref: string;
                      }
                      | {
                          digest: string;
                          event_type: "VOLUME_VERSION_DELETED";
                          namespace: string;
                          version: string;
                          volume_name: string;
                          volume_ref: string;
                      }
                      | {
                          digest: string;
                          event_type: "VOLUME_VERSION_RESTORED";
                          namespace: string;
                          version: string;
                          volume_name: string;
                          volume_ref: string;
                      }
                      | {
                          digest: string;
                          event_type: "VOLUME_TAG_SET";
                          tag: string;
                          volume_ref: string;
                      }
                      | {
                          deleted: boolean;
                          event_type: "VOLUME_TAG_DELETED";
                          tag: string;
                          volume_ref: string;
                      }
                      | {
                          event_type: "VOLUME_UPDATED";
                          expires_at: string
                          | null;
                          previous_expires_at: string | null;
                          volume_ref: string;
                      }
                      | {
                          event_type: "TELEMETRY_EXPORT_CREATED";
                          telemetry_export_configuration_id: string;
                      }
                      | {
                          credential_rotated: boolean;
                          enabled: boolean
                          | null;
                          event_type: "TELEMETRY_EXPORT_UPDATED";
                          telemetry_export_configuration_id: string;
                      }
                      | {
                          event_type: "TELEMETRY_EXPORT_DELETED";
                          telemetry_export_configuration_id: string;
                      };
                  event_type: | "REPLICA_TERMINATED"
                  | "MODEL_DEPLOYED"
                  | "MODEL_DEPLOYMENT_ACTIVATED"
                  | "MODEL_DEPLOYMENT_DEACTIVATED"
                  | "MODEL_DEPLOYMENT_RETRIED"
                  | "MODEL_DEPLOYMENT_PROMOTED"
                  | "MODEL_DEPLOYMENT_AUTOSCALING_SETTINGS_CHANGED"
                  | "MODEL_DEPLOYMENT_REQUEST_BACKPRESSURE_SETTINGS_CHANGED"
                  | "MODEL_DEPLOYMENT_INSTANCE_TYPE_CHANGED"
                  | "MODEL_DEPLOYMENT_DELETED"
                  | "MODEL_DELETED"
                  | "MODEL_RENAMED"
                  | "CHAIN_DEPLOYED"
                  | "CHAIN_DEPLOYMENT_ACTIVATED"
                  | "CHAIN_DEPLOYMENT_DEACTIVATED"
                  | "CHAIN_DEPLOYMENT_PROMOTED"
                  | "CHAINLET_AUTOSCALING_SETTINGS_CHANGED"
                  | "CHAINLET_INSTANCE_TYPE_CHANGED"
                  | "CHAIN_DEPLOYMENT_DELETED"
                  | "CHAIN_DELETED"
                  | "CHAIN_ENVIRONMENT_CREATED"
                  | "CHAIN_ENVIRONMENT_UPDATED"
                  | "SECRET_UPDATED"
                  | "SECRET_DELETED"
                  | "API_KEY_CREATED"
                  | "API_KEY_DELETED"
                  | "API_KEY_LIFETIME_LIMITS_UPDATED"
                  | "GATEWAY_ENDPOINT_CREATED"
                  | "GATEWAY_ENDPOINT_UPDATED"
                  | "GATEWAY_ENDPOINT_DELETED"
                  | "PROVIDER_CONNECTION_CREATED"
                  | "PROVIDER_CONNECTION_UPDATED"
                  | "PROVIDER_CONNECTION_DELETED"
                  | "GRID_MACHINE_USER_CREATED"
                  | "GRID_MACHINE_USER_UPDATED"
                  | "GRID_MACHINE_USER_DELETED"
                  | "USER_INVITED"
                  | "USER_JOINED_ORGANIZATION"
                  | "WEBHOOK_SIGNING_SECRET_CREATED"
                  | "WEBHOOK_SIGNING_SECRET_ROTATED"
                  | "WEBHOOK_SIGNING_SECRET_DELETED"
                  | "USER_ROLE_UPDATED"
                  | "USER_TEAM_ROLE_UPDATED"
                  | "USER_REMOVED"
                  | "DIRECTORY_GROUP_ROLE_UPDATED"
                  | "REQUIRE_GROUP_BASED_ADMINS_ENABLED"
                  | "ENVIRONMENT_CREATED"
                  | "ENVIRONMENT_UPDATED"
                  | "ENVIRONMENT_DELETED"
                  | "MODEL_PROMOTION_CONTROL_ACTION"
                  | "SSH_CERTIFICATE_SIGNED"
                  | "VOLUME_DELETED"
                  | "VOLUME_VERSION_DELETED"
                  | "VOLUME_VERSION_RESTORED"
                  | "VOLUME_TAG_SET"
                  | "VOLUME_TAG_DELETED"
                  | "VOLUME_UPDATED"
                  | "TELEMETRY_EXPORT_CREATED"
                  | "TELEMETRY_EXPORT_UPDATED"
                  | "TELEMETRY_EXPORT_DELETED";
                  id: string;
                  source: "UI"
                  | "API"
                  | "MCP"
                  | "SYSTEM"
                  | "OTHER"
                  | null;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets all deployments of a model

      Parameters

      • params: { model_id: string; params?: { name?: string | null } }

      Returns Promise<
          {
              deployments: {
                  active_replica_count: number;
                  autoscaling_settings: | {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  }
                  | null;
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  instance_type_name: string | null;
                  is_development: boolean;
                  is_production: boolean;
                  labels: { [key: string]: unknown } | null;
                  model_id: string;
                  name: string;
                  region: { display_name: string; slug: string } | null;
                  request_backpressure_settings: {
                      policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                  };
                  status: | "FAILED"
                  | "DEPLOYING"
                  | "DEACTIVATING"
                  | "BUILDING"
                  | "DEPLOY_FAILED"
                  | "LOADING_MODEL"
                  | "ACTIVE"
                  | "UNHEALTHY"
                  | "BUILD_FAILED"
                  | "BUILD_STOPPED"
                  | "INACTIVE"
                  | "UPDATING"
                  | "SCALED_TO_ZERO"
                  | "WAKING_UP";
              }[];
          },
      >

    • Gets a deployment's config

      Parameters

      • params: {
            deployment_id: string;
            model_id: string;
            params?: { output_format?: "raw" | "parsed" | "both" };
        }

      Returns Promise<
          { config: { [key: string]: unknown }
          | null; raw_config: string | null },
      >

    • Gets a model's deployment by ID

      Parameters

      • params: { deployment_id: string; model_id: string }

      Returns Promise<
          {
              active_replica_count: number;
              autoscaling_settings: | {
                  autoscaling_window: number
                  | null;
                  concurrency_target: number;
                  max_replica: number;
                  max_scale_down_rate: number | null;
                  min_replica: number;
                  scale_down_delay: number | null;
                  target_in_flight_tokens: number | null;
                  target_utilization_percentage: number | null;
              }
              | null;
              created_at: string;
              environment: string
              | null;
              id: string;
              instance_type_name: string | null;
              is_development: boolean;
              is_production: boolean;
              labels: { [key: string]: unknown } | null;
              model_id: string;
              name: string;
              region: { display_name: string; slug: string } | null;
              request_backpressure_settings: {
                  policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
              };
              status: | "FAILED"
              | "DEPLOYING"
              | "DEACTIVATING"
              | "BUILDING"
              | "DEPLOY_FAILED"
              | "LOADING_MODEL"
              | "ACTIVE"
              | "UNHEALTHY"
              | "BUILD_FAILED"
              | "BUILD_STOPPED"
              | "INACTIVE"
              | "UPDATING"
              | "SCALED_TO_ZERO"
              | "WAKING_UP";
          },
      >

    • Gets a model's development deployment

      Parameters

      • params: { model_id: string }

      Returns Promise<
          {
              active_replica_count: number;
              autoscaling_settings: | {
                  autoscaling_window: number
                  | null;
                  concurrency_target: number;
                  max_replica: number;
                  max_scale_down_rate: number | null;
                  min_replica: number;
                  scale_down_delay: number | null;
                  target_in_flight_tokens: number | null;
                  target_utilization_percentage: number | null;
              }
              | null;
              created_at: string;
              environment: string
              | null;
              id: string;
              instance_type_name: string | null;
              is_development: boolean;
              is_production: boolean;
              labels: { [key: string]: unknown } | null;
              model_id: string;
              name: string;
              region: { display_name: string; slug: string } | null;
              request_backpressure_settings: {
                  policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
              };
              status: | "FAILED"
              | "DEPLOYING"
              | "DEACTIVATING"
              | "BUILDING"
              | "DEPLOY_FAILED"
              | "LOADING_MODEL"
              | "ACTIVE"
              | "UNHEALTHY"
              | "BUILD_FAILED"
              | "BUILD_STOPPED"
              | "INACTIVE"
              | "UPDATING"
              | "SCALED_TO_ZERO"
              | "WAKING_UP";
          },
      >

    • Gets a presigned download URL for a deployment's truss

      Parameters

      • params: { deployment_id: string; model_id: string }

      Returns Promise<{ download_url: string }>

    • Gets the logs for a model deployment

      Parameters

      • params: {
            deployment_id: string;
            model_id: string;
            params?: {
                component?: string | null;
                direction?: "asc" | "desc" | null;
                end_epoch_millis?: number | null;
                excludes?: string[];
                includes?: string[];
                limit?: number | null;
                min_level?: "DEBUG" | "INFO" | "WARNING" | "ERROR" | null;
                replica?: string | null;
                request_id?: string | null;
                search_pattern?: string | null;
                start_epoch_millis?: number | null;
            };
        }

      Returns Promise<
          {
              logs: {
                  level: "DEBUG"
                  | "INFO"
                  | "WARNING"
                  | "ERROR"
                  | null;
                  message: string;
                  replica: string | null;
                  request_id: string | null;
                  timestamp: string;
              }[];
          },
      >

    • Gets the metrics for a model deployment

      Parameters

      • params: {
            deployment_id: string;
            model_id: string;
            params?: {
                end_epoch_millis?: number | null;
                metrics?: string[];
                mode?: "CURRENT" | "SUMMARY" | "SERIES";
                start_epoch_millis?: number | null;
            };
        }

      Returns Promise<
          {
              end_epoch_millis: number;
              metric_descriptors: {
                  kind: "GAUGE"
                  | "COUNTER"
                  | "HISTOGRAM";
                  label_sets: { [key: string]: string }[];
                  name: string;
                  unit_hint:
                      | "PER_SECOND"
                      | "SECONDS"
                      | "BYTES"
                      | "MEBIBYTES"
                      | "COUNT"
                      | "RATIO"
                      | "CELSIUS"
                      | "WATTS";
              }[];
              metric_values: { start_epoch_millis: number; values: (number | null)[][] }[];
              mode: "CURRENT" | "SUMMARY" | "SERIES";
              start_epoch_millis: number;
              step_seconds: number | null;
          },
      >

    • Gets a development deployment's patch state

      Parameters

      • params: { deployment_id: string; model_id: string }

      Returns Promise<
          {
              pending_patch_point: | {
                  config: string;
                  content_hashes: { [key: string]: string
                  | null };
                  hash: string;
                  requirements?: string[];
              }
              | null;
              running_patch_point: {
                  config: string;
                  content_hashes: { [key: string]: string
                  | null };
                  hash: string;
                  requirements?: string[];
              };
          },
      >

    • Gets a model's production deployment

      Parameters

      • params: { model_id: string }

      Returns Promise<
          {
              active_replica_count: number;
              autoscaling_settings: | {
                  autoscaling_window: number
                  | null;
                  concurrency_target: number;
                  max_replica: number;
                  max_scale_down_rate: number | null;
                  min_replica: number;
                  scale_down_delay: number | null;
                  target_in_flight_tokens: number | null;
                  target_utilization_percentage: number | null;
              }
              | null;
              created_at: string;
              environment: string
              | null;
              id: string;
              instance_type_name: string | null;
              is_development: boolean;
              is_production: boolean;
              labels: { [key: string]: unknown } | null;
              model_id: string;
              name: string;
              region: { display_name: string; slug: string } | null;
              request_backpressure_settings: {
                  policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
              };
              status: | "FAILED"
              | "DEPLOYING"
              | "DEACTIVATING"
              | "BUILDING"
              | "DEPLOY_FAILED"
              | "LOADING_MODEL"
              | "ACTIVE"
              | "UNHEALTHY"
              | "BUILD_FAILED"
              | "BUILD_STOPPED"
              | "INACTIVE"
              | "UPDATING"
              | "SCALED_TO_ZERO"
              | "WAKING_UP";
          },
      >

    • Lists the startups of a model deployment

      Parameters

      • params: {
            deployment_id: string;
            model_id: string;
            params: {
                cursor?: string | null;
                direction?: "asc" | "desc" | null;
                end_epoch_millis: number;
                limit?: number;
                min_duration_ms?: number | null;
                outcomes?: ("SUCCESS" | "FAILED" | "STALLED")[];
                phase?:
                    | "SCHEDULING"
                    | "IMAGE_PULL"
                    | "WEIGHT_DOWNLOAD"
                    | "CONTAINER_CREATE"
                    | "CONTAINER_START"
                    | "READINESS"
                    | null;
                search?: string
                | null;
                sort_by?: "OUTCOME" | "STARTED_AT" | "READY_AT" | "DURATION" | null;
                start_epoch_millis: number;
            };
        }

      Returns Promise<
          {
              items: {
                  deployment_id: string
                  | null;
                  deployment_name: string;
                  duration_ms: number;
                  environment_name: string | null;
                  model_id: string;
                  outcome: "SUCCESS" | "FAILED" | "STALLED";
                  phase_summary: {
                      duration_ms: number | null;
                      offset_ms: number;
                      phase:
                          | "SCHEDULING"
                          | "IMAGE_PULL"
                          | "WEIGHT_DOWNLOAD"
                          | "CONTAINER_CREATE"
                          | "CONTAINER_START"
                          | "READINESS";
                      status: "FAILED"
                      | "COMPLETED";
                  }[];
                  ready_at_epoch_millis: number
                  | null;
                  replica_id: string | null;
                  started_at_epoch_millis: number;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
              total_count: number;
          },
      >

    • Gets the startup summary for a model deployment

      Parameters

      • params: {
            deployment_id: string;
            model_id: string;
            params: {
                end_epoch_millis: number;
                min_duration_ms?: number | null;
                start_epoch_millis: number;
            };
        }

      Returns Promise<
          {
              end_epoch_millis: number;
              phase_duration_ms: {
                  duration_ms: {
                      mean_ms: number
                      | null;
                      p50_ms: number | null;
                      p90_ms: number | null;
                      p95_ms: number | null;
                      p99_ms: number | null;
                      sample_count: number;
                  };
                  phase: | "SCHEDULING"
                  | "IMAGE_PULL"
                  | "WEIGHT_DOWNLOAD"
                  | "CONTAINER_CREATE"
                  | "CONTAINER_START"
                  | "READINESS";
              }[];
              start_epoch_millis: number;
              total_duration_ms: {
                  mean_ms: number
                  | null;
                  p50_ms: number | null;
                  p90_ms: number | null;
                  p95_ms: number | null;
                  p99_ms: number | null;
                  sample_count: number;
              };
          },
      >

    • Gets all environments

      Parameters

      • params: { model_id: string }

      Returns Promise<
          {
              environments: {
                  autoscaling_schedules: | {
                      applied_state: | {
                          autoscaling_settings: {
                              autoscaling_window: number
                              | null;
                              concurrency_target: number;
                              max_replica: number;
                              max_scale_down_rate: number | null;
                              min_replica: number;
                              scale_down_delay: number | null;
                              target_in_flight_tokens: number | null;
                              target_utilization_percentage: number | null;
                          };
                          schedule_id: string
                          | null;
                      }
                      | null;
                      schedules: (
                          | {
                              autoscaling_settings: {
                                  autoscaling_window: (...)
                                  | (...);
                                  concurrency_target: (...) | (...);
                                  max_replica: number;
                                  max_scale_down_rate: (...) | (...);
                                  min_replica: number;
                                  scale_down_delay: (...) | (...);
                                  target_in_flight_tokens: (...) | (...);
                                  target_utilization_percentage: (...) | (...);
                              };
                              cadence: "DAILY"
                              | "HOURLY";
                              enabled: boolean;
                              end_hour: number | null;
                              end_minute: number;
                              id: string;
                              name: string;
                              start_hour: number | null;
                              start_minute: number;
                              weekdays: ((...) | (...) | (...) | (...) | (...) | (...) | (...))[];
                          }
                          | {
                              autoscaling_settings: {
                                  autoscaling_window: (...)
                                  | (...);
                                  concurrency_target: (...) | (...);
                                  max_replica: number;
                                  max_scale_down_rate: (...) | (...);
                                  min_replica: number;
                                  scale_down_delay: (...) | (...);
                                  target_in_flight_tokens: (...) | (...);
                                  target_utilization_percentage: (...) | (...);
                              };
                              cadence: "ONE_TIME";
                              enabled: boolean;
                              end_at: string;
                              id: string;
                              name: string;
                              start_at: string;
                          }
                      )[];
                      timezone: string
                      | null;
                  }
                  | null;
                  autoscaling_settings: {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  };
                  candidate_deployment: | {
                      active_replica_count: number;
                      autoscaling_settings: | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          scale_down_delay: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | null;
                      created_at: string;
                      environment: string
                      | null;
                      id: string;
                      instance_type_name: string | null;
                      is_development: boolean;
                      is_production: boolean;
                      labels: { [key: string]: unknown } | null;
                      model_id: string;
                      name: string;
                      region: { display_name: string; slug: string } | null;
                      request_backpressure_settings: {
                          policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                      };
                      status: | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
                  }
                  | null;
                  created_at: string;
                  current_deployment: | {
                      active_replica_count: number;
                      autoscaling_settings: | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          scale_down_delay: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | null;
                      created_at: string;
                      environment: string
                      | null;
                      id: string;
                      instance_type_name: string | null;
                      is_development: boolean;
                      is_production: boolean;
                      labels: { [key: string]: unknown } | null;
                      model_id: string;
                      name: string;
                      region: { display_name: string; slug: string } | null;
                      request_backpressure_settings: {
                          policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                      };
                      status: | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
                  }
                  | null;
                  in_progress_promotion: | {
                      error_message: string
                      | null;
                      percent_traffic_to_new_version: number;
                      rolling_deploy: boolean | null;
                      status:
                          | "FAILED"
                          | "RELEASING"
                          | "RAMPING_UP"
                          | "RAMPING_DOWN"
                          | "PAUSED"
                          | "SUCCEEDED"
                          | "CANCELED";
                  }
                  | null;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number
                      | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
                  model_id: string;
                  name: string;
                  promotion_settings: {
                      promotion_cleanup_strategy: | "KEEP"
                      | "SCALE_TO_ZERO"
                      | "DEACTIVATE"
                      | null;
                      ramp_up_duration_seconds: number
                      | null;
                      ramp_up_while_promoting: boolean | null;
                      redeploy_on_promotion: boolean | null;
                      rolling_deploy: boolean | null;
                      rolling_deploy_config:
                          | {
                              max_surge_percent: number;
                              max_unavailable_percent: number;
                              replica_overhead_percent: number;
                              rolling_deploy_strategy: "REPLICA";
                              stabilization_time_seconds: number;
                          }
                          | null;
                  };
                  request_backpressure_settings: {
                      policy: "QUEUE_ON_FULL"
                      | "REJECT_ON_FULL"
                      | null;
                  };
                  traffic_routing: | {
                      rules: {
                          expires_at: string;
                          id: string;
                          percent_traffic: number;
                          propagate_client_cancellation: boolean;
                          sampling_mode: "RANDOM"
                          | "USER_SESSION";
                          targets: {
                              deployment_id: (...) | (...);
                              environment: (...) | (...);
                              model_id: string;
                          }[];
                          type: "SHADOW";
                      }[];
                  }
                  | null;
              }[];
          },
      >

    • Gets an environment's details

      Parameters

      • params: { env_name: string; model_id: string }

      Returns Promise<
          {
              autoscaling_schedules: | {
                  applied_state: | {
                      autoscaling_settings: {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          scale_down_delay: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      };
                      schedule_id: string
                      | null;
                  }
                  | null;
                  schedules: (
                      | {
                          autoscaling_settings: {
                              autoscaling_window: number
                              | null;
                              concurrency_target: number | null;
                              max_replica: number;
                              max_scale_down_rate: number | null;
                              min_replica: number;
                              scale_down_delay: number | null;
                              target_in_flight_tokens: number | null;
                              target_utilization_percentage: number | null;
                          };
                          cadence: "DAILY"
                          | "HOURLY";
                          enabled: boolean;
                          end_hour: number | null;
                          end_minute: number;
                          id: string;
                          name: string;
                          start_hour: number | null;
                          start_minute: number;
                          weekdays: (
                              | "SUNDAY"
                              | "MONDAY"
                              | "TUESDAY"
                              | "WEDNESDAY"
                              | "THURSDAY"
                              | "FRIDAY"
                              | "SATURDAY"
                          )[];
                      }
                      | {
                          autoscaling_settings: {
                              autoscaling_window: number
                              | null;
                              concurrency_target: number | null;
                              max_replica: number;
                              max_scale_down_rate: number | null;
                              min_replica: number;
                              scale_down_delay: number | null;
                              target_in_flight_tokens: number | null;
                              target_utilization_percentage: number | null;
                          };
                          cadence: "ONE_TIME";
                          enabled: boolean;
                          end_at: string;
                          id: string;
                          name: string;
                          start_at: string;
                      }
                  )[];
                  timezone: string
                  | null;
              }
              | null;
              autoscaling_settings: {
                  autoscaling_window: number
                  | null;
                  concurrency_target: number;
                  max_replica: number;
                  max_scale_down_rate: number | null;
                  min_replica: number;
                  scale_down_delay: number | null;
                  target_in_flight_tokens: number | null;
                  target_utilization_percentage: number | null;
              };
              candidate_deployment: | {
                  active_replica_count: number;
                  autoscaling_settings: | {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  }
                  | null;
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  instance_type_name: string | null;
                  is_development: boolean;
                  is_production: boolean;
                  labels: { [key: string]: unknown } | null;
                  model_id: string;
                  name: string;
                  region: { display_name: string; slug: string } | null;
                  request_backpressure_settings: {
                      policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                  };
                  status: | "FAILED"
                  | "DEPLOYING"
                  | "DEACTIVATING"
                  | "BUILDING"
                  | "DEPLOY_FAILED"
                  | "LOADING_MODEL"
                  | "ACTIVE"
                  | "UNHEALTHY"
                  | "BUILD_FAILED"
                  | "BUILD_STOPPED"
                  | "INACTIVE"
                  | "UPDATING"
                  | "SCALED_TO_ZERO"
                  | "WAKING_UP";
              }
              | null;
              created_at: string;
              current_deployment: | {
                  active_replica_count: number;
                  autoscaling_settings: | {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  }
                  | null;
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  instance_type_name: string | null;
                  is_development: boolean;
                  is_production: boolean;
                  labels: { [key: string]: unknown } | null;
                  model_id: string;
                  name: string;
                  region: { display_name: string; slug: string } | null;
                  request_backpressure_settings: {
                      policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                  };
                  status: | "FAILED"
                  | "DEPLOYING"
                  | "DEACTIVATING"
                  | "BUILDING"
                  | "DEPLOY_FAILED"
                  | "LOADING_MODEL"
                  | "ACTIVE"
                  | "UNHEALTHY"
                  | "BUILD_FAILED"
                  | "BUILD_STOPPED"
                  | "INACTIVE"
                  | "UPDATING"
                  | "SCALED_TO_ZERO"
                  | "WAKING_UP";
              }
              | null;
              in_progress_promotion: | {
                  error_message: string
                  | null;
                  percent_traffic_to_new_version: number;
                  rolling_deploy: boolean | null;
                  status:
                      | "FAILED"
                      | "RELEASING"
                      | "RAMPING_UP"
                      | "RAMPING_DOWN"
                      | "PAUSED"
                      | "SUCCEEDED"
                      | "CANCELED";
              }
              | null;
              instance_type: {
                  gpu_count: number;
                  gpu_memory_limit_mib: number
                  | null;
                  gpu_type: string | null;
                  id: string;
                  memory_limit_mib: number;
                  millicpu_limit: number;
                  name: string;
              };
              model_id: string;
              name: string;
              promotion_settings: {
                  promotion_cleanup_strategy: | "KEEP"
                  | "SCALE_TO_ZERO"
                  | "DEACTIVATE"
                  | null;
                  ramp_up_duration_seconds: number
                  | null;
                  ramp_up_while_promoting: boolean | null;
                  redeploy_on_promotion: boolean | null;
                  rolling_deploy: boolean | null;
                  rolling_deploy_config:
                      | {
                          max_surge_percent: number;
                          max_unavailable_percent: number;
                          replica_overhead_percent: number;
                          rolling_deploy_strategy: "REPLICA";
                          stabilization_time_seconds: number;
                      }
                      | null;
              };
              request_backpressure_settings: {
                  policy: "QUEUE_ON_FULL"
                  | "REJECT_ON_FULL"
                  | null;
              };
              traffic_routing: | {
                  rules: {
                      expires_at: string;
                      id: string;
                      percent_traffic: number;
                      propagate_client_cancellation: boolean;
                      sampling_mode: "RANDOM"
                      | "USER_SESSION";
                      targets: {
                          deployment_id: string | null;
                          environment: string | null;
                          model_id: string;
                      }[];
                      type: "SHADOW";
                  }[];
              }
              | null;
          },
      >

    • Gets the logs for a model environment

      Parameters

      • params: {
            env_name: string;
            model_id: string;
            params?: {
                component?: string | null;
                direction?: "asc" | "desc" | null;
                end_epoch_millis?: number | null;
                excludes?: string[];
                includes?: string[];
                limit?: number | null;
                min_level?: "DEBUG" | "INFO" | "WARNING" | "ERROR" | null;
                replica?: string | null;
                request_id?: string | null;
                search_pattern?: string | null;
                start_epoch_millis?: number | null;
            };
        }

      Returns Promise<
          {
              logs: {
                  level: "DEBUG"
                  | "INFO"
                  | "WARNING"
                  | "ERROR"
                  | null;
                  message: string;
                  replica: string | null;
                  request_id: string | null;
                  timestamp: string;
              }[];
          },
      >

    • Gets the metrics for a model environment.

      Parameters

      • params: {
            env_name: string;
            model_id: string;
            params?: {
                end_epoch_millis?: number | null;
                metrics?: string[];
                mode?: "CURRENT" | "SUMMARY" | "SERIES";
                start_epoch_millis?: number | null;
            };
        }

      Returns Promise<
          {
              end_epoch_millis: number;
              metric_descriptors: {
                  kind: "GAUGE"
                  | "COUNTER"
                  | "HISTOGRAM";
                  label_sets: { [key: string]: string }[];
                  name: string;
                  unit_hint:
                      | "PER_SECOND"
                      | "SECONDS"
                      | "BYTES"
                      | "MEBIBYTES"
                      | "COUNT"
                      | "RATIO"
                      | "CELSIUS"
                      | "WATTS";
              }[];
              metric_values: { start_epoch_millis: number; values: (number | null)[][] }[];
              mode: "CURRENT" | "SUMMARY" | "SERIES";
              start_epoch_millis: number;
              step_seconds: number | null;
          },
      >

    • Lists the startups of a model environment

      Parameters

      • params: {
            env_name: string;
            model_id: string;
            params: {
                cursor?: string | null;
                direction?: "asc" | "desc" | null;
                end_epoch_millis: number;
                limit?: number;
                min_duration_ms?: number | null;
                outcomes?: ("SUCCESS" | "FAILED" | "STALLED")[];
                phase?:
                    | "SCHEDULING"
                    | "IMAGE_PULL"
                    | "WEIGHT_DOWNLOAD"
                    | "CONTAINER_CREATE"
                    | "CONTAINER_START"
                    | "READINESS"
                    | null;
                search?: string
                | null;
                sort_by?: "OUTCOME" | "STARTED_AT" | "READY_AT" | "DURATION" | null;
                start_epoch_millis: number;
            };
        }

      Returns Promise<
          {
              items: {
                  deployment_id: string
                  | null;
                  deployment_name: string;
                  duration_ms: number;
                  environment_name: string | null;
                  model_id: string;
                  outcome: "SUCCESS" | "FAILED" | "STALLED";
                  phase_summary: {
                      duration_ms: number | null;
                      offset_ms: number;
                      phase:
                          | "SCHEDULING"
                          | "IMAGE_PULL"
                          | "WEIGHT_DOWNLOAD"
                          | "CONTAINER_CREATE"
                          | "CONTAINER_START"
                          | "READINESS";
                      status: "FAILED"
                      | "COMPLETED";
                  }[];
                  ready_at_epoch_millis: number
                  | null;
                  replica_id: string | null;
                  started_at_epoch_millis: number;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
              total_count: number;
          },
      >

    • Gets the startup summary for a model environment

      Parameters

      • params: {
            env_name: string;
            model_id: string;
            params: {
                end_epoch_millis: number;
                min_duration_ms?: number | null;
                start_epoch_millis: number;
            };
        }

      Returns Promise<
          {
              end_epoch_millis: number;
              phase_duration_ms: {
                  duration_ms: {
                      mean_ms: number
                      | null;
                      p50_ms: number | null;
                      p90_ms: number | null;
                      p95_ms: number | null;
                      p99_ms: number | null;
                      sample_count: number;
                  };
                  phase: | "SCHEDULING"
                  | "IMAGE_PULL"
                  | "WEIGHT_DOWNLOAD"
                  | "CONTAINER_CREATE"
                  | "CONTAINER_START"
                  | "READINESS";
              }[];
              start_epoch_millis: number;
              total_duration_ms: {
                  mean_ms: number
                  | null;
                  p50_ms: number | null;
                  p90_ms: number | null;
                  p95_ms: number | null;
                  p99_ms: number | null;
                  sample_count: number;
              };
          },
      >

    • Gets a model by ID

      Parameters

      • params: { model_id: string }

      Returns Promise<
          {
              created_at: string;
              deployments_count: number;
              development_deployment_id: string
              | null;
              id: string;
              instance_type_name: string;
              name: string;
              production_deployment_id: string | null;
              team_name: string;
          },
      >

    • Gets the authenticated organization

      Returns Promise<
          {
              aws_assume_role: | { baseten_role_arn: string; external_id: string }
              | null;
              created_at: string;
              name: string | null;
              org_id: string;
          },
      >

    • Get a sandbox

      Parameters

      • params: { params?: { show_secrets?: boolean; team_id?: string }; sandbox_name: string }

      Returns Promise<
          {
              cpu?: number;
              envs?: { name?: string; secret?: boolean; value?: string }[];
              external_id?: string;
              filesystem?: { max_memory_usage?: string | number };
              image?: string;
              labels?: { [key: string]: string };
              lifecycle?: {
                  expiration_policies?: (
                      | { action: "DELETE"; type: "TTL_IDLE"; value: string }
                      | { action: "DELETE"; type: "TTL_MAX_AGE"; value: string }
                      | { action: "DELETE"; type: "DATE"; value: string }
                  )[];
                  terminated_retention?: string;
              };
              memory?: number;
              ports?: {
                  name?: string;
                  protocol?: "HTTP"
                  | "TCP"
                  | "UDP"
                  | "TLS";
                  target: number;
              }[];
              region?: string;
              volumes?: { mount_path: string; name: string; read_only?: boolean }[];
          } & {
              created_at: string;
              created_by?: string;
              expires_in?: number;
              last_used_at?: string;
              name: string;
              status: | "DEPLOYED"
              | "FAILED"
              | "DEPLOYING"
              | "DELETING"
              | "DEACTIVATING"
              | "DEACTIVATED"
              | "TERMINATED"
              | "ARCHIVING"
              | "ARCHIVED"
              | "UNARCHIVING"
              | "BUILDING"
              | "UPLOADING";
              updated_at?: string;
              updated_by?: string;
              url: string;
          },
      >

    • Get sandbox configuration

      Returns Promise<
          {
              regions: {
                  continent: string;
                  country: string;
                  info_generation: "CARBON";
                  location: string;
                  name: string;
              }[];
          },
      >

    • Get sandbox logs

      Parameters

      • params: {
            params: {
                cursor?: string;
                end_time: string;
                limit?: number;
                start_time: string;
                team_id?: string;
            };
            sandbox_name: string;
        }

      Returns Promise<
          {
              end_time: string;
              logs: {
                  action?: string;
                  message: string;
                  severity: number;
                  timestamp: string;
                  trace_id: string;
              }[];
              next_cursor: string
              | null;
              sandbox_name: string;
              start_time: string;
          },
      >

    • Get sandbox metrics

      Parameters

      • params: {
            params?: {
                end_epoch_millis?: number;
                metrics?: (
                    | "baseten_sandbox_requests_total"
                    | "baseten_sandbox_cpu_usage_cores"
                    | "baseten_sandbox_memory_bytes"
                )[];
                mode?: "CURRENT"
                | "SUMMARY"
                | "SERIES";
                start_epoch_millis?: number;
                team_id?: string;
            };
            sandbox_name: string;
        }

      Returns Promise<
          {
              end_epoch_millis: number;
              metric_descriptors: {
                  kind: "GAUGE"
                  | "COUNTER";
                  label_sets: { [key: string]: string }[];
                  name:
                      | "baseten_sandbox_requests_total"
                      | "baseten_sandbox_cpu_usage_cores"
                      | "baseten_sandbox_memory_bytes";
                  unit_hint: "BYTES"
                  | "COUNT"
                  | "CORES";
              }[];
              metric_values: { start_epoch_millis: number; values: (number | null)[][] }[];
              mode: "CURRENT" | "SUMMARY" | "SERIES";
              start_epoch_millis: number;
              step_seconds: number | null;
          },
      >

    • Get a sandbox preview

      Parameters

      • params: {
            params?: { show_secrets?: boolean; team_id?: string };
            preview_name: string;
            sandbox_name: string;
        }

      Returns Promise<
          {
              expires_at?: string;
              public?: boolean;
              request_headers?: { [key: string]: string };
              response_headers?: { [key: string]: string };
          } & {
              created_at?: string;
              created_by?: string;
              name: string;
              port: number;
              region?: string;
              status: "DEPLOYED"
              | "FAILED"
              | "DEPLOYING"
              | "DELETING"
              | "TERMINATED";
              updated_at?: string;
              updated_by?: string;
              url: string;
          },
      >

    • Get a volume

      Parameters

      • params: { params?: { team_id?: string }; volume_name: string }

      Returns Promise<
          {
              attached_to?: string;
              created_at?: string;
              created_by?: string;
              labels?: { [key: string]: string };
              name: string;
              region: string;
              size: string | number;
              status: "DEPLOYED" | "FAILED" | "DEPLOYING" | "DELETING";
              updated_at?: string;
              updated_by?: string;
          },
      >

    • Gets all secrets (metadata only, no plain text keys)

      Returns Promise<
          {
              secrets: {
                  created_at: string;
                  id: string;
                  name: string;
                  team_name: string;
              }[];
          },
      >

    • Lists all teams

      Parameters

      • Optionalparams: { params?: { name?: string | null } }

      Returns Promise<
          {
              teams: {
                  created_at: string;
                  default: boolean;
                  id: string;
                  name: string;
              }[];
          },
      >

    • Lists environment groups

      Parameters

      • params: { team_id: string }

      Returns Promise<
          {
              items: {
                  manage_access: {
                      is_restricted: boolean;
                      users?: { email: string
                      | null; name: string | null; user_id: string }[];
                  };
                  name: string;
                  team_id: string;
                  team_name: string;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets an environment group by name

      Parameters

      • params: { env_name: string; team_id: string }

      Returns Promise<
          {
              manage_access: {
                  is_restricted: boolean;
                  users?: { email: string
                  | null; name: string | null; user_id: string }[];
              };
              name: string;
              team_id: string;
              team_name: string;
          },
      >

    • Lists a team's Loops runs

      Parameters

      • params: {
            params?: {
                base_model?: string | null;
                run_id?: string | null;
                scope?: string | null;
                session_id?: string | null;
            };
            team_id: string;
        }

      Returns Promise<
          {
              runs: {
                  base_checkpoint: string
                  | null;
                  base_model: string;
                  base_url: string;
                  created_at: string;
                  deployment_id: string | null;
                  id: string;
                  lora_config_version: string | null;
                  name: string;
                  sampler:
                      | {
                          base_checkpoint: string
                          | null;
                          base_model: string;
                          base_url: string;
                          created_at: string;
                          deployment_id: string | null;
                          id: string;
                          instance_type:
                              | {
                                  gpu_count: number;
                                  gpu_memory_limit_mib: number
                                  | null;
                                  gpu_type: string | null;
                                  id: string;
                                  memory_limit_mib: number;
                                  millicpu_limit: number;
                                  name: string;
                              }
                              | null;
                          model_id: string
                          | null;
                          node_count: number;
                          session_id: string;
                          status: {
                              name:
                                  | "FAILED"
                                  | "DEPLOYING"
                                  | "DEACTIVATING"
                                  | "BUILDING"
                                  | "DEPLOY_FAILED"
                                  | "LOADING_MODEL"
                                  | "ACTIVE"
                                  | "UNHEALTHY"
                                  | "BUILD_FAILED"
                                  | "BUILD_STOPPED"
                                  | "INACTIVE"
                                  | "UPDATING"
                                  | "SCALED_TO_ZERO"
                                  | "WAKING_UP";
                          };
                          user: { email: string
                          | null };
                      }
                      | null;
                  session_id: string;
                  status: { name: "ACTIVE"
                  | "INACTIVE" };
                  user: { email: string | null };
              }[];
          },
      >

    • Lists a team's Loops samplers

      Parameters

      • params: {
            params?: { scope?: string | null; session_id?: string | null };
            team_id: string;
        }

      Returns Promise<
          {
              samplers: {
                  base_checkpoint: string
                  | null;
                  base_model: string;
                  base_url: string;
                  created_at: string;
                  deployment_id: string | null;
                  id: string;
                  instance_type:
                      | {
                          gpu_count: number;
                          gpu_memory_limit_mib: number
                          | null;
                          gpu_type: string | null;
                          id: string;
                          memory_limit_mib: number;
                          millicpu_limit: number;
                          name: string;
                      }
                      | null;
                  model_id: string
                  | null;
                  node_count: number;
                  session_id: string;
                  status: {
                      name:
                          | "FAILED"
                          | "DEPLOYING"
                          | "DEACTIVATING"
                          | "BUILDING"
                          | "DEPLOY_FAILED"
                          | "LOADING_MODEL"
                          | "ACTIVE"
                          | "UNHEALTHY"
                          | "BUILD_FAILED"
                          | "BUILD_STOPPED"
                          | "INACTIVE"
                          | "UPDATING"
                          | "SCALED_TO_ZERO"
                          | "WAKING_UP";
                  };
                  user: { email: string
                  | null };
              }[];
          },
      >

    • Gets all models

      Parameters

      • params: { params?: { name?: string | null }; team_id: string }

      Returns Promise<
          {
              models: {
                  created_at: string;
                  deployments_count: number;
                  development_deployment_id: string
                  | null;
                  id: string;
                  instance_type_name: string;
                  name: string;
                  production_deployment_id: string | null;
                  team_name: string;
              }[];
          },
      >

    • Lists regions available to a team

      Parameters

      • params: { team_id: string }

      Returns Promise<{ regions: { display_name: string; slug: string }[] }>

    • Gets all secrets for a team (metadata only, no plain text keys)

      Parameters

      • params: { team_id: string }

      Returns Promise<
          {
              secrets: {
                  created_at: string;
                  id: string;
                  name: string;
                  team_name: string;
              }[];
          },
      >

    • Gets a team by ID

      Parameters

      • params: { team_id: string }

      Returns Promise<{ created_at: string; default: boolean; id: string; name: string }>

    • Gets training GPU capacity

      Returns Promise<
          {
              gpu_capacities: {
                  baseline: number;
                  dedicated_usage_count: number;
                  gpu_type: string;
                  limit: number;
                  spot_usage_count: number;
                  usage_count: number;
              }[];
              team_gpu_capacities?: {
                  baseline: number;
                  dedicated_usage_count: number;
                  gpu_type: string;
                  limit: number;
                  spot_usage_count: number;
                  team_id: string;
                  team_name: string;
                  usage_count: number;
              }[];
          },
      >

    • Reconstructs queue context for a training job

      Parameters

      • params: { training_job_id: string }

      Returns Promise<
          {
              active_at_submit: {
                  instance_type_name: string;
                  status_at_submit: string;
                  status_set_at: string;
                  total_gpus: number;
                  training_job_id: string;
                  training_job_name: string
                  | null;
                  workload_plane_name: string;
              }[];
              events: {
                  created: string;
                  event_message: string
                  | null;
                  exit_code: number | null;
                  status: string;
                  training_job_id: string;
                  training_job_name: string | null;
              }[];
              events_window_end: string;
              gpu_type: string;
              org_capacity: | {
                  gpu_type: string;
                  last_modified: string;
                  max_gpus: number;
                  min_gpus: number
                  | null;
              }
              | null;
              pending_ahead_at_submit: {
                  instance_type_name: string;
                  priority: number;
                  requested_gpus: number;
                  submitted_at: string;
                  training_job_id: string;
                  training_job_name: string
                  | null;
              }[];
              pending_seconds: number
              | null;
              released_at: string | null;
              requested_gpus: number;
              submitted_at: string;
              target_job_id: string;
              target_job_name: string | null;
              team_capacity:
                  | {
                      gpu_type: string;
                      last_modified: string;
                      max_gpus: number;
                      min_gpus: number
                      | null;
                  }
                  | null;
          },
      >

    • Lists training projects

      Parameters

      • Optionalparams: {
            params?: {
                cursor?: string | null;
                limit?: number | null;
                name?: string | null;
            };
        }

      Returns Promise<
          {
              pagination: { cursor: string
              | null; has_more: boolean };
              training_projects: {
                  created_at: string;
                  id: string;
                  latest_job:
                      | {
                          availability_model: "standard"
                          | "spot";
                          checkpoint_sync_status: "COMPLETED" | "SYNCING" | null;
                          created_at: string;
                          current_status: string;
                          error_message: string | null;
                          id: string;
                          instance_type: {
                              gpu_count: number;
                              gpu_memory_limit_mib: number | null;
                              gpu_type: string | null;
                              id: string;
                              memory_limit_mib: number;
                              millicpu_limit: number;
                              name: string;
                          };
                          name: string
                          | null;
                          node_count: number;
                          priority: number;
                          training_project: { id: string; name: string };
                          training_project_id: string;
                          updated_at: string;
                          user: { email: string | null } | null;
                      }
                      | null;
                  name: string;
                  project_accelerator: string
                  | null;
                  team_name: string | null;
                  updated_at: string;
              }[];
          },
      >

    • Gets training project cache summary

      Parameters

      • params: { training_project_id: string }

      Returns Promise<
          {
              file_summaries: {
                  file_type: string;
                  modified: string;
                  path: string;
                  permissions: string;
                  size_bytes: number;
              }[];
              project_id: string;
              timestamp: string;
          },
      >

    • Lists training jobs

      Parameters

      • params: { training_project_id: string }

      Returns Promise<
          {
              training_jobs: {
                  availability_model: "standard"
                  | "spot";
                  checkpoint_sync_status: "COMPLETED" | "SYNCING" | null;
                  created_at: string;
                  current_status: string;
                  error_message: string | null;
                  id: string;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
                  name: string
                  | null;
                  node_count: number;
                  priority: number;
                  training_project: { id: string; name: string };
                  training_project_id: string;
                  updated_at: string;
                  user: { email: string | null } | null;
              }[];
              training_project: {
                  created_at: string;
                  id: string;
                  latest_job: | {
                      availability_model: "standard"
                      | "spot";
                      checkpoint_sync_status: "COMPLETED" | "SYNCING" | null;
                      created_at: string;
                      current_status: string;
                      error_message: string | null;
                      id: string;
                      instance_type: {
                          gpu_count: number;
                          gpu_memory_limit_mib: number | null;
                          gpu_type: string | null;
                          id: string;
                          memory_limit_mib: number;
                          millicpu_limit: number;
                          name: string;
                      };
                      name: string
                      | null;
                      node_count: number;
                      priority: number;
                      training_project: { id: string; name: string };
                      training_project_id: string;
                      updated_at: string;
                      user: { email: string | null } | null;
                  }
                  | null;
                  name: string;
                  project_accelerator: string
                  | null;
                  team_name: string | null;
                  updated_at: string;
              };
          },
      >

    • Gets auth codes for a training job

      Parameters

      • params: { training_job_id: string; training_project_id: string }

      Returns Promise<
          {
              auth_codes: {
                  auth_code: string;
                  auth_url: string;
                  expires_at: string
                  | null;
                  generated_at: string | null;
                  replica_id: string;
                  session_id: string;
                  tunnel_name: string | null;
                  working_directory: string | null;
              }[];
          },
      >

    • Gets training job checkpoint files

      Parameters

      • params: {
            params?: { page_size?: number; page_token?: number };
            training_job_id: string;
            training_project_id: string;
        }

      Returns Promise<
          {
              next_page_token: number
              | null;
              presigned_urls: {
                  last_modified: string;
                  node_rank: number;
                  relative_file_name: string;
                  size_bytes: number;
                  url: string;
              }[];
              total_count: number;
          },
      >

    • Gets training job checkpoints

      Parameters

      • params: { training_job_id: string; training_project_id: string }

      Returns Promise<
          {
              checkpoints: {
                  base_model: string
                  | null;
                  checkpoint_id: string;
                  checkpoint_type: string;
                  created_at: string;
                  lora_adapter_config: { [key: string]: unknown } | null;
                  size_bytes: number;
                  sync_status: string | null;
                  training_job_id: string;
              }[];
              training_job: {
                  availability_model: "standard"
                  | "spot";
                  checkpoint_sync_status: "COMPLETED" | "SYNCING" | null;
                  created_at: string;
                  current_status: string;
                  error_message: string | null;
                  id: string;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
                  name: string
                  | null;
                  node_count: number;
                  priority: number;
                  training_project: { id: string; name: string };
                  training_project_id: string;
                  updated_at: string;
                  user: { email: string | null } | null;
              };
          },
      >

    • Gets presigned URLs for a training job's artifacts

      Parameters

      • params: { training_job_id: string; training_project_id: string }

      Returns Promise<{ artifact_presigned_urls: string[] }>

    • Gets the logs for a training job

      Parameters

      • params: {
            params?: {
                direction?: "asc" | "desc" | null;
                end_epoch_millis?: number | null;
                limit?: number | null;
                min_level?: "DEBUG" | "INFO" | "WARNING" | "ERROR" | null;
                start_epoch_millis?: number | null;
            };
            training_job_id: string;
            training_project_id: string;
        }

      Returns Promise<
          {
              logs: {
                  level: "DEBUG"
                  | "INFO"
                  | "WARNING"
                  | "ERROR"
                  | null;
                  message: string;
                  replica: string | null;
                  request_id: string | null;
                  timestamp: string;
              }[];
          },
      >

    • Gets the metrics for a training job

      Parameters

      • params: {
            params?: {
                end_epoch_millis?: number | null;
                start_epoch_millis?: number | null;
                step_seconds?: number | null;
            };
            training_job_id: string;
            training_project_id: string;
        }

      Returns Promise<
          {
              cache: | {
                  usage_bytes: { timestamp: string; value: number }[];
                  utilization: { timestamp: string; value: number }[];
              }
              | null;
              cpu_memory_usage_bytes: { timestamp: string; value: number }[];
              cpu_usage: { timestamp: string; value: number }[];
              ephemeral_storage: {
                  usage_bytes: { timestamp: string; value: number }[];
                  utilization: { timestamp: string; value: number }[];
              };
              gpu_memory_usage_bytes: {
                  [key: string]: { timestamp: string; value: number }[];
              };
              gpu_utilization: { [key: string]: { timestamp: string; value: number }[] };
              per_node_metrics: {
                  metrics: {
                      cpu_memory_usage_bytes: { timestamp: string; value: number }[];
                      cpu_usage: { timestamp: string; value: number }[];
                      ephemeral_storage: {
                          usage_bytes: { timestamp: string; value: number }[];
                          utilization: { timestamp: string; value: number }[];
                      };
                      gpu_memory_usage_bytes: {
                          [key: string]: { timestamp: string; value: number }[];
                      };
                      gpu_utilization: {
                          [key: string]: { timestamp: string; value: number }[];
                      };
                  };
                  node_id: string;
              }[];
              training_job: {
                  availability_model: "standard"
                  | "spot";
                  checkpoint_sync_status: "COMPLETED" | "SYNCING" | null;
                  created_at: string;
                  current_status: string;
                  error_message: string | null;
                  id: string;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
                  name: string
                  | null;
                  node_count: number;
                  priority: number;
                  training_project: { id: string; name: string };
                  training_project_id: string;
                  updated_at: string;
                  user: { email: string | null } | null;
              };
          },
      >

    • Gets a training job

      Parameters

      • params: { training_job_id: string; training_project_id: string }

      Returns Promise<
          {
              training_job: {
                  availability_model: "standard"
                  | "spot";
                  checkpoint_sync_status: "COMPLETED" | "SYNCING" | null;
                  created_at: string;
                  current_status: string;
                  error_message: string | null;
                  id: string;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
                  name: string
                  | null;
                  node_count: number;
                  priority: number;
                  training_project: { id: string; name: string };
                  training_project_id: string;
                  updated_at: string;
                  user: { email: string | null } | null;
              };
              training_project: {
                  created_at: string;
                  id: string;
                  latest_job: | {
                      availability_model: "standard"
                      | "spot";
                      checkpoint_sync_status: "COMPLETED" | "SYNCING" | null;
                      created_at: string;
                      current_status: string;
                      error_message: string | null;
                      id: string;
                      instance_type: {
                          gpu_count: number;
                          gpu_memory_limit_mib: number | null;
                          gpu_type: string | null;
                          id: string;
                          memory_limit_mib: number;
                          millicpu_limit: number;
                          name: string;
                      };
                      name: string
                      | null;
                      node_count: number;
                      priority: number;
                      training_project: { id: string; name: string };
                      training_project_id: string;
                      updated_at: string;
                      user: { email: string | null } | null;
                  }
                  | null;
                  name: string;
                  project_accelerator: string
                  | null;
                  team_name: string | null;
                  updated_at: string;
              };
          },
      >

    • Gets a training project

      Parameters

      • params: { training_project_id: string }

      Returns Promise<
          {
              training_project: {
                  created_at: string;
                  id: string;
                  latest_job: | {
                      availability_model: "standard"
                      | "spot";
                      checkpoint_sync_status: "COMPLETED" | "SYNCING" | null;
                      created_at: string;
                      current_status: string;
                      error_message: string | null;
                      id: string;
                      instance_type: {
                          gpu_count: number;
                          gpu_memory_limit_mib: number | null;
                          gpu_type: string | null;
                          id: string;
                          memory_limit_mib: number;
                          millicpu_limit: number;
                          name: string;
                      };
                      name: string
                      | null;
                      node_count: number;
                      priority: number;
                      training_project: { id: string; name: string };
                      training_project_id: string;
                      updated_at: string;
                      user: { email: string | null } | null;
                  }
                  | null;
                  name: string;
                  project_accelerator: string
                  | null;
                  team_name: string | null;
                  updated_at: string;
              };
          },
      >

    • Lists users in the workspace

      Parameters

      • Optionalparams: { params?: { cursor?: string | null; email?: string | null; limit?: number } }

      Returns Promise<
          {
              items: {
                  email: string
                  | null;
                  name: string | null;
                  user_id: string;
                  workspace_name: string | null;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets the authenticated user

      Returns Promise<
          {
              email: string
              | null;
              name: string | null;
              user_id: string;
              workspace_name: string | null;
          },
      >

    • Gets a user by ID

      Parameters

      • params: { user_id: string }

      Returns Promise<
          {
              email: string
              | null;
              name: string | null;
              user_id: string;
              workspace_name: string | null;
          },
      >

    • Gets the volumes in a namespace

      Parameters

      • params: { params: { cursor?: string | null; limit?: number; namespace: string } }

      Returns Promise<
          {
              items: {
                  expires_at: string
                  | null;
                  head:
                      | { created_at: string; digest: string; total_size_bytes: number }
                      | null;
                  name: string;
                  namespace: string;
                  sequence: number;
                  tag_count: number;
                  tags: { digest: string; expires_at: string | null; name: string }[];
                  updated_at: string;
                  version_ref: string;
                  versions_alive: number;
                  versions_earliest_expires_at: string | null;
                  versions_expiring: number;
                  versions_tombstoned: number;
                  versions_untagged: number;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets the volume namespaces in your workspace

      Parameters

      • Optionalparams: { params?: { cursor?: string | null; limit?: number } }

      Returns Promise<
          {
              items: string[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Lists volume syncs

      Parameters

      • Optionalparams: { params?: { cursor?: string | null; limit?: number; ref?: string | null } }

      Returns Promise<
          {
              items: {
                  completed_at: string
                  | null;
                  content_digest: string | null;
                  created_at: string;
                  destination: { ref: string };
                  error: { code: string; message: string } | null;
                  source:
                      | {
                          auth_secret_name?: string
                          | null;
                          exclude?: string[];
                          hf_oidc?: { resource: string } | null;
                          include?: string[];
                          type: "HUGGING_FACE";
                          uri: string;
                      }
                      | {
                          auth_secret_name?: string
                          | null;
                          aws_assume_role?: { region: string; role_arn: string } | null;
                          aws_oidc?: { region: string; role_arn: string } | null;
                          exclude?: string[];
                          include?: string[];
                          type: "S3";
                          uri: string;
                      }
                      | {
                          auth_secret_name?: string
                          | null;
                          exclude?: string[];
                          gcp_oidc?:
                              | { service_account: string; workload_identity_provider: string }
                              | null;
                          include?: string[];
                          type: "GCS";
                          uri: string;
                      }
                      | {
                          auth_secret_name?: string
                          | null;
                          exclude?: string[];
                          include?: string[];
                          type: "AZURE";
                          uri: string;
                      }
                      | {
                          auth_secret_name?: string
                          | null;
                          exclude?: string[];
                          include?: string[];
                          type: "R2";
                          uri: string;
                      }
                      | {
                          auth_secret_name?: string
                          | null;
                          exclude?: string[];
                          include?: string[];
                          type: "COREWEAVE";
                          uri: string;
                      }
                      | {
                          exclude?: string[];
                          include?: string[];
                          type: "BASETEN_TRAINING";
                          uri: string;
                      };
                  status: "FAILED"
                  | "CANCELED"
                  | "SYNCING"
                  | "PENDING"
                  | "READY";
                  sync_id: string;
                  total_size_bytes: number | null;
                  version_ref: string | null;
                  volume_version_id: string | null;
              }[];
              pagination: { cursor: string
              | null; has_more: boolean };
          },
      >

    • Gets a volume sync

      Parameters

      • params: { volume_sync_id: string }

      Returns Promise<
          {
              completed_at: string
              | null;
              content_digest: string | null;
              created_at: string;
              destination: { ref: string };
              error: { code: string; message: string } | null;
              source:
                  | {
                      auth_secret_name?: string
                      | null;
                      exclude?: string[];
                      hf_oidc?: { resource: string } | null;
                      include?: string[];
                      type: "HUGGING_FACE";
                      uri: string;
                  }
                  | {
                      auth_secret_name?: string
                      | null;
                      aws_assume_role?: { region: string; role_arn: string } | null;
                      aws_oidc?: { region: string; role_arn: string } | null;
                      exclude?: string[];
                      include?: string[];
                      type: "S3";
                      uri: string;
                  }
                  | {
                      auth_secret_name?: string
                      | null;
                      exclude?: string[];
                      gcp_oidc?:
                          | { service_account: string; workload_identity_provider: string }
                          | null;
                      include?: string[];
                      type: "GCS";
                      uri: string;
                  }
                  | {
                      auth_secret_name?: string
                      | null;
                      exclude?: string[];
                      include?: string[];
                      type: "AZURE";
                      uri: string;
                  }
                  | {
                      auth_secret_name?: string
                      | null;
                      exclude?: string[];
                      include?: string[];
                      type: "R2";
                      uri: string;
                  }
                  | {
                      auth_secret_name?: string
                      | null;
                      exclude?: string[];
                      include?: string[];
                      type: "COREWEAVE";
                      uri: string;
                  }
                  | {
                      exclude?: string[];
                      include?: string[];
                      type: "BASETEN_TRAINING";
                      uri: string;
                  };
              status: "FAILED"
              | "CANCELED"
              | "SYNCING"
              | "PENDING"
              | "READY";
              sync_id: string;
              total_size_bytes: number | null;
              version_ref: string | null;
              volume_version_id: string | null;
          },
      >

    • Gets the versions of a volume

      Parameters

      • params: {
            params?: { include_tombstoned?: boolean };
            volume_name: string;
            volume_namespace: string;
        }

      Returns Promise<
          {
              versions: {
                  created_at: string;
                  delete_after: string
                  | null;
                  digest: string;
                  expires_at: string | null;
                  is_head: boolean;
                  lifecycle: string;
                  namespace: string;
                  sequence: number | null;
                  tags: string[];
                  tombstoned_at: string | null;
                  total_size_bytes: number | null;
                  version_ref: string;
                  volume: string;
              }[];
              volume_sequence: number;
          },
      >

    • Gets one version of a volume

      Parameters

      • params: { volume_name: string; volume_namespace: string; volume_version: string }

      Returns Promise<
          {
              created_at: string;
              delete_after: string
              | null;
              digest: string;
              entry_count: number | null;
              expires_at: string | null;
              is_head: boolean;
              lifecycle: string;
              namespace: string;
              sequence: number | null;
              tags: string[];
              tombstoned_at: string | null;
              total_size_bytes: number | null;
              version_ref: string;
              volume: string;
              volume_sequence: number;
          },
      >

    • Gets a volume

      Parameters

      • params: { volume_name: string; volume_namespace: string }

      Returns Promise<
          {
              expires_at: string
              | null;
              head:
                  | { created_at: string; digest: string; total_size_bytes: number }
                  | null;
              name: string;
              namespace: string;
              sequence: number;
              tag_count: number;
              tags: { digest: string; expires_at: string | null; name: string }[];
              updated_at: string;
              version_ref: string;
              versions_alive: number;
              versions_earliest_expires_at: string | null;
              versions_expiring: number;
              versions_tombstoned: number;
              versions_untagged: number;
          },
      >

    • List sandbox images

      Parameters

      • Optionalparams: {
            params?: {
                cursor?: string;
                limit?: number;
                q?: string;
                sort?: string;
                team_id?: string;
            };
        }

      Returns Promise<
          {
              items: {
                  created_at?: string;
                  last_deployed_at?: string;
                  name: string;
                  size?: number;
                  status: "FAILED"
                  | "BUILDING"
                  | "UPLOADING"
                  | "BUILT";
                  tag_count?: number;
                  updated_at?: string;
              }[];
              pagination: { cursor?: string; has_more: boolean };
          },
      >

    • List image tags

      Parameters

      • params: {
            image_name: string;
            params?: {
                cursor?: string;
                limit?: number;
                name?: string;
                q?: string;
                sort?: string;
                team_id?: string;
            };
        }

      Returns Promise<
          {
              items: {
                  created_at?: string;
                  name: string;
                  size?: number;
                  updated_at?: string;
              }[];
              pagination: { cursor?: string; has_more: boolean };
          },
      >

    • List sandboxes

      Parameters

      • Optionalparams: {
            params?: {
                cursor?: string;
                external_id?: string;
                limit?: number;
                q?: string;
                status?: string[];
                team_id?: string;
            };
        }

      Returns Promise<
          {
              items: (
                  {
                      cpu?: number;
                      envs?: { name?: string; secret?: boolean; value?: string }[];
                      external_id?: string;
                      filesystem?: { max_memory_usage?: string | number };
                      image?: string;
                      labels?: { [key: string]: string };
                      lifecycle?: {
                          expiration_policies?: (
                              | { action: ...; type: ...; value: ... }
                              | { action: ...; type: ...; value: ... }
                              | { action: ...; type: ...; value: ... }
                          )[];
                          terminated_retention?: string;
                      };
                      memory?: number;
                      ports?: {
                          name?: string;
                          protocol?: "HTTP"
                          | "TCP"
                          | "UDP"
                          | "TLS";
                          target: number;
                      }[];
                      region?: string;
                      volumes?: { mount_path: string; name: string; read_only?: boolean }[];
                  } & {
                      created_at: string;
                      created_by?: string;
                      expires_in?: number;
                      last_used_at?: string;
                      name: string;
                      status: | "DEPLOYED"
                      | "FAILED"
                      | "DEPLOYING"
                      | "DELETING"
                      | "DEACTIVATING"
                      | "DEACTIVATED"
                      | "TERMINATED"
                      | "ARCHIVING"
                      | "ARCHIVED"
                      | "UNARCHIVING"
                      | "BUILDING"
                      | "UPLOADING";
                      updated_at?: string;
                      updated_by?: string;
                      url: string;
                  }
              )[];
              pagination: { cursor?: string; has_more: boolean };
          },
      >

    • List built-in sandbox images

      Returns Promise<
          {
              items: {
                  categories?: string[];
                  coming_soon?: boolean;
                  creation_options?: {
                      extra_args?: { [key: string]: string };
                      volumes?: { mount_path: string; name: string; read_only?: boolean }[];
                  };
                  description?: string;
                  display_name?: string;
                  enterprise?: boolean;
                  hidden?: boolean;
                  icon?: string;
                  icon_dark?: string;
                  icon_light?: string;
                  image: string;
                  long_description?: string;
                  memory?: number;
                  name: string;
                  ports?: {
                      name?: string;
                      protocol?: "HTTP"
                      | "TCP"
                      | "UDP"
                      | "TLS";
                      target: number;
                  }[];
                  tags?: string[];
                  url?: string;
              }[];
          },
      >

    • List sandbox previews

      Parameters

      • params: {
            params?: { cursor?: string; limit?: number; team_id?: string };
            sandbox_name: string;
        }

      Returns Promise<
          {
              items: (
                  {
                      expires_at?: string;
                      public?: boolean;
                      request_headers?: { [key: string]: string };
                      response_headers?: { [key: string]: string };
                  } & {
                      created_at?: string;
                      created_by?: string;
                      name: string;
                      port: number;
                      region?: string;
                      status: "DEPLOYED"
                      | "FAILED"
                      | "DEPLOYING"
                      | "DELETING"
                      | "TERMINATED";
                      updated_at?: string;
                      updated_by?: string;
                      url: string;
                  }
              )[];
              pagination: { cursor?: string; has_more: boolean };
          },
      >

    • List preview tokens

      Parameters

      • params: {
            params?: { cursor?: string; limit?: number; team_id?: string };
            preview_name: string;
            sandbox_name: string;
        }

      Returns Promise<
          {
              items: {
                  expired: boolean;
                  expires_at: string;
                  name: string;
                  token: string;
              }[];
              pagination: { cursor?: string; has_more: boolean };
          },
      >

    • List volumes

      Parameters

      • Optionalparams: {
            params?: {
                cursor?: string;
                limit?: number;
                q?: string;
                status?: ("DEPLOYED" | "FAILED" | "DEPLOYING" | "DELETING")[];
                team_id?: string;
            };
        }

      Returns Promise<
          {
              items: {
                  attached_to?: string;
                  created_at?: string;
                  created_by?: string;
                  labels?: { [key: string]: string };
                  name: string;
                  region: string;
                  size: string | number;
                  status: "DEPLOYED" | "FAILED" | "DEPLOYING" | "DELETING";
                  updated_at?: string;
                  updated_by?: string;
              }[];
              pagination: { cursor?: string; has_more: boolean };
          },
      >

    • Updates a chain environment's settings

      Parameters

      • params: {
            chain_id: string;
            env_name: string;
            request: {
                promotion_settings?:
                    | {
                        promotion_cleanup_strategy?: | "KEEP"
                        | "SCALE_TO_ZERO"
                        | "DEACTIVATE"
                        | null;
                        ramp_up_duration_seconds?: number
                        | null;
                        ramp_up_while_promoting?: boolean | null;
                        redeploy_on_promotion?: boolean | null;
                        rolling_deploy?: boolean | null;
                        rolling_deploy_config?:
                            | {
                                max_surge_percent?: number
                                | null;
                                max_unavailable_percent?: number | null;
                                replica_overhead_percent?: number | null;
                                rolling_deploy_strategy?: "REPLICA" | null;
                                stabilization_time_seconds?: number | null;
                            }
                            | null;
                    }
                    | null;
            };
        }

      Returns Promise<{ ok: boolean }>

    • Updates a chainlet environment's autoscaling settings

      Parameters

      • params: {
            chain_id: string;
            env_name: string;
            request: {
                updates: {
                    autoscaling_settings: {
                        autoscaling_window?: number | null;
                        concurrency_target?: number | null;
                        max_replica?: number | null;
                        max_scale_down_rate?: number | null;
                        min_replica?: number | null;
                        scale_down_delay?: number | null;
                        target_in_flight_tokens?: number | null;
                        target_utilization_percentage?: number | null;
                    };
                    chainlet_name: string;
                }[];
            };
        }

      Returns Promise<{ message: string; status: "UNCHANGED" | "ACCEPTED" | "QUEUED" }>

    • Updates an environment group's restriction settings

      Parameters

      • params: {
            env_name: string;
            request: {
                manage_access?: { is_restricted: boolean; user_ids?: string[] } | null;
            };
        }

      Returns Promise<
          {
              manage_access: {
                  is_restricted: boolean;
                  users?: { email: string
                  | null; name: string | null; user_id: string }[];
              };
              name: string;
              team_id: string;
              team_name: string;
          },
      >

    • Updates a Gateway endpoint

      Parameters

      • params: {
            endpoint_id: string;
            request: {
                targets?:
                    | {
                        base_url?: string
                        | null;
                        environment_name?: string | null;
                        model_id?: string | null;
                        provider:
                            | "BASETEN_MODEL_API"
                            | "OPENAI"
                            | "ANTHROPIC"
                            | "XAI"
                            | "VERTEX"
                            | "OPENAI_COMPATIBLE"
                            | "BASETEN";
                        secret_id?: string
                        | null;
                        target_model?: string | null;
                        vertex_config?: { location: string; project_id: string } | null;
                    }[]
                    | null;
            };
        }

      Returns Promise<
          {
              created_at: string;
              id: string;
              region: "UNRESTRICTED"
              | "EU";
              slug: string;
              targets: {
                  base_url: string | null;
                  environment_name: string | null;
                  model_id: string | null;
                  provider:
                      | "BASETEN_MODEL_API"
                      | "OPENAI"
                      | "ANTHROPIC"
                      | "XAI"
                      | "VERTEX"
                      | "OPENAI_COMPATIBLE"
                      | "BASETEN";
                  secret_id: string
                  | null;
                  target_model: string | null;
                  vertex_config: { location: string; project_id: string } | null;
              }[];
              updated_at: string;
          },
      >

    • Updates a group

      Parameters

      • params: {
            group_id: string;
            request: {
                metadata?: { name?: string | null } | null;
                models?:
                    | {
                        rate_limits?: {
                            threshold: number;
                            type: | "REQUEST"
                            | "TOKEN"
                            | "CONCURRENT_REQUEST"
                            | "UNCACHED_INPUT_TOKEN"
                            | "OUTPUT_TOKEN";
                            unit: "SECOND"
                            | "MINUTE";
                        }[];
                        slug: string;
                        usage_limits?: {
                            threshold: number;
                            type: | "REQUEST"
                            | "TOKEN"
                            | "CONCURRENT_REQUEST"
                            | "UNCACHED_INPUT_TOKEN"
                            | "OUTPUT_TOKEN";
                            unit: "DAY";
                        }[];
                    }[]
                    | null;
            };
        }

      Returns Promise<
          {
              created_at: string;
              effective_models?: {
                  rate_limits?: {
                      source_group: string;
                      threshold: number;
                      type: | "REQUEST"
                      | "TOKEN"
                      | "CONCURRENT_REQUEST"
                      | "UNCACHED_INPUT_TOKEN"
                      | "OUTPUT_TOKEN";
                      unit: "SECOND"
                      | "MINUTE";
                  }[];
                  slug: string;
                  usage_limits?: {
                      source_group: string;
                      threshold: number;
                      type: | "REQUEST"
                      | "TOKEN"
                      | "CONCURRENT_REQUEST"
                      | "UNCACHED_INPUT_TOKEN"
                      | "OUTPUT_TOKEN";
                      unit: "DAY";
                  }[];
              }[];
              hierarchy: {
                  limit_enforcement: "CASCADING"
                  | "INDEPENDENT";
                  parent_group_id: string | null;
              };
              id: string;
              metadata: { external_entity_id: string; name?: string
              | null };
              models?: {
                  rate_limits?: {
                      threshold: number;
                      type:
                          | "REQUEST"
                          | "TOKEN"
                          | "CONCURRENT_REQUEST"
                          | "UNCACHED_INPUT_TOKEN"
                          | "OUTPUT_TOKEN";
                      unit: "SECOND"
                      | "MINUTE";
                  }[];
                  slug: string;
                  usage_limits?: {
                      threshold: number;
                      type: | "REQUEST"
                      | "TOKEN"
                      | "CONCURRENT_REQUEST"
                      | "UNCACHED_INPUT_TOKEN"
                      | "OUTPUT_TOKEN";
                      unit: "DAY";
                  }[];
              }[];
          },
      >

    • Updates a connection

      Parameters

      • params: {
            connection_id: string;
            request: {
                config:
                    | { provider: "ANTHROPIC"; secret_name: string }
                    | { provider: "OPENAI"; secret_name: string }
                    | { provider: "XAI"; secret_name: string }
                    | {
                        location: string;
                        project_id: string;
                        provider: "VERTEX";
                        secret_name: string;
                    }
                    | {
                        auth: { method: "api_key" }
                        | { method: "access_keys" };
                        provider: "BEDROCK";
                        region: string;
                        secret_name: string;
                    };
            };
        }

      Returns Promise<
          {
              config: | {
                  provider: "ANTHROPIC";
                  secret_id: string;
                  secret_name: string;
              }
              | { provider: "OPENAI"; secret_id: string; secret_name: string }
              | { provider: "XAI"; secret_id: string; secret_name: string }
              | {
                  location: string;
                  project_id: string;
                  provider: "VERTEX";
                  secret_id: string;
                  secret_name: string;
              }
              | {
                  auth: { method: "api_key" }
                  | { method: "access_keys" };
                  provider: "BEDROCK";
                  region: string;
                  secret_id: string;
                  secret_name: string;
              };
              created_at: string;
              id: string;
              team_id: string;
              team_name: string;
              updated_at: string;
          },
      >

    • Updates a machine user

      Parameters

      • params: { machine_user_id: string; request: { name?: string | null } }

      Returns Promise<
          {
              created_at: string;
              created_by: string
              | null;
              id: string;
              name: string;
              team_id: string;
              team_name: string;
          },
      >

    • Updates a route

      Parameters

      • params: {
            request: {
                description?: string | null;
                display_name?: string | null;
                target?:
                    | { model: string; type: "BASETEN_MODEL_API" }
                    | { connection_id: string; model: string; type: "CONNECTION" }
                    | {
                        allowed_route_ids: string[];
                        classifier_id: string;
                        default_route_id: string;
                        type: "CLASSIFIER";
                    }
                    | null;
            };
            route_id: string;
        }

      Returns Promise<
          {
              created_at: string;
              description: string;
              display_name: string;
              id: string;
              invoke_url: string;
              metadata: | {
                  context_window: number
                  | null;
                  cost:
                      | {
                          cache_read: number
                          | null;
                          cache_write: number | null;
                          input: number | null;
                          long_context:
                              | {
                                  cache_read: number
                                  | null;
                                  cache_write: number | null;
                                  input: number | null;
                                  output: number | null;
                              }
                              | null;
                          output: number
                          | null;
                      }
                      | null;
                  display_name: string
                  | null;
                  input_modalities: string[];
                  max_output_tokens: number | null;
                  parallel_tool_calls: boolean | null;
                  provider: string | null;
                  reasoning_effort_levels: string[] | null;
                  release_date: string | null;
                  slug: string | null;
                  supported_api_formats:
                      | {
                          chat_completions: boolean;
                          messages: boolean;
                          responses: boolean;
                      }
                      | null;
                  tools: boolean
                  | null;
              }
              | null;
              name: string;
              target: | { model: string; type: "BASETEN_MODEL_API" }
              | { connection_id: string; model: string; type: "CONNECTION" }
              | {
                  allowed_routes: { id: string; slug: string }[];
                  classifier: { id: string; name: string } | null;
                  default_route: { id: string; slug: string };
                  type: "CLASSIFIER";
              }
              | {
                  route_classifier: {
                      decidable_models: string[];
                      id: string;
                      name: string;
                      supported_tradeoffs: ("cost" | "balanced" | "intelligence")[];
                  };
                  tradeoff: "cost"
                  | "balanced"
                  | "intelligence";
                  type: "INTELLIGENT";
              };
              team_id: string;
              team_name: string;
          },
      >

    • Updates a team's Grid settings by team ID or your only team

      Parameters

      • params: {
            request: {
                harness_defaults?:
                    | {
                        claude_code?: | {
                            background?: string
                            | null;
                            primary?: string | null;
                        }
                        | null;
                        codex?: { background?: string | null; primary?: string | null }
                        | null;
                        opencode?:
                            | { background?: string
                            | null; primary?: string | null }
                            | null;
                        pi?: { background?: string | null; primary?: string | null } | null;
                    }
                    | null;
                spend_limit?: | {
                    per_member_monthly_limit_usd?: string
                    | null;
                    team_wide_monthly_limit_usd?: string | null;
                }
                | null;
                team_id?: string
                | null;
            };
        }

      Returns Promise<
          {
              harness_defaults: {
                  claude_code: {
                      background: | {
                          route: {
                              created_at: string;
                              description: string;
                              display_name: string;
                              id: string;
                              invoke_url: string;
                              metadata: | {
                                  context_window: number
                                  | null;
                                  cost:
                                      | {
                                          cache_read: ...;
                                          cache_write: ...;
                                          input: ...;
                                          long_context: ...;
                                          output: ...;
                                      }
                                      | null;
                                  display_name: string
                                  | null;
                                  input_modalities: string[];
                                  max_output_tokens: number | null;
                                  parallel_tool_calls: boolean | null;
                                  provider: string | null;
                                  reasoning_effort_levels: (...)[] | null;
                                  release_date: string | null;
                                  slug: string | null;
                                  supported_api_formats:
                                      | { chat_completions: ...; messages: ...; responses: ... }
                                      | null;
                                  tools: boolean | null;
                              }
                              | null;
                              name: string;
                              target: | { model: string; type: "BASETEN_MODEL_API" }
                              | { connection_id: string; model: string; type: "CONNECTION" }
                              | {
                                  allowed_routes: { id: ...; slug: ... }[];
                                  classifier: { id: ...; name: ... } | null;
                                  default_route: { id: string; slug: string };
                                  type: "CLASSIFIER";
                              }
                              | {
                                  route_classifier: {
                                      decidable_models: (...)[];
                                      id: string;
                                      name: string;
                                      supported_tradeoffs: (...)[];
                                  };
                                  tradeoff: "cost"
                                  | "balanced"
                                  | "intelligence";
                                  type: "INTELLIGENT";
                              };
                              team_id: string;
                              team_name: string;
                          };
                          source: "user"
                          | "team";
                      }
                      | null;
                      primary: | {
                          route: {
                              created_at: string;
                              description: string;
                              display_name: string;
                              id: string;
                              invoke_url: string;
                              metadata: | {
                                  context_window: number
                                  | null;
                                  cost:
                                      | {
                                          cache_read: ...;
                                          cache_write: ...;
                                          input: ...;
                                          long_context: ...;
                                          output: ...;
                                      }
                                      | null;
                                  display_name: string
                                  | null;
                                  input_modalities: string[];
                                  max_output_tokens: number | null;
                                  parallel_tool_calls: boolean | null;
                                  provider: string | null;
                                  reasoning_effort_levels: (...)[] | null;
                                  release_date: string | null;
                                  slug: string | null;
                                  supported_api_formats:
                                      | { chat_completions: ...; messages: ...; responses: ... }
                                      | null;
                                  tools: boolean | null;
                              }
                              | null;
                              name: string;
                              target: | { model: string; type: "BASETEN_MODEL_API" }
                              | { connection_id: string; model: string; type: "CONNECTION" }
                              | {
                                  allowed_routes: { id: ...; slug: ... }[];
                                  classifier: { id: ...; name: ... } | null;
                                  default_route: { id: string; slug: string };
                                  type: "CLASSIFIER";
                              }
                              | {
                                  route_classifier: {
                                      decidable_models: (...)[];
                                      id: string;
                                      name: string;
                                      supported_tradeoffs: (...)[];
                                  };
                                  tradeoff: "cost"
                                  | "balanced"
                                  | "intelligence";
                                  type: "INTELLIGENT";
                              };
                              team_id: string;
                              team_name: string;
                          };
                          source: "user"
                          | "team";
                      }
                      | null;
                  };
                  codex: {
                      background: | {
                          route: {
                              created_at: string;
                              description: string;
                              display_name: string;
                              id: string;
                              invoke_url: string;
                              metadata: | {
                                  context_window: number
                                  | null;
                                  cost:
                                      | {
                                          cache_read: ...;
                                          cache_write: ...;
                                          input: ...;
                                          long_context: ...;
                                          output: ...;
                                      }
                                      | null;
                                  display_name: string
                                  | null;
                                  input_modalities: string[];
                                  max_output_tokens: number | null;
                                  parallel_tool_calls: boolean | null;
                                  provider: string | null;
                                  reasoning_effort_levels: (...)[] | null;
                                  release_date: string | null;
                                  slug: string | null;
                                  supported_api_formats:
                                      | { chat_completions: ...; messages: ...; responses: ... }
                                      | null;
                                  tools: boolean | null;
                              }
                              | null;
                              name: string;
                              target: | { model: string; type: "BASETEN_MODEL_API" }
                              | { connection_id: string; model: string; type: "CONNECTION" }
                              | {
                                  allowed_routes: { id: ...; slug: ... }[];
                                  classifier: { id: ...; name: ... } | null;
                                  default_route: { id: string; slug: string };
                                  type: "CLASSIFIER";
                              }
                              | {
                                  route_classifier: {
                                      decidable_models: (...)[];
                                      id: string;
                                      name: string;
                                      supported_tradeoffs: (...)[];
                                  };
                                  tradeoff: "cost"
                                  | "balanced"
                                  | "intelligence";
                                  type: "INTELLIGENT";
                              };
                              team_id: string;
                              team_name: string;
                          };
                          source: "user"
                          | "team";
                      }
                      | null;
                      primary: | {
                          route: {
                              created_at: string;
                              description: string;
                              display_name: string;
                              id: string;
                              invoke_url: string;
                              metadata: | {
                                  context_window: number
                                  | null;
                                  cost:
                                      | {
                                          cache_read: ...;
                                          cache_write: ...;
                                          input: ...;
                                          long_context: ...;
                                          output: ...;
                                      }
                                      | null;
                                  display_name: string
                                  | null;
                                  input_modalities: string[];
                                  max_output_tokens: number | null;
                                  parallel_tool_calls: boolean | null;
                                  provider: string | null;
                                  reasoning_effort_levels: (...)[] | null;
                                  release_date: string | null;
                                  slug: string | null;
                                  supported_api_formats:
                                      | { chat_completions: ...; messages: ...; responses: ... }
                                      | null;
                                  tools: boolean | null;
                              }
                              | null;
                              name: string;
                              target: | { model: string; type: "BASETEN_MODEL_API" }
                              | { connection_id: string; model: string; type: "CONNECTION" }
                              | {
                                  allowed_routes: { id: ...; slug: ... }[];
                                  classifier: { id: ...; name: ... } | null;
                                  default_route: { id: string; slug: string };
                                  type: "CLASSIFIER";
                              }
                              | {
                                  route_classifier: {
                                      decidable_models: (...)[];
                                      id: string;
                                      name: string;
                                      supported_tradeoffs: (...)[];
                                  };
                                  tradeoff: "cost"
                                  | "balanced"
                                  | "intelligence";
                                  type: "INTELLIGENT";
                              };
                              team_id: string;
                              team_name: string;
                          };
                          source: "user"
                          | "team";
                      }
                      | null;
                  };
                  opencode: {
                      background: | {
                          route: {
                              created_at: string;
                              description: string;
                              display_name: string;
                              id: string;
                              invoke_url: string;
                              metadata: | {
                                  context_window: number
                                  | null;
                                  cost:
                                      | {
                                          cache_read: ...;
                                          cache_write: ...;
                                          input: ...;
                                          long_context: ...;
                                          output: ...;
                                      }
                                      | null;
                                  display_name: string
                                  | null;
                                  input_modalities: string[];
                                  max_output_tokens: number | null;
                                  parallel_tool_calls: boolean | null;
                                  provider: string | null;
                                  reasoning_effort_levels: (...)[] | null;
                                  release_date: string | null;
                                  slug: string | null;
                                  supported_api_formats:
                                      | { chat_completions: ...; messages: ...; responses: ... }
                                      | null;
                                  tools: boolean | null;
                              }
                              | null;
                              name: string;
                              target: | { model: string; type: "BASETEN_MODEL_API" }
                              | { connection_id: string; model: string; type: "CONNECTION" }
                              | {
                                  allowed_routes: { id: ...; slug: ... }[];
                                  classifier: { id: ...; name: ... } | null;
                                  default_route: { id: string; slug: string };
                                  type: "CLASSIFIER";
                              }
                              | {
                                  route_classifier: {
                                      decidable_models: (...)[];
                                      id: string;
                                      name: string;
                                      supported_tradeoffs: (...)[];
                                  };
                                  tradeoff: "cost"
                                  | "balanced"
                                  | "intelligence";
                                  type: "INTELLIGENT";
                              };
                              team_id: string;
                              team_name: string;
                          };
                          source: "user"
                          | "team";
                      }
                      | null;
                      primary: | {
                          route: {
                              created_at: string;
                              description: string;
                              display_name: string;
                              id: string;
                              invoke_url: string;
                              metadata: | {
                                  context_window: number
                                  | null;
                                  cost:
                                      | {
                                          cache_read: ...;
                                          cache_write: ...;
                                          input: ...;
                                          long_context: ...;
                                          output: ...;
                                      }
                                      | null;
                                  display_name: string
                                  | null;
                                  input_modalities: string[];
                                  max_output_tokens: number | null;
                                  parallel_tool_calls: boolean | null;
                                  provider: string | null;
                                  reasoning_effort_levels: (...)[] | null;
                                  release_date: string | null;
                                  slug: string | null;
                                  supported_api_formats:
                                      | { chat_completions: ...; messages: ...; responses: ... }
                                      | null;
                                  tools: boolean | null;
                              }
                              | null;
                              name: string;
                              target: | { model: string; type: "BASETEN_MODEL_API" }
                              | { connection_id: string; model: string; type: "CONNECTION" }
                              | {
                                  allowed_routes: { id: ...; slug: ... }[];
                                  classifier: { id: ...; name: ... } | null;
                                  default_route: { id: string; slug: string };
                                  type: "CLASSIFIER";
                              }
                              | {
                                  route_classifier: {
                                      decidable_models: (...)[];
                                      id: string;
                                      name: string;
                                      supported_tradeoffs: (...)[];
                                  };
                                  tradeoff: "cost"
                                  | "balanced"
                                  | "intelligence";
                                  type: "INTELLIGENT";
                              };
                              team_id: string;
                              team_name: string;
                          };
                          source: "user"
                          | "team";
                      }
                      | null;
                  };
                  pi: {
                      background: | {
                          route: {
                              created_at: string;
                              description: string;
                              display_name: string;
                              id: string;
                              invoke_url: string;
                              metadata: | {
                                  context_window: number
                                  | null;
                                  cost:
                                      | {
                                          cache_read: ...;
                                          cache_write: ...;
                                          input: ...;
                                          long_context: ...;
                                          output: ...;
                                      }
                                      | null;
                                  display_name: string
                                  | null;
                                  input_modalities: string[];
                                  max_output_tokens: number | null;
                                  parallel_tool_calls: boolean | null;
                                  provider: string | null;
                                  reasoning_effort_levels: (...)[] | null;
                                  release_date: string | null;
                                  slug: string | null;
                                  supported_api_formats:
                                      | { chat_completions: ...; messages: ...; responses: ... }
                                      | null;
                                  tools: boolean | null;
                              }
                              | null;
                              name: string;
                              target: | { model: string; type: "BASETEN_MODEL_API" }
                              | { connection_id: string; model: string; type: "CONNECTION" }
                              | {
                                  allowed_routes: { id: ...; slug: ... }[];
                                  classifier: { id: ...; name: ... } | null;
                                  default_route: { id: string; slug: string };
                                  type: "CLASSIFIER";
                              }
                              | {
                                  route_classifier: {
                                      decidable_models: (...)[];
                                      id: string;
                                      name: string;
                                      supported_tradeoffs: (...)[];
                                  };
                                  tradeoff: "cost"
                                  | "balanced"
                                  | "intelligence";
                                  type: "INTELLIGENT";
                              };
                              team_id: string;
                              team_name: string;
                          };
                          source: "user"
                          | "team";
                      }
                      | null;
                      primary: | {
                          route: {
                              created_at: string;
                              description: string;
                              display_name: string;
                              id: string;
                              invoke_url: string;
                              metadata: | {
                                  context_window: number
                                  | null;
                                  cost:
                                      | {
                                          cache_read: ...;
                                          cache_write: ...;
                                          input: ...;
                                          long_context: ...;
                                          output: ...;
                                      }
                                      | null;
                                  display_name: string
                                  | null;
                                  input_modalities: string[];
                                  max_output_tokens: number | null;
                                  parallel_tool_calls: boolean | null;
                                  provider: string | null;
                                  reasoning_effort_levels: (...)[] | null;
                                  release_date: string | null;
                                  slug: string | null;
                                  supported_api_formats:
                                      | { chat_completions: ...; messages: ...; responses: ... }
                                      | null;
                                  tools: boolean | null;
                              }
                              | null;
                              name: string;
                              target: | { model: string; type: "BASETEN_MODEL_API" }
                              | { connection_id: string; model: string; type: "CONNECTION" }
                              | {
                                  allowed_routes: { id: ...; slug: ... }[];
                                  classifier: { id: ...; name: ... } | null;
                                  default_route: { id: string; slug: string };
                                  type: "CLASSIFIER";
                              }
                              | {
                                  route_classifier: {
                                      decidable_models: (...)[];
                                      id: string;
                                      name: string;
                                      supported_tradeoffs: (...)[];
                                  };
                                  tradeoff: "cost"
                                  | "balanced"
                                  | "intelligence";
                                  type: "INTELLIGENT";
                              };
                              team_id: string;
                              team_name: string;
                          };
                          source: "user"
                          | "team";
                      }
                      | null;
                  };
              };
              spend_limit: {
                  per_member_monthly_limit_usd: string
                  | null;
                  team_wide_monthly_limit_usd: string | null;
              };
              team_id: string;
              team_name: string;
          },
      >

    • Updates a user's Grid settings by team ID or your only team

      Parameters

      • params: {
            request: {
                spend_limit?:
                    | {
                        month_override_usd?: string
                        | null;
                        user_monthly_limit_usd?: string | null;
                    }
                    | null;
                team_id?: string
                | null;
            };
            user_id: string;
        }

      Returns Promise<
          {
              blocked_by: "team"
              | "member"
              | null;
              email: string | null;
              is_blocked: boolean;
              month_spend_usd: string;
              spend_limit: {
                  effective: {
                      monthly_limit_usd: string | null;
                      source: "user" | "team" | null;
                  };
                  month_override_usd: string
                  | null;
                  team_default:
                      | {
                          per_member_monthly_limit_usd: string;
                          team_id: string;
                          team_name: string;
                      }
                      | null;
                  team_wide_monthly_limit_usd: string
                  | null;
                  user_monthly_limit_usd: string | null;
              };
              team_id: string;
              team_name: string;
              user_id: string;
          },
      >

    • Updates a library listing

      Parameters

      • params: {
            request: {
                display_name?: string | null;
                is_listed?: boolean | null;
                is_public?: boolean | null;
                metadata?:
                    | {
                        base_model?: string
                        | null;
                        context_length?: number | null;
                        description?: string | null;
                        input_modalities?: (
                            | "text"
                            | "image"
                            | "audio"
                            | "video"
                            | "embedding"
                            | "rerank"
                            | "decision"
                        )[];
                        license: string;
                        model_api_slug?: string
                        | null;
                        model_family?: string | null;
                        output_modalities?: (
                            | "text"
                            | "image"
                            | "audio"
                            | "video"
                            | "embedding"
                            | "rerank"
                            | "decision"
                        )[];
                        parameter_count?: number
                        | null;
                        publisher?: string | null;
                        release_date?: string | null;
                        trending?: boolean;
                        variant?: string | null;
                    }
                    | null;
                trending?: boolean
                | null;
            };
            user_defined_listing_id: string;
        }

      Returns Promise<
          {
              closed_source: boolean;
              created_at: string;
              display_name: string;
              is_listed: boolean;
              is_public: boolean;
              metadata: | {
                  base_model?: string
                  | null;
                  context_length?: number | null;
                  description?: string | null;
                  input_modalities?: (
                      | "text"
                      | "image"
                      | "audio"
                      | "video"
                      | "embedding"
                      | "rerank"
                      | "decision"
                  )[];
                  license: string;
                  model_api_slug?: string
                  | null;
                  model_family?: string | null;
                  output_modalities?: (
                      | "text"
                      | "image"
                      | "audio"
                      | "video"
                      | "embedding"
                      | "rerank"
                      | "decision"
                  )[];
                  parameter_count?: number
                  | null;
                  publisher?: string | null;
                  release_date?: string | null;
                  trending?: boolean;
                  variant?: string | null;
              }
              | null;
              modified_at: string;
              trending: boolean
              | null;
              user_defined_id: string;
          },
      >

    • Updates a library listing version

      Parameters

      • params: {
            request: {
                allow_truss_download?: boolean | null;
                benchmark?:
                    | {
                        embedding?: | {
                            e2e_latency_ms_p50?: number
                            | null;
                            e2e_latency_ms_p99?: number | null;
                            input_tokens_per_sec?: number | null;
                            requests_per_sec?: number | null;
                        }
                        | null;
                        llm?: | {
                            cost_per_1m_tokens_usd?: number
                            | null;
                            max_concurrent_users_at_50ms_tpot?: number | null;
                            output_tokens_per_sec_per_user_p50?: number | null;
                            requests_per_sec_p50?: number | null;
                            ttft_ms_p50?: number | null;
                        }
                        | null;
                        measured_at: string;
                        profile?: string
                        | null;
                        replicas?: number | null;
                        run_id: string;
                        tts?:
                            | {
                                cost_per_audio_minute_usd?: number
                                | null;
                                max_concurrent_streams_at_rtf1?: number | null;
                                ttft_ms_p50?: number | null;
                                ttft_ms_p50_at_max_concurrency?: number | null;
                            }
                            | null;
                    }
                    | null;
                is_live?: boolean
                | null;
            };
            user_defined_listing_id: string;
            version_tag: string;
        }

      Returns Promise<
          {
              allow_truss_download: boolean;
              benchmark: | {
                  embedding?: | {
                      e2e_latency_ms_p50?: number
                      | null;
                      e2e_latency_ms_p99?: number | null;
                      input_tokens_per_sec?: number | null;
                      requests_per_sec?: number | null;
                  }
                  | null;
                  llm?: | {
                      cost_per_1m_tokens_usd?: number
                      | null;
                      max_concurrent_users_at_50ms_tpot?: number | null;
                      output_tokens_per_sec_per_user_p50?: number | null;
                      requests_per_sec_p50?: number | null;
                      ttft_ms_p50?: number | null;
                  }
                  | null;
                  measured_at: string;
                  profile?: string
                  | null;
                  replicas?: number | null;
                  run_id: string;
                  tts?:
                      | {
                          cost_per_audio_minute_usd?: number
                          | null;
                          max_concurrent_streams_at_rtf1?: number | null;
                          ttft_ms_p50?: number | null;
                          ttft_ms_p50_at_max_concurrency?: number | null;
                      }
                      | null;
              }
              | null;
              created_at: string;
              is_live: boolean;
              modified_at: string;
              oracle_version_id: string;
              version_tag: string;
          },
      >

    • Patches the caller's Loops user config

      Parameters

      • params: {
            request: {
                sampler_accelerator_priority?: string[] | null;
                trainer_accelerator_priority?: string[] | null;
            };
        }

      Returns Promise<
          {
              user_config: {
                  sampler_accelerator_priority: string[]
                  | null;
                  trainer_accelerator_priority: string[] | null;
              };
          },
      >

    • Updates a model by ID

      Parameters

      • params: { model_id: string; request: { name?: string | null } }

      Returns Promise<
          {
              created_at: string;
              deployments_count: number;
              development_deployment_id: string
              | null;
              id: string;
              instance_type_name: string;
              name: string;
              production_deployment_id: string | null;
              team_name: string;
          },
      >

    • Updates a model's deployment by ID

      Parameters

      • params: { deployment_id: string; model_id: string; request: { name?: string | null } }

      Returns Promise<
          {
              active_replica_count: number;
              autoscaling_settings: | {
                  autoscaling_window: number
                  | null;
                  concurrency_target: number;
                  max_replica: number;
                  max_scale_down_rate: number | null;
                  min_replica: number;
                  scale_down_delay: number | null;
                  target_in_flight_tokens: number | null;
                  target_utilization_percentage: number | null;
              }
              | null;
              created_at: string;
              environment: string
              | null;
              id: string;
              instance_type_name: string | null;
              is_development: boolean;
              is_production: boolean;
              labels: { [key: string]: unknown } | null;
              model_id: string;
              name: string;
              region: { display_name: string; slug: string } | null;
              request_backpressure_settings: {
                  policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
              };
              status: | "FAILED"
              | "DEPLOYING"
              | "DEACTIVATING"
              | "BUILDING"
              | "DEPLOY_FAILED"
              | "LOADING_MODEL"
              | "ACTIVE"
              | "UNHEALTHY"
              | "BUILD_FAILED"
              | "BUILD_STOPPED"
              | "INACTIVE"
              | "UPDATING"
              | "SCALED_TO_ZERO"
              | "WAKING_UP";
          },
      >

    • Updates a deployment's autoscaling settings

      Parameters

      • params: {
            deployment_id: string;
            model_id: string;
            request: {
                autoscaling_window?: number | null;
                concurrency_target?: number | null;
                max_replica?: number | null;
                max_scale_down_rate?: number | null;
                min_replica?: number | null;
                scale_down_delay?: number | null;
                target_in_flight_tokens?: number | null;
                target_utilization_percentage?: number | null;
            };
        }

      Returns Promise<{ message: string; status: "UNCHANGED" | "ACCEPTED" | "QUEUED" }>

    • Updates a development deployment's autoscaling settings

      Parameters

      • params: {
            model_id: string;
            request: {
                autoscaling_window?: number | null;
                concurrency_target?: number | null;
                max_replica?: number | null;
                max_scale_down_rate?: number | null;
                min_replica?: number | null;
                scale_down_delay?: number | null;
                target_in_flight_tokens?: number | null;
                target_utilization_percentage?: number | null;
            };
        }

      Returns Promise<{ message: string; status: "UNCHANGED" | "ACCEPTED" | "QUEUED" }>

    • Updates a production deployment's autoscaling settings

      Parameters

      • params: {
            model_id: string;
            request: {
                autoscaling_window?: number | null;
                concurrency_target?: number | null;
                max_replica?: number | null;
                max_scale_down_rate?: number | null;
                min_replica?: number | null;
                scale_down_delay?: number | null;
                target_in_flight_tokens?: number | null;
                target_utilization_percentage?: number | null;
            };
        }

      Returns Promise<{ message: string; status: "UNCHANGED" | "ACCEPTED" | "QUEUED" }>

    • Updates a deployment's request backpressure settings

      Parameters

      • params: {
            deployment_id: string;
            model_id: string;
            request: { policy?: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null };
        }

      Returns Promise<{ policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null }>

    • Updates an environment's settings

      Parameters

      • params: {
            env_name: string;
            model_id: string;
            request: {
                autoscaling_schedule_settings?:
                    | {
                        delete_schedules?: string[];
                        schedules?: (
                            | {
                                autoscaling_settings: {
                                    autoscaling_window: number
                                    | null;
                                    concurrency_target: number | null;
                                    max_replica: number;
                                    max_scale_down_rate: number | null;
                                    min_replica: number;
                                    scale_down_delay: number | null;
                                    target_in_flight_tokens: number | null;
                                    target_utilization_percentage: number | null;
                                };
                                cadence: "DAILY"
                                | "HOURLY";
                                enabled: boolean;
                                end_hour?: number | null;
                                end_minute: number;
                                id?: string | null;
                                name: string;
                                start_hour?: number | null;
                                start_minute: number;
                                weekdays: (
                                    | "SUNDAY"
                                    | "MONDAY"
                                    | "TUESDAY"
                                    | "WEDNESDAY"
                                    | "THURSDAY"
                                    | "FRIDAY"
                                    | "SATURDAY"
                                )[];
                            }
                            | {
                                autoscaling_settings: {
                                    autoscaling_window: number
                                    | null;
                                    concurrency_target: number | null;
                                    max_replica: number;
                                    max_scale_down_rate: number | null;
                                    min_replica: number;
                                    scale_down_delay: number | null;
                                    target_in_flight_tokens: number | null;
                                    target_utilization_percentage: number | null;
                                };
                                cadence: "ONE_TIME";
                                enabled: boolean;
                                end_at: string;
                                id?: string
                                | null;
                                name: string;
                                start_at: string;
                            }
                        )[];
                        timezone?: string
                        | null;
                    }
                    | null;
                autoscaling_settings?: | {
                    autoscaling_window?: number
                    | null;
                    concurrency_target?: number | null;
                    max_replica?: number | null;
                    max_scale_down_rate?: number | null;
                    min_replica?: number | null;
                    scale_down_delay?: number | null;
                    target_in_flight_tokens?: number | null;
                    target_utilization_percentage?: number | null;
                }
                | null;
                promotion_settings?: | {
                    promotion_cleanup_strategy?: | "KEEP"
                    | "SCALE_TO_ZERO"
                    | "DEACTIVATE"
                    | null;
                    ramp_up_duration_seconds?: number
                    | null;
                    ramp_up_while_promoting?: boolean | null;
                    redeploy_on_promotion?: boolean | null;
                    rolling_deploy?: boolean | null;
                    rolling_deploy_config?:
                        | {
                            max_surge_percent?: number
                            | null;
                            max_unavailable_percent?: number | null;
                            replica_overhead_percent?: number | null;
                            rolling_deploy_strategy?: "REPLICA" | null;
                            stabilization_time_seconds?: number | null;
                        }
                        | null;
                }
                | null;
                request_backpressure_settings?: | {
                    policy?: "QUEUE_ON_FULL"
                    | "REJECT_ON_FULL"
                    | null;
                }
                | null;
                traffic_routing_settings?: | {
                    delete_rules?: string[];
                    rules?: {
                        expires_at: string;
                        id?: string
                        | null;
                        percent_traffic: number;
                        propagate_client_cancellation: boolean;
                        sampling_mode: "RANDOM" | "USER_SESSION";
                        targets: { deployment_id?: string | null; environment?: string | null }[];
                        type: "SHADOW";
                    }[];
                }
                | null;
            };
        }

      Returns Promise<
          {
              environment: {
                  autoscaling_schedules: | {
                      applied_state: | {
                          autoscaling_settings: {
                              autoscaling_window: number
                              | null;
                              concurrency_target: number;
                              max_replica: number;
                              max_scale_down_rate: number | null;
                              min_replica: number;
                              scale_down_delay: number | null;
                              target_in_flight_tokens: number | null;
                              target_utilization_percentage: number | null;
                          };
                          schedule_id: string
                          | null;
                      }
                      | null;
                      schedules: (
                          | {
                              autoscaling_settings: {
                                  autoscaling_window: number
                                  | null;
                                  concurrency_target: number | null;
                                  max_replica: number;
                                  max_scale_down_rate: number | null;
                                  min_replica: number;
                                  scale_down_delay: number | null;
                                  target_in_flight_tokens: number | null;
                                  target_utilization_percentage: number | null;
                              };
                              cadence: "DAILY"
                              | "HOURLY";
                              enabled: boolean;
                              end_hour: number | null;
                              end_minute: number;
                              id: string;
                              name: string;
                              start_hour: number | null;
                              start_minute: number;
                              weekdays: (
                                  | "SUNDAY"
                                  | "MONDAY"
                                  | "TUESDAY"
                                  | "WEDNESDAY"
                                  | "THURSDAY"
                                  | "FRIDAY"
                                  | "SATURDAY"
                              )[];
                          }
                          | {
                              autoscaling_settings: {
                                  autoscaling_window: number
                                  | null;
                                  concurrency_target: number | null;
                                  max_replica: number;
                                  max_scale_down_rate: number | null;
                                  min_replica: number;
                                  scale_down_delay: number | null;
                                  target_in_flight_tokens: number | null;
                                  target_utilization_percentage: number | null;
                              };
                              cadence: "ONE_TIME";
                              enabled: boolean;
                              end_at: string;
                              id: string;
                              name: string;
                              start_at: string;
                          }
                      )[];
                      timezone: string
                      | null;
                  }
                  | null;
                  autoscaling_settings: {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  };
                  candidate_deployment: | {
                      active_replica_count: number;
                      autoscaling_settings: | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          scale_down_delay: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | null;
                      created_at: string;
                      environment: string
                      | null;
                      id: string;
                      instance_type_name: string | null;
                      is_development: boolean;
                      is_production: boolean;
                      labels: { [key: string]: unknown } | null;
                      model_id: string;
                      name: string;
                      region: { display_name: string; slug: string } | null;
                      request_backpressure_settings: {
                          policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                      };
                      status: | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
                  }
                  | null;
                  created_at: string;
                  current_deployment: | {
                      active_replica_count: number;
                      autoscaling_settings: | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          scale_down_delay: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | null;
                      created_at: string;
                      environment: string
                      | null;
                      id: string;
                      instance_type_name: string | null;
                      is_development: boolean;
                      is_production: boolean;
                      labels: { [key: string]: unknown } | null;
                      model_id: string;
                      name: string;
                      region: { display_name: string; slug: string } | null;
                      request_backpressure_settings: {
                          policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                      };
                      status: | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
                  }
                  | null;
                  in_progress_promotion: | {
                      error_message: string
                      | null;
                      percent_traffic_to_new_version: number;
                      rolling_deploy: boolean | null;
                      status:
                          | "FAILED"
                          | "RELEASING"
                          | "RAMPING_UP"
                          | "RAMPING_DOWN"
                          | "PAUSED"
                          | "SUCCEEDED"
                          | "CANCELED";
                  }
                  | null;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number
                      | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
                  model_id: string;
                  name: string;
                  promotion_settings: {
                      promotion_cleanup_strategy: | "KEEP"
                      | "SCALE_TO_ZERO"
                      | "DEACTIVATE"
                      | null;
                      ramp_up_duration_seconds: number
                      | null;
                      ramp_up_while_promoting: boolean | null;
                      redeploy_on_promotion: boolean | null;
                      rolling_deploy: boolean | null;
                      rolling_deploy_config:
                          | {
                              max_surge_percent: number;
                              max_unavailable_percent: number;
                              replica_overhead_percent: number;
                              rolling_deploy_strategy: "REPLICA";
                              stabilization_time_seconds: number;
                          }
                          | null;
                  };
                  request_backpressure_settings: {
                      policy: "QUEUE_ON_FULL"
                      | "REJECT_ON_FULL"
                      | null;
                  };
                  traffic_routing: | {
                      rules: {
                          expires_at: string;
                          id: string;
                          percent_traffic: number;
                          propagate_client_cancellation: boolean;
                          sampling_mode: "RANDOM"
                          | "USER_SESSION";
                          targets: {
                              deployment_id: string | null;
                              environment: string | null;
                              model_id: string;
                          }[];
                          type: "SHADOW";
                      }[];
                  }
                  | null;
              };
              message: string;
              status: "UNCHANGED"
              | "ACCEPTED"
              | "QUEUED";
          },
      >

    • Updates an environment group's restriction settings

      Parameters

      • params: {
            env_name: string;
            request: {
                manage_access?: { is_restricted: boolean; user_ids?: string[] } | null;
            };
            team_id: string;
        }

      Returns Promise<
          {
              manage_access: {
                  is_restricted: boolean;
                  users?: { email: string
                  | null; name: string | null; user_id: string }[];
              };
              name: string;
              team_id: string;
              team_name: string;
          },
      >

    • Sets a team's training GPU capacity

      Parameters

      • params: { request: { gpu_type: string; max_gpus: number; team_id: string } }

      Returns Promise<
          {
              team_gpu_capacity: {
                  baseline: number;
                  dedicated_usage_count: number;
                  gpu_type: string;
                  limit: number;
                  spot_usage_count: number;
                  team_id: string;
                  team_name: string;
                  usage_count: number;
              };
          },
      >

    • Updates a training job

      Parameters

      • params: {
            request: {
                availability_model?: "standard" | "spot" | null;
                priority?: number | null;
            };
            training_job_id: string;
            training_project_id: string;
        }

      Returns Promise<
          {
              training_job: {
                  availability_model: "standard"
                  | "spot";
                  checkpoint_sync_status: "COMPLETED" | "SYNCING" | null;
                  created_at: string;
                  current_status: string;
                  error_message: string | null;
                  id: string;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
                  name: string
                  | null;
                  node_count: number;
                  priority: number;
                  training_project: { id: string; name: string };
                  training_project_id: string;
                  updated_at: string;
                  user: { email: string | null } | null;
              };
          },
      >

    • Patches an interactive session

      Parameters

      • params: {
            request: {
                timeout_minutes?: number | null;
                trigger?: "on_startup" | "on_failure" | "on_demand" | null;
            };
            session_id: string;
            training_job_id: string;
            training_project_id: string;
        }

      Returns Promise<
          {
              interactive_session: {
                  auth_code: string
                  | null;
                  auth_code_generated_at: string | null;
                  auth_provider: string;
                  auth_url: string | null;
                  authenticated_at: string | null;
                  expires_at: string | null;
                  id: string;
                  pod_name: string;
                  session_provider: string;
                  timeout_minutes: number;
                  trigger: string;
                  tunnel_name: string | null;
                  working_directory: string | null;
              };
              message: string;
          },
      >

    • Updates a volume

      Parameters

      • params: {
            request: {
                expected_sequence?: number | null;
                expires_at?: string | null;
            };
            volume_name: string;
            volume_namespace: string;
        }

      Returns Promise<
          {
              expires_at: string
              | null;
              namespace: string;
              volume: string;
              volume_sequence: number;
          },
      >

    • Creates an API key

      Parameters

      • params: {
            request: {
                expires_at?: string | null;
                model_ids?: string[] | null;
                name?: string | null;
                team_id?: string | null;
                type:
                    | "PERSONAL"
                    | "GRID"
                    | "WORKSPACE_MANAGE_ALL"
                    | "WORKSPACE_EXPORT_METRICS"
                    | "WORKSPACE_INVOKE"
                    | "WORKSPACE_MANAGE_API_KEYS";
            };
        }

      Returns Promise<{ api_key: string }>

    • Deactivates a chain deployment

      Parameters

      • params: { chain_deployment_id: string; chain_id: string }

      Returns Promise<{ no_op: boolean; success: boolean }>

    • Creates a chain environment

      Parameters

      • params: {
            chain_id: string;
            request: {
                chainlet_settings?:
                    | {
                        autoscaling_settings?: | {
                            autoscaling_window?: number
                            | null;
                            concurrency_target?: number | null;
                            max_replica?: number | null;
                            max_scale_down_rate?: number | null;
                            min_replica?: number | null;
                            scale_down_delay?: number | null;
                            target_in_flight_tokens?: number | null;
                            target_utilization_percentage?: number | null;
                        }
                        | null;
                        chainlet_name: string;
                        instance_type_id?: string;
                    }[]
                    | null;
                name: string;
                promotion_settings?: | {
                    promotion_cleanup_strategy?: | "KEEP"
                    | "SCALE_TO_ZERO"
                    | "DEACTIVATE"
                    | null;
                    ramp_up_duration_seconds?: number
                    | null;
                    ramp_up_while_promoting?: boolean | null;
                    redeploy_on_promotion?: boolean | null;
                    rolling_deploy?: boolean | null;
                    rolling_deploy_config?:
                        | {
                            max_surge_percent?: number
                            | null;
                            max_unavailable_percent?: number | null;
                            replica_overhead_percent?: number | null;
                            rolling_deploy_strategy?: "REPLICA" | null;
                            stabilization_time_seconds?: number | null;
                        }
                        | null;
                }
                | null;
            };
        }

      Returns Promise<
          {
              candidate_deployment: | {
                  chain_id: string;
                  chainlets: {
                      active_replica_count: number;
                      autoscaling_settings: | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          scale_down_delay: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | null;
                      id: string;
                      instance_type_name: string;
                      name: string;
                      status: | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
                  }[];
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  status:
                      | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
              }
              | null;
              chain_id: string;
              chainlet_settings: {
                  autoscaling_settings: | {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  }
                  | null;
                  chainlet_name: string;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number
                      | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
              }[];
              created_at: string;
              current_deployment: | {
                  chain_id: string;
                  chainlets: {
                      active_replica_count: number;
                      autoscaling_settings: | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          scale_down_delay: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | null;
                      id: string;
                      instance_type_name: string;
                      name: string;
                      status: | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
                  }[];
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  status:
                      | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
              }
              | null;
              in_progress_promotion: | {
                  error_message: string
                  | null;
                  percent_traffic_to_new_version: number;
                  rolling_deploy: boolean | null;
                  status:
                      | "FAILED"
                      | "RELEASING"
                      | "RAMPING_UP"
                      | "RAMPING_DOWN"
                      | "PAUSED"
                      | "SUCCEEDED"
                      | "CANCELED";
              }
              | null;
              name: string;
              promotion_settings: {
                  promotion_cleanup_strategy: | "KEEP"
                  | "SCALE_TO_ZERO"
                  | "DEACTIVATE"
                  | null;
                  ramp_up_duration_seconds: number
                  | null;
                  ramp_up_while_promoting: boolean | null;
                  redeploy_on_promotion: boolean | null;
                  rolling_deploy: boolean | null;
                  rolling_deploy_config:
                      | {
                          max_surge_percent: number;
                          max_unavailable_percent: number;
                          replica_overhead_percent: number;
                          rolling_deploy_strategy: "REPLICA";
                          stabilization_time_seconds: number;
                      }
                      | null;
              };
          },
      >

    • Updates a chainlet environment's instance type settings

      Parameters

      • params: {
            chain_id: string;
            env_name: string;
            request: { updates: { chainlet_name: string; instance_type_id: string }[] };
        }

      Returns Promise<
          {
              chain_deployment: | {
                  chain_id: string;
                  chainlets: {
                      active_replica_count: number;
                      autoscaling_settings: | {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          scale_down_delay: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      }
                      | null;
                      id: string;
                      instance_type_name: string;
                      name: string;
                      status: | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
                  }[];
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  status:
                      | "FAILED"
                      | "DEPLOYING"
                      | "DEACTIVATING"
                      | "BUILDING"
                      | "DEPLOY_FAILED"
                      | "LOADING_MODEL"
                      | "ACTIVE"
                      | "UNHEALTHY"
                      | "BUILD_FAILED"
                      | "BUILD_STOPPED"
                      | "INACTIVE"
                      | "UPDATING"
                      | "SCALED_TO_ZERO"
                      | "WAKING_UP";
              }
              | null;
              chainlet_environment_settings: {
                  autoscaling_settings: | {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  }
                  | null;
                  chainlet_name: string;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number
                      | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
              }[];
              requires_redeployment: boolean;
          },
      >

    • Promotes a chain deployment to an environment

      Parameters

      • params: {
            chain_id: string;
            env_name: string;
            request: {
                deployment_id: string;
                scale_down_previous_deployment?: boolean;
            };
        }

      Returns Promise<
          {
              chain_id: string;
              chainlets: {
                  active_replica_count: number;
                  autoscaling_settings: | {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  }
                  | null;
                  id: string;
                  instance_type_name: string;
                  name: string;
                  status: | "FAILED"
                  | "DEPLOYING"
                  | "DEACTIVATING"
                  | "BUILDING"
                  | "DEPLOY_FAILED"
                  | "LOADING_MODEL"
                  | "ACTIVE"
                  | "UNHEALTHY"
                  | "BUILD_FAILED"
                  | "BUILD_STOPPED"
                  | "INACTIVE"
                  | "UPDATING"
                  | "SCALED_TO_ZERO"
                  | "WAKING_UP";
              }[];
              created_at: string;
              environment: string
              | null;
              id: string;
              status:
                  | "FAILED"
                  | "DEPLOYING"
                  | "DEACTIVATING"
                  | "BUILDING"
                  | "DEPLOY_FAILED"
                  | "LOADING_MODEL"
                  | "ACTIVE"
                  | "UNHEALTHY"
                  | "BUILD_FAILED"
                  | "BUILD_STOPPED"
                  | "INACTIVE"
                  | "UPDATING"
                  | "SCALED_TO_ZERO"
                  | "WAKING_UP";
          },
      >

    • Creates a Gateway endpoint

      Parameters

      • params: {
            request: {
                region?: "UNRESTRICTED" | "EU";
                slug: string;
                targets: {
                    base_url?: string | null;
                    environment_name?: string | null;
                    model_id?: string | null;
                    provider:
                        | "BASETEN_MODEL_API"
                        | "OPENAI"
                        | "ANTHROPIC"
                        | "XAI"
                        | "VERTEX"
                        | "OPENAI_COMPATIBLE"
                        | "BASETEN";
                    secret_id?: string
                    | null;
                    target_model?: string | null;
                    vertex_config?: { location: string; project_id: string } | null;
                }[];
            };
        }

      Returns Promise<
          {
              created_at: string;
              id: string;
              region: "UNRESTRICTED"
              | "EU";
              slug: string;
              targets: {
                  base_url: string | null;
                  environment_name: string | null;
                  model_id: string | null;
                  provider:
                      | "BASETEN_MODEL_API"
                      | "OPENAI"
                      | "ANTHROPIC"
                      | "XAI"
                      | "VERTEX"
                      | "OPENAI_COMPATIBLE"
                      | "BASETEN";
                  secret_id: string
                  | null;
                  target_model: string | null;
                  vertex_config: { location: string; project_id: string } | null;
              }[];
              updated_at: string;
          },
      >

    • Creates a group

      Parameters

      • params: {
            request: {
                hierarchy: {
                    limit_enforcement?: "CASCADING" | "INDEPENDENT" | null;
                    parent_group_id?: string | null;
                };
                metadata: { external_entity_id: string; name?: string
                | null };
                models: {
                    rate_limits?: {
                        threshold: number;
                        type:
                            | "REQUEST"
                            | "TOKEN"
                            | "CONCURRENT_REQUEST"
                            | "UNCACHED_INPUT_TOKEN"
                            | "OUTPUT_TOKEN";
                        unit: "SECOND"
                        | "MINUTE";
                    }[];
                    slug: string;
                    usage_limits?: {
                        threshold: number;
                        type: | "REQUEST"
                        | "TOKEN"
                        | "CONCURRENT_REQUEST"
                        | "UNCACHED_INPUT_TOKEN"
                        | "OUTPUT_TOKEN";
                        unit: "DAY";
                    }[];
                }[];
            };
        }

      Returns Promise<
          {
              created_at: string;
              effective_models?: {
                  rate_limits?: {
                      source_group: string;
                      threshold: number;
                      type: | "REQUEST"
                      | "TOKEN"
                      | "CONCURRENT_REQUEST"
                      | "UNCACHED_INPUT_TOKEN"
                      | "OUTPUT_TOKEN";
                      unit: "SECOND"
                      | "MINUTE";
                  }[];
                  slug: string;
                  usage_limits?: {
                      source_group: string;
                      threshold: number;
                      type: | "REQUEST"
                      | "TOKEN"
                      | "CONCURRENT_REQUEST"
                      | "UNCACHED_INPUT_TOKEN"
                      | "OUTPUT_TOKEN";
                      unit: "DAY";
                  }[];
              }[];
              hierarchy: {
                  limit_enforcement: "CASCADING"
                  | "INDEPENDENT";
                  parent_group_id: string | null;
              };
              id: string;
              metadata: { external_entity_id: string; name?: string
              | null };
              models?: {
                  rate_limits?: {
                      threshold: number;
                      type:
                          | "REQUEST"
                          | "TOKEN"
                          | "CONCURRENT_REQUEST"
                          | "UNCACHED_INPUT_TOKEN"
                          | "OUTPUT_TOKEN";
                      unit: "SECOND"
                      | "MINUTE";
                  }[];
                  slug: string;
                  usage_limits?: {
                      threshold: number;
                      type: | "REQUEST"
                      | "TOKEN"
                      | "CONCURRENT_REQUEST"
                      | "UNCACHED_INPUT_TOKEN"
                      | "OUTPUT_TOKEN";
                      unit: "DAY";
                  }[];
              }[];
          },
      >

    • Creates an API key for a group

      Parameters

      • params: { group_id: string; request: { name?: string | null } }

      Returns Promise<{ api_key: string; name: string | null; prefix: string }>

    • Registers an API key for a group

      Parameters

      • params: { group_id: string; request: { key: string; name?: string | null } }

      Returns Promise<{ ok: boolean }>

    • Creates a connection

      Parameters

      • params: {
            request: {
                config:
                    | { provider: "ANTHROPIC"; secret_name: string }
                    | { provider: "OPENAI"; secret_name: string }
                    | { provider: "XAI"; secret_name: string }
                    | {
                        location: string;
                        project_id: string;
                        provider: "VERTEX";
                        secret_name: string;
                    }
                    | {
                        auth: { method: "api_key" }
                        | { method: "access_keys" };
                        provider: "BEDROCK";
                        region: string;
                        secret_name: string;
                    };
                team_id?: string
                | null;
            };
        }

      Returns Promise<
          {
              config: | {
                  provider: "ANTHROPIC";
                  secret_id: string;
                  secret_name: string;
              }
              | { provider: "OPENAI"; secret_id: string; secret_name: string }
              | { provider: "XAI"; secret_id: string; secret_name: string }
              | {
                  location: string;
                  project_id: string;
                  provider: "VERTEX";
                  secret_id: string;
                  secret_name: string;
              }
              | {
                  auth: { method: "api_key" }
                  | { method: "access_keys" };
                  provider: "BEDROCK";
                  region: string;
                  secret_id: string;
                  secret_name: string;
              };
              created_at: string;
              id: string;
              team_id: string;
              team_name: string;
              updated_at: string;
          },
      >

    • Creates a machine user

      Parameters

      • params: {
            request: {
                api_key?: { name?: string | null } | null;
                name: string;
                team_id?: string | null;
            };
        }

      Returns Promise<
          {
              api_key: string
              | null;
              created_at: string;
              created_by: string | null;
              id: string;
              name: string;
              team_id: string;
              team_name: string;
          },
      >

    • Creates an API key for a machine user

      Parameters

      • params: { machine_user_id: string; request: { name?: string | null } }

      Returns Promise<{ api_key: string }>

    • Creates a route

      Parameters

      • params: {
            request: {
                description?: string | null;
                display_name?: string | null;
                target:
                    | { model: string; type: "BASETEN_MODEL_API" }
                    | { connection_id: string; model: string; type: "CONNECTION" }
                    | {
                        allowed_route_ids: string[];
                        classifier_id: string;
                        default_route_id: string;
                        type: "CLASSIFIER";
                    };
                team_id?: string
                | null;
            };
        }

      Returns Promise<
          {
              created_at: string;
              description: string;
              display_name: string;
              id: string;
              invoke_url: string;
              metadata: | {
                  context_window: number
                  | null;
                  cost:
                      | {
                          cache_read: number
                          | null;
                          cache_write: number | null;
                          input: number | null;
                          long_context:
                              | {
                                  cache_read: number
                                  | null;
                                  cache_write: number | null;
                                  input: number | null;
                                  output: number | null;
                              }
                              | null;
                          output: number
                          | null;
                      }
                      | null;
                  display_name: string
                  | null;
                  input_modalities: string[];
                  max_output_tokens: number | null;
                  parallel_tool_calls: boolean | null;
                  provider: string | null;
                  reasoning_effort_levels: string[] | null;
                  release_date: string | null;
                  slug: string | null;
                  supported_api_formats:
                      | {
                          chat_completions: boolean;
                          messages: boolean;
                          responses: boolean;
                      }
                      | null;
                  tools: boolean
                  | null;
              }
              | null;
              name: string;
              target: | { model: string; type: "BASETEN_MODEL_API" }
              | { connection_id: string; model: string; type: "CONNECTION" }
              | {
                  allowed_routes: { id: string; slug: string }[];
                  classifier: { id: string; name: string } | null;
                  default_route: { id: string; slug: string };
                  type: "CLASSIFIER";
              }
              | {
                  route_classifier: {
                      decidable_models: string[];
                      id: string;
                      name: string;
                      supported_tradeoffs: ("cost" | "balanced" | "intelligence")[];
                  };
                  tradeoff: "cost"
                  | "balanced"
                  | "intelligence";
                  type: "INTELLIGENT";
              };
              team_id: string;
              team_name: string;
          },
      >

    • Creates a Grid access token

      Parameters

      • params: { request: { team_id?: string | null } }

      Returns Promise<
          {
              expires_at: string;
              team_id: string;
              team_name: string;
              token: string;
          },
      >

    • Creates a new library listing

      Parameters

      • params: {
            request: {
                closed_source?: boolean;
                display_name: string;
                is_listed?: boolean;
                is_public?: boolean;
                user_defined_id: string;
            };
        }

      Returns Promise<
          {
              closed_source: boolean;
              created_at: string;
              display_name: string;
              is_listed: boolean;
              is_public: boolean;
              metadata: | {
                  base_model?: string
                  | null;
                  context_length?: number | null;
                  description?: string | null;
                  input_modalities?: (
                      | "text"
                      | "image"
                      | "audio"
                      | "video"
                      | "embedding"
                      | "rerank"
                      | "decision"
                  )[];
                  license: string;
                  model_api_slug?: string
                  | null;
                  model_family?: string | null;
                  output_modalities?: (
                      | "text"
                      | "image"
                      | "audio"
                      | "video"
                      | "embedding"
                      | "rerank"
                      | "decision"
                  )[];
                  parameter_count?: number
                  | null;
                  publisher?: string | null;
                  release_date?: string | null;
                  trending?: boolean;
                  variant?: string | null;
              }
              | null;
              modified_at: string;
              trending: boolean
              | null;
              user_defined_id: string;
          },
      >

    • Creates a new library listing version

      Parameters

      • params: {
            request: {
                allow_truss_download?: boolean;
                closed_source?: boolean;
                display_name?: string | null;
                is_listed?: boolean;
                is_public?: boolean;
                oracle_version_id: string;
                replace_model?: boolean;
                version_tag: string;
            };
            user_defined_listing_id: string;
        }

      Returns Promise<
          {
              allow_truss_download: boolean;
              benchmark: | {
                  embedding?: | {
                      e2e_latency_ms_p50?: number
                      | null;
                      e2e_latency_ms_p99?: number | null;
                      input_tokens_per_sec?: number | null;
                      requests_per_sec?: number | null;
                  }
                  | null;
                  llm?: | {
                      cost_per_1m_tokens_usd?: number
                      | null;
                      max_concurrent_users_at_50ms_tpot?: number | null;
                      output_tokens_per_sec_per_user_p50?: number | null;
                      requests_per_sec_p50?: number | null;
                      ttft_ms_p50?: number | null;
                  }
                  | null;
                  measured_at: string;
                  profile?: string
                  | null;
                  replicas?: number | null;
                  run_id: string;
                  tts?:
                      | {
                          cost_per_audio_minute_usd?: number
                          | null;
                          max_concurrent_streams_at_rtf1?: number | null;
                          ttft_ms_p50?: number | null;
                          ttft_ms_p50_at_max_concurrency?: number | null;
                      }
                      | null;
              }
              | null;
              created_at: string;
              is_live: boolean;
              modified_at: string;
              oracle_version_id: string;
              version_tag: string;
          },
      >

    • Creates a new BIS-LLM deployment

      Parameters

      • params: {
            request: {
                additional_autoscaling_config?: { [key: string]: unknown } | null;
                autoscaling_settings?:
                    | {
                        autoscaling_window?: number
                        | null;
                        concurrency_target?: number | null;
                        max_replica?: number | null;
                        max_scale_down_rate?: number | null;
                        min_replica?: number | null;
                        scale_down_delay?: number | null;
                        target_in_flight_tokens?: number | null;
                        target_utilization_percentage?: number | null;
                    }
                    | null;
                bdn?: { [key: string]: unknown }
                | null;
                deployment_name?: string | null;
                egress_restrictions?:
                    | {
                        fqdn_allow_list?: string[]
                        | null;
                        ip_allow_list?: string[] | null;
                    }
                    | null;
                environment_variables?: { [key: string]: unknown };
                llm_config?: { [key: string]: unknown };
                llm_version?: string | null;
                metadata?: { [key: string]: unknown } | null;
                model_metadata?: { [key: string]: unknown } | null;
                name: string;
                region?: string | null;
                resources: { [key: string]: unknown };
                runtime?:
                    | {
                        oidc?: | {
                            byok?: { [key: string]: unknown }
                            | null;
                            enabled?: boolean | null;
                        }
                        | null;
                    }
                    | null;
                weights?: { [key: string]: unknown }[]
                | null;
            };
        }

      Returns Promise<
          {
              hostname: string;
              instance_type_name: string
              | null;
              model_id: string;
              version_id: string;
          },
      >

    • Creates a new BIS-LLM deployment version

      Parameters

      • params: {
            model_id: string;
            request: {
                additional_autoscaling_config?: { [key: string]: unknown } | null;
                autoscaling_settings?:
                    | {
                        autoscaling_window?: number
                        | null;
                        concurrency_target?: number | null;
                        max_replica?: number | null;
                        max_scale_down_rate?: number | null;
                        min_replica?: number | null;
                        scale_down_delay?: number | null;
                        target_in_flight_tokens?: number | null;
                        target_utilization_percentage?: number | null;
                    }
                    | null;
                bdn?: { [key: string]: unknown }
                | null;
                deployment_name?: string | null;
                egress_restrictions?:
                    | {
                        fqdn_allow_list?: string[]
                        | null;
                        ip_allow_list?: string[] | null;
                    }
                    | null;
                environment_variables?: { [key: string]: unknown };
                llm_config?: { [key: string]: unknown };
                llm_version?: string | null;
                metadata?: { [key: string]: unknown } | null;
                model_metadata?: { [key: string]: unknown } | null;
                region?: string | null;
                resources: { [key: string]: unknown };
                runtime?:
                    | {
                        oidc?: | {
                            byok?: { [key: string]: unknown }
                            | null;
                            enabled?: boolean | null;
                        }
                        | null;
                    }
                    | null;
                weights?: { [key: string]: unknown }[]
                | null;
            };
        }

      Returns Promise<
          {
              hostname: string;
              instance_type_name: string
              | null;
              model_id: string;
              version_id: string;
          },
      >

    • Deploys Loops checkpoints

      Parameters

      • params: {
            request: {
                checkpoint_ids: string[];
                hf_secret_name: string;
                instance_type_id: string;
                model_name: string;
            };
        }

      Returns Promise<{ deployment_id: string; model_id: string }>

    • Validates a Loops checkpoint bt:// URI

      Parameters

      • params: { request: { checkpoint_path: string; run_id?: string | null } }

      Returns Promise<Record<string, unknown>>

    • Deactivates a Loops deployment

      Parameters

      • params: { deployment_id: string }

      Returns Promise<{ base_model: string; id: string; user: { email: string | null } }>

    • Gets metrics for a Loops trainer deployment

      Parameters

      • params: {
            deployment_id: string;
            request: {
                end_epoch_millis?: number | null;
                start_epoch_millis?: number | null;
                step_seconds?: number | null;
                time_divisor_seconds?: number | null;
            };
        }

      Returns Promise<
          {
              deployment_id: string;
              metrics: {
                  concurrent_requests: { timestamp: string; value: number }[];
                  cpu_memory_usage_bytes: { timestamp: string; value: number }[];
                  cpu_usage: { timestamp: string; value: number }[];
                  ephemeral_storage: {
                      usage_bytes: { timestamp: string; value: number }[];
                      utilization: { timestamp: string; value: number }[];
                  };
                  gpu_memory_usage_bytes: {
                      [key: string]: { timestamp: string; value: number }[];
                  };
                  gpu_utilization: {
                      [key: string]: { timestamp: string; value: number }[];
                  };
                  inference_volume: { timestamp: string; value: number }[];
                  inference_volume_by_status: {
                      status_2xx: number;
                      status_4xx: number;
                      status_5xx: number;
                      timestamp: string;
                  }[];
                  per_node_metrics: {
                      cpu_memory_usage_bytes: { timestamp: string; value: number }[];
                      cpu_usage: { timestamp: string; value: number }[];
                      ephemeral_storage: {
                          usage_bytes: { timestamp: string; value: number }[];
                          utilization: { timestamp: string; value: number }[];
                      };
                      gpu_memory_usage_bytes: {
                          [key: string]: { timestamp: string; value: number }[];
                      };
                      gpu_utilization: {
                          [key: string]: { timestamp: string; value: number }[];
                      };
                      node_id: string;
                  }[];
                  response_time_stats: {
                      p50: number
                      | null;
                      p95: number | null;
                      p99: number | null;
                      timestamp: string;
                  }[];
              };
          },
      >

    • Creates a Loops run

      Parameters

      • params: {
            request: {
                availability_model?: "standard" | "spot";
                base_checkpoint?: string | null;
                base_model: string;
                lora_rank?: number;
                max_seq_len?: number | null;
                name?: string | null;
                path?: string | null;
                replicas?: number;
                reuse_from_run_id?: string | null;
                reuse_from_session_id?: string | null;
                sampler_num_replicas?: number | null;
                scale_down_delay_seconds?: number;
                seed?: number | null;
                session_id: string;
            };
        }

      Returns Promise<
          {
              run: {
                  base_checkpoint: string
                  | null;
                  base_model: string;
                  base_url: string;
                  created_at: string;
                  deployment_id: string | null;
                  id: string;
                  lora_config_version: string | null;
                  name: string;
                  sampler:
                      | {
                          base_checkpoint: string
                          | null;
                          base_model: string;
                          base_url: string;
                          created_at: string;
                          deployment_id: string | null;
                          id: string;
                          instance_type:
                              | {
                                  gpu_count: number;
                                  gpu_memory_limit_mib: number
                                  | null;
                                  gpu_type: string | null;
                                  id: string;
                                  memory_limit_mib: number;
                                  millicpu_limit: number;
                                  name: string;
                              }
                              | null;
                          model_id: string
                          | null;
                          node_count: number;
                          session_id: string;
                          status: {
                              name:
                                  | "FAILED"
                                  | "DEPLOYING"
                                  | "DEACTIVATING"
                                  | "BUILDING"
                                  | "DEPLOY_FAILED"
                                  | "LOADING_MODEL"
                                  | "ACTIVE"
                                  | "UNHEALTHY"
                                  | "BUILD_FAILED"
                                  | "BUILD_STOPPED"
                                  | "INACTIVE"
                                  | "UPDATING"
                                  | "SCALED_TO_ZERO"
                                  | "WAKING_UP";
                          };
                          user: { email: string
                          | null };
                      }
                      | null;
                  session_id: string;
                  status: { name: "ACTIVE"
                  | "INACTIVE" };
                  user: { email: string | null };
              };
          },
      >

    • Deactivates a Loops run

      Parameters

      • params: { run_id: string }

      Returns Promise<{ base_model: string; id: string; user: { email: string | null } }>

    • Creates a Loops sampler

      Parameters

      • params: {
            request: {
                availability_model?: "standard" | "spot" | null;
                base_model?: string | null;
                max_seq_length?: number | null;
                model_path?: string | null;
                num_replicas?: number | null;
                reuse_from_session_id?: string | null;
                run_id?: string | null;
                scope?: "default" | "serverless" | "dedicated";
                session_id: string;
            };
        }

      Returns Promise<
          {
              sampler: {
                  base_checkpoint: string
                  | null;
                  base_model: string;
                  base_url: string;
                  created_at: string;
                  deployment_id: string | null;
                  id: string;
                  instance_type:
                      | {
                          gpu_count: number;
                          gpu_memory_limit_mib: number
                          | null;
                          gpu_type: string | null;
                          id: string;
                          memory_limit_mib: number;
                          millicpu_limit: number;
                          name: string;
                      }
                      | null;
                  model_id: string
                  | null;
                  node_count: number;
                  session_id: string;
                  status: {
                      name:
                          | "FAILED"
                          | "DEPLOYING"
                          | "DEACTIVATING"
                          | "BUILDING"
                          | "DEPLOY_FAILED"
                          | "LOADING_MODEL"
                          | "ACTIVE"
                          | "UNHEALTHY"
                          | "BUILD_FAILED"
                          | "BUILD_STOPPED"
                          | "INACTIVE"
                          | "UPDATING"
                          | "SCALED_TO_ZERO"
                          | "WAKING_UP";
                  };
                  user: { email: string
                  | null };
              };
          },
      >

    • Deactivates a standalone Loops sampler

      Parameters

      • params: { sampler_id: string }

      Returns Promise<{ base_model: string; id: string; user: { email: string | null } }>

    • Creates a Loops trainer

      Parameters

      • params: {
            request: {
                availability_model?: "standard" | "spot";
                base_checkpoint?: string | null;
                base_model: string;
                lora_rank?: number;
                max_seq_len?: number | null;
                name?: string | null;
                path?: string | null;
                replicas?: number;
                reuse_from_run_id?: string | null;
                reuse_from_session_id?: string | null;
                scale_down_delay_seconds?: number;
                scope?: "default" | "serverless" | "dedicated";
                seed?: number | null;
                session_id: string;
            };
        }

      Returns Promise<
          {
              run: {
                  base_checkpoint: string
                  | null;
                  base_model: string;
                  base_url: string;
                  created_at: string;
                  deployment_id: string | null;
                  id: string;
                  lora_config_version: string | null;
                  name: string;
                  sampler:
                      | {
                          base_checkpoint: string
                          | null;
                          base_model: string;
                          base_url: string;
                          created_at: string;
                          deployment_id: string | null;
                          id: string;
                          instance_type:
                              | {
                                  gpu_count: number;
                                  gpu_memory_limit_mib: number
                                  | null;
                                  gpu_type: string | null;
                                  id: string;
                                  memory_limit_mib: number;
                                  millicpu_limit: number;
                                  name: string;
                              }
                              | null;
                          model_id: string
                          | null;
                          node_count: number;
                          session_id: string;
                          status: {
                              name:
                                  | "FAILED"
                                  | "DEPLOYING"
                                  | "DEACTIVATING"
                                  | "BUILDING"
                                  | "DEPLOY_FAILED"
                                  | "LOADING_MODEL"
                                  | "ACTIVE"
                                  | "UNHEALTHY"
                                  | "BUILD_FAILED"
                                  | "BUILD_STOPPED"
                                  | "INACTIVE"
                                  | "UPDATING"
                                  | "SCALED_TO_ZERO"
                                  | "WAKING_UP";
                          };
                          user: { email: string
                          | null };
                      }
                      | null;
                  session_id: string;
                  status: { name: "ACTIVE"
                  | "INACTIVE" };
                  user: { email: string | null };
              };
          },
      >

    • Creates a new model from a source

      Parameters

      • params: {
            request: {
                source:
                    | {
                        deployed_model_name?: string
                        | null;
                        kind: "library_listing";
                        lab_display_name: string;
                        user_defined_listing_id: string;
                    }
                    | {
                        deployment: {
                            autoscaling_schedule_settings?: | {
                                delete_schedules?: string[];
                                schedules?: (
                                    | {
                                        autoscaling_settings: ...;
                                        cadence: ...;
                                        enabled: ...;
                                        end_hour?: ...;
                                        end_minute: ...;
                                        id?: ...;
                                        name: ...;
                                        start_hour?: ...;
                                        start_minute: ...;
                                        weekdays: ...;
                                    }
                                    | {
                                        autoscaling_settings: ...;
                                        cadence: ...;
                                        enabled: ...;
                                        end_at: ...;
                                        id?: ...;
                                        name: ...;
                                        start_at: ...;
                                    }
                                )[];
                                timezone?: string
                                | null;
                            }
                            | null;
                            autoscaling_settings?: | {
                                autoscaling_window?: number
                                | null;
                                concurrency_target?: number | null;
                                max_replica?: number | null;
                                max_scale_down_rate?: number | null;
                                min_replica?: number | null;
                                scale_down_delay?: number | null;
                                target_in_flight_tokens?: number | null;
                                target_utilization_percentage?: number | null;
                            }
                            | null;
                            config: { [key: string]: unknown };
                            create_environment_if_missing?: boolean;
                            deploy_timeout_minutes?: number | null;
                            deployment_name?: string | null;
                            environment_name?: string | null;
                            instance_type_id?: string | null;
                            is_development?: boolean;
                            labels?: { [key: string]: unknown } | null;
                            preserve_env_instance_type?: boolean;
                            promotion_settings_override?:
                                | {
                                    promotion_cleanup_strategy?: | "KEEP"
                                    | "SCALE_TO_ZERO"
                                    | "DEACTIVATE"
                                    | null;
                                    ramp_up_duration_seconds?: number
                                    | null;
                                    ramp_up_while_promoting?: boolean | null;
                                    redeploy_on_promotion?: boolean | null;
                                    rolling_deploy?: boolean | null;
                                    rolling_deploy_config?:
                                        | {
                                            max_surge_percent?: number
                                            | null;
                                            max_unavailable_percent?: number | null;
                                            replica_overhead_percent?: number | null;
                                            rolling_deploy_strategy?: "REPLICA" | null;
                                            stabilization_time_seconds?: number | null;
                                        }
                                        | null;
                                }
                                | null;
                            raw_config?: string
                            | null;
                            region?: string | null;
                            request_backpressure_settings?:
                                | { policy?: "QUEUE_ON_FULL"
                                | "REJECT_ON_FULL"
                                | null }
                                | null;
                            user_env?: { [key: string]: unknown } | null;
                        };
                        disable_archive_download?: boolean;
                        kind: "model_archive";
                        name: string;
                        s3_key?: string
                        | null;
                    };
            };
        }

      Returns Promise<
          {
              deployment: {
                  active_replica_count: number;
                  autoscaling_settings: | {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  }
                  | null;
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  instance_type_name: string | null;
                  is_development: boolean;
                  is_production: boolean;
                  labels: { [key: string]: unknown } | null;
                  model_id: string;
                  name: string;
                  region: { display_name: string; slug: string } | null;
                  request_backpressure_settings: {
                      policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                  };
                  status: | "FAILED"
                  | "DEPLOYING"
                  | "DEACTIVATING"
                  | "BUILDING"
                  | "DEPLOY_FAILED"
                  | "LOADING_MODEL"
                  | "ACTIVE"
                  | "UNHEALTHY"
                  | "BUILD_FAILED"
                  | "BUILD_STOPPED"
                  | "INACTIVE"
                  | "UPDATING"
                  | "SCALED_TO_ZERO"
                  | "WAKING_UP";
              };
              model: {
                  created_at: string;
                  deployments_count: number;
                  development_deployment_id: string
                  | null;
                  id: string;
                  instance_type_name: string;
                  name: string;
                  production_deployment_id: string | null;
                  team_name: string;
              };
          },
      >

    • Adds a new deployment to a model

      Parameters

      • params: {
            model_id: string;
            request: {
                source: {
                    deployment: {
                        autoscaling_schedule_settings?:
                            | {
                                delete_schedules?: string[];
                                schedules?: (
                                    | {
                                        autoscaling_settings: {
                                            autoscaling_window: ...;
                                            concurrency_target: ...;
                                            max_replica: ...;
                                            max_scale_down_rate: ...;
                                            min_replica: ...;
                                            scale_down_delay: ...;
                                            target_in_flight_tokens: ...;
                                            target_utilization_percentage: ...;
                                        };
                                        cadence: (...)
                                        | (...);
                                        enabled: boolean;
                                        end_hour?: (...) | (...) | (...);
                                        end_minute: number;
                                        id?: (...) | (...) | (...);
                                        name: string;
                                        start_hour?: (...) | (...) | (...);
                                        start_minute: number;
                                        weekdays: (...)[];
                                    }
                                    | {
                                        autoscaling_settings: {
                                            autoscaling_window: ...;
                                            concurrency_target: ...;
                                            max_replica: ...;
                                            max_scale_down_rate: ...;
                                            min_replica: ...;
                                            scale_down_delay: ...;
                                            target_in_flight_tokens: ...;
                                            target_utilization_percentage: ...;
                                        };
                                        cadence: "ONE_TIME";
                                        enabled: boolean;
                                        end_at: string;
                                        id?: (...)
                                        | (...)
                                        | (...);
                                        name: string;
                                        start_at: string;
                                    }
                                )[];
                                timezone?: string
                                | null;
                            }
                            | null;
                        autoscaling_settings?: | {
                            autoscaling_window?: number
                            | null;
                            concurrency_target?: number | null;
                            max_replica?: number | null;
                            max_scale_down_rate?: number | null;
                            min_replica?: number | null;
                            scale_down_delay?: number | null;
                            target_in_flight_tokens?: number | null;
                            target_utilization_percentage?: number | null;
                        }
                        | null;
                        config: { [key: string]: unknown };
                        create_environment_if_missing?: boolean;
                        deploy_timeout_minutes?: number | null;
                        deployment_name?: string | null;
                        environment_name?: string | null;
                        instance_type_id?: string | null;
                        is_development?: boolean;
                        labels?: { [key: string]: unknown } | null;
                        preserve_env_instance_type?: boolean;
                        promotion_settings_override?:
                            | {
                                promotion_cleanup_strategy?: | "KEEP"
                                | "SCALE_TO_ZERO"
                                | "DEACTIVATE"
                                | null;
                                ramp_up_duration_seconds?: number
                                | null;
                                ramp_up_while_promoting?: boolean | null;
                                redeploy_on_promotion?: boolean | null;
                                rolling_deploy?: boolean | null;
                                rolling_deploy_config?:
                                    | {
                                        max_surge_percent?: number
                                        | null;
                                        max_unavailable_percent?: number | null;
                                        replica_overhead_percent?: number | null;
                                        rolling_deploy_strategy?: "REPLICA" | null;
                                        stabilization_time_seconds?: number | null;
                                    }
                                    | null;
                            }
                            | null;
                        raw_config?: string
                        | null;
                        region?: string | null;
                        request_backpressure_settings?:
                            | { policy?: "QUEUE_ON_FULL"
                            | "REJECT_ON_FULL"
                            | null }
                            | null;
                        user_env?: { [key: string]: unknown } | null;
                    };
                    kind: "model_archive";
                    s3_key?: string
                    | null;
                };
            };
        }

      Returns Promise<
          {
              deployment: {
                  active_replica_count: number;
                  autoscaling_settings: | {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  }
                  | null;
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  instance_type_name: string | null;
                  is_development: boolean;
                  is_production: boolean;
                  labels: { [key: string]: unknown } | null;
                  model_id: string;
                  name: string;
                  region: { display_name: string; slug: string } | null;
                  request_backpressure_settings: {
                      policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                  };
                  status: | "FAILED"
                  | "DEPLOYING"
                  | "DEACTIVATING"
                  | "BUILDING"
                  | "DEPLOY_FAILED"
                  | "LOADING_MODEL"
                  | "ACTIVE"
                  | "UNHEALTHY"
                  | "BUILD_FAILED"
                  | "BUILD_STOPPED"
                  | "INACTIVE"
                  | "UPDATING"
                  | "SCALED_TO_ZERO"
                  | "WAKING_UP";
              };
              model: {
                  created_at: string;
                  deployments_count: number;
                  development_deployment_id: string
                  | null;
                  id: string;
                  instance_type_name: string;
                  name: string;
                  production_deployment_id: string | null;
                  team_name: string;
              };
          },
      >

    • Activates a deployment

      Parameters

      • params: { deployment_id: string; model_id: string }

      Returns Promise<{ no_op: boolean; success: boolean }>

    • Deactivates a deployment

      Parameters

      • params: { deployment_id: string; model_id: string }

      Returns Promise<{ no_op: boolean; success: boolean }>

    • Activates a development deployment

      Parameters

      • params: { model_id: string }

      Returns Promise<{ no_op: boolean; success: boolean }>

    • Deactivates a development deployment

      Parameters

      • params: { model_id: string }

      Returns Promise<{ no_op: boolean; success: boolean }>

    • Promotes a development deployment to production

      Parameters

      • params: {
            model_id: string;
            request: {
                environment_settings_update?:
                    | {
                        autoscaling_schedule_settings?: | {
                            delete_schedules?: string[];
                            schedules?: (
                                | {
                                    autoscaling_settings: {
                                        autoscaling_window: ...;
                                        concurrency_target: ...;
                                        max_replica: ...;
                                        max_scale_down_rate: ...;
                                        min_replica: ...;
                                        scale_down_delay: ...;
                                        target_in_flight_tokens: ...;
                                        target_utilization_percentage: ...;
                                    };
                                    cadence: (...)
                                    | (...);
                                    enabled: boolean;
                                    end_hour?: (...) | (...) | (...);
                                    end_minute: number;
                                    id?: (...) | (...) | (...);
                                    name: string;
                                    start_hour?: (...) | (...) | (...);
                                    start_minute: number;
                                    weekdays: (...)[];
                                }
                                | {
                                    autoscaling_settings: {
                                        autoscaling_window: ...;
                                        concurrency_target: ...;
                                        max_replica: ...;
                                        max_scale_down_rate: ...;
                                        min_replica: ...;
                                        scale_down_delay: ...;
                                        target_in_flight_tokens: ...;
                                        target_utilization_percentage: ...;
                                    };
                                    cadence: "ONE_TIME";
                                    enabled: boolean;
                                    end_at: string;
                                    id?: (...)
                                    | (...)
                                    | (...);
                                    name: string;
                                    start_at: string;
                                }
                            )[];
                            timezone?: string
                            | null;
                        }
                        | null;
                        autoscaling_settings?: | {
                            autoscaling_window?: number
                            | null;
                            concurrency_target?: number | null;
                            max_replica?: number | null;
                            max_scale_down_rate?: number | null;
                            min_replica?: number | null;
                            scale_down_delay?: number | null;
                            target_in_flight_tokens?: number | null;
                            target_utilization_percentage?: number | null;
                        }
                        | null;
                        instance_type_id?: string
                        | null;
                        promotion_settings?:
                            | {
                                promotion_cleanup_strategy?: | "KEEP"
                                | "SCALE_TO_ZERO"
                                | "DEACTIVATE"
                                | null;
                                ramp_up_duration_seconds?: number
                                | null;
                                ramp_up_while_promoting?: boolean | null;
                                redeploy_on_promotion?: boolean | null;
                                rolling_deploy?: boolean | null;
                                rolling_deploy_config?:
                                    | {
                                        max_surge_percent?: number
                                        | null;
                                        max_unavailable_percent?: number | null;
                                        replica_overhead_percent?: number | null;
                                        rolling_deploy_strategy?: "REPLICA" | null;
                                        stabilization_time_seconds?: number | null;
                                    }
                                    | null;
                            }
                            | null;
                        region?: string
                        | null;
                        request_backpressure_settings?:
                            | { policy?: "QUEUE_ON_FULL"
                            | "REJECT_ON_FULL"
                            | null }
                            | null;
                    }
                    | null;
                preserve_env_instance_type?: boolean;
                promotion_settings_override?: | {
                    promotion_cleanup_strategy?: | "KEEP"
                    | "SCALE_TO_ZERO"
                    | "DEACTIVATE"
                    | null;
                    ramp_up_duration_seconds?: number
                    | null;
                    ramp_up_while_promoting?: boolean | null;
                    redeploy_on_promotion?: boolean | null;
                    rolling_deploy?: boolean | null;
                    rolling_deploy_config?:
                        | {
                            max_surge_percent?: number
                            | null;
                            max_unavailable_percent?: number | null;
                            replica_overhead_percent?: number | null;
                            rolling_deploy_strategy?: "REPLICA" | null;
                            stabilization_time_seconds?: number | null;
                        }
                        | null;
                }
                | null;
                scale_down_previous_production?: boolean;
            };
        }

      Returns Promise<
          {
              active_replica_count: number;
              autoscaling_settings: | {
                  autoscaling_window: number
                  | null;
                  concurrency_target: number;
                  max_replica: number;
                  max_scale_down_rate: number | null;
                  min_replica: number;
                  scale_down_delay: number | null;
                  target_in_flight_tokens: number | null;
                  target_utilization_percentage: number | null;
              }
              | null;
              created_at: string;
              environment: string
              | null;
              id: string;
              instance_type_name: string | null;
              is_development: boolean;
              is_production: boolean;
              labels: { [key: string]: unknown } | null;
              model_id: string;
              name: string;
              region: { display_name: string; slug: string } | null;
              request_backpressure_settings: {
                  policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
              };
              status: | "FAILED"
              | "DEPLOYING"
              | "DEACTIVATING"
              | "BUILDING"
              | "DEPLOY_FAILED"
              | "LOADING_MODEL"
              | "ACTIVE"
              | "UNHEALTHY"
              | "BUILD_FAILED"
              | "BUILD_STOPPED"
              | "INACTIVE"
              | "UPDATING"
              | "SCALED_TO_ZERO"
              | "WAKING_UP";
          },
      >

    • Retries a failed development deployment

      Parameters

      • params: { model_id: string }

      Returns Promise<
          {
              deployment: {
                  active_replica_count: number;
                  autoscaling_settings: | {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  }
                  | null;
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  instance_type_name: string | null;
                  is_development: boolean;
                  is_production: boolean;
                  labels: { [key: string]: unknown } | null;
                  model_id: string;
                  name: string;
                  region: { display_name: string; slug: string } | null;
                  request_backpressure_settings: {
                      policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                  };
                  status: | "FAILED"
                  | "DEPLOYING"
                  | "DEACTIVATING"
                  | "BUILDING"
                  | "DEPLOY_FAILED"
                  | "LOADING_MODEL"
                  | "ACTIVE"
                  | "UNHEALTHY"
                  | "BUILD_FAILED"
                  | "BUILD_STOPPED"
                  | "INACTIVE"
                  | "UPDATING"
                  | "SCALED_TO_ZERO"
                  | "WAKING_UP";
              };
              reason: string
              | null;
              retried: boolean;
          },
      >

    • Gets the logs for a model deployment (deprecated; use GET)

      Parameters

      • params: {
            deployment_id: string;
            model_id: string;
            request: {
                component?: string | null;
                direction?: "asc" | "desc" | null;
                end_epoch_millis?: number | null;
                excludes?: string[];
                includes?: string[];
                limit?: number | null;
                min_level?: "DEBUG" | "INFO" | "WARNING" | "ERROR" | null;
                replica?: string | null;
                request_id?: string | null;
                search_pattern?: string | null;
                start_epoch_millis?: number | null;
            };
        }

      Returns Promise<
          {
              logs: {
                  level: "DEBUG"
                  | "INFO"
                  | "WARNING"
                  | "ERROR"
                  | null;
                  message: string;
                  replica: string | null;
                  request_id: string | null;
                  timestamp: string;
              }[];
          },
      >

    • Stages a patch against a development deployment

      Parameters

      • params: {
            deployment_id: string;
            model_id: string;
            request: {
                next_patch_point: {
                    config: string;
                    content_hashes: { [key: string]: string | null };
                    requirements?: string[];
                };
                patch_ops: (
                    | {
                        action: "ADD"
                        | "UPDATE"
                        | "REMOVE";
                        content?: string | null;
                        content_bytes?: string | null;
                        hot_reload?: boolean;
                        path: string;
                        type: "model_code";
                    }
                    | {
                        action: "ADD"
                        | "UPDATE"
                        | "REMOVE";
                        content?: string | null;
                        content_bytes?: string | null;
                        path: string;
                        type: "package";
                    }
                    | { config: { [key: string]: unknown }; path?: string; type: "config" }
                    | {
                        action: "ADD" | "UPDATE" | "REMOVE";
                        requirement: string;
                        type: "python_requirement";
                    }
                    | {
                        action: "ADD"
                        | "UPDATE"
                        | "REMOVE";
                        name: string;
                        type: "environment_variable";
                        value?: string | null;
                    }
                    | {
                        action: "ADD"
                        | "UPDATE"
                        | "REMOVE";
                        item: { [key: string]: string };
                        type: "external_data";
                    }
                )[];
                prev_patch_hash: string;
            };
        }

      Returns Promise<
          {
              patch_point: {
                  config: string;
                  content_hashes: { [key: string]: string
                  | null };
                  hash: string;
                  requirements?: string[];
              };
          },
      >

    • Activates a production deployment

      Parameters

      • params: { model_id: string }

      Returns Promise<{ no_op: boolean; success: boolean }>

    • Deactivates a production deployment

      Parameters

      • params: { model_id: string }

      Returns Promise<{ no_op: boolean; success: boolean }>

    • Retries a failed production deployment

      Parameters

      • params: { model_id: string }

      Returns Promise<
          {
              deployment: {
                  active_replica_count: number;
                  autoscaling_settings: | {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  }
                  | null;
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  instance_type_name: string | null;
                  is_development: boolean;
                  is_production: boolean;
                  labels: { [key: string]: unknown } | null;
                  model_id: string;
                  name: string;
                  region: { display_name: string; slug: string } | null;
                  request_backpressure_settings: {
                      policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                  };
                  status: | "FAILED"
                  | "DEPLOYING"
                  | "DEACTIVATING"
                  | "BUILDING"
                  | "DEPLOY_FAILED"
                  | "LOADING_MODEL"
                  | "ACTIVE"
                  | "UNHEALTHY"
                  | "BUILD_FAILED"
                  | "BUILD_STOPPED"
                  | "INACTIVE"
                  | "UPDATING"
                  | "SCALED_TO_ZERO"
                  | "WAKING_UP";
              };
              reason: string
              | null;
              retried: boolean;
          },
      >

    • Promotes a deployment to production

      Parameters

      • params: {
            deployment_id: string;
            model_id: string;
            request: {
                environment_settings_update?:
                    | {
                        autoscaling_schedule_settings?: | {
                            delete_schedules?: string[];
                            schedules?: (
                                | {
                                    autoscaling_settings: {
                                        autoscaling_window: ...;
                                        concurrency_target: ...;
                                        max_replica: ...;
                                        max_scale_down_rate: ...;
                                        min_replica: ...;
                                        scale_down_delay: ...;
                                        target_in_flight_tokens: ...;
                                        target_utilization_percentage: ...;
                                    };
                                    cadence: (...)
                                    | (...);
                                    enabled: boolean;
                                    end_hour?: (...) | (...) | (...);
                                    end_minute: number;
                                    id?: (...) | (...) | (...);
                                    name: string;
                                    start_hour?: (...) | (...) | (...);
                                    start_minute: number;
                                    weekdays: (...)[];
                                }
                                | {
                                    autoscaling_settings: {
                                        autoscaling_window: ...;
                                        concurrency_target: ...;
                                        max_replica: ...;
                                        max_scale_down_rate: ...;
                                        min_replica: ...;
                                        scale_down_delay: ...;
                                        target_in_flight_tokens: ...;
                                        target_utilization_percentage: ...;
                                    };
                                    cadence: "ONE_TIME";
                                    enabled: boolean;
                                    end_at: string;
                                    id?: (...)
                                    | (...)
                                    | (...);
                                    name: string;
                                    start_at: string;
                                }
                            )[];
                            timezone?: string
                            | null;
                        }
                        | null;
                        autoscaling_settings?: | {
                            autoscaling_window?: number
                            | null;
                            concurrency_target?: number | null;
                            max_replica?: number | null;
                            max_scale_down_rate?: number | null;
                            min_replica?: number | null;
                            scale_down_delay?: number | null;
                            target_in_flight_tokens?: number | null;
                            target_utilization_percentage?: number | null;
                        }
                        | null;
                        instance_type_id?: string
                        | null;
                        promotion_settings?:
                            | {
                                promotion_cleanup_strategy?: | "KEEP"
                                | "SCALE_TO_ZERO"
                                | "DEACTIVATE"
                                | null;
                                ramp_up_duration_seconds?: number
                                | null;
                                ramp_up_while_promoting?: boolean | null;
                                redeploy_on_promotion?: boolean | null;
                                rolling_deploy?: boolean | null;
                                rolling_deploy_config?:
                                    | {
                                        max_surge_percent?: number
                                        | null;
                                        max_unavailable_percent?: number | null;
                                        replica_overhead_percent?: number | null;
                                        rolling_deploy_strategy?: "REPLICA" | null;
                                        stabilization_time_seconds?: number | null;
                                    }
                                    | null;
                            }
                            | null;
                        region?: string
                        | null;
                        request_backpressure_settings?:
                            | { policy?: "QUEUE_ON_FULL"
                            | "REJECT_ON_FULL"
                            | null }
                            | null;
                    }
                    | null;
                preserve_env_instance_type?: boolean;
                promotion_settings_override?: | {
                    promotion_cleanup_strategy?: | "KEEP"
                    | "SCALE_TO_ZERO"
                    | "DEACTIVATE"
                    | null;
                    ramp_up_duration_seconds?: number
                    | null;
                    ramp_up_while_promoting?: boolean | null;
                    redeploy_on_promotion?: boolean | null;
                    rolling_deploy?: boolean | null;
                    rolling_deploy_config?:
                        | {
                            max_surge_percent?: number
                            | null;
                            max_unavailable_percent?: number | null;
                            replica_overhead_percent?: number | null;
                            rolling_deploy_strategy?: "REPLICA" | null;
                            stabilization_time_seconds?: number | null;
                        }
                        | null;
                }
                | null;
                scale_down_previous_production?: boolean;
            };
        }

      Returns Promise<
          {
              active_replica_count: number;
              autoscaling_settings: | {
                  autoscaling_window: number
                  | null;
                  concurrency_target: number;
                  max_replica: number;
                  max_scale_down_rate: number | null;
                  min_replica: number;
                  scale_down_delay: number | null;
                  target_in_flight_tokens: number | null;
                  target_utilization_percentage: number | null;
              }
              | null;
              created_at: string;
              environment: string
              | null;
              id: string;
              instance_type_name: string | null;
              is_development: boolean;
              is_production: boolean;
              labels: { [key: string]: unknown } | null;
              model_id: string;
              name: string;
              region: { display_name: string; slug: string } | null;
              request_backpressure_settings: {
                  policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
              };
              status: | "FAILED"
              | "DEPLOYING"
              | "DEACTIVATING"
              | "BUILDING"
              | "DEPLOY_FAILED"
              | "LOADING_MODEL"
              | "ACTIVE"
              | "UNHEALTHY"
              | "BUILD_FAILED"
              | "BUILD_STOPPED"
              | "INACTIVE"
              | "UPDATING"
              | "SCALED_TO_ZERO"
              | "WAKING_UP";
          },
      >

    • Retries a failed deployment

      Parameters

      • params: { deployment_id: string; model_id: string }

      Returns Promise<
          {
              deployment: {
                  active_replica_count: number;
                  autoscaling_settings: | {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  }
                  | null;
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  instance_type_name: string | null;
                  is_development: boolean;
                  is_production: boolean;
                  labels: { [key: string]: unknown } | null;
                  model_id: string;
                  name: string;
                  region: { display_name: string; slug: string } | null;
                  request_backpressure_settings: {
                      policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                  };
                  status: | "FAILED"
                  | "DEPLOYING"
                  | "DEACTIVATING"
                  | "BUILDING"
                  | "DEPLOY_FAILED"
                  | "LOADING_MODEL"
                  | "ACTIVE"
                  | "UNHEALTHY"
                  | "BUILD_FAILED"
                  | "BUILD_STOPPED"
                  | "INACTIVE"
                  | "UPDATING"
                  | "SCALED_TO_ZERO"
                  | "WAKING_UP";
              };
              reason: string
              | null;
              retried: boolean;
          },
      >

    • Signs an SSH certificate for an inference model

      Parameters

      • params: {
            deployment_id: string;
            model_id: string;
            request: { public_key: string; replica_id?: string | null };
        }

      Returns Promise<
          {
              jwt: string;
              proxy_address: string;
              ssh_cert_expires_at: string;
              ssh_certificate: string;
          },
      >

    • Creates an environment

      Parameters

      • params: {
            model_id: string;
            request: {
                autoscaling_settings?:
                    | {
                        autoscaling_window?: number
                        | null;
                        concurrency_target?: number | null;
                        max_replica?: number | null;
                        max_scale_down_rate?: number | null;
                        min_replica?: number | null;
                        scale_down_delay?: number | null;
                        target_in_flight_tokens?: number | null;
                        target_utilization_percentage?: number | null;
                    }
                    | null;
                name: string;
                promotion_settings?: | {
                    promotion_cleanup_strategy?: | "KEEP"
                    | "SCALE_TO_ZERO"
                    | "DEACTIVATE"
                    | null;
                    ramp_up_duration_seconds?: number
                    | null;
                    ramp_up_while_promoting?: boolean | null;
                    redeploy_on_promotion?: boolean | null;
                    rolling_deploy?: boolean | null;
                    rolling_deploy_config?:
                        | {
                            max_surge_percent?: number
                            | null;
                            max_unavailable_percent?: number | null;
                            replica_overhead_percent?: number | null;
                            rolling_deploy_strategy?: "REPLICA" | null;
                            stabilization_time_seconds?: number | null;
                        }
                        | null;
                }
                | null;
                request_backpressure_settings?: | {
                    policy?: "QUEUE_ON_FULL"
                    | "REJECT_ON_FULL"
                    | null;
                }
                | null;
            };
        }

      Returns Promise<
          {
              autoscaling_schedules: | {
                  applied_state: | {
                      autoscaling_settings: {
                          autoscaling_window: number
                          | null;
                          concurrency_target: number;
                          max_replica: number;
                          max_scale_down_rate: number | null;
                          min_replica: number;
                          scale_down_delay: number | null;
                          target_in_flight_tokens: number | null;
                          target_utilization_percentage: number | null;
                      };
                      schedule_id: string
                      | null;
                  }
                  | null;
                  schedules: (
                      | {
                          autoscaling_settings: {
                              autoscaling_window: number
                              | null;
                              concurrency_target: number | null;
                              max_replica: number;
                              max_scale_down_rate: number | null;
                              min_replica: number;
                              scale_down_delay: number | null;
                              target_in_flight_tokens: number | null;
                              target_utilization_percentage: number | null;
                          };
                          cadence: "DAILY"
                          | "HOURLY";
                          enabled: boolean;
                          end_hour: number | null;
                          end_minute: number;
                          id: string;
                          name: string;
                          start_hour: number | null;
                          start_minute: number;
                          weekdays: (
                              | "SUNDAY"
                              | "MONDAY"
                              | "TUESDAY"
                              | "WEDNESDAY"
                              | "THURSDAY"
                              | "FRIDAY"
                              | "SATURDAY"
                          )[];
                      }
                      | {
                          autoscaling_settings: {
                              autoscaling_window: number
                              | null;
                              concurrency_target: number | null;
                              max_replica: number;
                              max_scale_down_rate: number | null;
                              min_replica: number;
                              scale_down_delay: number | null;
                              target_in_flight_tokens: number | null;
                              target_utilization_percentage: number | null;
                          };
                          cadence: "ONE_TIME";
                          enabled: boolean;
                          end_at: string;
                          id: string;
                          name: string;
                          start_at: string;
                      }
                  )[];
                  timezone: string
                  | null;
              }
              | null;
              autoscaling_settings: {
                  autoscaling_window: number
                  | null;
                  concurrency_target: number;
                  max_replica: number;
                  max_scale_down_rate: number | null;
                  min_replica: number;
                  scale_down_delay: number | null;
                  target_in_flight_tokens: number | null;
                  target_utilization_percentage: number | null;
              };
              candidate_deployment: | {
                  active_replica_count: number;
                  autoscaling_settings: | {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  }
                  | null;
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  instance_type_name: string | null;
                  is_development: boolean;
                  is_production: boolean;
                  labels: { [key: string]: unknown } | null;
                  model_id: string;
                  name: string;
                  region: { display_name: string; slug: string } | null;
                  request_backpressure_settings: {
                      policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                  };
                  status: | "FAILED"
                  | "DEPLOYING"
                  | "DEACTIVATING"
                  | "BUILDING"
                  | "DEPLOY_FAILED"
                  | "LOADING_MODEL"
                  | "ACTIVE"
                  | "UNHEALTHY"
                  | "BUILD_FAILED"
                  | "BUILD_STOPPED"
                  | "INACTIVE"
                  | "UPDATING"
                  | "SCALED_TO_ZERO"
                  | "WAKING_UP";
              }
              | null;
              created_at: string;
              current_deployment: | {
                  active_replica_count: number;
                  autoscaling_settings: | {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  }
                  | null;
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  instance_type_name: string | null;
                  is_development: boolean;
                  is_production: boolean;
                  labels: { [key: string]: unknown } | null;
                  model_id: string;
                  name: string;
                  region: { display_name: string; slug: string } | null;
                  request_backpressure_settings: {
                      policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                  };
                  status: | "FAILED"
                  | "DEPLOYING"
                  | "DEACTIVATING"
                  | "BUILDING"
                  | "DEPLOY_FAILED"
                  | "LOADING_MODEL"
                  | "ACTIVE"
                  | "UNHEALTHY"
                  | "BUILD_FAILED"
                  | "BUILD_STOPPED"
                  | "INACTIVE"
                  | "UPDATING"
                  | "SCALED_TO_ZERO"
                  | "WAKING_UP";
              }
              | null;
              in_progress_promotion: | {
                  error_message: string
                  | null;
                  percent_traffic_to_new_version: number;
                  rolling_deploy: boolean | null;
                  status:
                      | "FAILED"
                      | "RELEASING"
                      | "RAMPING_UP"
                      | "RAMPING_DOWN"
                      | "PAUSED"
                      | "SUCCEEDED"
                      | "CANCELED";
              }
              | null;
              instance_type: {
                  gpu_count: number;
                  gpu_memory_limit_mib: number
                  | null;
                  gpu_type: string | null;
                  id: string;
                  memory_limit_mib: number;
                  millicpu_limit: number;
                  name: string;
              };
              model_id: string;
              name: string;
              promotion_settings: {
                  promotion_cleanup_strategy: | "KEEP"
                  | "SCALE_TO_ZERO"
                  | "DEACTIVATE"
                  | null;
                  ramp_up_duration_seconds: number
                  | null;
                  ramp_up_while_promoting: boolean | null;
                  redeploy_on_promotion: boolean | null;
                  rolling_deploy: boolean | null;
                  rolling_deploy_config:
                      | {
                          max_surge_percent: number;
                          max_unavailable_percent: number;
                          replica_overhead_percent: number;
                          rolling_deploy_strategy: "REPLICA";
                          stabilization_time_seconds: number;
                      }
                      | null;
              };
              request_backpressure_settings: {
                  policy: "QUEUE_ON_FULL"
                  | "REJECT_ON_FULL"
                  | null;
              };
              traffic_routing: | {
                  rules: {
                      expires_at: string;
                      id: string;
                      percent_traffic: number;
                      propagate_client_cancellation: boolean;
                      sampling_mode: "RANDOM"
                      | "USER_SESSION";
                      targets: {
                          deployment_id: string | null;
                          environment: string | null;
                          model_id: string;
                      }[];
                      type: "SHADOW";
                  }[];
              }
              | null;
          },
      >

    • Activates a deployment associated with an environment

      Parameters

      • params: { env_name: string; model_id: string }

      Returns Promise<{ no_op: boolean; success: boolean }>

    • Cancels a promotion to an environment

      Parameters

      • params: { env_name: string; model_id: string }

      Returns Promise<{ message: string; status: "RAMPING_DOWN" | "CANCELED" }>

    • Deactivates a deployment associated with an environment

      Parameters

      • params: { env_name: string; model_id: string }

      Returns Promise<{ no_op: boolean; success: boolean }>

    • Force cancels a rolling promotion

      Parameters

      • params: { env_name: string; model_id: string }

      Returns Promise<{ success: boolean }>

    • Force rolls forward a rolling promotion

      Parameters

      • params: { env_name: string; model_id: string }

      Returns Promise<{ success: boolean }>

    • Pauses a rolling promotion

      Parameters

      • params: { env_name: string; model_id: string }

      Returns Promise<{ success: boolean }>

    • Promotes a deployment to an environment

      Parameters

      • params: {
            env_name: string;
            model_id: string;
            request: {
                deployment_id: string;
                environment_settings_update?:
                    | {
                        autoscaling_schedule_settings?: | {
                            delete_schedules?: string[];
                            schedules?: (
                                | {
                                    autoscaling_settings: {
                                        autoscaling_window: ...;
                                        concurrency_target: ...;
                                        max_replica: ...;
                                        max_scale_down_rate: ...;
                                        min_replica: ...;
                                        scale_down_delay: ...;
                                        target_in_flight_tokens: ...;
                                        target_utilization_percentage: ...;
                                    };
                                    cadence: (...)
                                    | (...);
                                    enabled: boolean;
                                    end_hour?: (...) | (...) | (...);
                                    end_minute: number;
                                    id?: (...) | (...) | (...);
                                    name: string;
                                    start_hour?: (...) | (...) | (...);
                                    start_minute: number;
                                    weekdays: (...)[];
                                }
                                | {
                                    autoscaling_settings: {
                                        autoscaling_window: ...;
                                        concurrency_target: ...;
                                        max_replica: ...;
                                        max_scale_down_rate: ...;
                                        min_replica: ...;
                                        scale_down_delay: ...;
                                        target_in_flight_tokens: ...;
                                        target_utilization_percentage: ...;
                                    };
                                    cadence: "ONE_TIME";
                                    enabled: boolean;
                                    end_at: string;
                                    id?: (...)
                                    | (...)
                                    | (...);
                                    name: string;
                                    start_at: string;
                                }
                            )[];
                            timezone?: string
                            | null;
                        }
                        | null;
                        autoscaling_settings?: | {
                            autoscaling_window?: number
                            | null;
                            concurrency_target?: number | null;
                            max_replica?: number | null;
                            max_scale_down_rate?: number | null;
                            min_replica?: number | null;
                            scale_down_delay?: number | null;
                            target_in_flight_tokens?: number | null;
                            target_utilization_percentage?: number | null;
                        }
                        | null;
                        instance_type_id?: string
                        | null;
                        promotion_settings?:
                            | {
                                promotion_cleanup_strategy?: | "KEEP"
                                | "SCALE_TO_ZERO"
                                | "DEACTIVATE"
                                | null;
                                ramp_up_duration_seconds?: number
                                | null;
                                ramp_up_while_promoting?: boolean | null;
                                redeploy_on_promotion?: boolean | null;
                                rolling_deploy?: boolean | null;
                                rolling_deploy_config?:
                                    | {
                                        max_surge_percent?: number
                                        | null;
                                        max_unavailable_percent?: number | null;
                                        replica_overhead_percent?: number | null;
                                        rolling_deploy_strategy?: "REPLICA" | null;
                                        stabilization_time_seconds?: number | null;
                                    }
                                    | null;
                            }
                            | null;
                        region?: string
                        | null;
                        request_backpressure_settings?:
                            | { policy?: "QUEUE_ON_FULL"
                            | "REJECT_ON_FULL"
                            | null }
                            | null;
                    }
                    | null;
                preserve_env_instance_type?: boolean;
                promotion_settings_override?: | {
                    promotion_cleanup_strategy?: | "KEEP"
                    | "SCALE_TO_ZERO"
                    | "DEACTIVATE"
                    | null;
                    ramp_up_duration_seconds?: number
                    | null;
                    ramp_up_while_promoting?: boolean | null;
                    redeploy_on_promotion?: boolean | null;
                    rolling_deploy?: boolean | null;
                    rolling_deploy_config?:
                        | {
                            max_surge_percent?: number
                            | null;
                            max_unavailable_percent?: number | null;
                            replica_overhead_percent?: number | null;
                            rolling_deploy_strategy?: "REPLICA" | null;
                            stabilization_time_seconds?: number | null;
                        }
                        | null;
                }
                | null;
                scale_down_previous_deployment?: boolean;
            };
        }

      Returns Promise<
          {
              active_replica_count: number;
              autoscaling_settings: | {
                  autoscaling_window: number
                  | null;
                  concurrency_target: number;
                  max_replica: number;
                  max_scale_down_rate: number | null;
                  min_replica: number;
                  scale_down_delay: number | null;
                  target_in_flight_tokens: number | null;
                  target_utilization_percentage: number | null;
              }
              | null;
              created_at: string;
              environment: string
              | null;
              id: string;
              instance_type_name: string | null;
              is_development: boolean;
              is_production: boolean;
              labels: { [key: string]: unknown } | null;
              model_id: string;
              name: string;
              region: { display_name: string; slug: string } | null;
              request_backpressure_settings: {
                  policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
              };
              status: | "FAILED"
              | "DEPLOYING"
              | "DEACTIVATING"
              | "BUILDING"
              | "DEPLOY_FAILED"
              | "LOADING_MODEL"
              | "ACTIVE"
              | "UNHEALTHY"
              | "BUILD_FAILED"
              | "BUILD_STOPPED"
              | "INACTIVE"
              | "UPDATING"
              | "SCALED_TO_ZERO"
              | "WAKING_UP";
          },
      >

    • Resumes a paused rolling promotion

      Parameters

      • params: { env_name: string; model_id: string }

      Returns Promise<{ success: boolean }>

    • Validates a model push payload and issues upload credentials

      Parameters

      • params: {
            request: {
                deployment: {
                    autoscaling_schedule_settings?:
                        | {
                            delete_schedules?: string[];
                            schedules?: (
                                | {
                                    autoscaling_settings: {
                                        autoscaling_window: (...)
                                        | (...);
                                        concurrency_target: (...) | (...);
                                        max_replica: number;
                                        max_scale_down_rate: (...) | (...);
                                        min_replica: number;
                                        scale_down_delay: (...) | (...);
                                        target_in_flight_tokens: (...) | (...);
                                        target_utilization_percentage: (...) | (...);
                                    };
                                    cadence: "DAILY"
                                    | "HOURLY";
                                    enabled: boolean;
                                    end_hour?: number | null;
                                    end_minute: number;
                                    id?: string | null;
                                    name: string;
                                    start_hour?: number | null;
                                    start_minute: number;
                                    weekdays: ((...) | (...) | (...) | (...) | (...) | (...) | (...))[];
                                }
                                | {
                                    autoscaling_settings: {
                                        autoscaling_window: (...)
                                        | (...);
                                        concurrency_target: (...) | (...);
                                        max_replica: number;
                                        max_scale_down_rate: (...) | (...);
                                        min_replica: number;
                                        scale_down_delay: (...) | (...);
                                        target_in_flight_tokens: (...) | (...);
                                        target_utilization_percentage: (...) | (...);
                                    };
                                    cadence: "ONE_TIME";
                                    enabled: boolean;
                                    end_at: string;
                                    id?: string
                                    | null;
                                    name: string;
                                    start_at: string;
                                }
                            )[];
                            timezone?: string
                            | null;
                        }
                        | null;
                    autoscaling_settings?: | {
                        autoscaling_window?: number
                        | null;
                        concurrency_target?: number | null;
                        max_replica?: number | null;
                        max_scale_down_rate?: number | null;
                        min_replica?: number | null;
                        scale_down_delay?: number | null;
                        target_in_flight_tokens?: number | null;
                        target_utilization_percentage?: number | null;
                    }
                    | null;
                    config: { [key: string]: unknown };
                    create_environment_if_missing?: boolean;
                    deploy_timeout_minutes?: number | null;
                    deployment_name?: string | null;
                    environment_name?: string | null;
                    instance_type_id?: string | null;
                    is_development?: boolean;
                    labels?: { [key: string]: unknown } | null;
                    preserve_env_instance_type?: boolean;
                    promotion_settings_override?:
                        | {
                            promotion_cleanup_strategy?: | "KEEP"
                            | "SCALE_TO_ZERO"
                            | "DEACTIVATE"
                            | null;
                            ramp_up_duration_seconds?: number
                            | null;
                            ramp_up_while_promoting?: boolean | null;
                            redeploy_on_promotion?: boolean | null;
                            rolling_deploy?: boolean | null;
                            rolling_deploy_config?:
                                | {
                                    max_surge_percent?: number
                                    | null;
                                    max_unavailable_percent?: number | null;
                                    replica_overhead_percent?: number | null;
                                    rolling_deploy_strategy?: "REPLICA" | null;
                                    stabilization_time_seconds?: number | null;
                                }
                                | null;
                        }
                        | null;
                    raw_config?: string
                    | null;
                    region?: string | null;
                    request_backpressure_settings?:
                        | { policy?: "QUEUE_ON_FULL"
                        | "REJECT_ON_FULL"
                        | null }
                        | null;
                    user_env?: { [key: string]: unknown } | null;
                };
                dry_run?: boolean;
                model_id?: string
                | null;
                name?: string | null;
                team_id?: string | null;
            };
        }

      Returns Promise<
          {
              creds: | {
                  aws_access_key_id: string;
                  aws_secret_access_key: string;
                  aws_session_token: string;
              }
              | null;
              s3_bucket: string
              | null;
              s3_key: string | null;
              s3_region: string | null;
          },
      >

    • Upserts a secret

      Parameters

      • params: { request: { name: string; value: string } }

      Returns Promise<{ created_at: string; id: string; name: string; team_name: string }>

    • Creates a team API key

      Parameters

      • params: {
            request: {
                expires_at?: string | null;
                model_ids?: string[] | null;
                name?: string | null;
                team_id?: string | null;
                type:
                    | "PERSONAL"
                    | "GRID"
                    | "WORKSPACE_MANAGE_ALL"
                    | "WORKSPACE_EXPORT_METRICS"
                    | "WORKSPACE_INVOKE"
                    | "WORKSPACE_MANAGE_API_KEYS";
            };
            team_id: string;
        }

      Returns Promise<{ api_key: string }>

    • Creates a new BIS-LLM deployment

      Parameters

      • params: {
            request: {
                additional_autoscaling_config?: { [key: string]: unknown } | null;
                autoscaling_settings?:
                    | {
                        autoscaling_window?: number
                        | null;
                        concurrency_target?: number | null;
                        max_replica?: number | null;
                        max_scale_down_rate?: number | null;
                        min_replica?: number | null;
                        scale_down_delay?: number | null;
                        target_in_flight_tokens?: number | null;
                        target_utilization_percentage?: number | null;
                    }
                    | null;
                bdn?: { [key: string]: unknown }
                | null;
                deployment_name?: string | null;
                egress_restrictions?:
                    | {
                        fqdn_allow_list?: string[]
                        | null;
                        ip_allow_list?: string[] | null;
                    }
                    | null;
                environment_variables?: { [key: string]: unknown };
                llm_config?: { [key: string]: unknown };
                llm_version?: string | null;
                metadata?: { [key: string]: unknown } | null;
                model_metadata?: { [key: string]: unknown } | null;
                name: string;
                region?: string | null;
                resources: { [key: string]: unknown };
                runtime?:
                    | {
                        oidc?: | {
                            byok?: { [key: string]: unknown }
                            | null;
                            enabled?: boolean | null;
                        }
                        | null;
                    }
                    | null;
                weights?: { [key: string]: unknown }[]
                | null;
            };
            team_id: string;
        }

      Returns Promise<
          {
              hostname: string;
              instance_type_name: string
              | null;
              model_id: string;
              version_id: string;
          },
      >

    • Creates a Loops run in a team

      Parameters

      • params: {
            request: {
                availability_model?: "standard" | "spot";
                base_checkpoint?: string | null;
                base_model: string;
                lora_rank?: number;
                max_seq_len?: number | null;
                name?: string | null;
                path?: string | null;
                replicas?: number;
                reuse_from_run_id?: string | null;
                reuse_from_session_id?: string | null;
                sampler_num_replicas?: number | null;
                scale_down_delay_seconds?: number;
                seed?: number | null;
                session_id: string;
            };
            team_id: string;
        }

      Returns Promise<
          {
              run: {
                  base_checkpoint: string
                  | null;
                  base_model: string;
                  base_url: string;
                  created_at: string;
                  deployment_id: string | null;
                  id: string;
                  lora_config_version: string | null;
                  name: string;
                  sampler:
                      | {
                          base_checkpoint: string
                          | null;
                          base_model: string;
                          base_url: string;
                          created_at: string;
                          deployment_id: string | null;
                          id: string;
                          instance_type:
                              | {
                                  gpu_count: number;
                                  gpu_memory_limit_mib: number
                                  | null;
                                  gpu_type: string | null;
                                  id: string;
                                  memory_limit_mib: number;
                                  millicpu_limit: number;
                                  name: string;
                              }
                              | null;
                          model_id: string
                          | null;
                          node_count: number;
                          session_id: string;
                          status: {
                              name:
                                  | "FAILED"
                                  | "DEPLOYING"
                                  | "DEACTIVATING"
                                  | "BUILDING"
                                  | "DEPLOY_FAILED"
                                  | "LOADING_MODEL"
                                  | "ACTIVE"
                                  | "UNHEALTHY"
                                  | "BUILD_FAILED"
                                  | "BUILD_STOPPED"
                                  | "INACTIVE"
                                  | "UPDATING"
                                  | "SCALED_TO_ZERO"
                                  | "WAKING_UP";
                          };
                          user: { email: string
                          | null };
                      }
                      | null;
                  session_id: string;
                  status: { name: "ACTIVE"
                  | "INACTIVE" };
                  user: { email: string | null };
              };
          },
      >

    • Creates a Loops sampler in a team

      Parameters

      • params: {
            request: {
                availability_model?: "standard" | "spot" | null;
                base_model?: string | null;
                max_seq_length?: number | null;
                model_path?: string | null;
                num_replicas?: number | null;
                reuse_from_session_id?: string | null;
                run_id?: string | null;
                scope?: "default" | "serverless" | "dedicated";
                session_id: string;
            };
            team_id: string;
        }

      Returns Promise<
          {
              sampler: {
                  base_checkpoint: string
                  | null;
                  base_model: string;
                  base_url: string;
                  created_at: string;
                  deployment_id: string | null;
                  id: string;
                  instance_type:
                      | {
                          gpu_count: number;
                          gpu_memory_limit_mib: number
                          | null;
                          gpu_type: string | null;
                          id: string;
                          memory_limit_mib: number;
                          millicpu_limit: number;
                          name: string;
                      }
                      | null;
                  model_id: string
                  | null;
                  node_count: number;
                  session_id: string;
                  status: {
                      name:
                          | "FAILED"
                          | "DEPLOYING"
                          | "DEACTIVATING"
                          | "BUILDING"
                          | "DEPLOY_FAILED"
                          | "LOADING_MODEL"
                          | "ACTIVE"
                          | "UNHEALTHY"
                          | "BUILD_FAILED"
                          | "BUILD_STOPPED"
                          | "INACTIVE"
                          | "UPDATING"
                          | "SCALED_TO_ZERO"
                          | "WAKING_UP";
                  };
                  user: { email: string
                  | null };
              };
          },
      >

    • Creates a Loops session

      Parameters

      • params: { team_id: string }

      Returns Promise<{ session: { id: string } }>

    • Creates a Loops trainer

      Parameters

      • params: {
            request: {
                availability_model?: "standard" | "spot";
                base_checkpoint?: string | null;
                base_model: string;
                lora_rank?: number;
                max_seq_len?: number | null;
                name?: string | null;
                path?: string | null;
                replicas?: number;
                reuse_from_run_id?: string | null;
                reuse_from_session_id?: string | null;
                scale_down_delay_seconds?: number;
                scope?: "default" | "serverless" | "dedicated";
                seed?: number | null;
                session_id: string;
            };
            team_id: string;
        }

      Returns Promise<
          {
              run: {
                  base_checkpoint: string
                  | null;
                  base_model: string;
                  base_url: string;
                  created_at: string;
                  deployment_id: string | null;
                  id: string;
                  lora_config_version: string | null;
                  name: string;
                  sampler:
                      | {
                          base_checkpoint: string
                          | null;
                          base_model: string;
                          base_url: string;
                          created_at: string;
                          deployment_id: string | null;
                          id: string;
                          instance_type:
                              | {
                                  gpu_count: number;
                                  gpu_memory_limit_mib: number
                                  | null;
                                  gpu_type: string | null;
                                  id: string;
                                  memory_limit_mib: number;
                                  millicpu_limit: number;
                                  name: string;
                              }
                              | null;
                          model_id: string
                          | null;
                          node_count: number;
                          session_id: string;
                          status: {
                              name:
                                  | "FAILED"
                                  | "DEPLOYING"
                                  | "DEACTIVATING"
                                  | "BUILDING"
                                  | "DEPLOY_FAILED"
                                  | "LOADING_MODEL"
                                  | "ACTIVE"
                                  | "UNHEALTHY"
                                  | "BUILD_FAILED"
                                  | "BUILD_STOPPED"
                                  | "INACTIVE"
                                  | "UPDATING"
                                  | "SCALED_TO_ZERO"
                                  | "WAKING_UP";
                          };
                          user: { email: string
                          | null };
                      }
                      | null;
                  session_id: string;
                  status: { name: "ACTIVE"
                  | "INACTIVE" };
                  user: { email: string | null };
              };
          },
      >

    • Creates a new model from a source

      Parameters

      • params: {
            request: {
                source:
                    | {
                        deployed_model_name?: string
                        | null;
                        kind: "library_listing";
                        lab_display_name: string;
                        user_defined_listing_id: string;
                    }
                    | {
                        deployment: {
                            autoscaling_schedule_settings?: | {
                                delete_schedules?: string[];
                                schedules?: (
                                    | {
                                        autoscaling_settings: ...;
                                        cadence: ...;
                                        enabled: ...;
                                        end_hour?: ...;
                                        end_minute: ...;
                                        id?: ...;
                                        name: ...;
                                        start_hour?: ...;
                                        start_minute: ...;
                                        weekdays: ...;
                                    }
                                    | {
                                        autoscaling_settings: ...;
                                        cadence: ...;
                                        enabled: ...;
                                        end_at: ...;
                                        id?: ...;
                                        name: ...;
                                        start_at: ...;
                                    }
                                )[];
                                timezone?: string
                                | null;
                            }
                            | null;
                            autoscaling_settings?: | {
                                autoscaling_window?: number
                                | null;
                                concurrency_target?: number | null;
                                max_replica?: number | null;
                                max_scale_down_rate?: number | null;
                                min_replica?: number | null;
                                scale_down_delay?: number | null;
                                target_in_flight_tokens?: number | null;
                                target_utilization_percentage?: number | null;
                            }
                            | null;
                            config: { [key: string]: unknown };
                            create_environment_if_missing?: boolean;
                            deploy_timeout_minutes?: number | null;
                            deployment_name?: string | null;
                            environment_name?: string | null;
                            instance_type_id?: string | null;
                            is_development?: boolean;
                            labels?: { [key: string]: unknown } | null;
                            preserve_env_instance_type?: boolean;
                            promotion_settings_override?:
                                | {
                                    promotion_cleanup_strategy?: | "KEEP"
                                    | "SCALE_TO_ZERO"
                                    | "DEACTIVATE"
                                    | null;
                                    ramp_up_duration_seconds?: number
                                    | null;
                                    ramp_up_while_promoting?: boolean | null;
                                    redeploy_on_promotion?: boolean | null;
                                    rolling_deploy?: boolean | null;
                                    rolling_deploy_config?:
                                        | {
                                            max_surge_percent?: number
                                            | null;
                                            max_unavailable_percent?: number | null;
                                            replica_overhead_percent?: number | null;
                                            rolling_deploy_strategy?: "REPLICA" | null;
                                            stabilization_time_seconds?: number | null;
                                        }
                                        | null;
                                }
                                | null;
                            raw_config?: string
                            | null;
                            region?: string | null;
                            request_backpressure_settings?:
                                | { policy?: "QUEUE_ON_FULL"
                                | "REJECT_ON_FULL"
                                | null }
                                | null;
                            user_env?: { [key: string]: unknown } | null;
                        };
                        disable_archive_download?: boolean;
                        kind: "model_archive";
                        name: string;
                        s3_key?: string
                        | null;
                    };
            };
            team_id: string;
        }

      Returns Promise<
          {
              deployment: {
                  active_replica_count: number;
                  autoscaling_settings: | {
                      autoscaling_window: number
                      | null;
                      concurrency_target: number;
                      max_replica: number;
                      max_scale_down_rate: number | null;
                      min_replica: number;
                      scale_down_delay: number | null;
                      target_in_flight_tokens: number | null;
                      target_utilization_percentage: number | null;
                  }
                  | null;
                  created_at: string;
                  environment: string
                  | null;
                  id: string;
                  instance_type_name: string | null;
                  is_development: boolean;
                  is_production: boolean;
                  labels: { [key: string]: unknown } | null;
                  model_id: string;
                  name: string;
                  region: { display_name: string; slug: string } | null;
                  request_backpressure_settings: {
                      policy: "QUEUE_ON_FULL" | "REJECT_ON_FULL" | null;
                  };
                  status: | "FAILED"
                  | "DEPLOYING"
                  | "DEACTIVATING"
                  | "BUILDING"
                  | "DEPLOY_FAILED"
                  | "LOADING_MODEL"
                  | "ACTIVE"
                  | "UNHEALTHY"
                  | "BUILD_FAILED"
                  | "BUILD_STOPPED"
                  | "INACTIVE"
                  | "UPDATING"
                  | "SCALED_TO_ZERO"
                  | "WAKING_UP";
              };
              model: {
                  created_at: string;
                  deployments_count: number;
                  development_deployment_id: string
                  | null;
                  id: string;
                  instance_type_name: string;
                  name: string;
                  production_deployment_id: string | null;
                  team_name: string;
              };
          },
      >

    • Upserts a secret in a team

      Parameters

      • params: { request: { name: string; value: string }; team_id: string }

      Returns Promise<{ created_at: string; id: string; name: string; team_name: string }>

    • Upserts a training project in a specific team

      Parameters

      • params: {
            request: {
                training_project: { name: string; project_accelerator?: string | null };
            };
            team_id: string;
        }

      Returns Promise<
          {
              training_project: {
                  created_at: string;
                  id: string;
                  latest_job: | {
                      availability_model: "standard"
                      | "spot";
                      checkpoint_sync_status: "COMPLETED" | "SYNCING" | null;
                      created_at: string;
                      current_status: string;
                      error_message: string | null;
                      id: string;
                      instance_type: {
                          gpu_count: number;
                          gpu_memory_limit_mib: number | null;
                          gpu_type: string | null;
                          id: string;
                          memory_limit_mib: number;
                          millicpu_limit: number;
                          name: string;
                      };
                      name: string
                      | null;
                      node_count: number;
                      priority: number;
                      training_project: { id: string; name: string };
                      training_project_id: string;
                      updated_at: string;
                      user: { email: string | null } | null;
                  }
                  | null;
                  name: string;
                  project_accelerator: string
                  | null;
                  team_name: string | null;
                  updated_at: string;
              };
          },
      >

    • Creates a sandbox access token

      Parameters

      • params: { request: { scopes: "sandboxes"[] } }

      Returns Promise<{ expires_at: string; token: string }>

    • Searches training jobs

      Parameters

      • params: {
            request: {
                cursor?: string | null;
                job_id?: string | null;
                limit?: number;
                order_by?: { field: string; order: string }[];
                project_id?: string | null;
                statuses?: string[] | null;
            };
        }

      Returns Promise<
          {
              pagination: { cursor: string
              | null; has_more: boolean };
              training_jobs: {
                  availability_model: "standard" | "spot";
                  checkpoint_sync_status: "COMPLETED" | "SYNCING" | null;
                  created_at: string;
                  current_status: string;
                  error_message: string | null;
                  id: string;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
                  name: string
                  | null;
                  node_count: number;
                  priority: number;
                  training_project: { id: string; name: string };
                  training_project_id: string;
                  updated_at: string;
                  user: { email: string | null } | null;
              }[];
          },
      >

    • Upserts a training project

      Parameters

      • params: {
            request: {
                training_project: { name: string; project_accelerator?: string | null };
            };
        }

      Returns Promise<
          {
              training_project: {
                  created_at: string;
                  id: string;
                  latest_job: | {
                      availability_model: "standard"
                      | "spot";
                      checkpoint_sync_status: "COMPLETED" | "SYNCING" | null;
                      created_at: string;
                      current_status: string;
                      error_message: string | null;
                      id: string;
                      instance_type: {
                          gpu_count: number;
                          gpu_memory_limit_mib: number | null;
                          gpu_type: string | null;
                          id: string;
                          memory_limit_mib: number;
                          millicpu_limit: number;
                          name: string;
                      };
                      name: string
                      | null;
                      node_count: number;
                      priority: number;
                      training_project: { id: string; name: string };
                      training_project_id: string;
                      updated_at: string;
                      user: { email: string | null } | null;
                  }
                  | null;
                  name: string;
                  project_accelerator: string
                  | null;
                  team_name: string | null;
                  updated_at: string;
              };
          },
      >

    • Creates a training job

      Parameters

      • params: {
            request: {
                training_job: {
                    compute?: {
                        accelerator?: { accelerator: string; count: number } | null;
                        availability_model?: "standard" | "spot";
                        cpu_count?: number;
                        memory?: string;
                        node_count?: number;
                    };
                    enable_baseten_workdir?: boolean;
                    image: {
                        base_image: string;
                        docker_auth?: | {
                            auth_method: | "GCP_SERVICE_ACCOUNT_JSON"
                            | "AWS_IAM"
                            | "AWS_OIDC"
                            | "GCP_OIDC"
                            | "REGISTRY_SECRET"
                            | "AWS_ASSUME_ROLE";
                            aws_assume_role_docker_auth?: | { region: string; role_arn: string }
                            | null;
                            aws_iam_docker_auth?:
                                | {
                                    access_key_secret_ref: { name: string };
                                    secret_access_key_secret_ref: { name: string };
                                }
                                | null;
                            aws_oidc_docker_auth?: { region: string; role_arn: string }
                            | null;
                            gcp_oidc_docker_auth?:
                                | { service_account: string; workload_identity_provider: string }
                                | null;
                            gcp_service_account_json_docker_auth?:
                                | { service_account_json_secret_ref: { name: string } }
                                | null;
                            registry: string;
                            registry_secret_docker_auth?: { secret_ref: { name: string } } | null;
                        }
                        | null;
                    };
                    interactive_session?: | {
                        auth_provider?: "github"
                        | "microsoft";
                        session_provider?: "cursor" | "vs_code" | "ssh";
                        timeout_minutes?: number;
                        trigger?: "on_startup" | "on_failure" | "on_demand";
                    }
                    | null;
                    name?: string
                    | null;
                    priority?: number | null;
                    runtime?: {
                        artifacts?: { s3_bucket: string; s3_key: string }[];
                        cache_config?:
                            | {
                                enable_legacy_hf_mount?: boolean;
                                enabled?: boolean;
                                mount_base_path?: string;
                                persistent_home?: boolean;
                                require_cache_affinity?: boolean;
                            }
                            | null;
                        checkpointing_config?: {
                            checkpoint_path?: string
                            | null;
                            enabled?: boolean;
                            volume_size_gib?: number | null;
                        };
                        enable_cache?: boolean
                        | null;
                        environment_variables?: { [key: string]: string | { name: string } };
                        load_checkpoint_config?:
                            | {
                                checkpoints?: (
                                    | { job_id?: ...; project_name?: ...; typ: ... }
                                    | {
                                        checkpoint_name: ...;
                                        job_id?: ...;
                                        project_name?: ...;
                                        typ: ...;
                                    }
                                    | { checkpoint_name: ...; run_id: ...; target?: ...; typ: ... }
                                )[];
                                download_folder?: string;
                                enabled?: boolean;
                            }
                            | null;
                        start_commands?: string[];
                    };
                    truss_user_env?: | {
                        git_info?: | {
                            commits_since_tag: number
                            | null;
                            has_uncommitted_changes: boolean;
                            latest_commit_sha: string;
                            latest_tag: string | null;
                        }
                        | null;
                        is_frontend_deployment?: boolean;
                        is_library_deployment?: boolean;
                        mypy_version?: string
                        | null;
                        pydantic_version?: string | null;
                        python_version?: string | null;
                        truss_client_version?: string | null;
                    }
                    | null;
                    weights?: {
                        allow_patterns?: string[]
                        | null;
                        auth?:
                            | {
                                auth_method: | "AWS_OIDC"
                                | "GCP_OIDC"
                                | "AWS_ASSUME_ROLE"
                                | "CUSTOM_SECRET"
                                | "HUGGING_FACE_OIDC";
                                auth_secret_name?: string
                                | null;
                                aws_assume_role_arn?: string | null;
                                aws_assume_role_region?: string | null;
                                aws_oidc_region?: string | null;
                                aws_oidc_role_arn?: string | null;
                                gcp_oidc_service_account?: string | null;
                                gcp_oidc_workload_id_provider?: string | null;
                            }
                            | null;
                        auth_secret_name?: string
                        | null;
                        ignore_patterns?: string[] | null;
                        mount_location: string;
                        source: string;
                    }[];
                };
            };
            training_project_id: string;
        }

      Returns Promise<
          {
              training_job: {
                  availability_model: "standard"
                  | "spot";
                  checkpoint_sync_status: "COMPLETED" | "SYNCING" | null;
                  created_at: string;
                  current_status: string;
                  error_message: string | null;
                  id: string;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
                  name: string
                  | null;
                  node_count: number;
                  priority: number;
                  training_project: { id: string; name: string };
                  training_project_id: string;
                  updated_at: string;
                  user: { email: string | null } | null;
              };
          },
      >

    • Gets the logs for a training job (deprecated; use GET)

      Parameters

      • params: {
            request: {
                direction?: "asc" | "desc" | null;
                end_epoch_millis?: number | null;
                limit?: number | null;
                min_level?: "DEBUG" | "INFO" | "WARNING" | "ERROR" | null;
                start_epoch_millis?: number | null;
            };
            training_job_id: string;
            training_project_id: string;
        }

      Returns Promise<
          {
              logs: {
                  level: "DEBUG"
                  | "INFO"
                  | "WARNING"
                  | "ERROR"
                  | null;
                  message: string;
                  replica: string | null;
                  request_id: string | null;
                  timestamp: string;
              }[];
          },
      >

    • Gets the metrics for a training job (deprecated; use GET)

      Parameters

      • params: {
            request: {
                end_epoch_millis?: number | null;
                start_epoch_millis?: number | null;
                step_seconds?: number | null;
            };
            training_job_id: string;
            training_project_id: string;
        }

      Returns Promise<
          {
              cache: | {
                  usage_bytes: { timestamp: string; value: number }[];
                  utilization: { timestamp: string; value: number }[];
              }
              | null;
              cpu_memory_usage_bytes: { timestamp: string; value: number }[];
              cpu_usage: { timestamp: string; value: number }[];
              ephemeral_storage: {
                  usage_bytes: { timestamp: string; value: number }[];
                  utilization: { timestamp: string; value: number }[];
              };
              gpu_memory_usage_bytes: {
                  [key: string]: { timestamp: string; value: number }[];
              };
              gpu_utilization: { [key: string]: { timestamp: string; value: number }[] };
              per_node_metrics: {
                  metrics: {
                      cpu_memory_usage_bytes: { timestamp: string; value: number }[];
                      cpu_usage: { timestamp: string; value: number }[];
                      ephemeral_storage: {
                          usage_bytes: { timestamp: string; value: number }[];
                          utilization: { timestamp: string; value: number }[];
                      };
                      gpu_memory_usage_bytes: {
                          [key: string]: { timestamp: string; value: number }[];
                      };
                      gpu_utilization: {
                          [key: string]: { timestamp: string; value: number }[];
                      };
                  };
                  node_id: string;
              }[];
              training_job: {
                  availability_model: "standard"
                  | "spot";
                  checkpoint_sync_status: "COMPLETED" | "SYNCING" | null;
                  created_at: string;
                  current_status: string;
                  error_message: string | null;
                  id: string;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
                  name: string
                  | null;
                  node_count: number;
                  priority: number;
                  training_project: { id: string; name: string };
                  training_project_id: string;
                  updated_at: string;
                  user: { email: string | null } | null;
              };
          },
      >

    • Recreates a training job

      Parameters

      • params: { training_job_id: string; training_project_id: string }

      Returns Promise<
          {
              training_job: {
                  availability_model: "standard"
                  | "spot";
                  checkpoint_sync_status: "COMPLETED" | "SYNCING" | null;
                  created_at: string;
                  current_status: string;
                  error_message: string | null;
                  id: string;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
                  name: string
                  | null;
                  node_count: number;
                  priority: number;
                  training_project: { id: string; name: string };
                  training_project_id: string;
                  updated_at: string;
                  user: { email: string | null } | null;
              };
          },
      >

    • Signs an SSH certificate for a training job

      Parameters

      • params: {
            request: { public_key: string; replica_id?: string | null };
            training_job_id: string;
            training_project_id: string;
        }

      Returns Promise<
          {
              jwt: string;
              proxy_address: string;
              ssh_cert_expires_at: string;
              ssh_certificate: string;
          },
      >

    • Stops a training job

      Parameters

      • params: {
            request: StopTrainingJobRequest;
            training_job_id: string;
            training_project_id: string;
        }

      Returns Promise<
          {
              training_job: {
                  availability_model: "standard"
                  | "spot";
                  checkpoint_sync_status: "COMPLETED" | "SYNCING" | null;
                  created_at: string;
                  current_status: string;
                  error_message: string | null;
                  id: string;
                  instance_type: {
                      gpu_count: number;
                      gpu_memory_limit_mib: number | null;
                      gpu_type: string | null;
                      id: string;
                      memory_limit_mib: number;
                      millicpu_limit: number;
                      name: string;
                  };
                  name: string
                  | null;
                  node_count: number;
                  priority: number;
                  training_project: { id: string; name: string };
                  training_project_id: string;
                  updated_at: string;
                  user: { email: string | null } | null;
              };
          },
      >

    • Starts a volume sync

      Parameters

      • params: {
            request: {
                destination: { ref: string };
                source:
                    | {
                        auth_secret_name?: string
                        | null;
                        exclude?: string[];
                        hf_oidc?: { resource: string } | null;
                        include?: string[];
                        type: "HUGGING_FACE";
                        uri: string;
                    }
                    | {
                        auth_secret_name?: string
                        | null;
                        aws_assume_role?: { region: string; role_arn: string } | null;
                        aws_oidc?: { region: string; role_arn: string } | null;
                        exclude?: string[];
                        include?: string[];
                        type: "S3";
                        uri: string;
                    }
                    | {
                        auth_secret_name?: string
                        | null;
                        exclude?: string[];
                        gcp_oidc?:
                            | { service_account: string; workload_identity_provider: string }
                            | null;
                        include?: string[];
                        type: "GCS";
                        uri: string;
                    }
                    | {
                        auth_secret_name?: string
                        | null;
                        exclude?: string[];
                        include?: string[];
                        type: "AZURE";
                        uri: string;
                    }
                    | {
                        auth_secret_name?: string
                        | null;
                        exclude?: string[];
                        include?: string[];
                        type: "R2";
                        uri: string;
                    }
                    | {
                        auth_secret_name?: string
                        | null;
                        exclude?: string[];
                        include?: string[];
                        type: "COREWEAVE";
                        uri: string;
                    }
                    | {
                        exclude?: string[];
                        include?: string[];
                        type: "BASETEN_TRAINING";
                        uri: string;
                    };
            };
        }

      Returns Promise<
          {
              completed_at: string
              | null;
              content_digest: string | null;
              created_at: string;
              destination: { ref: string };
              error: { code: string; message: string } | null;
              source:
                  | {
                      auth_secret_name?: string
                      | null;
                      exclude?: string[];
                      hf_oidc?: { resource: string } | null;
                      include?: string[];
                      type: "HUGGING_FACE";
                      uri: string;
                  }
                  | {
                      auth_secret_name?: string
                      | null;
                      aws_assume_role?: { region: string; role_arn: string } | null;
                      aws_oidc?: { region: string; role_arn: string } | null;
                      exclude?: string[];
                      include?: string[];
                      type: "S3";
                      uri: string;
                  }
                  | {
                      auth_secret_name?: string
                      | null;
                      exclude?: string[];
                      gcp_oidc?:
                          | { service_account: string; workload_identity_provider: string }
                          | null;
                      include?: string[];
                      type: "GCS";
                      uri: string;
                  }
                  | {
                      auth_secret_name?: string
                      | null;
                      exclude?: string[];
                      include?: string[];
                      type: "AZURE";
                      uri: string;
                  }
                  | {
                      auth_secret_name?: string
                      | null;
                      exclude?: string[];
                      include?: string[];
                      type: "R2";
                      uri: string;
                  }
                  | {
                      auth_secret_name?: string
                      | null;
                      exclude?: string[];
                      include?: string[];
                      type: "COREWEAVE";
                      uri: string;
                  }
                  | {
                      exclude?: string[];
                      include?: string[];
                      type: "BASETEN_TRAINING";
                      uri: string;
                  };
              status: "FAILED"
              | "CANCELED"
              | "SYNCING"
              | "PENDING"
              | "READY";
              sync_id: string;
              total_size_bytes: number | null;
              version_ref: string | null;
              volume_version_id: string | null;
          },
      >

    • Cancels a volume sync

      Parameters

      • params: { volume_sync_id: string }

      Returns Promise<
          {
              completed_at: string
              | null;
              content_digest: string | null;
              created_at: string;
              destination: { ref: string };
              error: { code: string; message: string } | null;
              source:
                  | {
                      auth_secret_name?: string
                      | null;
                      exclude?: string[];
                      hf_oidc?: { resource: string } | null;
                      include?: string[];
                      type: "HUGGING_FACE";
                      uri: string;
                  }
                  | {
                      auth_secret_name?: string
                      | null;
                      aws_assume_role?: { region: string; role_arn: string } | null;
                      aws_oidc?: { region: string; role_arn: string } | null;
                      exclude?: string[];
                      include?: string[];
                      type: "S3";
                      uri: string;
                  }
                  | {
                      auth_secret_name?: string
                      | null;
                      exclude?: string[];
                      gcp_oidc?:
                          | { service_account: string; workload_identity_provider: string }
                          | null;
                      include?: string[];
                      type: "GCS";
                      uri: string;
                  }
                  | {
                      auth_secret_name?: string
                      | null;
                      exclude?: string[];
                      include?: string[];
                      type: "AZURE";
                      uri: string;
                  }
                  | {
                      auth_secret_name?: string
                      | null;
                      exclude?: string[];
                      include?: string[];
                      type: "R2";
                      uri: string;
                  }
                  | {
                      auth_secret_name?: string
                      | null;
                      exclude?: string[];
                      include?: string[];
                      type: "COREWEAVE";
                      uri: string;
                  }
                  | {
                      exclude?: string[];
                      include?: string[];
                      type: "BASETEN_TRAINING";
                      uri: string;
                  };
              status: "FAILED"
              | "CANCELED"
              | "SYNCING"
              | "PENDING"
              | "READY";
              sync_id: string;
              total_size_bytes: number | null;
              version_ref: string | null;
              volume_version_id: string | null;
          },
      >

    • Sets a volume tag

      Parameters

      • params: {
            request: {
                expected_sequence?: number | null;
                expires_at?: string | null;
                tag: string;
                version: string;
            };
            volume_name: string;
            volume_namespace: string;
        }

      Returns Promise<
          {
              digest: string;
              expires_at: string
              | null;
              namespace: string;
              tag: string;
              version_ref: string;
              volume: string;
              volume_sequence: number;
          },
      >

    • Creates a volume access token

      Parameters

      • params: {
            request: {
                correlation_id?: string | null;
                namespaces: string[];
                scopes: ("PULL" | "INSPECT" | "PUSH" | "TAG")[];
                volumes: string[];
            };
        }

      Returns Promise<
          {
              bdn_endpoint: string
              | null;
              expires_at: string;
              namespaces: string[];
              scopes: ("PULL" | "INSPECT" | "PUSH" | "TAG")[];
              token: string;
              volumes: string[];
          },
      >

    • Restores a deleted or expired version of a volume

      Parameters

      • params: {
            request: { expected_sequence?: number | null };
            volume_name: string;
            volume_namespace: string;
            volume_version: string;
        }

      Returns Promise<
          {
              digest: string;
              lifecycle: string;
              namespace: string;
              version_ref: string;
              volume: string;
              volume_sequence: number;
          },
      >

    • Push a sandbox image

      Parameters

      • params: {
            params?: { team_id?: string };
            request: {
                docker_config?: string;
                image?: string;
                memory?: number;
                name: string;
                volume?: number;
            };
        }

      Returns Promise<
          {
              image?: string;
              name: string;
              status: "FAILED"
              | "BUILDING"
              | "UPLOADING"
              | "BUILT";
              upload_headers?: { [key: string]: string };
              upload_url?: string;
          },
      >

    • Update a sandbox

      Parameters

      • params: {
            params?: { team_id?: string };
            request: {
                envs?: { name?: string; secret?: boolean; value?: string }[];
                external_id?: string;
                labels?: { [key: string]: string };
                lifecycle?: {
                    expiration_policies?: (
                        | { action: "DELETE"; type: "TTL_IDLE"; value: string }
                        | { action: "DELETE"; type: "TTL_MAX_AGE"; value: string }
                        | { action: "DELETE"; type: "DATE"; value: string }
                    )[];
                    terminated_retention?: string;
                };
            };
            sandbox_name: string;
        }

      Returns Promise<
          {
              cpu?: number;
              envs?: { name?: string; secret?: boolean; value?: string }[];
              external_id?: string;
              filesystem?: { max_memory_usage?: string | number };
              image?: string;
              labels?: { [key: string]: string };
              lifecycle?: {
                  expiration_policies?: (
                      | { action: "DELETE"; type: "TTL_IDLE"; value: string }
                      | { action: "DELETE"; type: "TTL_MAX_AGE"; value: string }
                      | { action: "DELETE"; type: "DATE"; value: string }
                  )[];
                  terminated_retention?: string;
              };
              memory?: number;
              ports?: {
                  name?: string;
                  protocol?: "HTTP"
                  | "TCP"
                  | "UDP"
                  | "TLS";
                  target: number;
              }[];
              region?: string;
              volumes?: { mount_path: string; name: string; read_only?: boolean }[];
          } & {
              created_at: string;
              created_by?: string;
              expires_in?: number;
              last_used_at?: string;
              name: string;
              status: | "DEPLOYED"
              | "FAILED"
              | "DEPLOYING"
              | "DELETING"
              | "DEACTIVATING"
              | "DEACTIVATED"
              | "TERMINATED"
              | "ARCHIVING"
              | "ARCHIVED"
              | "UNARCHIVING"
              | "BUILDING"
              | "UPLOADING";
              updated_at?: string;
              updated_by?: string;
              url: string;
          },
      >

    • Update a sandbox preview

      Parameters

      • params: {
            params?: { team_id?: string };
            preview_name: string;
            request: {
                expires_at?: string;
                public?: boolean;
                request_headers?: { [key: string]: string };
                response_headers?: { [key: string]: string };
            } & { ttl?: string };
            sandbox_name: string;
        }

      Returns Promise<
          {
              expires_at?: string;
              public?: boolean;
              request_headers?: { [key: string]: string };
              response_headers?: { [key: string]: string };
          } & {
              created_at?: string;
              created_by?: string;
              name: string;
              port: number;
              region?: string;
              status: "DEPLOYED"
              | "FAILED"
              | "DEPLOYING"
              | "DELETING"
              | "TERMINATED";
              updated_at?: string;
              updated_by?: string;
              url: string;
          },
      >

    • Update a volume

      Parameters

      • params: {
            params?: { team_id?: string };
            request: { labels?: { [key: string]: string }; size?: string | number };
            volume_name: string;
        }

      Returns Promise<
          {
              attached_to?: string;
              created_at?: string;
              created_by?: string;
              labels?: { [key: string]: string };
              name: string;
              region: string;
              size: string | number;
              status: "DEPLOYED" | "FAILED" | "DEPLOYING" | "DELETING";
              updated_at?: string;
              updated_by?: string;
          },
      >