From 0713562b5272d1eb68f136ae0dafb43af94d6bdf Mon Sep 17 00:00:00 2001 From: Mingming Lang Date: Thu, 19 Nov 2026 15:51:53 -0500 Subject: [PATCH] Regenerate the API clients from the production spec Co-Authored-By: Claude Opus 5.5 --- baseten/client/managementapi/__init__.py | 170 +- baseten/client/managementapi/_client.py | 1136 +++- baseten/client/managementapi/_models.py | 2392 ++++++++- baseten/client/modelconfig/__init__.py | 4 + baseten/client/modelconfig/_models.py | 54 +- scripts/apigen/specs/config.schema.json | 124 +- scripts/apigen/specs/management.json | 6264 ++++++++++++++++++---- 7 files changed, 8622 insertions(+), 1522 deletions(-) diff --git a/baseten/client/managementapi/__init__.py b/baseten/client/managementapi/__init__.py index bfadfa4..02d5265 100644 --- a/baseten/client/managementapi/__init__.py +++ b/baseten/client/managementapi/__init__.py @@ -12,6 +12,9 @@ from ._client import ApiClient, AsyncApiClient, ResponseError from ._models import ( + AccessTokenLifetimeSeconds, + AccessTrustRule, + AccessTrustRules, ActivateResponse, ActiveJobAtSubmit, APIKey, @@ -19,6 +22,7 @@ APIKeyOwner, APIKeys, APIKeyTombstone, + AuditFieldChange, AuditLogActor, AuditLogEntry, AuditLogEventApiKeyCreated, @@ -51,6 +55,9 @@ AuditLogEventGridMachineUserCreated, AuditLogEventGridMachineUserDeleted, AuditLogEventGridMachineUserUpdated, + AuditLogEventIdentityProviderCreated, + AuditLogEventIdentityProviderDeleted, + AuditLogEventIdentityProviderUpdated, AuditLogEventModelDeleted, AuditLogEventModelDeployed, AuditLogEventModelDeploymentActivated, @@ -63,6 +70,8 @@ AuditLogEventModelDeploymentRetried, AuditLogEventModelPromotionControlAction, AuditLogEventModelRenamed, + AuditLogEventOrganizationApiKeySettingsUpdated, + AuditLogEventPredefinedIdentityProviderConfig, AuditLogEventPromotionSettingsOverride, AuditLogEventProviderConnectionCreated, AuditLogEventProviderConnectionDeleted, @@ -72,10 +81,17 @@ AuditLogEventRequireGroupBasedAdminsEnabled, AuditLogEventSecretDeleted, AuditLogEventSecretUpdated, + AuditLogEventServiceAccountCreated, + AuditLogEventServiceAccountDeleted, + AuditLogEventServiceAccountPresetPermissions, + AuditLogEventServiceAccountUpdated, AuditLogEventSshCertificateSigned, AuditLogEventTelemetryExportCreated, AuditLogEventTelemetryExportDeleted, AuditLogEventTelemetryExportUpdated, + AuditLogEventTrustRuleCreated, + AuditLogEventTrustRuleDeleted, + AuditLogEventTrustRuleUpdated, AuditLogEventUserInvited, AuditLogEventUserJoinedOrganization, AuditLogEventUserRemoved, @@ -135,6 +151,7 @@ CostPerMillionInputTokens1, CostPerMillionOutputTokens, CostPerMillionOutputTokens1, + CreateAccessTrustRuleRequest, CreateApiKeyForGroupRequest, CreateApiKeyForGroupResponse, CreateAPIKeyRequest, @@ -152,6 +169,7 @@ CreateGridTokenRequest, CreateGroupHierarchy, CreateGroupRequest, + CreateIdentityProviderRequest, CreateJobWeightConfig, CreateLibraryListingRequest, CreateLibraryListingVersionRequest, @@ -165,6 +183,7 @@ CreateLoopsTrainerRequest, CreateModelDeploymentRequest, CreateModelRequest, + CreatePredefinedIdentityProviderConfig, CreateSandboxParams, CreateSandboxPreviewParams, CreateSandboxPreviewRequest, @@ -173,6 +192,7 @@ CreateSandboxRequest, CreateSandboxVolumeParams, CreateSandboxVolumeRequest, + CreateServiceAccountRequest, CreateTokenRequest, CreateTrainingJob, CreateTrainingJobAccelerator, @@ -198,8 +218,12 @@ DeactivateResponse, DedicatedItem, DedicatedUsage, + DeletedAccessTrustRule, + DeletedIdentityProvider, + DeletedServiceAccount, DeleteImageParams, DeleteImageTagParams, + DeleteLoopsRunResponse, DeleteSandboxParams, DeleteSandboxPreviewParams, DeleteSandboxPreviewTokenParams, @@ -224,10 +248,16 @@ DeploymentPatchOpPythonRequirement, DeploymentPatchPoint, DeploymentPatchPointWithHash, + DeploymentReplica, + DeploymentReplicas, Deployments, DeploymentTombstone, Description, Description1, + Description2, + Description3, + Description4, + Description5, DisplayName, DisplayName1, DockerAuth, @@ -271,6 +301,8 @@ GatewayKeyInfo, GcpOidcDockerAuth, GcpServiceAccountJsonDockerAuth, + GetAccessIdentityProvidersParams, + GetAccessTrustRulesParams, GetApiKeysParams, GetAuditLogsParams, GetAuthCodesResponse, @@ -285,7 +317,6 @@ GetDeploymentPatchesStateResponse, GetExploreMetadataParams, GetGatewayEventsParams, - GetGridClassifiersParams, GetGridConnectionsParams, GetGridMachineUsersParams, GetGridRouteClassifiersParams, @@ -323,10 +354,12 @@ GetModelsDeploymentsLogsParams, GetModelsDeploymentsMetricsParams, GetModelsDeploymentsParams, + GetModelsDeploymentsReplicasParams, GetModelsDeploymentsStartupsParams, GetModelsDeploymentsStartupsSummaryParams, GetModelsEnvironmentsLogsParams, GetModelsEnvironmentsMetricsParams, + GetModelsEnvironmentsReplicasParams, GetModelsEnvironmentsStartupsParams, GetModelsEnvironmentsStartupsSummaryParams, GetModelsParams, @@ -336,6 +369,7 @@ GetSandboxParams, GetSandboxPreviewParams, GetSandboxVolumeParams, + GetServiceAccountsParams, GetTeamsLoopsRunsParams, GetTeamsLoopsSamplersParams, GetTeamsModelsParams, @@ -359,12 +393,11 @@ GetVolumesSyncsParams, GetVolumesVersionsParams, GitInfo, - GridClassifier, - GridClassifiersResponse, GridConnection, GridConnectionBedrockAccessKeysAuth, GridConnectionBedrockApiKeyAuth, GridConnectionConfigAnthropic, + GridConnectionConfigAzure, GridConnectionConfigBedrock, GridConnectionConfigOpenAI, GridConnectionConfigVertex, @@ -379,12 +412,12 @@ GridMachineUsersResponse, GridMachineUserTombstone, GridRoute, + GridRouteAlias, GridRouteClassifier, GridRouteClassifiersResponse, - GridRouteRef, + GridRouteMetadata, GridRoutesResponse, GridRouteTargetBasetenModelAPI, - GridRouteTargetClassifier, GridRouteTargetConnection, GridRouteTargetIntelligent, GridRouteTombstone, @@ -402,6 +435,8 @@ GroupHierarchy, GroupMetadata, GroupsResponse, + IdentityProvider, + IdentityProviders, InferenceVolumeByStatusDatapoint, InProgressPromotion, InstanceType, @@ -410,6 +445,7 @@ InstanceTypeWithPrice, InteractiveSession, InteractiveSessionConfig, + IssuerUrl, KeysForGroupResponse, LibraryListing, LibraryListingMetadata, @@ -458,6 +494,7 @@ LoopsCheckpointFilesResponse, LoopsCheckpointS3Source, LoopsCheckpointSourceResponse, + LoopsCheckpointTombstone, LoopsCheckpointVolumeSource, LoopsDebugArchiveFilesResponse, LoopsDeployment, @@ -474,6 +511,7 @@ LoopsSession, LoopsUsage, LoopsUserConfig, + MaxAccessTokenLifetimeSeconds, MaxScaleDownRate, MaxScaleDownRate1, MaxSeqLen, @@ -502,9 +540,15 @@ Name1, Name2, Name3, + Name4, Name5, Name6, - Name7, + Name8, + Name9, + Name10, + Name12, + Name13, + Name14, NumReplicas, OneTimeAutoscalingSchedule, OneTimeAutoscalingScheduleUpsert, @@ -520,6 +564,9 @@ PatchVolumeRequest, PatchVolumeResponse, PendingJobAheadAtSubmit, + PredefinedIdentityProvider, + PredefinedIdentityProviderConfig, + PredefinedIdentityProviders, PrepareModelUploadRequest, PrepareModelUploadResponse, Primary, @@ -584,6 +631,11 @@ SecretReference, Secrets, SecretTombstone, + ServiceAccount, + ServiceAccountPresetPermissions, + ServiceAccountPresetPermissionsRequest, + ServiceAccounts, + SetLoopsCheckpointTtlRequest, SetVolumeTagRequest, SetVolumeTagResponse, SignalPromotionResponse, @@ -627,17 +679,26 @@ TeamId5, TeamId6, TeamId7, + TeamId8, Teams, TeamTrainingGpuCapacityItem, TerminateReplicaResponse, Token, + TokenExchangeRequest, + TokenExchangeResponse, ToolCallUsageBucket, ToolCallUsageResponse, Total, + Total2, + Total3, TrafficRoutingRule, TrafficRoutingRuleUpsert, TrafficRoutingTarget, TrafficRoutingTargetUpsert, + TrainingBDNConfig, + TrainingBDNConfigResponse, + TrainingBDNMount, + TrainingBDNMountResponse, TrainingGpuCapacityItem, TrainingItem, TrainingJob, @@ -652,7 +713,9 @@ TrainingUsage, TrainingWeightAuth, TrussUserEnv, + TtlSeconds, TTSBenchmarkMetrics, + UpdateAccessTrustRuleRequest, UpdateAutoscalingScheduleSettings, UpdateAutoscalingSettings, UpdateAutoscalingSettingsResponse, @@ -678,10 +741,12 @@ UpdateGridUserSettingsRequest, UpdateGroupMetadata, UpdateGroupRequest, + UpdateIdentityProviderRequest, UpdateLibraryListingRequest, UpdateLibraryListingVersionRequest, UpdateModelPromotionSettings, UpdateModelRequest, + UpdateOrganizationRequest, UpdatePromotionSettings, UpdateRequestBackpressureSettings, UpdateRollingDeployConfig, @@ -691,19 +756,21 @@ UpdateSandboxRequest, UpdateSandboxVolumeParams, UpdateSandboxVolumeRequest, + UpdateServiceAccountRequest, UpdateTrafficRoutingSettings, UpdateTrainingJobRequest, UpdateTrainingJobResponse, UpsertGridConnectionBedrockAccessKeysAuth, UpsertGridConnectionBedrockApiKeyAuth, UpsertGridConnectionConfigAnthropic, + UpsertGridConnectionConfigAzure, UpsertGridConnectionConfigBedrock, UpsertGridConnectionConfigOpenAI, UpsertGridConnectionConfigVertex, UpsertGridConnectionConfigXAI, UpsertGridRouteTargetBasetenModelAPI, - UpsertGridRouteTargetClassifier, UpsertGridRouteTargetConnection, + UpsertGridRouteTargetIntelligent, UpsertSecretRequest, UpsertTrainingProject, UpsertTrainingProjectRequest, @@ -716,6 +783,10 @@ ValidateLoopsCheckpointRequest, ValidateLoopsCheckpointResponse, Value, + Verification, + VerifyAccessTrustRuleRequest, + VerifyIdentityProviderRequest, + VerifyPredefinedIdentityProviderConfig, VertexTargetConfig, Volume, VolumeSync, @@ -746,10 +817,14 @@ "APIKeyTombstone", "APIKeys", "AWSCredentials", + "AccessTokenLifetimeSeconds", + "AccessTrustRule", + "AccessTrustRules", "ActivateResponse", "ActiveJobAtSubmit", "ApiClient", "AsyncApiClient", + "AuditFieldChange", "AuditLogActor", "AuditLogEntry", "AuditLogEventApiKeyCreated", @@ -782,6 +857,9 @@ "AuditLogEventGridMachineUserCreated", "AuditLogEventGridMachineUserDeleted", "AuditLogEventGridMachineUserUpdated", + "AuditLogEventIdentityProviderCreated", + "AuditLogEventIdentityProviderDeleted", + "AuditLogEventIdentityProviderUpdated", "AuditLogEventModelDeleted", "AuditLogEventModelDeployed", "AuditLogEventModelDeploymentActivated", @@ -794,6 +872,8 @@ "AuditLogEventModelDeploymentRetried", "AuditLogEventModelPromotionControlAction", "AuditLogEventModelRenamed", + "AuditLogEventOrganizationApiKeySettingsUpdated", + "AuditLogEventPredefinedIdentityProviderConfig", "AuditLogEventPromotionSettingsOverride", "AuditLogEventProviderConnectionCreated", "AuditLogEventProviderConnectionDeleted", @@ -803,10 +883,17 @@ "AuditLogEventRequireGroupBasedAdminsEnabled", "AuditLogEventSecretDeleted", "AuditLogEventSecretUpdated", + "AuditLogEventServiceAccountCreated", + "AuditLogEventServiceAccountDeleted", + "AuditLogEventServiceAccountPresetPermissions", + "AuditLogEventServiceAccountUpdated", "AuditLogEventSshCertificateSigned", "AuditLogEventTelemetryExportCreated", "AuditLogEventTelemetryExportDeleted", "AuditLogEventTelemetryExportUpdated", + "AuditLogEventTrustRuleCreated", + "AuditLogEventTrustRuleDeleted", + "AuditLogEventTrustRuleUpdated", "AuditLogEventUserInvited", "AuditLogEventUserJoinedOrganization", "AuditLogEventUserRemoved", @@ -866,6 +953,7 @@ "CostPerMillionOutputTokens", "CostPerMillionOutputTokens1", "CreateAPIKeyRequest", + "CreateAccessTrustRuleRequest", "CreateApiKeyForGroupRequest", "CreateApiKeyForGroupResponse", "CreateChainEnvironmentRequest", @@ -880,6 +968,7 @@ "CreateGridTokenRequest", "CreateGroupHierarchy", "CreateGroupRequest", + "CreateIdentityProviderRequest", "CreateJobWeightConfig", "CreateLLMModelRequest", "CreateLLMModelVersionRequest", @@ -893,6 +982,7 @@ "CreateLoopsTrainerRequest", "CreateModelDeploymentRequest", "CreateModelRequest", + "CreatePredefinedIdentityProviderConfig", "CreateSandboxParams", "CreateSandboxPreviewParams", "CreateSandboxPreviewRequest", @@ -901,6 +991,7 @@ "CreateSandboxRequest", "CreateSandboxVolumeParams", "CreateSandboxVolumeRequest", + "CreateServiceAccountRequest", "CreateTokenRequest", "CreateTrainingJob", "CreateTrainingJobAccelerator", @@ -930,6 +1021,7 @@ "DedicatedUsage", "DeleteImageParams", "DeleteImageTagParams", + "DeleteLoopsRunResponse", "DeleteSandboxParams", "DeleteSandboxPreviewParams", "DeleteSandboxPreviewTokenParams", @@ -940,6 +1032,9 @@ "DeleteVolumeTagResponse", "DeleteVolumeVersionRequest", "DeleteVolumeVersionResponse", + "DeletedAccessTrustRule", + "DeletedIdentityProvider", + "DeletedServiceAccount", "DeployLoopsCheckpointRequest", "DeployLoopsCheckpointResponse", "Deployment", @@ -954,10 +1049,16 @@ "DeploymentPatchOpPythonRequirement", "DeploymentPatchPoint", "DeploymentPatchPointWithHash", + "DeploymentReplica", + "DeploymentReplicas", "DeploymentTombstone", "Deployments", "Description", "Description1", + "Description2", + "Description3", + "Description4", + "Description5", "DisplayName", "DisplayName1", "DockerAuth", @@ -1001,6 +1102,8 @@ "GatewayKeyInfo", "GcpOidcDockerAuth", "GcpServiceAccountJsonDockerAuth", + "GetAccessIdentityProvidersParams", + "GetAccessTrustRulesParams", "GetApiKeysParams", "GetAuditLogsParams", "GetAuthCodesResponse", @@ -1015,7 +1118,6 @@ "GetDeploymentPatchesStateResponse", "GetExploreMetadataParams", "GetGatewayEventsParams", - "GetGridClassifiersParams", "GetGridConnectionsParams", "GetGridMachineUsersParams", "GetGridRouteClassifiersParams", @@ -1053,10 +1155,12 @@ "GetModelsDeploymentsLogsParams", "GetModelsDeploymentsMetricsParams", "GetModelsDeploymentsParams", + "GetModelsDeploymentsReplicasParams", "GetModelsDeploymentsStartupsParams", "GetModelsDeploymentsStartupsSummaryParams", "GetModelsEnvironmentsLogsParams", "GetModelsEnvironmentsMetricsParams", + "GetModelsEnvironmentsReplicasParams", "GetModelsEnvironmentsStartupsParams", "GetModelsEnvironmentsStartupsSummaryParams", "GetModelsParams", @@ -1066,6 +1170,7 @@ "GetSandboxParams", "GetSandboxPreviewParams", "GetSandboxVolumeParams", + "GetServiceAccountsParams", "GetTeamsLoopsRunsParams", "GetTeamsLoopsSamplersParams", "GetTeamsModelsParams", @@ -1089,12 +1194,11 @@ "GetVolumesSyncsParams", "GetVolumesVersionsParams", "GitInfo", - "GridClassifier", - "GridClassifiersResponse", "GridConnection", "GridConnectionBedrockAccessKeysAuth", "GridConnectionBedrockApiKeyAuth", "GridConnectionConfigAnthropic", + "GridConnectionConfigAzure", "GridConnectionConfigBedrock", "GridConnectionConfigOpenAI", "GridConnectionConfigVertex", @@ -1109,11 +1213,11 @@ "GridMachineUserTombstone", "GridMachineUsersResponse", "GridRoute", + "GridRouteAlias", "GridRouteClassifier", "GridRouteClassifiersResponse", - "GridRouteRef", + "GridRouteMetadata", "GridRouteTargetBasetenModelAPI", - "GridRouteTargetClassifier", "GridRouteTargetConnection", "GridRouteTargetIntelligent", "GridRouteTombstone", @@ -1132,6 +1236,8 @@ "GroupHierarchy", "GroupMetadata", "GroupsResponse", + "IdentityProvider", + "IdentityProviders", "InProgressPromotion", "InferenceVolumeByStatusDatapoint", "InstanceType", @@ -1140,6 +1246,7 @@ "InstanceTypes", "InteractiveSession", "InteractiveSessionConfig", + "IssuerUrl", "KeysForGroupResponse", "LLMBenchmarkMetrics", "LLMModelHandle", @@ -1188,6 +1295,7 @@ "LoopsCheckpointFilesResponse", "LoopsCheckpointS3Source", "LoopsCheckpointSourceResponse", + "LoopsCheckpointTombstone", "LoopsCheckpointVolumeSource", "LoopsDebugArchiveFilesResponse", "LoopsDeployment", @@ -1204,6 +1312,7 @@ "LoopsSession", "LoopsUsage", "LoopsUserConfig", + "MaxAccessTokenLifetimeSeconds", "MaxScaleDownRate", "MaxScaleDownRate1", "MaxSeqLen", @@ -1232,9 +1341,15 @@ "Name1", "Name2", "Name3", + "Name4", "Name5", "Name6", - "Name7", + "Name8", + "Name9", + "Name10", + "Name12", + "Name13", + "Name14", "NumReplicas", "OneTimeAutoscalingSchedule", "OneTimeAutoscalingScheduleUpsert", @@ -1250,6 +1365,9 @@ "PatchVolumeRequest", "PatchVolumeResponse", "PendingJobAheadAtSubmit", + "PredefinedIdentityProvider", + "PredefinedIdentityProviderConfig", + "PredefinedIdentityProviders", "PrepareModelUploadRequest", "PrepareModelUploadResponse", "Primary", @@ -1315,6 +1433,11 @@ "SecretReference", "SecretTombstone", "Secrets", + "ServiceAccount", + "ServiceAccountPresetPermissions", + "ServiceAccountPresetPermissionsRequest", + "ServiceAccounts", + "SetLoopsCheckpointTtlRequest", "SetVolumeTagRequest", "SetVolumeTagResponse", "SignSSHCertificateRequest", @@ -1359,17 +1482,26 @@ "TeamId5", "TeamId6", "TeamId7", + "TeamId8", "TeamTrainingGpuCapacityItem", "Teams", "TerminateReplicaResponse", "Token", + "TokenExchangeRequest", + "TokenExchangeResponse", "ToolCallUsageBucket", "ToolCallUsageResponse", "Total", + "Total2", + "Total3", "TrafficRoutingRule", "TrafficRoutingRuleUpsert", "TrafficRoutingTarget", "TrafficRoutingTargetUpsert", + "TrainingBDNConfig", + "TrainingBDNConfigResponse", + "TrainingBDNMount", + "TrainingBDNMountResponse", "TrainingGpuCapacityItem", "TrainingItem", "TrainingJob", @@ -1384,6 +1516,8 @@ "TrainingUsage", "TrainingWeightAuth", "TrussUserEnv", + "TtlSeconds", + "UpdateAccessTrustRuleRequest", "UpdateAutoscalingScheduleSettings", "UpdateAutoscalingSettings", "UpdateAutoscalingSettingsResponse", @@ -1409,10 +1543,12 @@ "UpdateGridUserSettingsRequest", "UpdateGroupMetadata", "UpdateGroupRequest", + "UpdateIdentityProviderRequest", "UpdateLibraryListingRequest", "UpdateLibraryListingVersionRequest", "UpdateModelPromotionSettings", "UpdateModelRequest", + "UpdateOrganizationRequest", "UpdatePromotionSettings", "UpdateRequestBackpressureSettings", "UpdateRollingDeployConfig", @@ -1422,19 +1558,21 @@ "UpdateSandboxRequest", "UpdateSandboxVolumeParams", "UpdateSandboxVolumeRequest", + "UpdateServiceAccountRequest", "UpdateTrafficRoutingSettings", "UpdateTrainingJobRequest", "UpdateTrainingJobResponse", "UpsertGridConnectionBedrockAccessKeysAuth", "UpsertGridConnectionBedrockApiKeyAuth", "UpsertGridConnectionConfigAnthropic", + "UpsertGridConnectionConfigAzure", "UpsertGridConnectionConfigBedrock", "UpsertGridConnectionConfigOpenAI", "UpsertGridConnectionConfigVertex", "UpsertGridConnectionConfigXAI", "UpsertGridRouteTargetBasetenModelAPI", - "UpsertGridRouteTargetClassifier", "UpsertGridRouteTargetConnection", + "UpsertGridRouteTargetIntelligent", "UpsertSecretRequest", "UpsertTrainingProject", "UpsertTrainingProjectRequest", @@ -1447,6 +1585,10 @@ "ValidateLoopsCheckpointRequest", "ValidateLoopsCheckpointResponse", "Value", + "Verification", + "VerifyAccessTrustRuleRequest", + "VerifyIdentityProviderRequest", + "VerifyPredefinedIdentityProviderConfig", "VertexTargetConfig", "Volume", "VolumeSync", diff --git a/baseten/client/managementapi/_client.py b/baseten/client/managementapi/_client.py index 145cd1e..f757c3d 100644 --- a/baseten/client/managementapi/_client.py +++ b/baseten/client/managementapi/_client.py @@ -11,6 +11,8 @@ from pydantic import BaseModel from ._models import ( + AccessTrustRule, + AccessTrustRules, ActivateResponse, APIKey, APIKeys, @@ -25,6 +27,7 @@ ChainTombstone, CleanupImagesParams, CleanupSandboxImagesResponse, + CreateAccessTrustRuleRequest, CreateApiKeyForGroupRequest, CreateApiKeyForGroupResponse, CreateAPIKeyRequest, @@ -41,6 +44,7 @@ CreateGridRouteRequest, CreateGridTokenRequest, CreateGroupRequest, + CreateIdentityProviderRequest, CreateLibraryListingRequest, CreateLibraryListingVersionRequest, CreateLLMModelRequest, @@ -61,6 +65,7 @@ CreateSandboxRequest, CreateSandboxVolumeParams, CreateSandboxVolumeRequest, + CreateServiceAccountRequest, CreateTokenRequest, CreateTrainingJobRequest, CreateTrainingJobResponse, @@ -71,8 +76,12 @@ DeactivateLoopsRunResponse, DeactivateLoopsSamplerResponse, DeactivateResponse, + DeletedAccessTrustRule, + DeletedIdentityProvider, + DeletedServiceAccount, DeleteImageParams, DeleteImageTagParams, + DeleteLoopsRunResponse, DeleteSandboxParams, DeleteSandboxPreviewParams, DeleteSandboxPreviewTokenParams, @@ -87,6 +96,8 @@ DeployLoopsCheckpointResponse, Deployment, DeploymentConfigResponse, + DeploymentReplica, + DeploymentReplicas, Deployments, DeploymentTombstone, DownloadDeploymentResponse, @@ -102,6 +113,8 @@ ExploreMetadataResponse, GatewayEventsResponse, GatewayKeyInfo, + GetAccessIdentityProvidersParams, + GetAccessTrustRulesParams, GetApiKeysParams, GetAuditLogsParams, GetAuthCodesResponse, @@ -116,7 +129,6 @@ GetDeploymentPatchesStateResponse, GetExploreMetadataParams, GetGatewayEventsParams, - GetGridClassifiersParams, GetGridConnectionsParams, GetGridMachineUsersParams, GetGridRouteClassifiersParams, @@ -154,10 +166,12 @@ GetModelsDeploymentsLogsParams, GetModelsDeploymentsMetricsParams, GetModelsDeploymentsParams, + GetModelsDeploymentsReplicasParams, GetModelsDeploymentsStartupsParams, GetModelsDeploymentsStartupsSummaryParams, GetModelsEnvironmentsLogsParams, GetModelsEnvironmentsMetricsParams, + GetModelsEnvironmentsReplicasParams, GetModelsEnvironmentsStartupsParams, GetModelsEnvironmentsStartupsSummaryParams, GetModelsParams, @@ -167,6 +181,7 @@ GetSandboxParams, GetSandboxPreviewParams, GetSandboxVolumeParams, + GetServiceAccountsParams, GetTeamsLoopsRunsParams, GetTeamsLoopsSamplersParams, GetTeamsModelsParams, @@ -189,8 +204,6 @@ GetVolumesParams, GetVolumesSyncsParams, GetVolumesVersionsParams, - GridClassifier, - GridClassifiersResponse, GridConnection, GridConnectionsResponse, GridConnectionTombstone, @@ -209,6 +222,8 @@ GridToken, Group, GroupsResponse, + IdentityProvider, + IdentityProviders, InstanceTypePrices, InstanceTypes, KeysForGroupResponse, @@ -242,8 +257,10 @@ ListVolumesResponse, ListVolumeVersionsResponse, LLMModelHandle, + LoopsCheckpoint, LoopsCheckpointFilesResponse, LoopsCheckpointSourceResponse, + LoopsCheckpointTombstone, LoopsDebugArchiveFilesResponse, Model, ModelAPI, @@ -261,6 +278,7 @@ PatchTeamTrainingGpuCapacityResponse, PatchVolumeRequest, PatchVolumeResponse, + PredefinedIdentityProviders, PrepareModelUploadRequest, PrepareModelUploadResponse, PromoteRequest, @@ -290,6 +308,9 @@ Secret, Secrets, SecretTombstone, + ServiceAccount, + ServiceAccounts, + SetLoopsCheckpointTtlRequest, SetVolumeTagRequest, SetVolumeTagResponse, SignalPromotionResponse, @@ -305,9 +326,12 @@ Teams, TerminateReplicaResponse, Token, + TokenExchangeRequest, + TokenExchangeResponse, ToolCallUsageResponse, TrainingJobTombstone, TrainingProjectTombstone, + UpdateAccessTrustRuleRequest, UpdateAutoscalingSettings, UpdateAutoscalingSettingsResponse, UpdateChainEnvironmentRequest, @@ -326,9 +350,11 @@ UpdateGridTeamSettingsRequest, UpdateGridUserSettingsRequest, UpdateGroupRequest, + UpdateIdentityProviderRequest, UpdateLibraryListingRequest, UpdateLibraryListingVersionRequest, UpdateModelRequest, + UpdateOrganizationRequest, UpdateRequestBackpressureSettings, UpdateSandboxParams, UpdateSandboxPreviewParams, @@ -336,6 +362,7 @@ UpdateSandboxRequest, UpdateSandboxVolumeParams, UpdateSandboxVolumeRequest, + UpdateServiceAccountRequest, UpdateTrainingJobRequest, UpdateTrainingJobResponse, UpsertSecretRequest, @@ -346,6 +373,9 @@ UsersResponse, ValidateLoopsCheckpointRequest, ValidateLoopsCheckpointResponse, + Verification, + VerifyAccessTrustRuleRequest, + VerifyIdentityProviderRequest, Volume, VolumeSync, VolumeSyncs, @@ -513,6 +543,40 @@ def create_sandbox_volume( ), ) + def delete_access_identity_providers( + self, *, identity_provider_id: str + ) -> DeletedIdentityProvider: + """Deletes an identity provider""" + return self._do_json( + DeletedIdentityProvider, + _ApiRequest( + method="DELETE", + path_fmt="/v1/access/identity_providers/{}", + path_args=[identity_provider_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + def delete_access_trust_rules( + self, *, trust_rule_id: str + ) -> DeletedAccessTrustRule: + """Deletes a trust rule""" + return self._do_json( + DeletedAccessTrustRule, + _ApiRequest( + method="DELETE", + path_fmt="/v1/access/trust_rules/{}", + path_args=[trust_rule_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + def delete_api_keys(self, *, api_key_prefix: str) -> APIKeyTombstone: """Deletes an API key by prefix""" return self._do_json( @@ -711,6 +775,38 @@ def delete_library_listings_versions( ), ) + def delete_loops_checkpoints( + self, *, checkpoint_id: str + ) -> LoopsCheckpointTombstone: + """Deletes a Loops checkpoint""" + return self._do_json( + LoopsCheckpointTombstone, + _ApiRequest( + method="DELETE", + path_fmt="/v1/loops/checkpoints/{}", + path_args=[checkpoint_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + def delete_loops_runs(self, *, run_id: str) -> DeleteLoopsRunResponse: + """Deletes a Loops run""" + return self._do_json( + DeleteLoopsRunResponse, + _ApiRequest( + method="DELETE", + path_fmt="/v1/loops/runs/{}", + path_args=[run_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + def delete_models(self, *, model_id: str) -> ModelTombstone: """Deletes a model by ID""" return self._do_json( @@ -777,6 +873,23 @@ def delete_models_environments( ), ) + def delete_models_environments_replicas( + self, *, model_id: str, env_name: str, replica_id: str + ) -> TerminateReplicaResponse: + """Terminates a replica in an environment""" + return self._do_json( + TerminateReplicaResponse, + _ApiRequest( + method="DELETE", + path_fmt="/v1/models/{}/environments/{}/replicas/{}", + path_args=[model_id, env_name, replica_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + def delete_sandbox( self, *, sandbox_name: str, params: DeleteSandboxParams | None = None ) -> Sandbox: @@ -868,6 +981,23 @@ def delete_secrets(self, *, secret_name: str) -> SecretTombstone: ), ) + def delete_service_accounts( + self, *, service_account_id: str + ) -> DeletedServiceAccount: + """Deletes a service account""" + return self._do_json( + DeletedServiceAccount, + _ApiRequest( + method="DELETE", + path_fmt="/v1/service_accounts/{}", + path_args=[service_account_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + def delete_teams_secrets( self, *, team_id: str, secret_name: str ) -> SecretTombstone: @@ -980,6 +1110,89 @@ def delete_volumes_versions( ), ) + def get_access_identity_providers( + self, *, params: GetAccessIdentityProvidersParams | None = None + ) -> IdentityProviders: + """Lists identity providers""" + return self._do_json( + IdentityProviders, + _ApiRequest( + method="GET", + path_fmt="/v1/access/identity_providers", + path_args=[], + body=None, + query=params, + success_codes=[200], + error_codes=None, + ), + ) + + def get_access_identity_providers_identity_provider_id( + self, *, identity_provider_id: str + ) -> IdentityProvider: + """Gets an identity provider""" + return self._do_json( + IdentityProvider, + _ApiRequest( + method="GET", + path_fmt="/v1/access/identity_providers/{}", + path_args=[identity_provider_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + def get_access_predefined_identity_providers(self) -> PredefinedIdentityProviders: + """Lists predefined identity providers""" + return self._do_json( + PredefinedIdentityProviders, + _ApiRequest( + method="GET", + path_fmt="/v1/access/predefined_identity_providers", + path_args=[], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + def get_access_trust_rules( + self, *, params: GetAccessTrustRulesParams | None = None + ) -> AccessTrustRules: + """Lists trust rules""" + return self._do_json( + AccessTrustRules, + _ApiRequest( + method="GET", + path_fmt="/v1/access/trust_rules", + path_args=[], + body=None, + query=params, + success_codes=[200], + error_codes=None, + ), + ) + + def get_access_trust_rules_trust_rule_id( + self, *, trust_rule_id: str + ) -> AccessTrustRule: + """Gets a trust rule""" + return self._do_json( + AccessTrustRule, + _ApiRequest( + method="GET", + path_fmt="/v1/access/trust_rules/{}", + path_args=[trust_rule_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + def get_api_keys(self, *, params: GetApiKeysParams | None = None) -> APIKeys: """Lists API keys (metadata only, no plain text keys)""" return self._do_json( @@ -1382,40 +1595,6 @@ def get_gateway_groups_group_id(self, *, group_id: str) -> Group: ), ) - def get_grid_classifiers( - self, *, params: GetGridClassifiersParams | None = None - ) -> GridClassifiersResponse: - """Lists classifiers available for intelligent routes""" - return self._do_json( - GridClassifiersResponse, - _ApiRequest( - method="GET", - path_fmt="/v1/grid/classifiers", - path_args=[], - body=None, - query=params, - success_codes=[200], - error_codes=None, - ), - ) - - def get_grid_classifiers_classifier_id( - self, *, classifier_id: str - ) -> GridClassifier: - """Gets a classifier available for intelligent routes""" - return self._do_json( - GridClassifier, - _ApiRequest( - method="GET", - path_fmt="/v1/grid/classifiers/{}", - path_args=[classifier_id], - body=None, - query=None, - success_codes=[200], - error_codes=None, - ), - ) - def get_grid_connections( self, *, params: GetGridConnectionsParams | None = None ) -> GridConnectionsResponse: @@ -2268,6 +2447,44 @@ def get_models_deployments_production(self, *, model_id: str) -> Deployment: ), ) + def get_models_deployments_replicas( + self, + *, + model_id: str, + deployment_id: str, + params: GetModelsDeploymentsReplicasParams | None = None, + ) -> DeploymentReplicas: + """Lists replicas for a deployment""" + return self._do_json( + DeploymentReplicas, + _ApiRequest( + method="GET", + path_fmt="/v1/models/{}/deployments/{}/replicas", + path_args=[model_id, deployment_id], + body=None, + query=params, + success_codes=[200], + error_codes=None, + ), + ) + + def get_models_deployments_replicas_replica_id( + self, *, model_id: str, deployment_id: str, replica_id: str + ) -> DeploymentReplica: + """Gets a replica in a deployment""" + return self._do_json( + DeploymentReplica, + _ApiRequest( + method="GET", + path_fmt="/v1/models/{}/deployments/{}/replicas/{}", + path_args=[model_id, deployment_id, replica_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + def get_models_deployments_startups( self, *, @@ -2384,6 +2601,44 @@ def get_models_environments_metrics( ), ) + def get_models_environments_replicas( + self, + *, + model_id: str, + env_name: str, + params: GetModelsEnvironmentsReplicasParams | None = None, + ) -> DeploymentReplicas: + """Lists replicas for an environment""" + return self._do_json( + DeploymentReplicas, + _ApiRequest( + method="GET", + path_fmt="/v1/models/{}/environments/{}/replicas", + path_args=[model_id, env_name], + body=None, + query=params, + success_codes=[200], + error_codes=None, + ), + ) + + def get_models_environments_replicas_replica_id( + self, *, model_id: str, env_name: str, replica_id: str + ) -> DeploymentReplica: + """Gets a replica in an environment""" + return self._do_json( + DeploymentReplica, + _ApiRequest( + method="GET", + path_fmt="/v1/models/{}/environments/{}/replicas/{}", + path_args=[model_id, env_name, replica_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + def get_models_environments_startups( self, *, @@ -2590,6 +2845,40 @@ def get_secrets(self) -> Secrets: ), ) + def get_service_accounts( + self, *, params: GetServiceAccountsParams | None = None + ) -> ServiceAccounts: + """Lists service accounts""" + return self._do_json( + ServiceAccounts, + _ApiRequest( + method="GET", + path_fmt="/v1/service_accounts", + path_args=[], + body=None, + query=params, + success_codes=[200], + error_codes=None, + ), + ) + + def get_service_accounts_service_account_id( + self, *, service_account_id: str + ) -> ServiceAccount: + """Gets a service account""" + return self._do_json( + ServiceAccount, + _ApiRequest( + method="GET", + path_fmt="/v1/service_accounts/{}", + path_args=[service_account_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + def get_teams(self, *, params: GetTeamsParams | None = None) -> Teams: """Lists all teams""" return self._do_json( @@ -3249,6 +3538,40 @@ def list_sandboxes( ), ) + def patch_access_identity_providers( + self, *, identity_provider_id: str, request: UpdateIdentityProviderRequest + ) -> IdentityProvider: + """Updates an identity provider""" + return self._do_json( + IdentityProvider, + _ApiRequest( + method="PATCH", + path_fmt="/v1/access/identity_providers/{}", + path_args=[identity_provider_id], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + def patch_access_trust_rules( + self, *, trust_rule_id: str, request: UpdateAccessTrustRuleRequest + ) -> AccessTrustRule: + """Updates a trust rule""" + return self._do_json( + AccessTrustRule, + _ApiRequest( + method="PATCH", + path_fmt="/v1/access/trust_rules/{}", + path_args=[trust_rule_id], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + def patch_chains_environments( self, *, chain_id: str, env_name: str, request: UpdateChainEnvironmentRequest ) -> UpdateChainEnvironmentResponse: @@ -3599,6 +3922,40 @@ def patch_models_environments( ), ) + def patch_organizations_me( + self, *, request: UpdateOrganizationRequest + ) -> OrganizationInfo: + """Updates the authenticated organization""" + return self._do_json( + OrganizationInfo, + _ApiRequest( + method="PATCH", + path_fmt="/v1/organizations/me", + path_args=[], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + def patch_service_accounts( + self, *, service_account_id: str, request: UpdateServiceAccountRequest + ) -> ServiceAccount: + """Updates a service account""" + return self._do_json( + ServiceAccount, + _ApiRequest( + method="PATCH", + path_fmt="/v1/service_accounts/{}", + path_args=[service_account_id], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + def patch_teams_environment_groups( self, *, team_id: str, env_name: str, request: UpdateEnvironmentGroupRequest ) -> EnvironmentGroup: @@ -3619,7 +3976,7 @@ def patch_teams_environment_groups( def patch_training_capacity( self, *, request: PatchTeamTrainingGpuCapacityRequest ) -> PatchTeamTrainingGpuCapacityResponse: - """Sets a team's training GPU capacity""" + """Sets a team's training GPU quota""" return self._do_json( PatchTeamTrainingGpuCapacityResponse, _ApiRequest( @@ -3693,6 +4050,74 @@ def patch_volumes( ), ) + def post_access_identity_providers( + self, *, request: CreateIdentityProviderRequest + ) -> IdentityProvider: + """Adds an identity provider""" + return self._do_json( + IdentityProvider, + _ApiRequest( + method="POST", + path_fmt="/v1/access/identity_providers", + path_args=[], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + def post_access_identity_providers_verify( + self, *, request: VerifyIdentityProviderRequest + ) -> Verification: + """Checks an identity provider before adding it""" + return self._do_json( + Verification, + _ApiRequest( + method="POST", + path_fmt="/v1/access/identity_providers/verify", + path_args=[], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + def post_access_trust_rules( + self, *, request: CreateAccessTrustRuleRequest + ) -> AccessTrustRule: + """Creates a trust rule""" + return self._do_json( + AccessTrustRule, + _ApiRequest( + method="POST", + path_fmt="/v1/access/trust_rules", + path_args=[], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + def post_access_trust_rules_verify( + self, *, request: VerifyAccessTrustRuleRequest + ) -> Verification: + """Checks a trust rule's condition and audience""" + return self._do_json( + Verification, + _ApiRequest( + method="POST", + path_fmt="/v1/access/trust_rules/verify", + path_args=[], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + def post_api_keys(self, *, request: CreateAPIKeyRequest) -> APIKey: """Creates an API key""" return self._do_json( @@ -3708,6 +4133,23 @@ def post_api_keys(self, *, request: CreateAPIKeyRequest) -> APIKey: ), ) + def post_auth_token( + self, *, request: TokenExchangeRequest + ) -> TokenExchangeResponse: + """Exchanges an identity provider's JWT for an access token""" + return self._do_json( + TokenExchangeResponse, + _ApiRequest( + method="POST", + path_fmt="/v1/auth/token", + path_args=[], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + def post_chains_deployments_deactivate( self, *, chain_id: str, chain_deployment_id: str ) -> DeactivateResponse: @@ -4640,6 +5082,23 @@ def post_secrets(self, *, request: UpsertSecretRequest) -> Secret: ), ) + def post_service_accounts( + self, *, request: CreateServiceAccountRequest + ) -> ServiceAccount: + """Creates a service account""" + return self._do_json( + ServiceAccount, + _ApiRequest( + method="POST", + path_fmt="/v1/service_accounts", + path_args=[], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + def post_teams_api_keys( self, *, team_id: str, request: CreateAPIKeyRequest ) -> APIKey: @@ -5061,6 +5520,23 @@ def push_image( ), ) + def put_loops_checkpoints_ttl( + self, *, checkpoint_id: str, request: SetLoopsCheckpointTtlRequest + ) -> LoopsCheckpoint: + """Sets a Loops checkpoint's TTL""" + return self._do_json( + LoopsCheckpoint, + _ApiRequest( + method="PUT", + path_fmt="/v1/loops/checkpoints/{}/ttl", + path_args=[checkpoint_id], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + def update_sandbox( self, *, @@ -5335,6 +5811,40 @@ async def create_sandbox_volume( ), ) + async def delete_access_identity_providers( + self, *, identity_provider_id: str + ) -> DeletedIdentityProvider: + """Deletes an identity provider""" + return await self._do_json( + DeletedIdentityProvider, + _ApiRequest( + method="DELETE", + path_fmt="/v1/access/identity_providers/{}", + path_args=[identity_provider_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + async def delete_access_trust_rules( + self, *, trust_rule_id: str + ) -> DeletedAccessTrustRule: + """Deletes a trust rule""" + return await self._do_json( + DeletedAccessTrustRule, + _ApiRequest( + method="DELETE", + path_fmt="/v1/access/trust_rules/{}", + path_args=[trust_rule_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + async def delete_api_keys(self, *, api_key_prefix: str) -> APIKeyTombstone: """Deletes an API key by prefix""" return await self._do_json( @@ -5535,6 +6045,38 @@ async def delete_library_listings_versions( ), ) + async def delete_loops_checkpoints( + self, *, checkpoint_id: str + ) -> LoopsCheckpointTombstone: + """Deletes a Loops checkpoint""" + return await self._do_json( + LoopsCheckpointTombstone, + _ApiRequest( + method="DELETE", + path_fmt="/v1/loops/checkpoints/{}", + path_args=[checkpoint_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + async def delete_loops_runs(self, *, run_id: str) -> DeleteLoopsRunResponse: + """Deletes a Loops run""" + return await self._do_json( + DeleteLoopsRunResponse, + _ApiRequest( + method="DELETE", + path_fmt="/v1/loops/runs/{}", + path_args=[run_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + async def delete_models(self, *, model_id: str) -> ModelTombstone: """Deletes a model by ID""" return await self._do_json( @@ -5601,6 +6143,23 @@ async def delete_models_environments( ), ) + async def delete_models_environments_replicas( + self, *, model_id: str, env_name: str, replica_id: str + ) -> TerminateReplicaResponse: + """Terminates a replica in an environment""" + return await self._do_json( + TerminateReplicaResponse, + _ApiRequest( + method="DELETE", + path_fmt="/v1/models/{}/environments/{}/replicas/{}", + path_args=[model_id, env_name, replica_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + async def delete_sandbox( self, *, sandbox_name: str, params: DeleteSandboxParams | None = None ) -> Sandbox: @@ -5692,6 +6251,23 @@ async def delete_secrets(self, *, secret_name: str) -> SecretTombstone: ), ) + async def delete_service_accounts( + self, *, service_account_id: str + ) -> DeletedServiceAccount: + """Deletes a service account""" + return await self._do_json( + DeletedServiceAccount, + _ApiRequest( + method="DELETE", + path_fmt="/v1/service_accounts/{}", + path_args=[service_account_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + async def delete_teams_secrets( self, *, team_id: str, secret_name: str ) -> SecretTombstone: @@ -5750,54 +6326,139 @@ async def delete_volumes( return await self._do_json( DeleteVolumeResponse, _ApiRequest( - method="DELETE", - path_fmt="/v1/volumes/{}/{}", - path_args=[volume_namespace, volume_name], - body=request, + method="DELETE", + path_fmt="/v1/volumes/{}/{}", + path_args=[volume_namespace, volume_name], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + async def delete_volumes_tags( + self, + *, + volume_namespace: str, + volume_name: str, + volume_tag: str, + request: DeleteVolumeTagRequest, + ) -> DeleteVolumeTagResponse: + """Deletes a volume tag""" + return await self._do_json( + DeleteVolumeTagResponse, + _ApiRequest( + method="DELETE", + path_fmt="/v1/volumes/{}/{}/tags/{}", + path_args=[volume_namespace, volume_name, volume_tag], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + async def delete_volumes_versions( + self, + *, + volume_namespace: str, + volume_name: str, + volume_version: str, + request: DeleteVolumeVersionRequest, + ) -> DeleteVolumeVersionResponse: + """Deletes one version of a volume""" + return await self._do_json( + DeleteVolumeVersionResponse, + _ApiRequest( + method="DELETE", + path_fmt="/v1/volumes/{}/{}/versions/{}", + path_args=[volume_namespace, volume_name, volume_version], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + async def get_access_identity_providers( + self, *, params: GetAccessIdentityProvidersParams | None = None + ) -> IdentityProviders: + """Lists identity providers""" + return await self._do_json( + IdentityProviders, + _ApiRequest( + method="GET", + path_fmt="/v1/access/identity_providers", + path_args=[], + body=None, + query=params, + success_codes=[200], + error_codes=None, + ), + ) + + async def get_access_identity_providers_identity_provider_id( + self, *, identity_provider_id: str + ) -> IdentityProvider: + """Gets an identity provider""" + return await self._do_json( + IdentityProvider, + _ApiRequest( + method="GET", + path_fmt="/v1/access/identity_providers/{}", + path_args=[identity_provider_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + async def get_access_predefined_identity_providers( + self, + ) -> PredefinedIdentityProviders: + """Lists predefined identity providers""" + return await self._do_json( + PredefinedIdentityProviders, + _ApiRequest( + method="GET", + path_fmt="/v1/access/predefined_identity_providers", + path_args=[], + body=None, query=None, success_codes=[200], error_codes=None, ), ) - async def delete_volumes_tags( - self, - *, - volume_namespace: str, - volume_name: str, - volume_tag: str, - request: DeleteVolumeTagRequest, - ) -> DeleteVolumeTagResponse: - """Deletes a volume tag""" + async def get_access_trust_rules( + self, *, params: GetAccessTrustRulesParams | None = None + ) -> AccessTrustRules: + """Lists trust rules""" return await self._do_json( - DeleteVolumeTagResponse, + AccessTrustRules, _ApiRequest( - method="DELETE", - path_fmt="/v1/volumes/{}/{}/tags/{}", - path_args=[volume_namespace, volume_name, volume_tag], - body=request, - query=None, + method="GET", + path_fmt="/v1/access/trust_rules", + path_args=[], + body=None, + query=params, success_codes=[200], error_codes=None, ), ) - async def delete_volumes_versions( - self, - *, - volume_namespace: str, - volume_name: str, - volume_version: str, - request: DeleteVolumeVersionRequest, - ) -> DeleteVolumeVersionResponse: - """Deletes one version of a volume""" + async def get_access_trust_rules_trust_rule_id( + self, *, trust_rule_id: str + ) -> AccessTrustRule: + """Gets a trust rule""" return await self._do_json( - DeleteVolumeVersionResponse, + AccessTrustRule, _ApiRequest( - method="DELETE", - path_fmt="/v1/volumes/{}/{}/versions/{}", - path_args=[volume_namespace, volume_name, volume_version], - body=request, + method="GET", + path_fmt="/v1/access/trust_rules/{}", + path_args=[trust_rule_id], + body=None, query=None, success_codes=[200], error_codes=None, @@ -6210,40 +6871,6 @@ async def get_gateway_groups_group_id(self, *, group_id: str) -> Group: ), ) - async def get_grid_classifiers( - self, *, params: GetGridClassifiersParams | None = None - ) -> GridClassifiersResponse: - """Lists classifiers available for intelligent routes""" - return await self._do_json( - GridClassifiersResponse, - _ApiRequest( - method="GET", - path_fmt="/v1/grid/classifiers", - path_args=[], - body=None, - query=params, - success_codes=[200], - error_codes=None, - ), - ) - - async def get_grid_classifiers_classifier_id( - self, *, classifier_id: str - ) -> GridClassifier: - """Gets a classifier available for intelligent routes""" - return await self._do_json( - GridClassifier, - _ApiRequest( - method="GET", - path_fmt="/v1/grid/classifiers/{}", - path_args=[classifier_id], - body=None, - query=None, - success_codes=[200], - error_codes=None, - ), - ) - async def get_grid_connections( self, *, params: GetGridConnectionsParams | None = None ) -> GridConnectionsResponse: @@ -7096,6 +7723,44 @@ async def get_models_deployments_production(self, *, model_id: str) -> Deploymen ), ) + async def get_models_deployments_replicas( + self, + *, + model_id: str, + deployment_id: str, + params: GetModelsDeploymentsReplicasParams | None = None, + ) -> DeploymentReplicas: + """Lists replicas for a deployment""" + return await self._do_json( + DeploymentReplicas, + _ApiRequest( + method="GET", + path_fmt="/v1/models/{}/deployments/{}/replicas", + path_args=[model_id, deployment_id], + body=None, + query=params, + success_codes=[200], + error_codes=None, + ), + ) + + async def get_models_deployments_replicas_replica_id( + self, *, model_id: str, deployment_id: str, replica_id: str + ) -> DeploymentReplica: + """Gets a replica in a deployment""" + return await self._do_json( + DeploymentReplica, + _ApiRequest( + method="GET", + path_fmt="/v1/models/{}/deployments/{}/replicas/{}", + path_args=[model_id, deployment_id, replica_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + async def get_models_deployments_startups( self, *, @@ -7212,6 +7877,44 @@ async def get_models_environments_metrics( ), ) + async def get_models_environments_replicas( + self, + *, + model_id: str, + env_name: str, + params: GetModelsEnvironmentsReplicasParams | None = None, + ) -> DeploymentReplicas: + """Lists replicas for an environment""" + return await self._do_json( + DeploymentReplicas, + _ApiRequest( + method="GET", + path_fmt="/v1/models/{}/environments/{}/replicas", + path_args=[model_id, env_name], + body=None, + query=params, + success_codes=[200], + error_codes=None, + ), + ) + + async def get_models_environments_replicas_replica_id( + self, *, model_id: str, env_name: str, replica_id: str + ) -> DeploymentReplica: + """Gets a replica in an environment""" + return await self._do_json( + DeploymentReplica, + _ApiRequest( + method="GET", + path_fmt="/v1/models/{}/environments/{}/replicas/{}", + path_args=[model_id, env_name, replica_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + async def get_models_environments_startups( self, *, @@ -7418,6 +8121,40 @@ async def get_secrets(self) -> Secrets: ), ) + async def get_service_accounts( + self, *, params: GetServiceAccountsParams | None = None + ) -> ServiceAccounts: + """Lists service accounts""" + return await self._do_json( + ServiceAccounts, + _ApiRequest( + method="GET", + path_fmt="/v1/service_accounts", + path_args=[], + body=None, + query=params, + success_codes=[200], + error_codes=None, + ), + ) + + async def get_service_accounts_service_account_id( + self, *, service_account_id: str + ) -> ServiceAccount: + """Gets a service account""" + return await self._do_json( + ServiceAccount, + _ApiRequest( + method="GET", + path_fmt="/v1/service_accounts/{}", + path_args=[service_account_id], + body=None, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + async def get_teams(self, *, params: GetTeamsParams | None = None) -> Teams: """Lists all teams""" return await self._do_json( @@ -8079,6 +8816,40 @@ async def list_sandboxes( ), ) + async def patch_access_identity_providers( + self, *, identity_provider_id: str, request: UpdateIdentityProviderRequest + ) -> IdentityProvider: + """Updates an identity provider""" + return await self._do_json( + IdentityProvider, + _ApiRequest( + method="PATCH", + path_fmt="/v1/access/identity_providers/{}", + path_args=[identity_provider_id], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + async def patch_access_trust_rules( + self, *, trust_rule_id: str, request: UpdateAccessTrustRuleRequest + ) -> AccessTrustRule: + """Updates a trust rule""" + return await self._do_json( + AccessTrustRule, + _ApiRequest( + method="PATCH", + path_fmt="/v1/access/trust_rules/{}", + path_args=[trust_rule_id], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + async def patch_chains_environments( self, *, chain_id: str, env_name: str, request: UpdateChainEnvironmentRequest ) -> UpdateChainEnvironmentResponse: @@ -8431,6 +9202,40 @@ async def patch_models_environments( ), ) + async def patch_organizations_me( + self, *, request: UpdateOrganizationRequest + ) -> OrganizationInfo: + """Updates the authenticated organization""" + return await self._do_json( + OrganizationInfo, + _ApiRequest( + method="PATCH", + path_fmt="/v1/organizations/me", + path_args=[], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + async def patch_service_accounts( + self, *, service_account_id: str, request: UpdateServiceAccountRequest + ) -> ServiceAccount: + """Updates a service account""" + return await self._do_json( + ServiceAccount, + _ApiRequest( + method="PATCH", + path_fmt="/v1/service_accounts/{}", + path_args=[service_account_id], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + async def patch_teams_environment_groups( self, *, team_id: str, env_name: str, request: UpdateEnvironmentGroupRequest ) -> EnvironmentGroup: @@ -8451,7 +9256,7 @@ async def patch_teams_environment_groups( async def patch_training_capacity( self, *, request: PatchTeamTrainingGpuCapacityRequest ) -> PatchTeamTrainingGpuCapacityResponse: - """Sets a team's training GPU capacity""" + """Sets a team's training GPU quota""" return await self._do_json( PatchTeamTrainingGpuCapacityResponse, _ApiRequest( @@ -8525,6 +9330,74 @@ async def patch_volumes( ), ) + async def post_access_identity_providers( + self, *, request: CreateIdentityProviderRequest + ) -> IdentityProvider: + """Adds an identity provider""" + return await self._do_json( + IdentityProvider, + _ApiRequest( + method="POST", + path_fmt="/v1/access/identity_providers", + path_args=[], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + async def post_access_identity_providers_verify( + self, *, request: VerifyIdentityProviderRequest + ) -> Verification: + """Checks an identity provider before adding it""" + return await self._do_json( + Verification, + _ApiRequest( + method="POST", + path_fmt="/v1/access/identity_providers/verify", + path_args=[], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + async def post_access_trust_rules( + self, *, request: CreateAccessTrustRuleRequest + ) -> AccessTrustRule: + """Creates a trust rule""" + return await self._do_json( + AccessTrustRule, + _ApiRequest( + method="POST", + path_fmt="/v1/access/trust_rules", + path_args=[], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + + async def post_access_trust_rules_verify( + self, *, request: VerifyAccessTrustRuleRequest + ) -> Verification: + """Checks a trust rule's condition and audience""" + return await self._do_json( + Verification, + _ApiRequest( + method="POST", + path_fmt="/v1/access/trust_rules/verify", + path_args=[], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + async def post_api_keys(self, *, request: CreateAPIKeyRequest) -> APIKey: """Creates an API key""" return await self._do_json( @@ -8540,6 +9413,23 @@ async def post_api_keys(self, *, request: CreateAPIKeyRequest) -> APIKey: ), ) + async def post_auth_token( + self, *, request: TokenExchangeRequest + ) -> TokenExchangeResponse: + """Exchanges an identity provider's JWT for an access token""" + return await self._do_json( + TokenExchangeResponse, + _ApiRequest( + method="POST", + path_fmt="/v1/auth/token", + path_args=[], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + async def post_chains_deployments_deactivate( self, *, chain_id: str, chain_deployment_id: str ) -> DeactivateResponse: @@ -9480,6 +10370,23 @@ async def post_secrets(self, *, request: UpsertSecretRequest) -> Secret: ), ) + async def post_service_accounts( + self, *, request: CreateServiceAccountRequest + ) -> ServiceAccount: + """Creates a service account""" + return await self._do_json( + ServiceAccount, + _ApiRequest( + method="POST", + path_fmt="/v1/service_accounts", + path_args=[], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + async def post_teams_api_keys( self, *, team_id: str, request: CreateAPIKeyRequest ) -> APIKey: @@ -9905,6 +10812,23 @@ async def push_image( ), ) + async def put_loops_checkpoints_ttl( + self, *, checkpoint_id: str, request: SetLoopsCheckpointTtlRequest + ) -> LoopsCheckpoint: + """Sets a Loops checkpoint's TTL""" + return await self._do_json( + LoopsCheckpoint, + _ApiRequest( + method="PUT", + path_fmt="/v1/loops/checkpoints/{}/ttl", + path_args=[checkpoint_id], + body=request, + query=None, + success_codes=[200], + error_codes=None, + ), + ) + async def update_sandbox( self, *, diff --git a/baseten/client/managementapi/_models.py b/baseten/client/managementapi/_models.py index b5f378f..53b2707 100644 --- a/baseten/client/managementapi/_models.py +++ b/baseten/client/managementapi/_models.py @@ -828,6 +828,111 @@ class GetUsersParams(BaseModel): ] = None +class Name1(RootModel[str]): + root: Annotated[ + str | None, + Field( + description="Only the account with this name, ignoring case", + min_length=1, + title="Name", + ), + ] = None + + +class GetServiceAccountsParams(BaseModel): + cursor: Annotated[ + str | None, + Field( + description="Opaque cursor returned by a previous page. Omit to fetch the first page.", + title="Cursor", + ), + ] = None + limit: Annotated[ + int, + Field( + description="Maximum number of items to return.", + ge=1, + le=1000, + title="Limit", + ), + ] = 100 + name: Annotated[ + Name1 | None, + Field( + description="Only the account with this name, ignoring case", title="Name" + ), + ] = None + team_id: Annotated[ + str | None, Field(description="Only this team's accounts", title="Team Id") + ] = None + disabled: Annotated[ + bool | None, + Field(description="Only disabled or enabled accounts", title="Disabled"), + ] = None + + +class Name2(RootModel[str]): + root: Annotated[ + str | None, + Field( + description="Only the provider with this name, ignoring case", + min_length=1, + title="Name", + ), + ] = None + + +class Name3(RootModel[str]): + root: Annotated[ + str | None, + Field( + description="Only the rule with this name, ignoring case", + min_length=1, + title="Name", + ), + ] = None + + +class GetAccessTrustRulesParams(BaseModel): + cursor: Annotated[ + str | None, + Field( + description="Opaque cursor returned by a previous page. Omit to fetch the first page.", + title="Cursor", + ), + ] = None + limit: Annotated[ + int, + Field( + description="Maximum number of items to return.", + ge=1, + le=1000, + title="Limit", + ), + ] = 100 + name: Annotated[ + Name3 | None, + Field(description="Only the rule with this name, ignoring case", title="Name"), + ] = None + identity_provider_id: Annotated[ + str | None, + Field(description="Only this provider's rules", title="Identity Provider Id"), + ] = None + service_account_id: Annotated[ + str | None, + Field( + description="Only rules for this service account", + title="Service Account Id", + ), + ] = None + team_id: Annotated[ + str | None, + Field( + description="Only rules for this team's service accounts", title="Team Id" + ), + ] = None + + class Limit6(RootModel[int]): root: Annotated[ int | None, @@ -949,7 +1054,7 @@ class GetGridRoutesParams(BaseModel): name: Annotated[ str | None, Field( - description="Filter by exact route name. Preserved by the cursor; if repeated, must match the original filter.", + description="Filter by exact route name, the value to send in the inference request's `model` field. Matches a route's name or any of its aliases. Preserved by the cursor; if repeated, must match the original filter.", title="Name", ), ] = None @@ -1066,25 +1171,6 @@ class GetGridConnectionsParams(BaseModel): ] = None -class GetGridClassifiersParams(BaseModel): - cursor: Annotated[ - str | None, - Field( - description="Opaque cursor returned by a previous page. Omit to fetch the first page.", - title="Cursor", - ), - ] = None - limit: Annotated[ - int, - Field( - description="Maximum number of items to return.", - ge=1, - le=1000, - title="Limit", - ), - ] = 100 - - class GetGridRouteClassifiersParams(BaseModel): cursor: Annotated[ str | None, @@ -3329,9 +3415,21 @@ class PrepareModelUploadResponse(BaseModel): ] = None +class AuditFieldChange(BaseModel): + old: Annotated[Any, Field(description="The value before the update.", title="Old")] + new: Annotated[Any, Field(description="The value after the update.", title="New")] + + class AuditLogActor(BaseModel): type: Annotated[ - Literal["USER", "API_KEY", "BASETEN_USER", "BASETEN_SYSTEM", "TOMBSTONE_USER"] + Literal[ + "USER", + "API_KEY", + "BASETEN_USER", + "BASETEN_SYSTEM", + "TOMBSTONE_USER", + "SERVICE_ACCOUNT", + ] | str, Field( description="Kind of actor that performed the action.", @@ -3359,6 +3457,27 @@ class AuditLogActor(BaseModel): title="Api Key Name", ), ] = None + service_account_id: Annotated[ + str | None, + Field( + description="ID of the acting service account, when the actor is a service account.", + title="Service Account Id", + ), + ] = None + service_account_name: Annotated[ + str | None, + Field( + description="Current name of the acting service account, when the actor is a service account.", + title="Service Account Name", + ), + ] = None + trust_rule_id: Annotated[ + str | None, + Field( + description="ID of the trust rule the acting workload identity federation token was exchanged through, when the actor is a service account.", + title="Trust Rule Id", + ), + ] = None class AuditLogEventApiKeyCreated(BaseModel): @@ -3370,6 +3489,7 @@ class AuditLogEventApiKeyCreated(BaseModel): "CREATOR_SERVICE_ACCOUNT", "MANAGE_API_KEYS_SERVICE_ACCOUNT", "INVOKE_ALL_MODELS_SERVICE_ACCOUNT", + "INVOKE_ALL_DEDICATED_MODELS_SERVICE_ACCOUNT", "INVOKE_ALLOWED_MODELS_SERVICE_ACCOUNT", "INVOKE_SCOPED_ENVS_AND_MODELS_SERVICE_ACCOUNT", "EXPORT_METRICS_ALL_MODELS_SERVICE_ACCOUNT", @@ -3396,6 +3516,7 @@ class AuditLogEventApiKeyDeleted(BaseModel): "CREATOR_SERVICE_ACCOUNT", "MANAGE_API_KEYS_SERVICE_ACCOUNT", "INVOKE_ALL_MODELS_SERVICE_ACCOUNT", + "INVOKE_ALL_DEDICATED_MODELS_SERVICE_ACCOUNT", "INVOKE_ALLOWED_MODELS_SERVICE_ACCOUNT", "INVOKE_SCOPED_ENVS_AND_MODELS_SERVICE_ACCOUNT", "EXPORT_METRICS_ALL_MODELS_SERVICE_ACCOUNT", @@ -3411,7 +3532,7 @@ class AuditLogEventApiKeyDeleted(BaseModel): ), ] prefix: Annotated[str, Field(title="Prefix")] - revocation_reason: Literal["INACTIVITY"] | str | None = None + revocation_reason: Literal["INACTIVITY", "CREDENTIAL_EXPOSURE"] | str | None = None class AuditLogEventApiKeyLifetimeLimitsUpdated(BaseModel): @@ -3810,6 +3931,29 @@ class AuditLogEventGridMachineUserUpdated(BaseModel): team_name: Annotated[str, Field(title="Team Name")] +class AuditLogEventIdentityProviderDeleted(BaseModel): + event_type: Annotated[ + Literal["IDENTITY_PROVIDER_DELETED"], Field(title="Event Type") + ] + identity_provider_id: Annotated[str, Field(title="Identity Provider Id")] + name: Annotated[str, Field(title="Name")] + + +class AuditLogEventIdentityProviderUpdated(BaseModel): + event_type: Annotated[ + Literal["IDENTITY_PROVIDER_UPDATED"], Field(title="Event Type") + ] + identity_provider_id: Annotated[str, Field(title="Identity Provider Id")] + name: Annotated[str, Field(title="Name")] + changes: Annotated[ + dict[str, AuditFieldChange], + Field( + description="The fields the update changed, keyed by field name.", + title="Changes", + ), + ] + + class AuditLogEventModelDeleted(BaseModel): event_type: Annotated[Literal["MODEL_DELETED"], Field(title="Event Type")] model_id: Annotated[str, Field(title="Model Id")] @@ -3888,6 +4032,41 @@ class AuditLogEventModelRenamed(BaseModel): previous_name: Annotated[str | None, Field(title="Previous Name")] +class AuditLogEventOrganizationApiKeySettingsUpdated(BaseModel): + event_type: Annotated[ + Literal["ORGANIZATION_API_KEY_SETTINGS_UPDATED"], Field(title="Event Type") + ] + organization_id: Annotated[str, Field(title="Organization Id")] + previous_allow_personal_api_keys: Annotated[ + bool, Field(title="Previous Allow Personal Api Keys") + ] + new_allow_personal_api_keys: Annotated[ + bool, Field(title="New Allow Personal Api Keys") + ] + previous_allow_service_account_api_keys: Annotated[ + bool, Field(title="Previous Allow Service Account Api Keys") + ] + new_allow_service_account_api_keys: Annotated[ + bool, Field(title="New Allow Service Account Api Keys") + ] + + +class AuditLogEventPredefinedIdentityProviderConfig(BaseModel): + kind: Annotated[ + str, + Field( + description="Which predefined provider, for example `AWS_EKS`.", + title="Kind", + ), + ] + issuer_url: Annotated[ + str, + Field( + description="The `iss` claim of the provider's tokens.", title="Issuer Url" + ), + ] + + class AuditLogEventPromotionSettingsOverride(BaseModel): redeploy_on_promotion: Annotated[bool | None, Field(title="Redeploy On Promotion")] rolling_deploy: Annotated[bool | None, Field(title="Rolling Deploy")] @@ -3968,6 +4147,56 @@ class AuditLogEventSecretUpdated(BaseModel): secret_name: Annotated[str, Field(title="Secret Name")] +class AuditLogEventServiceAccountDeleted(BaseModel): + event_type: Annotated[Literal["SERVICE_ACCOUNT_DELETED"], Field(title="Event Type")] + service_account_id: Annotated[str, Field(title="Service Account Id")] + name: Annotated[str, Field(title="Name")] + + +class AuditLogEventServiceAccountPresetPermissions(BaseModel): + api_key_type: Annotated[ + str, + Field( + description="The API key type whose permissions the account has, as API key events record it.", + title="Api Key Type", + ), + ] + model_ids: Annotated[ + list[str], + Field( + description="Models the access is limited to; empty for all.", + title="Model Ids", + ), + ] + environment_names: Annotated[ + list[str], + Field( + description="Environments the access is limited to, or may also manage; empty for none.", + title="Environment Names", + ), + ] + model_api_slugs: Annotated[ + list[str], + Field( + description="Model APIs the access is limited to; empty for all.", + title="Model Api Slugs", + ), + ] + + +class AuditLogEventServiceAccountUpdated(BaseModel): + event_type: Annotated[Literal["SERVICE_ACCOUNT_UPDATED"], Field(title="Event Type")] + service_account_id: Annotated[str, Field(title="Service Account Id")] + name: Annotated[str, Field(title="Name")] + changes: Annotated[ + dict[str, AuditFieldChange], + Field( + description="The fields the update changed, keyed by field name.", + title="Changes", + ), + ] + + class AuditLogEventSshCertificateSigned(BaseModel): event_type: Annotated[Literal["SSH_CERTIFICATE_SIGNED"], Field(title="Event Type")] workload_type: Annotated[str, Field(title="Workload Type")] @@ -4007,6 +4236,57 @@ class AuditLogEventTelemetryExportUpdated(BaseModel): enabled: Annotated[bool | None, Field(title="Enabled")] +class AuditLogEventTrustRuleCreated(BaseModel): + event_type: Annotated[Literal["TRUST_RULE_CREATED"], Field(title="Event Type")] + trust_rule_id: Annotated[str, Field(title="Trust Rule Id")] + name: Annotated[str, Field(title="Name")] + description: Annotated[ + str | None, + Field( + description="Null when the rule was created without one.", + title="Description", + ), + ] = None + identity_provider_id: Annotated[str, Field(title="Identity Provider Id")] + service_account_id: Annotated[str, Field(title="Service Account Id")] + condition: Annotated[ + str, + Field( + description="The CEL expression a token's claims must satisfy.", + title="Condition", + ), + ] + audience: Annotated[ + str, Field(description="The `aud` claim a token must carry.", title="Audience") + ] + max_access_token_lifetime_seconds: Annotated[ + int, + Field( + description="The longest lifetime, in seconds, of an access token the rule issues.", + title="Max Access Token Lifetime Seconds", + ), + ] + + +class AuditLogEventTrustRuleDeleted(BaseModel): + event_type: Annotated[Literal["TRUST_RULE_DELETED"], Field(title="Event Type")] + trust_rule_id: Annotated[str, Field(title="Trust Rule Id")] + name: Annotated[str, Field(title="Name")] + + +class AuditLogEventTrustRuleUpdated(BaseModel): + event_type: Annotated[Literal["TRUST_RULE_UPDATED"], Field(title="Event Type")] + trust_rule_id: Annotated[str, Field(title="Trust Rule Id")] + name: Annotated[str, Field(title="Name")] + changes: Annotated[ + dict[str, AuditFieldChange], + Field( + description="The fields the update changed, keyed by field name.", + title="Changes", + ), + ] + + class AuditLogEventUserInvited(BaseModel): event_type: Annotated[Literal["USER_INVITED"], Field(title="Event Type")] invited_user_email: Annotated[str, Field(title="Invited User Email")] @@ -4261,7 +4541,7 @@ class ModelTombstone(BaseModel): ] -class Name1(RootModel[str]): +class Name4(RootModel[str]): root: Annotated[ str | None, Field( @@ -4279,7 +4559,7 @@ class UpdateModelRequest(BaseModel): extra="forbid", ) name: Annotated[ - Name1 | None, + Name4 | None, Field( description="New name for the model, unique within its team. Renaming does not change the model ID, endpoints, or deployments. Pushes that still use the old model_name create another model or target a model that now uses that name, so update config.yaml after renaming.", examples=["my-model"], @@ -4300,7 +4580,7 @@ class DeploymentTombstone(BaseModel): ] -class Name2(RootModel[str]): +class Name5(RootModel[str]): root: Annotated[ str | None, Field( @@ -4318,7 +4598,7 @@ class UpdateDeploymentRequest(BaseModel): extra="forbid", ) name: Annotated[ - Name2 | None, + Name5 | None, Field( description="New name for the deployment, unique among the model's deployments. Only alphanumeric characters, hyphens, underscores, and periods are allowed.", examples=["my-deployment"], @@ -4885,45 +5165,108 @@ class StartupSummary(BaseModel): ] -class TerminateReplicaResponse(BaseModel): - success: Annotated[ - bool, - Field( - description="Whether the replica was successfully terminated", - title="Success", - ), - ] = True - - -class SignSSHCertificateRequest(BaseModel): - public_key: Annotated[ +class DeploymentReplica(BaseModel): + id: Annotated[ str, Field( - description="The user's SSH public key (e.g., 'ssh-ed25519 AAAA... user@host').", - title="Public Key", + description="Pod-name suffix used for replica lookup and termination, usually five characters.", + title="Id", ), ] - replica_id: Annotated[ - str | None, - Field( - description="The replica to connect to. Required for training jobs (e.g. '0'). Optional for inference (server picks a running replica if omitted).", - title="Replica Id", - ), - ] = None - - -class SignSSHCertificateResponse(BaseModel): - ssh_certificate: Annotated[ + deployment_id: Annotated[ + str, Field(description="ID of the replica's deployment.", title="Deployment Id") + ] + deployment_name: Annotated[ str, + Field(description="Name of the replica's deployment.", title="Deployment Name"), + ] + status: Annotated[ + Literal[ + "STARTING", "ACTIVE", "UNHEALTHY", "TERMINATING", "TERMINATED", "UNKNOWN" + ] + | str, Field( - description="The signed SSH certificate in OpenSSH format.", - title="Ssh Certificate", + description="Current replica lifecycle status.", + title="DeploymentReplicaStatusV1", ), ] - jwt: Annotated[ - str, + created_at: Annotated[ + AwareDatetime, Field( - description="Signed JWT (ES256) for SSH proxy authorization.", title="Jwt" + description="Replica creation time in ISO 8601 format.", title="Created At" + ), + ] + terminated_at: Annotated[ + AwareDatetime | None, + Field( + description="Observed termination completion time in ISO 8601 format, or null if unavailable.", + title="Terminated At", + ), + ] + age_seconds: Annotated[ + float, + Field( + description="Age in seconds since creation, frozen at termination.", + title="Age Seconds", + ), + ] + restart_count: Annotated[ + int | None, + Field( + description="Model container lifetime restart count, or null if unavailable.", + title="Restart Count", + ), + ] + + +class DeploymentReplicas(BaseModel): + items: Annotated[ + list[DeploymentReplica], Field(description="Items in this page.", title="Items") + ] + pagination: Annotated[ + PaginationResponse, Field(description="Pagination metadata for the page.") + ] + + +class TerminateReplicaResponse(BaseModel): + success: Annotated[ + bool, + Field( + description="Whether the replica was successfully terminated", + title="Success", + ), + ] = True + + +class SignSSHCertificateRequest(BaseModel): + public_key: Annotated[ + str, + Field( + description="The user's SSH public key (e.g., 'ssh-ed25519 AAAA... user@host').", + title="Public Key", + ), + ] + replica_id: Annotated[ + str | None, + Field( + description="The replica to connect to. Required for training jobs (e.g. '0'). Optional for inference (server picks a running replica if omitted).", + title="Replica Id", + ), + ] = None + + +class SignSSHCertificateResponse(BaseModel): + ssh_certificate: Annotated[ + str, + Field( + description="The signed SSH certificate in OpenSSH format.", + title="Ssh Certificate", + ), + ] + jwt: Annotated[ + str, + Field( + description="Signed JWT (ES256) for SSH proxy authorization.", title="Jwt" ), ] proxy_address: Annotated[ @@ -5688,6 +6031,25 @@ class UpsertTrainingProjectRequest(BaseModel): ] +class TrainingBDNMountResponse(BaseModel): + source: Annotated[str, Field(title="Source")] + path: Annotated[str, Field(title="Path")] + include: Annotated[ + list[str] | None, + Field( + description="Relative glob patterns selecting files to mount; empty includes all files.", + title="Include", + ), + ] = None + exclude: Annotated[ + list[str] | None, + Field( + description="Relative glob patterns excluding files from the mount; exclusions win.", + title="Exclude", + ), + ] = None + + class TrainingProjectSummary(BaseModel): id: Annotated[ str, Field(description="Unique identifier of the training project.", title="Id") @@ -5843,6 +6205,28 @@ class SecretReference(BaseModel): ] +class TrainingBDNMount(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + source: Annotated[str, Field(title="Source")] + path: Annotated[str, Field(title="Path")] + include: Annotated[ + list[str] | None, + Field( + description="Relative glob patterns selecting files to mount; empty includes all files.", + title="Include", + ), + ] = None + exclude: Annotated[ + list[str] | None, + Field( + description="Relative glob patterns excluding files from the mount; exclusions win.", + title="Exclude", + ), + ] = None + + class TrainingWeightAuth(BaseModel): auth_method: Annotated[ Literal[ @@ -6552,7 +6936,7 @@ class LoopsSampler(BaseModel): ] = None -class Name3(RootModel[str]): +class Name6(RootModel[str]): root: Annotated[ str | None, Field( @@ -6588,7 +6972,7 @@ class CreateLoopsRunRequest(BaseModel): Field(description="Base model ID (e.g. 'Qwen/Qwen3-8B').", title="Base Model"), ] name: Annotated[ - Name3 | None, + Name6 | None, Field( description="Optional display name for the run. Defaults to the base model name when omitted.", title="Name", @@ -6657,10 +7041,22 @@ class CreateLoopsRunRequest(BaseModel): base_checkpoint: Annotated[ str | None, Field( - description="Optional Hugging Face checkpoint to start training from instead of the base model's weights. Form: hf:///[@]. It must be a complete, merged checkpoint in safetensors format with the same architecture as base_model, which still selects the hardware and training configuration. It must include its tokenizer files: the run's sampler and the SDK load the tokenizer and chat template from the checkpoint. A private or gated repository needs a Hugging Face token in the team secret hf_access_token. The revision is pinned to a commit when the run is created. Cannot be combined with path, reuse_from_run_id, or reuse_from_session_id.", + description="Optional checkpoint to start training from instead of the base model's weights: a Hugging Face repo (hf:///[@]), an object store path (s3://, gs://, r2://, cw://, or azure://), or a full Baseten Training checkpoint in the run's team (bt://@/, with the checkpoint named). It must be a complete, merged checkpoint in safetensors format with the same architecture as base_model, which still selects the hardware and training configuration. It must include tokenizer files: the run's sampler loads the tokenizer and chat template from the checkpoint. A Hugging Face revision is pinned to a commit when the run is created, and its files are checked then. Any other source is read again by each sampler and resumed run, so do not change it while the run is in use. Checkpoints from a run on a source outside Hugging Face cannot be deployed yet. Cannot be combined with path, reuse_from_run_id, or reuse_from_session_id.", title="Base Checkpoint", ), ] = None + base_checkpoint_auth: Annotated[ + TrainingWeightAuth | None, + Field( + description="Optional credentials that read base_checkpoint. Only CUSTOM_SECRET is supported: set auth_secret_name to the team secret that holds a Hugging Face token for a Hugging Face repo, or the credentials for an object store. A Baseten Training checkpoint takes no auth. The run, its samplers, resumed runs, and checkpoint deployments all use this secret. When omitted, a Hugging Face repo is read with the team secret hf_access_token if it exists. Requires base_checkpoint.", + examples=[ + { + "auth_method": "CUSTOM_SECRET", + "auth_secret_name": "hf_read_my_checkpoint", + } + ], + ), + ] = None sampler_num_replicas: Annotated[ SamplerNumReplicas | None, Field( @@ -6682,6 +7078,25 @@ class DeactivateLoopsRunResponse(BaseModel): user: Annotated[User, Field(description="The user who owns the Loops run.")] +class LoopsLoRAConfig(BaseModel): + config_version: Annotated[ + str, Field(description="The config version, like v1.", title="Config Version") + ] + targets: Annotated[ + list[str], + Field( + description="The module names the LoRA adapter targets.", title="Targets" + ), + ] + expert_layout: Annotated[ + Literal["per_expert", "shared_outer", "shared_adapter"] | str | None, + Field( + description="How routed-expert LoRA weights are laid out. Null when no experts are targeted.", + title="Expert Layout", + ), + ] = None + + class CreateLoopsTrainerRequest(BaseModel): session_id: Annotated[ str, @@ -6695,7 +7110,7 @@ class CreateLoopsTrainerRequest(BaseModel): Field(description="Base model ID (e.g. 'Qwen/Qwen3-8B').", title="Base Model"), ] name: Annotated[ - Name3 | None, + Name6 | None, Field( description="Optional display name for the run. Defaults to the base model name when omitted.", title="Name", @@ -6764,10 +7179,22 @@ class CreateLoopsTrainerRequest(BaseModel): base_checkpoint: Annotated[ str | None, Field( - description="Optional Hugging Face checkpoint to start training from instead of the base model's weights. Form: hf:///[@]. It must be a complete, merged checkpoint in safetensors format with the same architecture as base_model, which still selects the hardware and training configuration. It must include its tokenizer files: the run's sampler and the SDK load the tokenizer and chat template from the checkpoint. A private or gated repository needs a Hugging Face token in the team secret hf_access_token. The revision is pinned to a commit when the run is created. Cannot be combined with path, reuse_from_run_id, or reuse_from_session_id.", + description="Optional checkpoint to start training from instead of the base model's weights: a Hugging Face repo (hf:///[@]), an object store path (s3://, gs://, r2://, cw://, or azure://), or a full Baseten Training checkpoint in the run's team (bt://@/, with the checkpoint named). It must be a complete, merged checkpoint in safetensors format with the same architecture as base_model, which still selects the hardware and training configuration. It must include tokenizer files: the run's sampler loads the tokenizer and chat template from the checkpoint. A Hugging Face revision is pinned to a commit when the run is created, and its files are checked then. Any other source is read again by each sampler and resumed run, so do not change it while the run is in use. Checkpoints from a run on a source outside Hugging Face cannot be deployed yet. Cannot be combined with path, reuse_from_run_id, or reuse_from_session_id.", title="Base Checkpoint", ), ] = None + base_checkpoint_auth: Annotated[ + TrainingWeightAuth | None, + Field( + description="Optional credentials that read base_checkpoint. Only CUSTOM_SECRET is supported: set auth_secret_name to the team secret that holds a Hugging Face token for a Hugging Face repo, or the credentials for an object store. A Baseten Training checkpoint takes no auth. The run, its samplers, resumed runs, and checkpoint deployments all use this secret. When omitted, a Hugging Face repo is read with the team secret hf_access_token if it exists. Requires base_checkpoint.", + examples=[ + { + "auth_method": "CUSTOM_SECRET", + "auth_secret_name": "hf_read_my_checkpoint", + } + ], + ), + ] = None scope: Annotated[ Literal["default", "serverless", "dedicated"] | str, Field( @@ -6882,25 +7309,6 @@ class GetLoopsSamplerResponse(BaseModel): sampler: Annotated[LoopsSampler, Field(description="The Loops sampler.")] -class LoopsLoRAConfig(BaseModel): - config_version: Annotated[ - str, Field(description="The config version, like v1.", title="Config Version") - ] - targets: Annotated[ - list[str], - Field( - description="The module names the LoRA adapter targets.", title="Targets" - ), - ] - expert_layout: Annotated[ - Literal["per_expert", "shared_outer", "shared_adapter"] | str | None, - Field( - description="How routed-expert LoRA weights are laid out. Null when no experts are targeted.", - title="Expert Layout", - ), - ] = None - - class ValidateLoopsCheckpointRequest(BaseModel): checkpoint_path: Annotated[ str, @@ -6968,6 +7376,34 @@ class DeployLoopsCheckpointResponse(BaseModel): ] +class LoopsCheckpointTombstone(BaseModel): + id: Annotated[str, Field(description="The deleted checkpoint ID.", title="Id")] + run_id: Annotated[ + str, + Field( + description="The ID of the run that produced the checkpoint.", + title="Run Id", + ), + ] + checkpoint_id: Annotated[ + str, + Field( + description="The name the checkpoint was saved under.", + title="Checkpoint Id", + ), + ] + target: Annotated[ + Literal["sampler", "trainer"] | str, + Field( + description="Whether the checkpoint was loadable by the sampler or by the run.", + title="TrainerCheckpointTarget", + ), + ] + path: Annotated[ + str, Field(description="The checkpoint's bt:// path.", title="Path") + ] + + class LoopsCheckpointFilesResponse(BaseModel): presigned_urls: Annotated[ list[CheckpointFile], @@ -7029,6 +7465,28 @@ class LoopsCheckpointSourceResponse(BaseModel): ] +class TtlSeconds(RootModel[int]): + root: Annotated[ + int, + Field( + description="Seconds from now until the checkpoint expires and is deleted, from 3600 (1 hour) to 315360000 (10 years). Null removes the TTL, so the checkpoint is kept until you delete it.", + ge=3600, + le=315360000, + title="Ttl Seconds", + ), + ] + + +class SetLoopsCheckpointTtlRequest(BaseModel): + ttl_seconds: Annotated[ + TtlSeconds | None, + Field( + description="Seconds from now until the checkpoint expires and is deleted, from 3600 (1 hour) to 315360000 (10 years). Null removes the TTL, so the checkpoint is kept until you delete it.", + title="Ttl Seconds", + ), + ] + + class LoopsDeploymentStatus(BaseModel): name: Annotated[ Literal[ @@ -7221,14 +7679,14 @@ class TeamTrainingGpuCapacityItem(BaseModel): baseline: Annotated[ int, Field( - description="Baseline GPU allocation for the team. 0 if not configured.", + description="Configured minimum GPU allocation for the team. Not enforced. 0 if not configured.", title="Baseline", ), ] limit: Annotated[ int, Field( - description="Maximum concurrent GPUs of this type for this team", + description="The team's GPU quota for this type. It counts the team's on-demand jobs, plus its spot jobs when the organization has no separate on-demand quota. On-demand jobs can run past it by borrowing from the organization's shared pool, when one exists.", title="Limit", ), ] @@ -7242,7 +7700,7 @@ class TeamTrainingGpuCapacityItem(BaseModel): dedicated_usage_count: Annotated[ int, Field( - description="Portion of usage_count from standard (non-spot) jobs.", + description="Portion of usage_count from on-demand (non-spot) jobs.", title="Dedicated Usage Count", ), ] = 0 @@ -7265,17 +7723,31 @@ class TrainingGpuCapacityItem(BaseModel): baseline: Annotated[ int, Field( - description="Baseline GPU allocation; jobs below this threshold are expected to run immediately. 0 if not configured.", + description="Configured minimum GPU allocation (`min_gpus`). 0 if not configured. Use `on_demand_quota` for the quota applied to on-demand jobs.", title="Baseline", ), ] limit: Annotated[ int, Field( - description="Maximum concurrent GPUs of this type for this org", + description="Configured maximum GPU allocation (`max_gpus`). Use `on_demand_quota` and `spot_quota` for the quotas applied to jobs.", title="Limit", ), ] + on_demand_quota: Annotated[ + int, + Field( + description="GPU quota for this type for on-demand (non-spot) jobs: the most GPUs they can use at once.", + title="On Demand Quota", + ), + ] + spot_quota: Annotated[ + int | None, + Field( + description="GPU quota for this type for spot jobs. Spot shares this quota with on-demand jobs: spot can use up to the quota minus on-demand GPUs in use. Null if spot is not enabled for the organization.", + title="Spot Quota", + ), + ] = None usage_count: Annotated[ int, Field( @@ -7286,14 +7758,14 @@ class TrainingGpuCapacityItem(BaseModel): dedicated_usage_count: Annotated[ int, Field( - description="Portion of usage_count from standard (non-spot) jobs, which run against the baseline.", + description="Portion of usage_count from on-demand (non-spot) jobs.", title="Dedicated Usage Count", ), ] = 0 spot_usage_count: Annotated[ int, Field( - description="Portion of usage_count from spot jobs, which burst into the peak and may push usage above the limit.", + description="Portion of usage_count from spot jobs.", title="Spot Usage Count", ), ] = 0 @@ -7303,17 +7775,24 @@ class GetTrainingGpuCapacityResponse(BaseModel): gpu_capacities: Annotated[ list[TrainingGpuCapacityItem], Field( - description="Org-level GPU capacity limits and current usage per GPU type", + description="Organization GPU quotas and current usage per GPU type", title="Gpu Capacities", ), ] team_gpu_capacities: Annotated[ list[TeamTrainingGpuCapacityItem] | None, Field( - description="Per-team GPU capacity limits and current usage per GPU type", + description="Per-team GPU quotas and current usage per GPU type", title="Team Gpu Capacities", ), ] = None + spot_enabled: Annotated[ + bool, + Field( + description="Whether the organization can submit spot training jobs.", + title="Spot Enabled", + ), + ] = False class PatchTeamTrainingGpuCapacityRequest(BaseModel): @@ -7327,7 +7806,7 @@ class PatchTeamTrainingGpuCapacityRequest(BaseModel): max_gpus: Annotated[ int, Field( - description="Max concurrent GPUs of this type the team may use", + description="The team's GPU quota for this type. It counts the team's on-demand jobs, plus its spot jobs when the organization has no separate on-demand quota. On-demand jobs can run past it by borrowing from the organization's shared pool, when one exists.", examples=[8, 16, 32], title="Max Gpus", ), @@ -7336,8 +7815,7 @@ class PatchTeamTrainingGpuCapacityRequest(BaseModel): class PatchTeamTrainingGpuCapacityResponse(BaseModel): team_gpu_capacity: Annotated[ - TeamTrainingGpuCapacityItem, - Field(description="The updated per-team GPU capacity limit"), + TeamTrainingGpuCapacityItem, Field(description="The updated per-team GPU quota") ] @@ -8390,7 +8868,7 @@ class Subtotal5(RootModel[str]): root: Annotated[ str, Field( - description="Subtotal cost in dollars after applying credits used", + description="Usage charges in dollars before applying credits", pattern="^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", title="Subtotal", ), @@ -8515,6 +8993,20 @@ class ModelApiItem(BaseModel): float | Subtotal10, Field(description="Subtotal cost in dollars for this model", title="Subtotal"), ] + team_id: Annotated[ + str | None, + Field( + description="Team ID for multi-team organizations; otherwise null", + title="Team Id", + ), + ] = None + team_name: Annotated[ + str | None, + Field( + description="Team name, including historical teams; null if unavailable", + title="Team Name", + ), + ] = None input_tokens: Annotated[ int, Field(description="Total input tokens for this model", title="Input Tokens"), @@ -8543,18 +9035,32 @@ class Subtotal11(RootModel[str]): root: Annotated[ str, Field( - description="Subtotal cost in dollars after applying credits used", + description="Usage charges in dollars before applying credits", pattern="^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", title="Subtotal", ), ] +class Total2(RootModel[str]): + model_config = ConfigDict( + regex_engine="python-re", + ) + root: Annotated[ + str, + Field( + description="Usage charges in dollars after applying credits, floored at zero", + pattern="^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", + title="Total", + ), + ] + + class ModelApisUsage(BaseModel): subtotal: Annotated[ float | Subtotal11, Field( - description="Subtotal cost in dollars after applying credits used", + description="Usage charges in dollars before applying credits", title="Subtotal", ), ] @@ -8563,11 +9069,18 @@ class ModelApisUsage(BaseModel): Field(description="Credits applied in dollars", title="Credits Used"), ] total: Annotated[ - float | Total, Field(description="Total cost in dollars", title="Total") + float | Total2, + Field( + description="Usage charges in dollars after applying credits, floored at zero", + title="Total", + ), ] breakdown: Annotated[ list[ModelApiItem] | None, - Field(description="Per-model usage breakdown", title="Breakdown"), + Field( + description="Per-model usage breakdown, split by team for multi-team organizations", + title="Breakdown", + ), ] = None @@ -8592,13 +9105,27 @@ class Subtotal13(RootModel[str]): root: Annotated[ str, Field( - description="Subtotal cost in dollars after applying credits used", + description="Usage charges in dollars before applying credits", pattern="^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", title="Subtotal", ), ] +class Total3(RootModel[str]): + model_config = ConfigDict( + regex_engine="python-re", + ) + root: Annotated[ + str, + Field( + description="Total cost in dollars", + pattern="^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", + title="Total", + ), + ] + + class ToolCallUsageBucket(BaseModel): date: Annotated[ date_aliased, @@ -8701,17 +9228,796 @@ class OrganizationInfo(BaseModel): description="AWS AssumeRole trust-policy inputs; null while the method is not enabled for the organization" ), ] = None - - -class GatewayEventTokens(BaseModel): - inputTokens: Annotated[ - int, Field(description="Cached and uncached input tokens.", title="Inputtokens") - ] - outputTokens: Annotated[ - int, Field(description="Output tokens.", title="Outputtokens") + allow_personal_api_keys: Annotated[ + bool, + Field( + description="Whether members can create new personal API keys. Existing keys keep working.", + title="Allow Personal Api Keys", + ), ] - cachedInputTokens: Annotated[ - int, Field(description="Cached input tokens.", title="Cachedinputtokens") + allow_service_account_api_keys: Annotated[ + bool, + Field( + description="Whether new team and organization API keys can be created. Existing keys keep working.", + title="Allow Service Account Api Keys", + ), + ] + + +class UpdateOrganizationRequest(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + allow_personal_api_keys: Annotated[ + bool | None, + Field( + description="Whether members can create new personal API keys. Null is not accepted.", + title="Allow Personal Api Keys", + ), + ] = None + allow_service_account_api_keys: Annotated[ + bool | None, + Field( + description="Whether new team and organization API keys can be created. Null is not accepted.", + title="Allow Service Account Api Keys", + ), + ] = None + + +class ServiceAccountPresetPermissionsRequest(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Annotated[ + Literal[ + "WORKSPACE_MANAGE_ALL", + "WORKSPACE_INVOKE", + "WORKSPACE_EXPORT_METRICS", + "WORKSPACE_MANAGE_API_KEYS", + "WORKSPACE_INVOKE_MODEL_APIS", + ] + | str, + Field( + description="What the service account may do. WORKSPACE_MANAGE_API_KEYS is for organization-level accounts only; every other type needs a team.", + examples=["WORKSPACE_MANAGE_ALL"], + title="ServiceAccountPresetTypeV1", + ), + ] + model_ids: Annotated[ + list[str] | None, + Field( + description="WORKSPACE_INVOKE and WORKSPACE_EXPORT_METRICS only. Models the account covers. Omit for every model in the team, including models added later.", + examples=[["abcd1234"]], + title="Model Ids", + ), + ] = None + environment_names: Annotated[ + list[str] | None, + Field( + description="WORKSPACE_INVOKE: environments the account may call; omit for all. With model_ids, each model must have each environment. WORKSPACE_MANAGE_ALL: restricted environments the account may also manage.", + examples=[["production"]], + title="Environment Names", + ), + ] = None + model_api_slugs: Annotated[ + list[str] | None, + Field( + description="WORKSPACE_INVOKE_MODEL_APIS only. Model APIs the account may call; omit for all.", + examples=[["my-model-api"]], + title="Model Api Slugs", + ), + ] = None + + +class Description(RootModel[str]): + root: Annotated[ + str | None, + Field( + description="Optional description, up to 1,024 characters", + max_length=1024, + title="Description", + ), + ] = None + + +class TeamId4(RootModel[str]): + root: Annotated[ + str | None, + Field( + description="The team that owns the account. Omit for an organization account. Can't be changed.", + min_length=1, + title="Team Id", + ), + ] = None + + +class CreateServiceAccountRequest(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: Annotated[ + str, + Field( + description="Name, unique in the organization. Can be changed later.", + examples=["ci-deployer"], + max_length=255, + min_length=1, + title="Name", + ), + ] + description: Annotated[ + Description | None, + Field( + description="Optional description, up to 1,024 characters", + title="Description", + ), + ] = None + team_id: Annotated[ + TeamId4 | None, + Field( + description="The team that owns the account. Omit for an organization account. Can't be changed.", + title="Team Id", + ), + ] = None + preset_permissions: Annotated[ + ServiceAccountPresetPermissionsRequest, + Field( + description="What the service account may do. Can be changed later. Temporary; may be removed once fine-grained access control is available." + ), + ] + + +class DeletedServiceAccount(BaseModel): + id: Annotated[ + str, Field(description="ID of the deleted service account", title="Id") + ] + deleted: Annotated[bool, Field(description="Always true", title="Deleted")] + + +class Name8(RootModel[str]): + root: Annotated[ + str | None, + Field( + description="Name, unique in the organization", + max_length=255, + min_length=1, + title="Name", + ), + ] = None + + +class Description1(RootModel[str]): + root: Annotated[ + str | None, + Field( + description="Description, up to 1,024 characters; null clears it", + max_length=1024, + title="Description", + ), + ] = None + + +class UpdateServiceAccountRequest(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: Annotated[ + Name8 | None, + Field(description="Name, unique in the organization", title="Name"), + ] = None + description: Annotated[ + Description1 | None, + Field( + description="Description, up to 1,024 characters; null clears it", + title="Description", + ), + ] = None + disabled: Annotated[ + bool | None, + Field( + description="Disable the account to stop it being used, or enable it again", + title="Disabled", + ), + ] = None + preset_permissions: Annotated[ + ServiceAccountPresetPermissionsRequest | None, + Field( + description="Replaces the account's access as a whole. Temporary; may be removed once fine-grained access control is available." + ), + ] = None + + +class PredefinedIdentityProvider(BaseModel): + kind: Annotated[ + Literal[ + "GITHUB_ACTIONS", + "GCP", + "BASETEN", + "AWS_IAM", + "AWS_EKS", + "AZURE_MANAGED_IDENTITY_V1", + "AZURE_MANAGED_IDENTITY_V2", + "AZURE_AKS", + ] + | str, + Field( + description="Pass as `kind` when adding the provider", + title="PredefinedIdentityProviderKindV1", + ), + ] + name: Annotated[str, Field(description="Display name", title="Name")] + issuer_url: Annotated[ + str | None, + Field( + description="The `iss` claim its tokens carry. Null when each account, tenant, or cluster has its own issuer, which you pass as `issuer_url` when adding the provider.", + title="Issuer Url", + ), + ] = None + issuer_url_example: Annotated[ + str | None, + Field( + description="An example of the `issuer_url` to pass. Null when the issuer is fixed.", + title="Issuer Url Example", + ), + ] = None + + +class PredefinedIdentityProviders(BaseModel): + items: Annotated[ + list[PredefinedIdentityProvider], + Field(description="Identity providers Baseten supports", title="Items"), + ] + + +class IssuerUrl(RootModel[str]): + root: Annotated[ + str | None, + Field( + description="The `iss` claim of the provider's tokens. When adding AWS IAM, Amazon EKS, Azure managed identity, or Azure Kubernetes Service, pass your issuer in the format the predefined identity providers endpoint shows; it's unique in the organization. Can't be passed for other providers, or changed. Always set in responses.", + max_length=1024, + title="Issuer Url", + ), + ] = None + + +class PredefinedIdentityProviderConfig(BaseModel): + kind: Annotated[ + Literal[ + "GITHUB_ACTIONS", + "GCP", + "BASETEN", + "AWS_IAM", + "AWS_EKS", + "AZURE_MANAGED_IDENTITY_V1", + "AZURE_MANAGED_IDENTITY_V2", + "AZURE_AKS", + ] + | str, + Field( + description="Which predefined provider. Can't be changed.", + title="PredefinedIdentityProviderKindV1", + ), + ] + issuer_url: Annotated[ + IssuerUrl | None, + Field( + description="The `iss` claim of the provider's tokens. When adding AWS IAM, Amazon EKS, Azure managed identity, or Azure Kubernetes Service, pass your issuer in the format the predefined identity providers endpoint shows; it's unique in the organization. Can't be passed for other providers, or changed. Always set in responses.", + title="Issuer Url", + ), + ] = None + + +class CreatePredefinedIdentityProviderConfig(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + kind: Annotated[ + Literal[ + "GITHUB_ACTIONS", + "GCP", + "BASETEN", + "AWS_IAM", + "AWS_EKS", + "AZURE_MANAGED_IDENTITY_V1", + "AZURE_MANAGED_IDENTITY_V2", + "AZURE_AKS", + ] + | str, + Field( + description="Which predefined provider. Can't be changed.", + title="PredefinedIdentityProviderKindV1", + ), + ] + issuer_url: Annotated[ + IssuerUrl | None, + Field( + description="The `iss` claim of the provider's tokens. When adding AWS IAM, Amazon EKS, Azure managed identity, or Azure Kubernetes Service, pass your issuer in the format the predefined identity providers endpoint shows; it's unique in the organization. Can't be passed for other providers, or changed. Always set in responses.", + title="Issuer Url", + ), + ] = None + + +class Name9(RootModel[str]): + root: Annotated[ + str | None, + Field( + description="Name, unique in the organization. Defaults to the provider's display name, so pass one when adding a second issuer of the same provider.", + max_length=255, + min_length=1, + title="Name", + ), + ] = None + + +class Description2(RootModel[str]): + root: Annotated[ + str | None, + Field(description="Optional description", max_length=1024, title="Description"), + ] = None + + +class CreateIdentityProviderRequest(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: Annotated[ + Name9 | None, + Field( + description="Name, unique in the organization. Defaults to the provider's display name, so pass one when adding a second issuer of the same provider.", + title="Name", + ), + ] = None + description: Annotated[ + Description2 | None, + Field(description="Optional description", title="Description"), + ] = None + predefined: Annotated[ + CreatePredefinedIdentityProviderConfig, + Field(description="The predefined provider to add"), + ] + + +class VerifyPredefinedIdentityProviderConfig(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + kind: Annotated[ + Literal[ + "GITHUB_ACTIONS", + "GCP", + "BASETEN", + "AWS_IAM", + "AWS_EKS", + "AZURE_MANAGED_IDENTITY_V1", + "AZURE_MANAGED_IDENTITY_V2", + "AZURE_AKS", + ] + | str, + Field( + description="Which predefined provider", + title="PredefinedIdentityProviderKindV1", + ), + ] + issuer_url: Annotated[ + str | None, + Field( + description="The issuer to check, for AWS IAM, Amazon EKS, Azure managed identity, and Azure Kubernetes Service, in the format the predefined identity providers endpoint shows", + title="Issuer Url", + ), + ] = None + + +class VerifyIdentityProviderRequest(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + predefined: Annotated[ + VerifyPredefinedIdentityProviderConfig, + Field( + description="The predefined provider to check, as you'd pass it when adding it" + ), + ] + + +class Verification(BaseModel): + valid: Annotated[ + bool, Field(description="Whether the input passes every check", title="Valid") + ] + error: Annotated[ + str | None, + Field( + description="Why the input fails, as creating it would report. Null when it's valid.", + title="Error", + ), + ] = None + + +class DeletedIdentityProvider(BaseModel): + id: Annotated[ + str, Field(description="ID of the deleted identity provider", title="Id") + ] + deleted: Annotated[bool, Field(description="Always true", title="Deleted")] + + +class Name10(RootModel[str]): + root: Annotated[ + str | None, + Field( + description="Name, unique in the organization", + max_length=255, + min_length=1, + title="Name", + ), + ] = None + + +class Description3(RootModel[str]): + root: Annotated[ + str | None, + Field( + description="Description; null clears it", + max_length=1024, + title="Description", + ), + ] = None + + +class UpdateIdentityProviderRequest(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: Annotated[ + Name10 | None, + Field(description="Name, unique in the organization", title="Name"), + ] = None + description: Annotated[ + Description3 | None, + Field(description="Description; null clears it", title="Description"), + ] = None + + +class AccessTrustRule(BaseModel): + id: Annotated[ + str, + Field( + description="Trust rule ID. Workloads pass it when they exchange a token.", + title="Id", + ), + ] + name: Annotated[ + str, Field(description="Name, unique in the organization", title="Name") + ] + description: Annotated[ + str | None, Field(description="Description", title="Description") + ] = None + identity_provider_id: Annotated[ + str, + Field( + description="The identity provider whose tokens it accepts", + title="Identity Provider Id", + ), + ] + identity_provider_name: Annotated[ + str, + Field( + description="Name of the identity provider", title="Identity Provider Name" + ), + ] + service_account_id: Annotated[ + str, + Field( + description="The service account its tokens act as", + title="Service Account Id", + ), + ] + service_account_name: Annotated[ + str, + Field(description="Name of the service account", title="Service Account Name"), + ] + team_id: Annotated[ + str | None, + Field( + description="The service account's team. Null for an organization service account.", + title="Team Id", + ), + ] = None + team_name: Annotated[ + str | None, + Field( + description="Name of the service account's team. Null for an organization service account.", + title="Team Name", + ), + ] = None + condition: Annotated[ + str, + Field( + description="A CEL expression over the token's `claims` that must evaluate to true. It must pin a specific `claims.sub` in a top-level `&&` clause, plus any provider-required checks. Up to 4,096 characters.", + examples=[ + "claims.repository_owner_id == '12345' && claims.sub.startsWith('repo:acme/models:') && claims.ref == 'refs/heads/main'" + ], + title="Condition", + ), + ] + audience: Annotated[ + str, + Field( + description="The token's `aud` must equal this, or contain it when `aud` is a list. Up to 1,024 characters.", + title="Audience", + ), + ] + max_access_token_lifetime_seconds: Annotated[ + int, + Field( + description="Longest lifetime of a token the rule issues, in seconds", + title="Max Access Token Lifetime Seconds", + ), + ] + last_used_at: Annotated[ + AwareDatetime | None, + Field( + description="Last time a request authenticated with a token the rule issued, to within an hour. Null until the first.", + title="Last Used At", + ), + ] = None + created_by: Annotated[ + str, + Field(description="ID of the user who created the rule", title="Created By"), + ] + created_at: Annotated[ + AwareDatetime, + Field(description="Time the rule was created", title="Created At"), + ] + updated_at: Annotated[ + AwareDatetime, + Field(description="Time the rule was last updated", title="Updated At"), + ] + + +class AccessTrustRules(BaseModel): + items: Annotated[ + list[AccessTrustRule], Field(description="Items in this page.", title="Items") + ] + pagination: Annotated[ + PaginationResponse, Field(description="Pagination metadata for the page.") + ] + + +class CreateAccessTrustRuleRequest(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: Annotated[ + str, + Field( + description="Name, unique in the organization. Can be changed later.", + max_length=255, + min_length=1, + title="Name", + ), + ] + description: Annotated[ + str | None, Field(description="Optional description", title="Description") + ] = None + identity_provider_id: Annotated[ + str, + Field( + description="Whose tokens the rule accepts. Can't be changed.", + title="Identity Provider Id", + ), + ] + service_account_id: Annotated[ + str, + Field( + description="The service account its tokens act as. Can be changed later.", + title="Service Account Id", + ), + ] + condition: Annotated[ + str, + Field( + description="A CEL expression over the token's `claims` that must evaluate to true. It must pin a specific `claims.sub` in a top-level `&&` clause, plus any provider-required checks. Up to 4,096 characters. Can be changed later.", + examples=[ + "claims.repository_owner_id == '12345' && claims.sub.startsWith('repo:acme/models:') && claims.ref == 'refs/heads/main'" + ], + title="Condition", + ), + ] + audience: Annotated[ + str, + Field( + description="The token's `aud` must equal this, or contain it when `aud` is a list. Up to 1,024 characters. Can be changed later.", + title="Audience", + ), + ] + max_access_token_lifetime_seconds: Annotated[ + int, + Field( + description="Longest lifetime of a token the rule issues, 60 to 3600 seconds. Can be changed later.", + ge=60, + le=3600, + title="Max Access Token Lifetime Seconds", + ), + ] = 3600 + + +class VerifyAccessTrustRuleRequest(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + identity_provider_id: Annotated[ + str, + Field( + description="The identity provider the rule is for, which decides the claims it must pin", + title="Identity Provider Id", + ), + ] + condition: Annotated[ + str, + Field( + description="A CEL expression over the token's `claims` that must evaluate to true. It must pin a specific `claims.sub` in a top-level `&&` clause, plus any provider-required checks. Up to 4,096 characters.", + examples=[ + "claims.repository_owner_id == '12345' && claims.sub.startsWith('repo:acme/models:') && claims.ref == 'refs/heads/main'" + ], + title="Condition", + ), + ] + audience: Annotated[ + str, + Field( + description="The token's `aud` must equal this, or contain it when `aud` is a list. Up to 1,024 characters.", + title="Audience", + ), + ] + + +class DeletedAccessTrustRule(BaseModel): + id: Annotated[str, Field(description="ID of the deleted trust rule", title="Id")] + deleted: Annotated[bool, Field(description="Always true", title="Deleted")] + + +class MaxAccessTokenLifetimeSeconds(RootModel[int]): + root: Annotated[ + int | None, + Field( + description="Longest lifetime of a token the rule issues, 60 to 3600 seconds. Tokens already issued keep their lifetime.", + ge=60, + le=3600, + title="Max Access Token Lifetime Seconds", + ), + ] = None + + +class UpdateAccessTrustRuleRequest(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: Annotated[ + Name10 | None, + Field(description="Name, unique in the organization", title="Name"), + ] = None + description: Annotated[ + str | None, + Field(description="Description; null clears it", title="Description"), + ] = None + condition: Annotated[ + str | None, + Field( + description="A CEL expression over the token's `claims` that must evaluate to true. It must pin a specific `claims.sub` in a top-level `&&` clause, plus any provider-required checks. Up to 4,096 characters.", + title="Condition", + ), + ] = None + audience: Annotated[ + str | None, + Field( + description="The token's `aud` must equal this, or contain it when `aud` is a list. Up to 1,024 characters.", + title="Audience", + ), + ] = None + max_access_token_lifetime_seconds: Annotated[ + MaxAccessTokenLifetimeSeconds | None, + Field( + description="Longest lifetime of a token the rule issues, 60 to 3600 seconds. Tokens already issued keep their lifetime.", + title="Max Access Token Lifetime Seconds", + ), + ] = None + service_account_id: Annotated[ + str | None, + Field( + description="Moves the rule to another service account. Tokens already issued keep the old account until they expire.", + title="Service Account Id", + ), + ] = None + + +class AccessTokenLifetimeSeconds(RootModel[int]): + root: Annotated[ + int | None, + Field( + description="Lifetime of the access token, in seconds. At most the rule's maximum.", + ge=1, + title="Access Token Lifetime Seconds", + ), + ] = None + + +class TokenExchangeRequest(BaseModel): + grant_type: Annotated[ + str, + Field( + description="Always `urn:ietf:params:oauth:grant-type:token-exchange`", + examples=["urn:ietf:params:oauth:grant-type:token-exchange"], + title="Grant Type", + ), + ] + subject_token: Annotated[ + str, + Field( + description="The identity provider's JWT", + examples=[""], + max_length=16384, + title="Subject Token", + ), + ] + subject_token_type: Annotated[ + str, + Field( + description="`urn:ietf:params:oauth:token-type:jwt` or `urn:ietf:params:oauth:token-type:id_token`", + examples=["urn:ietf:params:oauth:token-type:jwt"], + title="Subject Token Type", + ), + ] + audience: Annotated[ + str, + Field( + description="ID of the trust rule to check the JWT against", + examples=["abcd1234"], + max_length=64, + title="Audience", + ), + ] + requested_token_type: Annotated[ + str | None, + Field( + description="Optional; only `urn:ietf:params:oauth:token-type:access_token` is issued", + title="Requested Token Type", + ), + ] = None + access_token_lifetime_seconds: Annotated[ + AccessTokenLifetimeSeconds | None, + Field( + description="Lifetime of the access token, in seconds. At most the rule's maximum.", + title="Access Token Lifetime Seconds", + ), + ] = None + + +class TokenExchangeResponse(BaseModel): + access_token: Annotated[ + str, Field(description="Send as `Authorization: Bearer`", title="Access Token") + ] + issued_token_type: Annotated[ + str, + Field( + description="Always `urn:ietf:params:oauth:token-type:access_token`", + title="Issued Token Type", + ), + ] + token_type: Annotated[str, Field(description="Always `Bearer`", title="Token Type")] + expires_in: Annotated[ + int, + Field(description="Seconds until the access token expires", title="Expires In"), + ] + + +class GatewayEventTokens(BaseModel): + inputTokens: Annotated[ + int, Field(description="Cached and uncached input tokens.", title="Inputtokens") + ] + outputTokens: Annotated[ + int, Field(description="Output tokens.", title="Outputtokens") + ] + cachedInputTokens: Annotated[ + int, Field(description="Cached input tokens.", title="Cachedinputtokens") ] @@ -8787,7 +10093,7 @@ class ExploreMetadataAPIFormats(BaseModel): ] = False -class TeamId4(RootModel[str]): +class TeamId5(RootModel[str]): root: Annotated[ str | None, Field( @@ -8801,7 +10107,7 @@ class TeamId4(RootModel[str]): class CreateGridTokenRequest(BaseModel): team_id: Annotated[ - TeamId4 | None, + TeamId5 | None, Field( description="ID of the team. When omitted, the team you belong to; required when you belong to several.", examples=["abc1234"], @@ -8843,21 +10149,19 @@ class GridToken(BaseModel): ] -class GridClassifier(BaseModel): - id: Annotated[ +class GridRouteAlias(BaseModel): + name: Annotated[ str, Field( - description="Stable classifier identifier.", - examples=["general-v1"], - title="Id", + description="Name to send in the inference request's `model` field instead of the route's `name`.", + title="Name", ), ] - name: Annotated[ - str, + kind: Annotated[ + Literal["CLAUDE_DESKTOP", "ALIAS"] | str, Field( - description="Display name of the classifier.", - examples=["General"], - title="Name", + description="Purpose of the alias. CLAUDE_DESKTOP is for Claude Code desktop, which rejects model names without a `claude` substring. ALIAS is any other name the team's clients send for the route.", + title="GridRouteAliasKindV1", ), ] @@ -8867,16 +10171,16 @@ class GridRouteClassifier(BaseModel): str, Field( description="Stable route classifier identifier.", - examples=["general-v1"], + examples=["abc1234"], title="Id", ), ] - name: Annotated[ + display_name: Annotated[ str, Field( description="Display name of the route classifier.", examples=["General"], - title="Name", + title="Display Name", ), ] supported_tradeoffs: Annotated[ @@ -8886,23 +10190,12 @@ class GridRouteClassifier(BaseModel): title="Supported Tradeoffs", ), ] - decidable_models: Annotated[ + decidable_canonical_model_ids: Annotated[ list[str], Field( - description="Model identities the route classifier picks from.", + description="Canonical model ids the route classifier picks from.", examples=[["zai-org/GLM-5.3", "anthropic/claude-opus-5-5"]], - title="Decidable Models", - ), - ] - - -class GridRouteRef(BaseModel): - id: Annotated[str, Field(description="Stable route identifier.", title="Id")] - slug: Annotated[ - str, - Field( - description="Name of the route to send in the inference request's model field.", - title="Slug", + title="Decidable Canonical Model Ids", ), ] @@ -8913,31 +10206,8 @@ class GridRouteTargetBasetenModelAPI(BaseModel): Field(description="Target kind for a Baseten Model API.", title="Type"), ] model: Annotated[ - str, - Field(description="Name of the target Model API.", min_length=1, title="Model"), - ] - - -class GridRouteTargetClassifier(BaseModel): - type: Annotated[ - Literal["CLASSIFIER"], - Field(description="Target kind for a classifier-based route.", title="Type"), - ] - classifier: Annotated[ - GridClassifier | None, - Field( - description="Classifier that picks a route for each request. Null for routers created before classifiers could be selected." - ), - ] - default_route: Annotated[ - GridRouteRef, Field(description="Route used when the classifier picks none.") - ] - allowed_routes: Annotated[ - list[GridRouteRef], - Field( - description="Routes the classifier may pick, in creation order.", - title="Allowed Routes", - ), + str, + Field(description="Name of the target Model API.", min_length=1, title="Model"), ] @@ -8998,70 +10268,64 @@ class UpsertGridRouteTargetBasetenModelAPI(BaseModel): ] -class UpsertGridRouteTargetClassifier(BaseModel): +class UpsertGridRouteTargetConnection(BaseModel): model_config = ConfigDict( extra="forbid", ) type: Annotated[ - Literal["CLASSIFIER"], - Field(description="Target kind for a classifier-based route.", title="Type"), - ] - classifier_id: Annotated[ - str, + Literal["CONNECTION"], Field( - description="ID of the classifier that picks a route for each request.", - examples=["general-v1"], - min_length=1, - title="Classifier Id", + description="Target kind for a provider reached through a team connection.", + title="Type", ), ] - allowed_route_ids: Annotated[ - list[str], + model: Annotated[ + str, Field( - description="IDs of the routes the classifier may pick. All must belong to the route's team and must not be routers themselves.", - examples=[["abc1234", "def5678"]], - title="Allowed Route Ids", + description="Model name sent to the provider.", min_length=1, title="Model" ), ] - default_route_id: Annotated[ + connection_id: Annotated[ str, Field( - description="ID of the allowed route used when the classifier picks none.", + description="Identifier of a connection owned by the route's team. Its provider serves the route.", examples=["abc1234"], - title="Default Route Id", + min_length=1, + title="Connection Id", ), ] -class UpsertGridRouteTargetConnection(BaseModel): +class UpsertGridRouteTargetIntelligent(BaseModel): model_config = ConfigDict( extra="forbid", ) type: Annotated[ - Literal["CONNECTION"], + Literal["INTELLIGENT"], Field( - description="Target kind for a provider reached through a team connection.", + description="Target kind for an intelligent route: Baseten picks the model per request.", title="Type", ), ] - model: Annotated[ + route_classifier_id: Annotated[ str, Field( - description="Model name sent to the provider.", min_length=1, title="Model" + description="Identifier of the route classifier that picks the model. List them with GET /v1/grid/route_classifiers.", + examples=["abc1234"], + min_length=1, + title="Route Classifier Id", ), ] - connection_id: Annotated[ - str, + tradeoff: Annotated[ + Literal["cost", "balanced", "intelligence"] | str, Field( - description="Identifier of a connection owned by the route's team. Its provider serves the route.", - examples=["abc1234"], - min_length=1, - title="Connection Id", + description="How the classifier weighs cost against quality. Must be one of the classifier's supported tradeoffs.", + title="GridRouteTradeoffV1", ), ] -class TeamId5(RootModel[str]): +class TeamId6(RootModel[str]): root: Annotated[ str | None, Field( @@ -9077,7 +10341,7 @@ class DisplayName(RootModel[str]): root: Annotated[ str | None, Field( - description="Display label. Omit to use the route name; null is not accepted.", + description="Display label. Omit to use the route's name; required for INTELLIGENT targets. Null is not accepted.", examples=["Assistant"], max_length=255, min_length=1, @@ -9086,7 +10350,7 @@ class DisplayName(RootModel[str]): ] = None -class Description(RootModel[str]): +class Description4(RootModel[str]): root: Annotated[ str | None, Field( @@ -9103,7 +10367,7 @@ class CreateGridRouteRequest(BaseModel): extra="forbid", ) team_id: Annotated[ - TeamId5 | None, + TeamId6 | None, Field( description="Identifier of the team that owns the route.", examples=["abc1234"], @@ -9113,7 +10377,7 @@ class CreateGridRouteRequest(BaseModel): display_name: Annotated[ DisplayName | None, Field( - description="Display label. Omit to use the route name; null is not accepted.", + description="Display label. Omit to use the route's name; required for INTELLIGENT targets. Null is not accepted.", examples=["Assistant"], title="Display Name", ), @@ -9122,9 +10386,9 @@ class CreateGridRouteRequest(BaseModel): Annotated[ UpsertGridRouteTargetBasetenModelAPI | UpsertGridRouteTargetConnection - | UpsertGridRouteTargetClassifier, + | UpsertGridRouteTargetIntelligent, Field( - description="Upstream target for the route. CONNECTION targets use the provider and credentials of a connection owned by the route's team.", + description="Upstream target for the route. CONNECTION targets use the provider and credentials of a connection owned by the route's team. INTELLIGENT targets need at least one of the route classifier's models, and one of its fallback models, servable by the team.", discriminator="type", examples=[{"model": "zai-org/GLM-5.3", "type": "BASETEN_MODEL_API"}], title="Target", @@ -9134,7 +10398,7 @@ class CreateGridRouteRequest(BaseModel): Field(union_mode="left_to_right"), ] description: Annotated[ - Description | None, + Description4 | None, Field( description="Short description of the route. Omit for no description; null is not accepted.", examples=["Assistant for code review and debugging."], @@ -9181,6 +10445,7 @@ class GridRouteUsageResult(BaseModel): "VERTEX", "OPENAI_COMPATIBLE", "BEDROCK", + "AZURE", ] | str | None, @@ -9188,11 +10453,18 @@ class GridRouteUsageResult(BaseModel): description="Provider that served the requests. Null when not grouping by PROVIDER." ), ] = None - intelligent_route: Annotated[ + intelligent_route_id: Annotated[ + str | None, + Field( + description="ID of the intelligent route, as `id` in GET /v1/grid/routes. Null when not grouping by INTELLIGENT_ROUTE.", + title="Intelligent Route Id", + ), + ] = None + intelligent_route_display_name: Annotated[ str | None, Field( - description="Name of the intelligent route, as in `GET /v1/grid/routes`. Null when not grouping by INTELLIGENT_ROUTE.", - title="Intelligent Route", + description="Display name of the intelligent route. Null when `intelligent_route_id` is null or the route cannot be resolved.", + title="Intelligent Route Display Name", ), ] = None harness: Annotated[ @@ -9201,6 +10473,20 @@ class GridRouteUsageResult(BaseModel): description="Coding harness. Null when not grouping by HARNESS, when no harness was recorded (including usage from before harness tracking), or when the recorded harness is not recognized by this API version." ), ] = None + api_key_prefix: Annotated[ + str | None, + Field( + description="Prefix of the API key that made the requests, matching `GET /v1/api_keys`. Null when not grouping by API_KEY, for usage without an API key, and for usage recorded before API key tracking.", + title="Api Key Prefix", + ), + ] = None + api_key_name: Annotated[ + str | None, + Field( + description="Name of the API key. Null when `api_key_prefix` is null or the key has no name.", + title="Api Key Name", + ), + ] = None cost_usd: Annotated[ str, Field( @@ -9249,7 +10535,7 @@ class GridRouteTombstone(BaseModel): name: Annotated[str, Field(description="Name of the deleted route.", title="Name")] -class Description1(RootModel[str]): +class Description5(RootModel[str]): root: Annotated[ str | None, Field( @@ -9279,7 +10565,7 @@ class UpdateGridRouteRequest(BaseModel): extra="forbid", ) description: Annotated[ - Description1 | None, + Description5 | None, Field( description="New description. Omit to keep the current description; use an empty string to clear it. Null is not accepted.", examples=["Assistant for code review and debugging."], @@ -9294,16 +10580,6 @@ class UpdateGridRouteRequest(BaseModel): title="Display Name", ), ] = None - target: Annotated[ - UpsertGridRouteTargetBasetenModelAPI - | UpsertGridRouteTargetConnection - | UpsertGridRouteTargetClassifier - | None, - Field( - description="Complete new target configuration. Omit to keep the current configuration; null is not accepted. Only the CLASSIFIER configuration of a router route is mutable.", - title="Target", - ), - ] = None class GridTeamSpendLimitSetting(BaseModel): @@ -9518,6 +10794,34 @@ class GridConnectionConfigAnthropic(BaseModel): ] +class GridConnectionConfigAzure(BaseModel): + provider: Annotated[ + Literal["AZURE"], + Field(description="Provider kind for Microsoft Azure.", title="Provider"), + ] + secret_id: Annotated[ + str, + Field( + description="Identifier of the team secret holding the provider API key.", + title="Secret Id", + ), + ] + secret_name: Annotated[ + str, + Field( + description="Name of the team secret holding the provider API key.", + title="Secret Name", + ), + ] + resource_name: Annotated[ + str, + Field( + description="Name of the Azure AI Foundry or Azure OpenAI resource.", + title="Resource Name", + ), + ] + + class GridConnectionConfigBedrock(BaseModel): provider: Annotated[ Literal["BEDROCK"], @@ -9652,7 +10956,8 @@ class GridConnection(BaseModel): | GridConnectionConfigOpenAI | GridConnectionConfigXAI | GridConnectionConfigVertex - | GridConnectionConfigBedrock, + | GridConnectionConfigBedrock + | GridConnectionConfigAzure, Field( description="Provider the connection authenticates with, and the team secret holding its API key.", discriminator="provider", @@ -9725,6 +11030,37 @@ class UpsertGridConnectionConfigAnthropic(BaseModel): ] +class UpsertGridConnectionConfigAzure(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + provider: Annotated[ + Literal["AZURE"], + Field( + description="Provider kind for Microsoft Azure. Route targets name a deployment, which must be named after its Azure model. Claude models (`claude-*`) use the Anthropic Messages API, and other models use the OpenAI-compatible APIs.", + title="Provider", + ), + ] + secret_name: Annotated[ + str, + Field( + description="Name of an existing secret, owned by the same team, that holds the provider API key.", + examples=["anthropic-key"], + min_length=1, + title="Secret Name", + ), + ] + resource_name: Annotated[ + str, + Field( + description="Name of the Azure AI Foundry or Azure OpenAI resource, the subdomain of `.openai.azure.com`.", + examples=["my-foundry-resource"], + min_length=1, + title="Resource Name", + ), + ] + + class UpsertGridConnectionConfigBedrock(BaseModel): model_config = ConfigDict( extra="forbid", @@ -9843,7 +11179,7 @@ class UpsertGridConnectionConfigXAI(BaseModel): ] -class TeamId6(RootModel[str]): +class TeamId7(RootModel[str]): root: Annotated[ str | None, Field( @@ -9860,7 +11196,7 @@ class CreateGridConnectionRequest(BaseModel): extra="forbid", ) team_id: Annotated[ - TeamId6 | None, + TeamId7 | None, Field( description="Identifier of the team that owns the connection.", examples=["abc1234"], @@ -9873,7 +11209,8 @@ class CreateGridConnectionRequest(BaseModel): | UpsertGridConnectionConfigOpenAI | UpsertGridConnectionConfigXAI | UpsertGridConnectionConfigVertex - | UpsertGridConnectionConfigBedrock, + | UpsertGridConnectionConfigBedrock + | UpsertGridConnectionConfigAzure, Field( description="Provider the connection authenticates with, and the team secret holding its API key.", discriminator="provider", @@ -9903,7 +11240,8 @@ class UpdateGridConnectionRequest(BaseModel): | UpsertGridConnectionConfigOpenAI | UpsertGridConnectionConfigXAI | UpsertGridConnectionConfigVertex - | UpsertGridConnectionConfigBedrock, + | UpsertGridConnectionConfigBedrock + | UpsertGridConnectionConfigAzure, Field( description="Complete new connection configuration, replacing the current one. The provider must match the connection and is immutable.", discriminator="provider", @@ -9916,15 +11254,6 @@ class UpdateGridConnectionRequest(BaseModel): ] -class GridClassifiersResponse(BaseModel): - items: Annotated[ - list[GridClassifier], Field(description="Items in this page.", title="Items") - ] - pagination: Annotated[ - PaginationResponse, Field(description="Pagination metadata for the page.") - ] - - class GridRouteClassifiersResponse(BaseModel): items: Annotated[ list[GridRouteClassifier], @@ -9985,7 +11314,7 @@ class GridMachineUsersResponse(BaseModel): ] -class Name5(RootModel[str]): +class Name12(RootModel[str]): root: Annotated[ str | None, Field( @@ -10003,7 +11332,7 @@ class CreateGridMachineUserAPIKeyRequest(BaseModel): extra="forbid", ) name: Annotated[ - Name5 | None, + Name12 | None, Field( description="Name of the API key: lowercase letters, numbers, and hyphens, at most 255 characters, and unique among the machine user's active keys. Defaults to a name derived from the machine user's.", examples=["production"], @@ -10012,7 +11341,7 @@ class CreateGridMachineUserAPIKeyRequest(BaseModel): ] = None -class TeamId7(RootModel[str]): +class TeamId8(RootModel[str]): root: Annotated[ str | None, Field( @@ -10029,7 +11358,7 @@ class CreateGridMachineUserRequest(BaseModel): extra="forbid", ) team_id: Annotated[ - TeamId7 | None, + TeamId8 | None, Field( description="Identifier of the team that owns the machine user. Defaults to your only team, if you belong to exactly one.", examples=["abc1234"], @@ -10107,7 +11436,7 @@ class GridMachineUserTombstone(BaseModel): ] -class Name6(RootModel[str]): +class Name13(RootModel[str]): root: Annotated[ str | None, Field( @@ -10124,7 +11453,7 @@ class UpdateGridMachineUserRequest(BaseModel): extra="forbid", ) name: Annotated[ - Name6 | None, + Name13 | None, Field( description="Name of the machine user, unique within its team. At most 255 characters. Omit to keep it.", title="Name", @@ -10390,7 +11719,7 @@ class EffectiveRateLimit(BaseModel): ] -class Name7(RootModel[str]): +class Name14(RootModel[str]): root: Annotated[ str | None, Field( @@ -10404,7 +11733,7 @@ class Name7(RootModel[str]): class GroupMetadata(BaseModel): name: Annotated[ - Name7 | None, + Name14 | None, Field( description="Optional display name for the group.", examples=["Acme prod"], @@ -10508,7 +11837,7 @@ class CreateGroupHierarchy(BaseModel): class UpdateGroupMetadata(BaseModel): name: Annotated[ - Name7 | None, + Name14 | None, Field( description="Optional display name for the group.", examples=["Acme prod"], @@ -11369,6 +12698,7 @@ class GetAuditLogsParams(BaseModel): "DIRECTORY_GROUP_MANAGEMENT", "SSH", "TELEMETRY_EXPORT", + "WORKLOAD_IDENTITY", ] | str ] @@ -11482,6 +12812,7 @@ class GetModelsAuditLogsParams(BaseModel): "DIRECTORY_GROUP_MANAGEMENT", "SSH", "TELEMETRY_EXPORT", + "WORKLOAD_IDENTITY", ] | str ] @@ -11725,6 +13056,43 @@ class GetModelsDeploymentsStartupsParams(BaseModel): ] = None +class GetModelsDeploymentsReplicasParams(BaseModel): + cursor: Annotated[ + str | None, + Field( + description="Opaque cursor returned by a previous page. Omit to fetch the first page.", + title="Cursor", + ), + ] = None + limit: Annotated[ + int, + Field( + description="Maximum number of items to return.", + ge=1, + le=1000, + title="Limit", + ), + ] = 100 + statuses: Annotated[ + list[ + Literal[ + "STARTING", + "ACTIVE", + "UNHEALTHY", + "TERMINATING", + "TERMINATED", + "UNKNOWN", + ] + | str + ] + | None, + Field( + description="Replica statuses to include. Repeat the statuses query parameter to filter by multiple statuses. Omit to include all statuses, including terminated replicas.", + title="Statuses", + ), + ] = None + + class GetModelsEnvironmentsLogsParams(BaseModel): start_epoch_millis: Annotated[ int | None, @@ -11908,6 +13276,43 @@ class GetModelsEnvironmentsStartupsParams(BaseModel): ] = None +class GetModelsEnvironmentsReplicasParams(BaseModel): + cursor: Annotated[ + str | None, + Field( + description="Opaque cursor returned by a previous page. Omit to fetch the first page.", + title="Cursor", + ), + ] = None + limit: Annotated[ + int, + Field( + description="Maximum number of items to return.", + ge=1, + le=1000, + title="Limit", + ), + ] = 100 + statuses: Annotated[ + list[ + Literal[ + "STARTING", + "ACTIVE", + "UNHEALTHY", + "TERMINATING", + "TERMINATED", + "UNKNOWN", + ] + | str + ] + | None, + Field( + description="Replica statuses to include. Repeat the statuses query parameter to filter by multiple statuses. Omit to include all statuses, including terminated replicas.", + title="Statuses", + ), + ] = None + + class GetChainsAuditLogsParams(BaseModel): cursor: Annotated[ str | None, @@ -11961,6 +13366,7 @@ class GetChainsAuditLogsParams(BaseModel): "DIRECTORY_GROUP_MANAGEMENT", "SSH", "TELEMETRY_EXPORT", + "WORKLOAD_IDENTITY", ] | str ] @@ -12301,6 +13707,13 @@ class GetModelApisMetricsParams(BaseModel): title="Metrics", ), ] = None + team_ids: Annotated[ + list[str] | None, + Field( + description="Return only metrics for these teams, repeated once per team. Defaults to all teams you can manage. Any unauthorized team causes a 403.", + title="Team Ids", + ), + ] = None class GetBillingModelApisParams(BaseModel): @@ -12410,6 +13823,46 @@ class GetBillingToolCallUsageParams(BaseModel): ] = None +class GetAccessIdentityProvidersParams(BaseModel): + cursor: Annotated[ + str | None, + Field( + description="Opaque cursor returned by a previous page. Omit to fetch the first page.", + title="Cursor", + ), + ] = None + limit: Annotated[ + int, + Field( + description="Maximum number of items to return.", + ge=1, + le=1000, + title="Limit", + ), + ] = 100 + name: Annotated[ + Name2 | None, + Field( + description="Only the provider with this name, ignoring case", title="Name" + ), + ] = None + predefined_kind: Annotated[ + Literal[ + "GITHUB_ACTIONS", + "GCP", + "BASETEN", + "AWS_IAM", + "AWS_EKS", + "AZURE_MANAGED_IDENTITY_V1", + "AZURE_MANAGED_IDENTITY_V2", + "AZURE_AKS", + ] + | str + | None, + Field(description="Only this predefined provider's issuers"), + ] = None + + class GetGridRoutesUsageParams(BaseModel): cursor: Annotated[ str | None, @@ -12450,12 +13903,20 @@ class GetGridRoutesUsageParams(BaseModel): ] = None group_by: Annotated[ list[ - Literal["USER", "TEAM", "MODEL", "PROVIDER", "INTELLIGENT_ROUTE", "HARNESS"] + Literal[ + "USER", + "TEAM", + "MODEL", + "PROVIDER", + "INTELLIGENT_ROUTE", + "HARNESS", + "API_KEY", + ] | str ] | None, Field( - description="Dimensions to break usage down by, repeated once per dimension: USER, TEAM, MODEL, PROVIDER, INTELLIGENT_ROUTE, or HARNESS. Each result represents one observed combination of the requested dimensions within that day, and results are sorted by those values. Combinations without usage are omitted, so result counts can differ between days. INTELLIGENT_ROUTE returns only usage sent through an intelligent route, one row per intelligent route, or per intelligent route and model with MODEL. These rows repeat usage already counted in other groupings, so don't add them to model totals. HARNESS includes usage with no recorded harness as a null group. Defaults to MODEL.", + description="Dimensions to break usage down by, repeated once per dimension: USER, TEAM, MODEL, PROVIDER, INTELLIGENT_ROUTE, HARNESS, or API_KEY. Each result represents one observed combination of the requested dimensions within that day, and results are sorted by those values. Combinations without usage are omitted, so result counts can differ between days. INTELLIGENT_ROUTE returns only usage sent through an intelligent route, one row per intelligent route, or per intelligent route and model with MODEL. These rows repeat usage already counted in other groupings, so don't add them to model totals. HARNESS includes usage with no recorded harness as a null group. API_KEY includes usage without an API key, such as requests authenticated by a signed-in session, as a null group. Defaults to MODEL.", title="Group By", ), ] = None @@ -12483,6 +13944,7 @@ class GetGridRoutesUsageParams(BaseModel): "VERTEX", "OPENAI_COMPATIBLE", "BEDROCK", + "AZURE", ] | str ] @@ -12499,6 +13961,13 @@ class GetGridRoutesUsageParams(BaseModel): title="Harnesses", ), ] = None + api_key_prefixes: Annotated[ + list[str] | None, + Field( + description="Return only usage made with these API keys, repeated once per key prefix. Omit to include all usage, including usage without an API key.", + title="Api Key Prefixes", + ), + ] = None class GetSandboxMetricsParams(BaseModel): @@ -12970,6 +14439,27 @@ class AuditLogEventEnvironmentUpdated(BaseModel): previous_settings: AuditLogEventEnvironmentSettings | None +class AuditLogEventIdentityProviderCreated(BaseModel): + event_type: Annotated[ + Literal["IDENTITY_PROVIDER_CREATED"], Field(title="Event Type") + ] + identity_provider_id: Annotated[str, Field(title="Identity Provider Id")] + name: Annotated[str, Field(title="Name")] + description: Annotated[ + str | None, + Field( + description="Null when the provider was added without one.", + title="Description", + ), + ] = None + predefined: Annotated[ + AuditLogEventPredefinedIdentityProviderConfig, + Field( + description="The provider's settings, as the identity provider resource returns them." + ), + ] + + class AuditLogEventModelDeployed(BaseModel): event_type: Annotated[Literal["MODEL_DEPLOYED"], Field(title="Event Type")] model_id: Annotated[str, Field(title="Model Id")] @@ -13062,10 +14552,31 @@ class AuditLogEventModelPromotionControlAction(BaseModel): ] | str, Field( - description="User-initiated promotion control signal recorded on a promotion-control event.", - title="AuditLogPromotionControlActionV1", + description="User-initiated promotion control signal recorded on a promotion-control event.", + title="AuditLogPromotionControlActionV1", + ), + ] + + +class AuditLogEventServiceAccountCreated(BaseModel): + event_type: Annotated[Literal["SERVICE_ACCOUNT_CREATED"], Field(title="Event Type")] + service_account_id: Annotated[str, Field(title="Service Account Id")] + name: Annotated[str, Field(title="Name")] + description: Annotated[ + str | None, + Field( + description="Null when the account was created without one.", + title="Description", + ), + ] = None + owner_team_id: Annotated[ + str | None, + Field( + description="The team that owns the account. Null for an organization account.", + title="Owner Team Id", ), - ] + ] = None + preset_permissions: AuditLogEventServiceAccountPresetPermissions class Deployment(BaseModel): @@ -13158,6 +14669,13 @@ class Deployment(BaseModel): description="Effective request backpressure settings for the deployment." ), ] + failure_reason: Annotated[ + str | None, + Field( + description="Why the deployment failed. Set only when the status is DEPLOY_FAILED; null otherwise.", + title="Failure Reason", + ), + ] = None class CreatedModelDeployment(BaseModel): @@ -13542,10 +15060,10 @@ class TrafficRoutingRuleUpsert(BaseModel): sampling_mode: Annotated[ Literal["RANDOM", "USER_SESSION"] | str, Field( - description="How requests are picked for shadowing", + description="How requests are picked for shadowing. Defaults to USER_SESSION.", title="TrafficRoutingRuleShadowSamplingModeV1", ), - ] + ] = "USER_SESSION" propagate_client_cancellation: Annotated[ bool, Field( @@ -13915,7 +15433,14 @@ class UpdateChainletEnvironmentInstanceTypeResponse(BaseModel): ] +class TrainingBDNConfigResponse(BaseModel): + mounts: Annotated[list[TrainingBDNMountResponse] | None, Field(title="Mounts")] = ( + None + ) + + class TrainingJob(BaseModel): + bdn: TrainingBDNConfigResponse | None = None id: Annotated[ str, Field(description="Unique identifier of the training job.", title="Id") ] @@ -14226,6 +15751,15 @@ class RegistrySecretDockerAuth(BaseModel): ] +class TrainingBDNConfig(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + mounts: Annotated[ + list[TrainingBDNMount] | None, Field(max_length=32, title="Mounts") + ] = None + + class CreateTrainingJobResponse(BaseModel): training_job: Annotated[TrainingJob, Field(description="The created training job.")] @@ -14266,35 +15800,63 @@ class TrainingJobMetrics(BaseModel): gpu_memory_usage_bytes: Annotated[ dict[str, list[TrainingJobMetric]], Field( - description="A map of GPU rank to memory usage for the training job. For multinode jobs, this is the memory usage of the leader unless specified otherwise.", + description="A map of GPU rank to memory usage for the training job. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", title="Gpu Memory Usage Bytes", ), ] gpu_utilization: Annotated[ dict[str, list[TrainingJobMetric]], Field( - description="A map of GPU rank to fractional GPU utilization. For multinode jobs, this is the GPU utilization of the leader unless specified otherwise.", + description="A map of GPU rank to the share of time the GPU's streaming multiprocessors have work assigned, from 0 to 1. This counts any GPU work, not only tensor core math; see gpu_tensor_core_utilization for that. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", title="Gpu Utilization", ), ] + gpu_temperature_celsius: Annotated[ + dict[str, list[TrainingJobMetric]], + Field( + description="A map of GPU rank to GPU temperature in degrees Celsius. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", + title="Gpu Temperature Celsius", + ), + ] + gpu_power_usage_watts: Annotated[ + dict[str, list[TrainingJobMetric]], + Field( + description="A map of GPU rank to GPU power draw in watts. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", + title="Gpu Power Usage Watts", + ), + ] + gpu_tensor_core_utilization: Annotated[ + dict[str, list[TrainingJobMetric]], + Field( + description="A map of GPU rank to the share of time the GPU tensor cores are active, from 0 to 1. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", + title="Gpu Tensor Core Utilization", + ), + ] + gpu_memory_bandwidth_utilization: Annotated[ + dict[str, list[TrainingJobMetric]], + Field( + description="A map of GPU rank to the share of cycles GPU memory is actively reading or writing, from 0 to 1. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", + title="Gpu Memory Bandwidth Utilization", + ), + ] cpu_usage: Annotated[ list[TrainingJobMetric], Field( - description="The CPU usage measured in cores. For multinode jobs, this is the CPU usage of the leader unless specified otherwise.", + description="The CPU usage measured in cores. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", title="Cpu Usage", ), ] cpu_memory_usage_bytes: Annotated[ list[TrainingJobMetric], Field( - description="The CPU memory usage for the training job. For multinode jobs, this is the CPU memory usage of the leader unless specified otherwise.", + description="The CPU memory usage for the training job. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", title="Cpu Memory Usage Bytes", ), ] ephemeral_storage: Annotated[ StorageMetrics, Field( - description="The storage usage for the ephemeral storage. For multinode jobs, this is the ephemeral storage usage of the leader unless specified otherwise." + description="The storage usage for the ephemeral storage. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node." ), ] @@ -14310,35 +15872,63 @@ class GetTrainingJobMetricsResponse(BaseModel): gpu_memory_usage_bytes: Annotated[ dict[str, list[TrainingJobMetric]], Field( - description="A map of GPU rank to memory usage for the training job. For multinode jobs, this is the memory usage of the leader unless specified otherwise.", + description="A map of GPU rank to memory usage for the training job. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", title="Gpu Memory Usage Bytes", ), ] gpu_utilization: Annotated[ dict[str, list[TrainingJobMetric]], Field( - description="A map of GPU rank to fractional GPU utilization. For multinode jobs, this is the GPU utilization of the leader unless specified otherwise.", + description="A map of GPU rank to the share of time the GPU's streaming multiprocessors have work assigned, from 0 to 1. This counts any GPU work, not only tensor core math; see gpu_tensor_core_utilization for that. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", title="Gpu Utilization", ), ] + gpu_temperature_celsius: Annotated[ + dict[str, list[TrainingJobMetric]], + Field( + description="A map of GPU rank to GPU temperature in degrees Celsius. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", + title="Gpu Temperature Celsius", + ), + ] + gpu_power_usage_watts: Annotated[ + dict[str, list[TrainingJobMetric]], + Field( + description="A map of GPU rank to GPU power draw in watts. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", + title="Gpu Power Usage Watts", + ), + ] + gpu_tensor_core_utilization: Annotated[ + dict[str, list[TrainingJobMetric]], + Field( + description="A map of GPU rank to the share of time the GPU tensor cores are active, from 0 to 1. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", + title="Gpu Tensor Core Utilization", + ), + ] + gpu_memory_bandwidth_utilization: Annotated[ + dict[str, list[TrainingJobMetric]], + Field( + description="A map of GPU rank to the share of cycles GPU memory is actively reading or writing, from 0 to 1. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", + title="Gpu Memory Bandwidth Utilization", + ), + ] cpu_usage: Annotated[ list[TrainingJobMetric], Field( - description="The CPU usage measured in cores. For multinode jobs, this is the CPU usage of the leader unless specified otherwise.", + description="The CPU usage measured in cores. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", title="Cpu Usage", ), ] cpu_memory_usage_bytes: Annotated[ list[TrainingJobMetric], Field( - description="The CPU memory usage for the training job. For multinode jobs, this is the CPU memory usage of the leader unless specified otherwise.", + description="The CPU memory usage for the training job. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", title="Cpu Memory Usage Bytes", ), ] ephemeral_storage: Annotated[ StorageMetrics, Field( - description="The storage usage for the ephemeral storage. For multinode jobs, this is the ephemeral storage usage of the leader unless specified otherwise." + description="The storage usage for the ephemeral storage. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node." ), ] training_job: Annotated[TrainingJob, Field(description="The training job.")] @@ -14444,12 +16034,6 @@ class CreateLoopsRunResponse(BaseModel): run: LoopsRun -class GetLoopsRunResponse(BaseModel): - run: Annotated[ - LoopsRun, Field(description="The Loops run with its associated sampler.") - ] - - class LoopsCheckpoint(BaseModel): checkpoint_id: Annotated[ str, Field(description="The ID of the checkpoint.", title="Checkpoint Id") @@ -14507,6 +16091,30 @@ class LoopsCheckpoint(BaseModel): title="TrainerCheckpointTarget", ), ] + expires_at: Annotated[ + AwareDatetime | None, + Field( + description="When the checkpoint expires and is deleted, set from the TTL it was saved with. Null means it's kept until you delete it. A checkpoint that's still in use when it expires, for example deployed, is deleted once it's released.", + title="Expires At", + ), + ] + + +class DeleteLoopsRunResponse(BaseModel): + id: Annotated[str, Field(description="The deleted Loops run ID.", title="Id")] + kept_checkpoints: Annotated[ + list[LoopsCheckpoint], + Field( + description="The run's checkpoints that were not deleted because something still uses them, such as a deployment. They stay usable until that stops.", + title="Kept Checkpoints", + ), + ] + + +class GetLoopsRunResponse(BaseModel): + run: Annotated[ + LoopsRun, Field(description="The Loops run with its associated sampler.") + ] class ListLoopsCheckpointsResponse(BaseModel): @@ -15351,7 +16959,7 @@ class DedicatedUsage(BaseModel): subtotal: Annotated[ float | Subtotal5, Field( - description="Subtotal cost in dollars after applying credits used", + description="Usage charges in dollars before applying credits", title="Subtotal", ), ] @@ -15428,7 +17036,7 @@ class TrainingUsage(BaseModel): subtotal: Annotated[ float | Subtotal13, Field( - description="Subtotal cost in dollars after applying credits used", + description="Usage charges in dollars before applying credits", title="Subtotal", ), ] @@ -15437,7 +17045,7 @@ class TrainingUsage(BaseModel): Field(description="Credits applied in dollars", title="Credits Used"), ] total: Annotated[ - float | Total, Field(description="Total cost in dollars", title="Total") + float | Total3, Field(description="Total cost in dollars", title="Total") ] minutes: Annotated[int, Field(description="Total minutes used", title="Minutes")] breakdown: Annotated[ @@ -15446,6 +17054,137 @@ class TrainingUsage(BaseModel): ] = None +class ServiceAccountPresetPermissions(BaseModel): + type: Annotated[ + Literal[ + "WORKSPACE_MANAGE_ALL", + "WORKSPACE_INVOKE", + "WORKSPACE_EXPORT_METRICS", + "WORKSPACE_MANAGE_API_KEYS", + "WORKSPACE_INVOKE_MODEL_APIS", + ] + | str, + Field( + description="What the service account may do. WORKSPACE_MANAGE_API_KEYS is for organization-level accounts only; every other type needs a team.", + examples=["WORKSPACE_MANAGE_ALL"], + title="ServiceAccountPresetTypeV1", + ), + ] + model_ids: Annotated[ + list[str] | None, + Field( + description="WORKSPACE_INVOKE and WORKSPACE_EXPORT_METRICS only. Models the account covers. Omit for every model in the team, including models added later.", + examples=[["abcd1234"]], + title="Model Ids", + ), + ] = None + environment_names: Annotated[ + list[str] | None, + Field( + description="WORKSPACE_INVOKE: environments the account may call; omit for all. With model_ids, each model must have each environment. WORKSPACE_MANAGE_ALL: restricted environments the account may also manage.", + examples=[["production"]], + title="Environment Names", + ), + ] = None + model_api_slugs: Annotated[ + list[str] | None, + Field( + description="WORKSPACE_INVOKE_MODEL_APIS only. Model APIs the account may call; omit for all.", + examples=[["my-model-api"]], + title="Model Api Slugs", + ), + ] = None + + +class ServiceAccount(BaseModel): + id: Annotated[str, Field(description="Service account ID", title="Id")] + name: Annotated[ + str, Field(description="Name, unique in the organization", title="Name") + ] + description: Annotated[ + str | None, Field(description="Description", title="Description") + ] = None + team_id: Annotated[ + str | None, + Field( + description="The team that owns the account. Null for an organization account.", + title="Team Id", + ), + ] = None + preset_permissions: Annotated[ + ServiceAccountPresetPermissions, + Field( + description="What the service account may do. Temporary; may be removed once fine-grained access control is available." + ), + ] + disabled: Annotated[ + bool, + Field( + description="Whether the account is disabled. A disabled account can't be used.", + title="Disabled", + ), + ] + last_used_at: Annotated[ + AwareDatetime | None, + Field( + description="Last time a request authenticated as this account, to within an hour. Null until the first.", + title="Last Used At", + ), + ] = None + created_at: Annotated[ + AwareDatetime, + Field(description="Time the account was created", title="Created At"), + ] + updated_at: Annotated[ + AwareDatetime, + Field(description="Time the account was last updated", title="Updated At"), + ] + + +class ServiceAccounts(BaseModel): + items: Annotated[ + list[ServiceAccount], Field(description="Items in this page.", title="Items") + ] + pagination: Annotated[ + PaginationResponse, Field(description="Pagination metadata for the page.") + ] + + +class IdentityProvider(BaseModel): + id: Annotated[str, Field(description="Identity provider ID", title="Id")] + name: Annotated[ + str, Field(description="Name, unique in the organization", title="Name") + ] + description: Annotated[ + str | None, Field(description="Description", title="Description") + ] = None + predefined: Annotated[ + PredefinedIdentityProviderConfig, + Field(description="Settings of the predefined provider"), + ] + created_by: Annotated[ + str, + Field(description="ID of the user who added the provider", title="Created By"), + ] + created_at: Annotated[ + AwareDatetime, + Field(description="Time the provider was added", title="Created At"), + ] + updated_at: Annotated[ + AwareDatetime, + Field(description="Time the provider was last updated", title="Updated At"), + ] + + +class IdentityProviders(BaseModel): + items: Annotated[ + list[IdentityProvider], Field(description="Items in this page.", title="Items") + ] + pagination: Annotated[ + PaginationResponse, Field(description="Pagination metadata for the page.") + ] + + class ExploreCost(BaseModel): input: Annotated[ float | None, @@ -15554,28 +17293,111 @@ class ExploreMetadataResponse(BaseModel): ] +class GridRouteMetadata(BaseModel): + slug: Annotated[ + str | None, + Field( + description="Metadata slug, e.g. 'anthropic/claude-opus-4'; null for rows without one.", + title="Slug", + ), + ] + display_name: Annotated[ + str | None, + Field(description="Model display name, when available.", title="Display Name"), + ] + release_date: Annotated[ + date_aliased | None, + Field( + description="Model release date. Month-only source dates use the first day of that month.", + title="Release Date", + ), + ] + provider: Annotated[ + str | None, + Field( + description="Provider key derived from the slug prefix, e.g. 'anthropic'; null for unprefixed slugs.", + title="Provider", + ), + ] + context_window: Annotated[ + int | None, + Field(description="Total context window in tokens.", title="Context Window"), + ] + max_output_tokens: Annotated[ + int | None, + Field( + description="Maximum output tokens per response.", title="Max Output Tokens" + ), + ] + input_modalities: Annotated[ + list[str], + Field(description="Accepted input modalities.", title="Input Modalities"), + ] + tools: Annotated[ + bool | None, + Field(description="Whether the model supports tool calling.", title="Tools"), + ] + reasoning_effort_levels: Annotated[ + list[str] | None, + Field( + description="Reasoning effort levels the model supports.", + title="Reasoning Effort Levels", + ), + ] + parallel_tool_calls: Annotated[ + bool | None, + Field( + description="Whether the model supports parallel tool calls.", + title="Parallel Tool Calls", + ), + ] + supported_api_formats: Annotated[ + ExploreMetadataAPIFormats | None, + Field(description="API formats the model supports."), + ] + cost: Annotated[ + ExploreCost | None, + Field(description="Provider list prices in USD per 1M tokens, when available."), + ] + api_formats: Annotated[ + list[Literal["messages", "responses", "chat_completions"] | str], + Field( + description="API formats the route supports, most preferred first: `chat_completions`, `messages`, `responses` for a BASETEN_MODEL_API target and `messages`, `responses`, `chat_completions` for any other target, keeping only the formats the route supports. Never empty.", + min_length=1, + title="Api Formats", + ), + ] + + class GridRoute(BaseModel): id: Annotated[str, Field(description="Stable route identifier.", title="Id")] name: Annotated[ str, Field( - description="Name to send in the inference request's model field.", + description="Name to send in the inference request's `model` field. Unique within the team; immutable.", title="Name", ), ] - team_id: Annotated[ - str, Field(description="Identifier of the owning team.", title="Team Id") - ] - team_name: Annotated[ - str, Field(description="Name of the owning team.", title="Team Name") - ] display_name: Annotated[ str, Field( - description="Display label, defaulting to the route name.", + description="Display label, defaulting to the route's name.", title="Display Name", ), ] + aliases: Annotated[ + list[GridRouteAlias] | None, + Field( + description="The route's other names, one per purpose. Empty for routes created before aliases existed.", + title="Aliases", + ), + ] = None + team_id: Annotated[ + str, Field(description="Identifier of the owning team.", title="Team Id") + ] + team_name: Annotated[ + str, Field(description="Name of the owning team.", title="Team Name") + ] description: Annotated[ str, Field( @@ -15587,7 +17409,6 @@ class GridRoute(BaseModel): Annotated[ GridRouteTargetBasetenModelAPI | GridRouteTargetConnection - | GridRouteTargetClassifier | GridRouteTargetIntelligent, Field( description="Configured upstream target.", @@ -15599,9 +17420,9 @@ class GridRoute(BaseModel): Field(union_mode="left_to_right"), ] metadata: Annotated[ - ExploreMetadata | None, + GridRouteMetadata | None, Field( - description="Resolved model metadata; for a router, the envelope of its allowed routes' metadata. Null when nothing is linked." + description="Resolved model metadata; for an intelligent route, the envelope of its servable models' metadata. Null when nothing is linked or the metadata has no supported API formats." ), ] invoke_url: Annotated[ @@ -16367,6 +18188,16 @@ class AuditLogEntry(BaseModel): "TELEMETRY_EXPORT_CREATED", "TELEMETRY_EXPORT_UPDATED", "TELEMETRY_EXPORT_DELETED", + "SERVICE_ACCOUNT_CREATED", + "SERVICE_ACCOUNT_UPDATED", + "SERVICE_ACCOUNT_DELETED", + "IDENTITY_PROVIDER_CREATED", + "IDENTITY_PROVIDER_UPDATED", + "IDENTITY_PROVIDER_DELETED", + "TRUST_RULE_CREATED", + "TRUST_RULE_UPDATED", + "TRUST_RULE_DELETED", + "ORGANIZATION_API_KEY_SETTINGS_UPDATED", ] | str, Field( @@ -16401,6 +18232,7 @@ class AuditLogEntry(BaseModel): | AuditLogEventApiKeyCreated | AuditLogEventApiKeyDeleted | AuditLogEventApiKeyLifetimeLimitsUpdated + | AuditLogEventOrganizationApiKeySettingsUpdated | AuditLogEventGatewayEndpointCreated | AuditLogEventGatewayEndpointUpdated | AuditLogEventGatewayEndpointDeleted @@ -16434,7 +18266,16 @@ class AuditLogEntry(BaseModel): | AuditLogEventVolumeUpdated | AuditLogEventTelemetryExportCreated | AuditLogEventTelemetryExportUpdated - | AuditLogEventTelemetryExportDeleted, + | AuditLogEventTelemetryExportDeleted + | AuditLogEventServiceAccountCreated + | AuditLogEventServiceAccountUpdated + | AuditLogEventServiceAccountDeleted + | AuditLogEventIdentityProviderCreated + | AuditLogEventIdentityProviderUpdated + | AuditLogEventIdentityProviderDeleted + | AuditLogEventTrustRuleCreated + | AuditLogEventTrustRuleUpdated + | AuditLogEventTrustRuleDeleted, Field( description="Structured details of the action, discriminated by `event_type`.", discriminator="event_type", @@ -17480,6 +19321,7 @@ class CreateTrainingJobImage(BaseModel): class CreateTrainingJob(BaseModel): + bdn: TrainingBDNConfig | None = None image: Annotated[ CreateTrainingJobImage, Field(examples=[{"base_image": "hello-world", "docker_auth": None}]), diff --git a/baseten/client/modelconfig/__init__.py b/baseten/client/modelconfig/__init__.py index 3215dcf..672e898 100644 --- a/baseten/client/modelconfig/__init__.py +++ b/baseten/client/modelconfig/__init__.py @@ -17,6 +17,8 @@ BDNConfig, BDNHotload, BDNVolumeMount, + BEIConfiguration, + BEIModelConfiguration, Build, CheckpointList, CheckpointRepository, @@ -74,6 +76,8 @@ "BDNConfig", "BDNHotload", "BDNVolumeMount", + "BEIConfiguration", + "BEIModelConfiguration", "BaseImage", "Build", "CheckpointList", diff --git a/baseten/client/modelconfig/_models.py b/baseten/client/modelconfig/_models.py index 64ca410..05b942a 100644 --- a/baseten/client/modelconfig/_models.py +++ b/baseten/client/modelconfig/_models.py @@ -71,6 +71,25 @@ class BDNVolumeMount(BaseModel): ] = None +class BEIModelConfiguration(BaseModel): + model_config = ConfigDict( + extra="allow", + ) + checkpoint: Annotated[ + str, + Field( + description="Hugging Face repository to download through weights, or an absolute path to manually mounted weights.", + min_length=1, + title="Checkpoint", + ), + ] + revision: Annotated[str | None, Field(title="Revision")] = None + served_model_name: Annotated[str | None, Field(title="Served Model Name")] = None + quantization: Annotated[ + Literal["none", "fp8", "mxfp8", "nvfp4"] | str, Field(title="Quantization") + ] = "none" + + class DockerServer(BaseModel): model_config = ConfigDict( extra="allow", @@ -85,7 +104,7 @@ class DockerServer(BaseModel): server_port: Annotated[ int, Field( - description="The port where the server runs. Port 8080 is reserved by Baseten's internal reverse proxy and cannot be used.", + description="The port where the server runs. Port 8080 is reserved when Truss installs its internal reverse proxy; no_build deployments can use 8080.", title="Server Port", ), ] @@ -234,14 +253,14 @@ class HealthChecks(BaseModel): restart_threshold_seconds: Annotated[ int | None, Field( - description="The time in seconds after which an unhealthy instance is restarted. Defaults to platform-determined value when not set.", + description="The time in seconds after which an unhealthy instance is restarted. With trt_llm, defaults to 60 and must be <= 60. Otherwise defaults to platform-determined value when not set.", title="Restart Threshold Seconds", ), ] = None stop_traffic_threshold_seconds: Annotated[ int | None, Field( - description="The time in seconds after which traffic is stopped to an unhealthy instance. Defaults to platform-determined value when not set.", + description="The time in seconds after which traffic is stopped to an unhealthy instance. With trt_llm, defaults to 30 and must be <= 30. Otherwise defaults to platform-determined value when not set.", title="Stop Traffic Threshold Seconds", ), ] = None @@ -318,7 +337,7 @@ class Resources(BaseModel): accelerator: Annotated[ str | None, Field( - description="The GPU type for your instance. To request multiple GPUs, use the ':' operator (e.g. L4:4).", + description="The accelerator type for your instance. To request multiple accelerators, use the ':' operator (e.g. L4:4).", examples=["A100", "T4:2", "H100:8"], ), ] = None @@ -590,6 +609,17 @@ class BDNConfig(BaseModel): ] = None +class BEIConfiguration(BaseModel): + model_config = ConfigDict( + extra="allow", + ) + backend: Annotated[Literal["nvidia", "tpu"] | str, Field(title="Backend")] + version_override: Annotated[str | None, Field(title="Version Override")] = None + configuration: Annotated[ + list[BEIModelConfiguration], Field(min_length=1, title="Configuration") + ] + + class BISLLM(BaseModel): model_config = ConfigDict( extra="allow", @@ -908,7 +938,8 @@ class WeightsAuth(BaseModel): ), ] = None auth_method: Annotated[ - Literal["CUSTOM_SECRET", "AWS_OIDC", "GCP_OIDC", "AWS_ASSUME_ROLE"] | str, + Literal["CUSTOM_SECRET", "AWS_OIDC", "GCP_OIDC", "HF_OIDC", "AWS_ASSUME_ROLE"] + | str, Field( description="Authentication method for downloading weights from the source.", title="WeightsAuthMethod", @@ -921,6 +952,13 @@ class WeightsAuth(BaseModel): title="Auth Secret Name", ), ] = None + hf_oidc_resource: Annotated[ + str | None, + Field( + description="Hugging Face repository (namespace/name) or username for OIDC token exchange.", + title="Hf Oidc Resource", + ), + ] = None class WeightsSource(BaseModel): @@ -1136,6 +1174,12 @@ class ModelConfig(BaseModel): TRTLLMConfigurationV1 | TRTLLMConfigurationV2 | None, Field(description="TensorRT-LLM configuration for optimized LLM inference."), ] = None + bei: Annotated[ + BEIConfiguration | None, + Field( + description="BEIv3 encoder serving without an engine-build job. Hugging Face checkpoints use runtime weights mounts. Requires explicit restart and stop-traffic health thresholds of 1–60 seconds." + ), + ] = None training_checkpoints: Annotated[ CheckpointList | None, Field(description="Configuration for deploying from training checkpoints."), diff --git a/scripts/apigen/specs/config.schema.json b/scripts/apigen/specs/config.schema.json index b9fbb1d..dc08074 100644 --- a/scripts/apigen/specs/config.schema.json +++ b/scripts/apigen/specs/config.schema.json @@ -167,6 +167,96 @@ "title": "BDNVolumeMount", "type": "object" }, + "BEIConfiguration": { + "additionalProperties": true, + "properties": { + "backend": { + "enum": [ + "nvidia", + "tpu" + ], + "title": "Backend", + "type": "string" + }, + "version_override": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Version Override" + }, + "configuration": { + "items": { + "$ref": "#/$defs/BEIModelConfiguration" + }, + "minItems": 1, + "title": "Configuration", + "type": "array" + } + }, + "required": [ + "backend", + "configuration" + ], + "title": "BEIConfiguration", + "type": "object" + }, + "BEIModelConfiguration": { + "additionalProperties": true, + "properties": { + "checkpoint": { + "description": "Hugging Face repository to download through weights, or an absolute path to manually mounted weights.", + "minLength": 1, + "title": "Checkpoint", + "type": "string" + }, + "revision": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Revision" + }, + "served_model_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Served Model Name" + }, + "quantization": { + "default": "none", + "enum": [ + "none", + "fp8", + "mxfp8", + "nvfp4" + ], + "title": "Quantization", + "type": "string" + } + }, + "required": [ + "checkpoint" + ], + "title": "BEIModelConfiguration", + "type": "object" + }, "BISLLM": { "additionalProperties": true, "description": "Configuration options for BIS LLM deployments.", @@ -519,7 +609,7 @@ "title": "Start Command" }, "server_port": { - "description": "The port where the server runs. Port 8080 is reserved by Baseten's internal reverse proxy and cannot be used.", + "description": "The port where the server runs. Port 8080 is reserved when Truss installs its internal reverse proxy; no_build deployments can use 8080.", "title": "Server Port", "type": "integer" }, @@ -783,7 +873,7 @@ } ], "default": null, - "description": "The time in seconds after which an unhealthy instance is restarted. Defaults to platform-determined value when not set.", + "description": "The time in seconds after which an unhealthy instance is restarted. With trt_llm, defaults to 60 and must be <= 60. Otherwise defaults to platform-determined value when not set.", "title": "Restart Threshold Seconds" }, "stop_traffic_threshold_seconds": { @@ -796,7 +886,7 @@ } ], "default": null, - "description": "The time in seconds after which traffic is stopped to an unhealthy instance. Defaults to platform-determined value when not set.", + "description": "The time in seconds after which traffic is stopped to an unhealthy instance. With trt_llm, defaults to 30 and must be <= 30. Otherwise defaults to platform-determined value when not set.", "title": "Stop Traffic Threshold Seconds" }, "startup_threshold_seconds": { @@ -1059,7 +1149,7 @@ }, "accelerator": { "$ref": "#/$defs/AcceleratorSpec", - "description": "The GPU type for your instance. To request multiple GPUs, use the ':' operator (e.g. L4:4).", + "description": "The accelerator type for your instance. To request multiple accelerators, use the ':' operator (e.g. L4:4).", "examples": [ "A100", "T4:2", @@ -2157,6 +2247,19 @@ "default": null, "description": "Baseten secret name containing credentials for accessing the source.", "title": "Auth Secret Name" + }, + "hf_oidc_resource": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Hugging Face repository (namespace/name) or username for OIDC token exchange.", + "title": "Hf Oidc Resource" } }, "required": [ @@ -2171,6 +2274,7 @@ "CUSTOM_SECRET", "AWS_OIDC", "GCP_OIDC", + "HF_OIDC", "AWS_ASSUME_ROLE" ], "title": "WeightsAuthMethod", @@ -2482,6 +2586,18 @@ "default": null, "description": "TensorRT-LLM configuration for optimized LLM inference." }, + "bei": { + "anyOf": [ + { + "$ref": "#/$defs/BEIConfiguration" + }, + { + "type": "null" + } + ], + "default": null, + "description": "BEIv3 encoder serving without an engine-build job. Hugging Face checkpoints use runtime weights mounts. Requires explicit restart and stop-traffic health thresholds of 1\u201360 seconds." + }, "training_checkpoints": { "anyOf": [ { diff --git a/scripts/apigen/specs/management.json b/scripts/apigen/specs/management.json index e859282..977a7ce 100644 --- a/scripts/apigen/specs/management.json +++ b/scripts/apigen/specs/management.json @@ -1494,7 +1494,7 @@ "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/audit_logs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'direction': 'DESC', 'search': None, 'start_epoch_millis': None, 'end_epoch_millis': None}\n)\n\nprint(response.text)" } ], - "description": "Returns audit-log entries across the workspace, newest first, covering models, chains, and workspace-level actions. Use the filters to narrow by event type, actor, resource, environment, source, or time window, and the cursor to page. In workspaces with multiple teams, only organization admins can read the workspace audit log.", + "description": "Returns audit-log entries across the workspace, newest first, covering models, chains, and workspace-level actions. Use the filters to narrow by event type, actor, resource, environment, source, or time window, and the cursor to page. Requires a personal API key; team API keys can't read the workspace audit log. In workspaces with multiple teams, only organization admins can read the workspace audit log.", "parameters": [ { "name": "cursor", @@ -3831,6 +3831,88 @@ } ] }, + "/v1/models/{model_id}/deployments/{deployment_id}/replicas": { + "get": { + "summary": "Lists replicas for a deployment", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/replicas \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/replicas\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None}\n)\n\nprint(response.text)" + } + ], + "description": "Includes terminated replicas and lifecycle information without metrics. Replicas are ordered by creation time, oldest first, with replica ID as a tie-breaker. For subsequent pages, pass pagination.cursor as cursor with unchanged filters. Cursors expire after one hour. Replica status may change between requests.", + "parameters": [ + { + "name": "cursor", + "in": "query", + "required": false, + "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Cursor" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "Maximum number of items to return.", + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "name": "statuses", + "in": "query", + "required": false, + "description": "Replica statuses to include. Repeat the statuses query parameter to filter by multiple statuses. Omit to include all statuses, including terminated replicas.", + "schema": { + "items": { + "$ref": "#/components/schemas/DeploymentReplicaStatusV1" + }, + "title": "Statuses", + "type": "array" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeploymentReplicasV1" + } + } + } + } + } + }, + "parameters": [ + { + "$ref": "#/components/parameters/model_id" + }, + { + "$ref": "#/components/parameters/deployment_id" + } + ] + }, "/v1/models/{model_id}/deployments/{deployment_id}/replicas/{replica_id}": { "delete": { "summary": "Terminates a replica in a deployment", @@ -3844,7 +3926,7 @@ "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/replicas/{replica_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"DELETE\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" } ], - "description": "Terminates a deployment replica and returns the termination status.", + "description": "Terminates a deployment replica and returns the termination status. Returns 404 if no replica matches the replica ID. Returns 400 without requesting termination if multiple replicas match the replica ID.", "responses": { "200": { "description": "", @@ -3868,7 +3950,33 @@ { "$ref": "#/components/parameters/replica_id" } - ] + ], + "get": { + "summary": "Gets a replica in a deployment", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/replicas/{replica_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/replicas/{replica_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + } + ], + "description": "Returns lifecycle information without metrics, including for terminated replicas. Returns 404 if the replica does not exist in the specified deployment. Returns 400 if multiple replicas match the replica ID.", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeploymentReplicaV1" + } + } + } + } + } + } }, "/v1/models/{model_id}/deployments/{deployment_id}/ssh/sign": { "post": { @@ -4980,6 +5088,153 @@ } ] }, + "/v1/models/{model_id}/environments/{env_name}/replicas": { + "get": { + "summary": "Lists replicas for an environment", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/replicas \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/replicas\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None}\n)\n\nprint(response.text)" + } + ], + "description": "Includes retained terminated replicas from deployments active in the preceding hour. Orders replicas oldest first, with replica ID breaking ties. Pass pagination.cursor with unchanged filters for subsequent pages. Cursors pin deployment membership and expire after one hour.", + "parameters": [ + { + "name": "cursor", + "in": "query", + "required": false, + "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Cursor" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "Maximum number of items to return.", + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "name": "statuses", + "in": "query", + "required": false, + "description": "Replica statuses to include. Repeat the statuses query parameter to filter by multiple statuses. Omit to include all statuses, including terminated replicas.", + "schema": { + "items": { + "$ref": "#/components/schemas/DeploymentReplicaStatusV1" + }, + "title": "Statuses", + "type": "array" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeploymentReplicasV1" + } + } + } + } + } + }, + "parameters": [ + { + "$ref": "#/components/parameters/model_id" + }, + { + "$ref": "#/components/parameters/env_name" + } + ] + }, + "/v1/models/{model_id}/environments/{env_name}/replicas/{replica_id}": { + "delete": { + "summary": "Terminates a replica in an environment", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/replicas/{replica_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/replicas/{replica_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"DELETE\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + } + ], + "description": "Requests replica termination in the environment's current deployment. Returns 404 if the environment has no current deployment or no replica matches the replica ID. Returns 400 without requesting termination if multiple replicas in the current deployment match the replica ID.", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TerminateReplicaResponseV1" + } + } + } + } + } + }, + "parameters": [ + { + "$ref": "#/components/parameters/model_id" + }, + { + "$ref": "#/components/parameters/env_name" + }, + { + "$ref": "#/components/parameters/replica_id" + } + ], + "get": { + "summary": "Gets a replica in an environment", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/replicas/{replica_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/models/{model_id}/environments/{env_name}/replicas/{replica_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + } + ], + "description": "Searches deployments active in the environment during the preceding hour. Includes retained terminated replicas. Returns 404 if the replica is outside this scope. Returns 400 if multiple replicas match the replica ID.", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeploymentReplicaV1" + } + } + } + } + } + } + }, "/v1/chains": { "get": { "summary": "Gets all chains", @@ -6116,11 +6371,11 @@ "x-codeSamples": [ { "lang": "bash", - "source": "curl --request POST \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"training_job\": {\n \"image\": {\n \"base_image\": \"hello-world\",\n \"docker_auth\": null\n },\n \"compute\": {\n \"node_count\": 1,\n \"cpu_count\": 1,\n \"memory\": \"2Gi\",\n \"accelerator\": {\n \"accelerator\": \"H100\",\n \"count\": 2\n },\n \"availability_model\": \"spot\"\n },\n \"runtime\": {\n \"start_commands\": [\n \"python main.py\"\n ],\n \"environment_variables\": {\n \"API_KEY\": \"your_api_key_here\",\n \"PATH\": \"/usr/bin\"\n },\n \"enable_cache\": true,\n \"cache_config\": {\n \"enable_legacy_hf_mount\": true,\n \"enabled\": true,\n \"mount_base_path\": \"/root/.cache\",\n \"persistent_home\": false,\n \"require_cache_affinity\": true\n },\n \"checkpointing_config\": {\n \"enabled\": true,\n \"checkpoint_path\": \"/mnt/ckpts\",\n \"volume_size_gib\": 10\n },\n \"load_checkpoint_config\": null\n },\n \"name\": \"gpt-oss-job\",\n \"truss_user_env\": null,\n \"interactive_session\": null,\n \"weights\": [\n {\n \"allow_patterns\": null,\n \"auth\": null,\n \"auth_secret_name\": null,\n \"ignore_patterns\": null,\n \"mount_location\": \"/app/models/base\",\n \"source\": \"hf://meta-llama/Llama-3-8B@main\"\n }\n ],\n \"enable_baseten_workdir\": false,\n \"priority\": 0\n }\n}'" + "source": "curl --request POST \\\n--url https://api.baseten.co/v1/training_projects/{training_project_id}/jobs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"training_job\": {\n \"bdn\": {},\n \"image\": {\n \"base_image\": \"hello-world\",\n \"docker_auth\": null\n },\n \"compute\": {\n \"node_count\": 1,\n \"cpu_count\": 1,\n \"memory\": \"2Gi\",\n \"accelerator\": {\n \"accelerator\": \"H100\",\n \"count\": 2\n },\n \"availability_model\": \"spot\"\n },\n \"runtime\": {\n \"start_commands\": [\n \"python main.py\"\n ],\n \"environment_variables\": {\n \"API_KEY\": \"your_api_key_here\",\n \"PATH\": \"/usr/bin\"\n },\n \"enable_cache\": true,\n \"cache_config\": {\n \"enable_legacy_hf_mount\": true,\n \"enabled\": true,\n \"mount_base_path\": \"/root/.cache\",\n \"persistent_home\": false,\n \"require_cache_affinity\": true\n },\n \"checkpointing_config\": {\n \"enabled\": true,\n \"checkpoint_path\": \"/mnt/ckpts\",\n \"volume_size_gib\": 10\n },\n \"load_checkpoint_config\": null\n },\n \"name\": \"gpt-oss-job\",\n \"truss_user_env\": null,\n \"interactive_session\": null,\n \"weights\": [\n {\n \"allow_patterns\": null,\n \"auth\": null,\n \"auth_secret_name\": null,\n \"ignore_patterns\": null,\n \"mount_location\": \"/app/models/base\",\n \"source\": \"hf://meta-llama/Llama-3-8B@main\"\n }\n ],\n \"enable_baseten_workdir\": false,\n \"priority\": 0\n }\n}'" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'training_job': {'image': {'base_image': 'hello-world', 'docker_auth': None}, 'compute': {'node_count': 1, 'cpu_count': 1, 'memory': '2Gi', 'accelerator': {'accelerator': 'H100', 'count': 2}, 'availability_model': 'spot'}, 'runtime': {'start_commands': ['python main.py'], 'environment_variables': {'API_KEY': 'your_api_key_here', 'PATH': '/usr/bin'}, 'enable_cache': True, 'cache_config': {'enable_legacy_hf_mount': True, 'enabled': True, 'mount_base_path': '/root/.cache', 'persistent_home': False, 'require_cache_affinity': True}, 'checkpointing_config': {'enabled': True, 'checkpoint_path': '/mnt/ckpts', 'volume_size_gib': 10}, 'load_checkpoint_config': None}, 'name': 'gpt-oss-job', 'truss_user_env': None, 'interactive_session': None, 'weights': [{'allow_patterns': None, 'auth': None, 'auth_secret_name': None, 'ignore_patterns': None, 'mount_location': '/app/models/base', 'source': 'hf://meta-llama/Llama-3-8B@main'}], 'enable_baseten_workdir': False, 'priority': 0}}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/training_projects/{training_project_id}/jobs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'training_job': {'bdn': {}, 'image': {'base_image': 'hello-world', 'docker_auth': None}, 'compute': {'node_count': 1, 'cpu_count': 1, 'memory': '2Gi', 'accelerator': {'accelerator': 'H100', 'count': 2}, 'availability_model': 'spot'}, 'runtime': {'start_commands': ['python main.py'], 'environment_variables': {'API_KEY': 'your_api_key_here', 'PATH': '/usr/bin'}, 'enable_cache': True, 'cache_config': {'enable_legacy_hf_mount': True, 'enabled': True, 'mount_base_path': '/root/.cache', 'persistent_home': False, 'require_cache_affinity': True}, 'checkpointing_config': {'enabled': True, 'checkpoint_path': '/mnt/ckpts', 'volume_size_gib': 10}, 'load_checkpoint_config': None}, 'name': 'gpt-oss-job', 'truss_user_env': None, 'interactive_session': None, 'weights': [{'allow_patterns': None, 'auth': None, 'auth_secret_name': None, 'ignore_patterns': None, 'mount_location': '/app/models/base', 'source': 'hf://meta-llama/Llama-3-8B@main'}], 'enable_baseten_workdir': False, 'priority': 0}}\n)\n\nprint(response.text)" } ], "description": "Creates a training job with the specified configuration.", @@ -7305,11 +7560,11 @@ "x-codeSamples": [ { "lang": "bash", - "source": "curl --request POST \\\n--url https://api.baseten.co/v1/loops/runs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"session_id\": null,\n \"base_model\": null,\n \"name\": null,\n \"max_seq_len\": null,\n \"seed\": null,\n \"availability_model\": \"spot\",\n \"path\": \"bt://loops:k4q95w5/weights/step-100\",\n \"reuse_from_run_id\": null,\n \"reuse_from_session_id\": null,\n \"base_checkpoint\": null,\n \"sampler_num_replicas\": null\n}'" + "source": "curl --request POST \\\n--url https://api.baseten.co/v1/loops/runs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"session_id\": null,\n \"base_model\": null,\n \"name\": null,\n \"max_seq_len\": null,\n \"seed\": null,\n \"availability_model\": \"spot\",\n \"path\": \"bt://loops:k4q95w5/weights/step-100\",\n \"reuse_from_run_id\": null,\n \"reuse_from_session_id\": null,\n \"base_checkpoint\": null,\n \"base_checkpoint_auth\": {\n \"auth_method\": \"CUSTOM_SECRET\",\n \"auth_secret_name\": \"hf_read_my_checkpoint\"\n },\n \"sampler_num_replicas\": null\n}'" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/loops/runs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'session_id': None, 'base_model': None, 'name': None, 'max_seq_len': None, 'seed': None, 'availability_model': 'spot', 'path': 'bt://loops:k4q95w5/weights/step-100', 'reuse_from_run_id': None, 'reuse_from_session_id': None, 'base_checkpoint': None, 'sampler_num_replicas': None}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/loops/runs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'session_id': None, 'base_model': None, 'name': None, 'max_seq_len': None, 'seed': None, 'availability_model': 'spot', 'path': 'bt://loops:k4q95w5/weights/step-100', 'reuse_from_run_id': None, 'reuse_from_session_id': None, 'base_checkpoint': None, 'base_checkpoint_auth': {'auth_method': 'CUSTOM_SECRET', 'auth_secret_name': 'hf_read_my_checkpoint'}, 'sampler_num_replicas': None}\n)\n\nprint(response.text)" } ], "description": "Creates a Loops run with an associated sampler in the given session.", @@ -7371,6 +7626,37 @@ ] }, "/v1/loops/runs/{run_id}": { + "delete": { + "summary": "Deletes a Loops run", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/loops/runs/{run_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/loops/runs/{run_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"DELETE\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + } + ], + "description": "Deletes a Loops run by ID, deactivating it first if it is active, and deletes its checkpoints. Checkpoints still in use, such as deployed ones, are kept and listed in the response; they stay usable until that use stops. Deletion is permanent, and storage for some checkpoints is reclaimed later.", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteLoopsRunResponseV1" + } + } + } + } + } + }, + "parameters": [ + { + "$ref": "#/components/parameters/run_id" + } + ], "get": { "summary": "Gets a Loops run", "x-codeSamples": [ @@ -7396,12 +7682,7 @@ } } } - }, - "parameters": [ - { - "$ref": "#/components/parameters/run_id" - } - ] + } }, "/v1/loops/trainers": { "post": { @@ -7409,11 +7690,11 @@ "x-codeSamples": [ { "lang": "bash", - "source": "curl --request POST \\\n--url https://api.baseten.co/v1/loops/trainers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"session_id\": null,\n \"base_model\": null,\n \"name\": null,\n \"max_seq_len\": null,\n \"seed\": null,\n \"availability_model\": \"spot\",\n \"path\": \"bt://loops:k4q95w5/weights/step-100\",\n \"reuse_from_run_id\": null,\n \"reuse_from_session_id\": null,\n \"base_checkpoint\": null,\n \"scope\": \"default\"\n}'" + "source": "curl --request POST \\\n--url https://api.baseten.co/v1/loops/trainers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"session_id\": null,\n \"base_model\": null,\n \"name\": null,\n \"max_seq_len\": null,\n \"seed\": null,\n \"availability_model\": \"spot\",\n \"path\": \"bt://loops:k4q95w5/weights/step-100\",\n \"reuse_from_run_id\": null,\n \"reuse_from_session_id\": null,\n \"base_checkpoint\": null,\n \"base_checkpoint_auth\": {\n \"auth_method\": \"CUSTOM_SECRET\",\n \"auth_secret_name\": \"hf_read_my_checkpoint\"\n },\n \"scope\": \"default\"\n}'" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/loops/trainers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'session_id': None, 'base_model': None, 'name': None, 'max_seq_len': None, 'seed': None, 'availability_model': 'spot', 'path': 'bt://loops:k4q95w5/weights/step-100', 'reuse_from_run_id': None, 'reuse_from_session_id': None, 'base_checkpoint': None, 'scope': 'default'}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/loops/trainers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'session_id': None, 'base_model': None, 'name': None, 'max_seq_len': None, 'seed': None, 'availability_model': 'spot', 'path': 'bt://loops:k4q95w5/weights/step-100', 'reuse_from_run_id': None, 'reuse_from_session_id': None, 'base_checkpoint': None, 'base_checkpoint_auth': {'auth_method': 'CUSTOM_SECRET', 'auth_secret_name': 'hf_read_my_checkpoint'}, 'scope': 'default'}\n)\n\nprint(response.text)" } ], "description": "Creates a trainer-only Loops run in the given session, without a sampler. To sample from it, create a sampler with POST /v1/loops/samplers and pass this run's ID as run_id to pair the two. List and read the trainer through the /v1/loops/runs endpoints.", @@ -7784,6 +8065,39 @@ } } }, + "/v1/loops/checkpoints/{checkpoint_id}": { + "delete": { + "summary": "Deletes a Loops checkpoint", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/loops/checkpoints/{checkpoint_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/loops/checkpoints/{checkpoint_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"DELETE\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + } + ], + "description": "Deletes a Loops checkpoint by ID and returns its tombstone. The checkpoint disappears from listings and can't be loaded, sampled, or deployed. Deletion is permanent, and storage for some checkpoints is reclaimed later. A checkpoint that is deployed, read by an unfinished LoRA merge, served by an active sampler, or the start of an active run can't be deleted, and the error says which. Deleting an already-deleted checkpoint returns the same tombstone.", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoopsCheckpointTombstoneV1" + } + } + } + } + } + }, + "parameters": [ + { + "$ref": "#/components/parameters/checkpoint_id" + } + ] + }, "/v1/loops/checkpoints/{checkpoint_id}/files": { "get": { "summary": "Gets Loops checkpoint files", @@ -7876,6 +8190,49 @@ } ] }, + "/v1/loops/checkpoints/{checkpoint_id}/ttl": { + "put": { + "summary": "Sets a Loops checkpoint's TTL", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request PUT \\\n--url https://api.baseten.co/v1/loops/checkpoints/{checkpoint_id}/ttl \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"ttl_seconds\": null\n}'" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/loops/checkpoints/{checkpoint_id}/ttl\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PUT\",\n url,\n headers=headers,\n json={'ttl_seconds': None}\n)\n\nprint(response.text)" + } + ], + "description": "Sets when a Loops checkpoint expires, counted from now, or removes its TTL so it's kept until you delete it. An expired checkpoint is deleted within 24 hours. If it's in use when it expires, it's deleted within 24 hours after it stops being used.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SetLoopsCheckpointTtlRequestV1" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoopsCheckpointV1" + } + } + } + } + } + }, + "parameters": [ + { + "$ref": "#/components/parameters/checkpoint_id" + } + ] + }, "/v1/loops/deployments": { "get": { "summary": "Lists Loops deployments", @@ -8115,7 +8472,7 @@ "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/loops/deployments/{deployment_id}/logs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'start_epoch_millis': None, 'end_epoch_millis': None, 'direction': None, 'limit': None, 'min_level': None}\n)\n\nprint(response.text)" } ], - "description": "Fetches logs from the trainer pods of a Loops deployment. Visible to any member of the deployment's team.", + "description": "Fetches logs from the trainer pods of a Loops deployment. Visible to anyone with training access to the deployment's team.", "parameters": [ { "name": "start_epoch_millis", @@ -8383,11 +8740,11 @@ "x-codeSamples": [ { "lang": "bash", - "source": "curl --request POST \\\n--url https://api.baseten.co/v1/teams/{team_id}/loops/runs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"session_id\": null,\n \"base_model\": null,\n \"name\": null,\n \"max_seq_len\": null,\n \"seed\": null,\n \"availability_model\": \"spot\",\n \"path\": \"bt://loops:k4q95w5/weights/step-100\",\n \"reuse_from_run_id\": null,\n \"reuse_from_session_id\": null,\n \"base_checkpoint\": null,\n \"sampler_num_replicas\": null\n}'" + "source": "curl --request POST \\\n--url https://api.baseten.co/v1/teams/{team_id}/loops/runs \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"session_id\": null,\n \"base_model\": null,\n \"name\": null,\n \"max_seq_len\": null,\n \"seed\": null,\n \"availability_model\": \"spot\",\n \"path\": \"bt://loops:k4q95w5/weights/step-100\",\n \"reuse_from_run_id\": null,\n \"reuse_from_session_id\": null,\n \"base_checkpoint\": null,\n \"base_checkpoint_auth\": {\n \"auth_method\": \"CUSTOM_SECRET\",\n \"auth_secret_name\": \"hf_read_my_checkpoint\"\n },\n \"sampler_num_replicas\": null\n}'" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/loops/runs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'session_id': None, 'base_model': None, 'name': None, 'max_seq_len': None, 'seed': None, 'availability_model': 'spot', 'path': 'bt://loops:k4q95w5/weights/step-100', 'reuse_from_run_id': None, 'reuse_from_session_id': None, 'base_checkpoint': None, 'sampler_num_replicas': None}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/loops/runs\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'session_id': None, 'base_model': None, 'name': None, 'max_seq_len': None, 'seed': None, 'availability_model': 'spot', 'path': 'bt://loops:k4q95w5/weights/step-100', 'reuse_from_run_id': None, 'reuse_from_session_id': None, 'base_checkpoint': None, 'base_checkpoint_auth': {'auth_method': 'CUSTOM_SECRET', 'auth_secret_name': 'hf_read_my_checkpoint'}, 'sampler_num_replicas': None}\n)\n\nprint(response.text)" } ], "description": "Creates a Loops run with an associated sampler in the given session; the run's infrastructure belongs to the given team.", @@ -8421,11 +8778,11 @@ "x-codeSamples": [ { "lang": "bash", - "source": "curl --request POST \\\n--url https://api.baseten.co/v1/teams/{team_id}/loops/trainers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"session_id\": null,\n \"base_model\": null,\n \"name\": null,\n \"max_seq_len\": null,\n \"seed\": null,\n \"availability_model\": \"spot\",\n \"path\": \"bt://loops:k4q95w5/weights/step-100\",\n \"reuse_from_run_id\": null,\n \"reuse_from_session_id\": null,\n \"base_checkpoint\": null,\n \"scope\": \"default\"\n}'" + "source": "curl --request POST \\\n--url https://api.baseten.co/v1/teams/{team_id}/loops/trainers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"session_id\": null,\n \"base_model\": null,\n \"name\": null,\n \"max_seq_len\": null,\n \"seed\": null,\n \"availability_model\": \"spot\",\n \"path\": \"bt://loops:k4q95w5/weights/step-100\",\n \"reuse_from_run_id\": null,\n \"reuse_from_session_id\": null,\n \"base_checkpoint\": null,\n \"base_checkpoint_auth\": {\n \"auth_method\": \"CUSTOM_SECRET\",\n \"auth_secret_name\": \"hf_read_my_checkpoint\"\n },\n \"scope\": \"default\"\n}'" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/loops/trainers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'session_id': None, 'base_model': None, 'name': None, 'max_seq_len': None, 'seed': None, 'availability_model': 'spot', 'path': 'bt://loops:k4q95w5/weights/step-100', 'reuse_from_run_id': None, 'reuse_from_session_id': None, 'base_checkpoint': None, 'scope': 'default'}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/teams/{team_id}/loops/trainers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'session_id': None, 'base_model': None, 'name': None, 'max_seq_len': None, 'seed': None, 'availability_model': 'spot', 'path': 'bt://loops:k4q95w5/weights/step-100', 'reuse_from_run_id': None, 'reuse_from_session_id': None, 'base_checkpoint': None, 'base_checkpoint_auth': {'auth_method': 'CUSTOM_SECRET', 'auth_secret_name': 'hf_read_my_checkpoint'}, 'scope': 'default'}\n)\n\nprint(response.text)" } ], "description": "Creates a trainer-only Loops run in the given session, without a sampler. To sample from it, create a sampler with POST /v1/loops/samplers and pass this run's ID as run_id to pair the two. List and read the trainer through the /v1/loops/runs endpoints.", @@ -8584,7 +8941,7 @@ "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/training/capacity\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" } ], - "description": "Returns GPU capacity limits (baseline and peak) and current usage for the organization.", + "description": "Returns on-demand and spot GPU quotas and current usage for the teams you can view, plus organization-wide totals when you have organization-level access.", "responses": { "200": { "description": "", @@ -8599,7 +8956,7 @@ } }, "patch": { - "summary": "Sets a team's training GPU capacity", + "summary": "Sets a team's training GPU quota", "x-codeSamples": [ { "lang": "bash", @@ -8610,7 +8967,7 @@ "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/training/capacity\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PATCH\",\n url,\n headers=headers,\n json={'team_id': None, 'gpu_type': None, 'max_gpus': 8}\n)\n\nprint(response.text)" } ], - "description": "Sets the max concurrent GPUs of a given type a team may use. Creates the limit if one doesn't exist for this (team, gpu_type) pair, otherwise updates it in place. Org-admin only: this is a ceiling the org imposes on the team, not something the team manages for itself.", + "description": "Sets a team's GPU quota for a given type. It counts the team's on-demand jobs, plus its spot jobs when the organization has no separate on-demand quota, and on-demand jobs can borrow past it from the organization's shared pool when one exists. Creates the quota if one doesn't exist for this (team, gpu_type) pair, otherwise updates it in place. Org-admin only: this is a quota the org imposes on the team, not something the team manages for itself.", "requestBody": { "content": { "application/json": { @@ -9170,7 +9527,7 @@ "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/model_apis/{model_api_name}/metrics\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'mode': 'CURRENT', 'start_epoch_millis': None, 'end_epoch_millis': None}\n)\n\nprint(response.text)" } ], - "description": "Gets the metrics for a Model API in the given time range.", + "description": "Gets the metrics for a Model API in the given time range for the teams you can manage, with each series labeled by team_id. Organization admins receive organization-wide metrics by default. For a Model API your lab organization lists, other organizations' consumption is included regardless of team_ids.", "parameters": [ { "name": "mode", @@ -9230,6 +9587,19 @@ "title": "Metrics", "type": "array" } + }, + { + "name": "team_ids", + "in": "query", + "required": false, + "description": "Return only metrics for these teams, repeated once per team. Defaults to all teams you can manage. Any unauthorized team causes a 403.", + "schema": { + "items": { + "type": "string" + }, + "title": "Team Ids", + "type": "array" + } } ], "responses": { @@ -9937,7 +10307,7 @@ "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/billing/usage_summary\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'start_date': None, 'end_date': None}\n)\n\nprint(response.text)" } ], - "description": "Returns billing usage within [start_date, end_date): the start date is inclusive and the end date is exclusive. Both dates are normalized to midnight UTC. Includes dedicated model serving, training, and model APIs usage. The date range must not exceed 31 days.", + "description": "Returns billing usage within [start_date, end_date): the start date is inclusive and the end date is exclusive. Both dates are normalized to midnight UTC. Includes dedicated model serving, training, and model APIs usage. For multi-team organizations, Model APIs usage is split by team. Historical usage without a recorded team is assigned to Default Team. Usage subtotals are before credits; credits are deducted only at the product summary level. The date range must not exceed 31 days.", "parameters": [ { "name": "start_date", @@ -10232,31 +10602,68 @@ } }, "x-stability": "unstable" + }, + "patch": { + "summary": "Updates the authenticated organization", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/organizations/me \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"allow_personal_api_keys\": null,\n \"allow_service_account_api_keys\": null\n}'" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/organizations/me\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PATCH\",\n url,\n headers=headers,\n json={'allow_personal_api_keys': None, 'allow_service_account_api_keys': None}\n)\n\nprint(response.text)" + } + ], + "description": "Updates settings of the organization of the user making the request. Only organization admins can call it. Omitted fields are unchanged.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateOrganizationRequestV1" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrganizationInfoV1" + } + } + } + } + }, + "x-stability": "unstable" } }, - "/v1/gateway/events": { + "/v1/service_accounts": { "get": { - "summary": "Lists gateway events", + "summary": "Lists service accounts", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request GET \\\n--url https://api.baseten.co/v1/gateway/events \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/service_accounts \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/gateway/events\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'start_time': None, 'end_time': None, 'limit': None, 'cursor': None}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/service_accounts\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'name': None, 'team_id': None, 'disabled': None}\n)\n\nprint(response.text)" } ], + "description": "Lists the service accounts you administer: every account for an organization admin, and your teams' accounts for a team admin. Workload identity federation tokens act as service accounts.", "parameters": [ { - "name": "start_time", + "name": "cursor", "in": "query", "required": false, - "description": "Inclusive start (ISO 8601, UTC). Required without a cursor.", + "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", "schema": { "anyOf": [ { - "format": "date-time", "type": "string" }, { @@ -10264,18 +10671,31 @@ } ], "default": null, - "title": "Start Time" + "title": "Cursor" } }, { - "name": "end_time", + "name": "limit", "in": "query", "required": false, - "description": "Exclusive end (ISO 8601, UTC). Defaults to now.", + "description": "Maximum number of items to return.", + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "name": "name", + "in": "query", + "required": false, + "description": "Only the account with this name, ignoring case", "schema": { "anyOf": [ { - "format": "date-time", + "minLength": 1, "type": "string" }, { @@ -10283,71 +10703,43 @@ } ], "default": null, - "title": "End Time" + "title": "Name" } }, { - "name": "limit", + "name": "team_id", "in": "query", "required": false, - "description": "Max events. Default 100, max 1000.", + "description": "Only this team's accounts", "schema": { "anyOf": [ { - "maximum": 1000, - "minimum": 1, - "type": "integer" + "type": "string" }, { "type": "null" } ], "default": null, - "title": "Limit" - } - }, - { - "name": "api_keys", - "in": "query", - "required": false, - "description": "Return only events for these API key prefixes, repeated once per prefix.", - "schema": { - "items": { - "type": "string" - }, - "title": "Api Keys", - "type": "array" + "title": "Team Id" } }, { - "name": "external_entity_ids", + "name": "disabled", "in": "query", "required": false, - "description": "Return only events for these external entity IDs, repeated once per ID.", - "schema": { - "items": { - "type": "string" - }, - "title": "External Entity Ids", - "type": "array" - } - }, - { - "name": "cursor", - "in": "query", - "required": false, - "description": "Next-page cursor. Other parameters are ignored.", + "description": "Only disabled or enabled accounts", "schema": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" } ], "default": null, - "title": "Cursor" + "title": "Disabled" } } ], @@ -10357,28 +10749,192 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GatewayEventsResponseV1" + "$ref": "#/components/schemas/ServiceAccountsV1" } } } } + }, + "x-stability": "unstable" + }, + "post": { + "summary": "Creates a service account", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request POST \\\n--url https://api.baseten.co/v1/service_accounts \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"name\": \"ci-deployer\",\n \"description\": \"GitHub Actions deploys from acme/models\",\n \"team_id\": \"abcd1234\",\n \"preset_permissions\": {\n \"type\": \"WORKSPACE_MANAGE_ALL\"\n }\n}'" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/service_accounts\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'name': 'ci-deployer', 'description': 'GitHub Actions deploys from acme/models', 'team_id': 'abcd1234', 'preset_permissions': {'type': 'WORKSPACE_MANAGE_ALL'}}\n)\n\nprint(response.text)" + } + ], + "description": "Creates a service account that workload identity federation tokens act as. It's enabled at once. Omit `team_id` for an organization account, which only an organization admin can create. A team admin can create accounts for their own team.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateServiceAccountRequestV1" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceAccountV1" + } + } + } + } + }, + "x-stability": "unstable" + } + }, + "/v1/service_accounts/{service_account_id}": { + "delete": { + "summary": "Deletes a service account", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/service_accounts/{service_account_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/service_accounts/{service_account_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"DELETE\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + } + ], + "description": "Deletes a disabled service account that no trust rule uses. Disable the account and delete its trust rules first.", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeletedServiceAccountV1" + } + } + } + } + }, + "x-stability": "unstable" + }, + "parameters": [ + { + "$ref": "#/components/parameters/service_account_id" } + ], + "get": { + "summary": "Gets a service account", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/service_accounts/{service_account_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/service_accounts/{service_account_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceAccountV1" + } + } + } + } + }, + "x-stability": "unstable" + }, + "patch": { + "summary": "Updates a service account", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/service_accounts/{service_account_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"disabled\": true\n}'" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/service_accounts/{service_account_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PATCH\",\n url,\n headers=headers,\n json={'disabled': True}\n)\n\nprint(response.text)" + } + ], + "description": "Updates the fields you send. Set `disabled` to true to stop the account being used, and back to false to restore it. `preset_permissions` replaces the account's access as a whole. The owning team can't change.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateServiceAccountRequestV1" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceAccountV1" + } + } + } + } + }, + "x-stability": "unstable" } }, - "/v1/explore/metadata": { + "/v1/access/predefined_identity_providers": { "get": { - "summary": "Lists model metadata", + "summary": "Lists predefined identity providers", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request GET \\\n--url https://api.baseten.co/v1/explore/metadata \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/access/predefined_identity_providers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/explore/metadata\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'provider': None, 'q': None}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/access/predefined_identity_providers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" } ], - "description": "Lists all live model metadata rows, e.g. for model pickers.", + "description": "Lists the identity providers Baseten supports, with the issuer format for those where each account, tenant, or cluster has its own issuer.", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PredefinedIdentityProvidersV1" + } + } + } + } + }, + "x-stability": "unstable" + } + }, + "/v1/access/identity_providers": { + "get": { + "summary": "Lists identity providers", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/access/identity_providers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/access/identity_providers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'name': None, 'predefined_kind': None}\n)\n\nprint(response.text)" + } + ], + "description": "Lists the organization's identity providers. Organization and team admins can list them.", "parameters": [ { "name": "cursor", @@ -10412,13 +10968,14 @@ } }, { - "name": "provider", + "name": "name", "in": "query", "required": false, - "description": "Filter to a provider by slug prefix, e.g. 'anthropic'. Preserved by the cursor; if repeated, must match the original filter.", + "description": "Only the provider with this name, ignoring case", "schema": { "anyOf": [ { + "minLength": 1, "type": "string" }, { @@ -10426,25 +10983,24 @@ } ], "default": null, - "title": "Provider" + "title": "Name" } }, { - "name": "q", + "name": "predefined_kind", "in": "query", "required": false, - "description": "Case-insensitive substring search over metadata slugs. Preserved by the cursor; if repeated, must match the original filter.", + "description": "Only this predefined provider's issuers", "schema": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/PredefinedIdentityProviderKindV1" }, { "type": "null" } ], - "default": null, - "title": "Q" + "default": null } } ], @@ -10454,34 +11010,32 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ExploreMetadataResponseV1" + "$ref": "#/components/schemas/IdentityProvidersV1" } } } } }, "x-stability": "unstable" - } - }, - "/v1/grid/token": { + }, "post": { - "summary": "Creates a Grid access token", + "summary": "Adds an identity provider", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request POST \\\n--url https://api.baseten.co/v1/grid/token \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"team_id\": \"abc1234\"\n}'" + "source": "curl --request POST \\\n--url https://api.baseten.co/v1/access/identity_providers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"name\": \"prod-eks\",\n \"predefined\": {\n \"kind\": \"AWS_EKS\",\n \"issuer_url\": \"https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLED539D4633E53DE1B71EXAMPLE\"\n }\n}'" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/token\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'team_id': 'abc1234'}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/access/identity_providers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'name': 'prod-eks', 'predefined': {'kind': 'AWS_EKS', 'issuer_url': 'https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLED539D4633E53DE1B71EXAMPLE'}}\n)\n\nprint(response.text)" } ], - "description": "Exchanges your Baseten credentials for a short-lived token that authenticates against the Grid gateway as you, in the given team. Tokens expire after four hours and cannot be renewed; request a new one when needed. Routes keys cannot create tokens.", + "description": "Adds an identity provider to the organization. For a provider with a per-customer issuer, the issuer must match the provider's format, and its signing keys are fetched before it's saved; a failure returns 422 with the reason. Each provider with a fixed issuer can be added once. Only organization admins can call this endpoint.", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateGridTokenRequestV1" + "$ref": "#/components/schemas/CreateIdentityProviderRequestV1" } } }, @@ -10493,7 +11047,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridTokenV1" + "$ref": "#/components/schemas/IdentityProviderV1" } } } @@ -10502,98 +11056,88 @@ "x-stability": "unstable" } }, - "/v1/grid/routes": { - "get": { - "summary": "Lists routes", + "/v1/access/identity_providers/verify": { + "post": { + "summary": "Checks an identity provider before adding it", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/routes \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request POST \\\n--url https://api.baseten.co/v1/access/identity_providers/verify \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"predefined\": {\n \"kind\": \"AWS_EKS\",\n \"issuer_url\": \"https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLED539D4633E53DE1B71EXAMPLE\"\n }\n}'" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/routes\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'team_id': None, 'name': None}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/access/identity_providers/verify\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'predefined': {'kind': 'AWS_EKS', 'issuer_url': 'https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLED539D4633E53DE1B71EXAMPLE'}}\n)\n\nprint(response.text)" } ], - "description": "Lists routes you can invoke, newest first, optionally filtered by exact name. Without `team_id`, routes from every team where you can invoke routes. With `for_harnesses`, exactly one team: `team_id`, else the team you belong to; when you belong to several and name none, the request fails with a 400.", - "parameters": [ - { - "name": "cursor", - "in": "query", - "required": false, - "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Cursor" + "description": "Runs the checks that adding the identity provider runs, without adding it: the issuer's format, that the organization doesn't have it yet, and, for a provider with a per-customer issuer, that its signing keys can be fetched. A failed check returns 200 with `valid` false and the reason. Only organization admins can call this endpoint.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VerifyIdentityProviderRequestV1" + } } }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "Maximum number of items to return.", - "schema": { - "default": 100, - "maximum": 1000, - "minimum": 1, - "title": "Limit", - "type": "integer" + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VerificationV1" + } + } } + } + }, + "x-stability": "unstable" + } + }, + "/v1/access/identity_providers/{identity_provider_id}": { + "delete": { + "summary": "Deletes an identity provider", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/access/identity_providers/{identity_provider_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" }, { - "name": "team_id", - "in": "query", - "required": false, - "description": "Limit routes to this team. Without it, routes from every team where you can invoke routes.", - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/access/identity_providers/{identity_provider_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"DELETE\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + } + ], + "description": "Removes the identity provider from the organization. Returns 409 while a trust rule uses it. Only organization admins can call this endpoint.", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeletedIdentityProviderV1" } - ], - "default": null, - "title": "Team Id" + } } - }, + } + }, + "x-stability": "unstable" + }, + "parameters": [ + { + "$ref": "#/components/parameters/identity_provider_id" + } + ], + "get": { + "summary": "Gets an identity provider", + "x-codeSamples": [ { - "name": "for_harnesses", - "in": "query", - "required": false, - "description": "Set by harness setup and sync. Returns routes from exactly one team: `team_id`, else the team you belong to; when you belong to several and name none, the request fails with a 400.", - "schema": { - "default": false, - "title": "For Harnesses", - "type": "boolean" - } + "lang": "bash", + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/access/identity_providers/{identity_provider_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" }, { - "name": "name", - "in": "query", - "required": false, - "description": "Filter by exact route name. Preserved by the cursor; if repeated, must match the original filter.", - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Name" - } + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/access/identity_providers/{identity_provider_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" } ], "responses": { @@ -10602,7 +11146,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridRoutesResponseV1" + "$ref": "#/components/schemas/IdentityProviderV1" } } } @@ -10610,24 +11154,24 @@ }, "x-stability": "unstable" }, - "post": { - "summary": "Creates a route", + "patch": { + "summary": "Updates an identity provider", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request POST \\\n--url https://api.baseten.co/v1/grid/routes \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"team_id\": \"abc1234\",\n \"display_name\": \"Assistant\",\n \"target\": {\n \"model\": \"zai-org/GLM-5.3\",\n \"type\": \"BASETEN_MODEL_API\"\n },\n \"description\": \"Assistant for code review and debugging.\"\n}'" + "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/access/identity_providers/{identity_provider_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"name\": \"prod-eks\"\n}'" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/routes\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'team_id': 'abc1234', 'display_name': 'Assistant', 'target': {'model': 'zai-org/GLM-5.3', 'type': 'BASETEN_MODEL_API'}, 'description': 'Assistant for code review and debugging.'}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/access/identity_providers/{identity_provider_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PATCH\",\n url,\n headers=headers,\n json={'name': 'prod-eks'}\n)\n\nprint(response.text)" } ], - "description": "Creates and derives a name for the provided route configuration. CONNECTION targets reference a connection owned by the route's team; create the connection first.", + "description": "Updates the fields you send. The provider and issuer can't change. Only organization admins can call this endpoint.", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateGridRouteRequestV1" + "$ref": "#/components/schemas/UpdateIdentityProviderRequestV1" } } }, @@ -10639,7 +11183,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridRouteV1" + "$ref": "#/components/schemas/IdentityProviderV1" } } } @@ -10648,20 +11192,20 @@ "x-stability": "unstable" } }, - "/v1/grid/routes/usage": { + "/v1/access/trust_rules": { "get": { - "summary": "Gets daily Grid usage and estimated costs", + "summary": "Lists trust rules", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/routes/usage \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/access/trust_rules \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/routes/usage\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'team_id': None, 'start_date': None, 'end_date': None}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/access/trust_rules\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'name': None, 'identity_provider_id': None, 'service_account_id': None, 'team_id': None}\n)\n\nprint(response.text)" } ], - "description": "Buckets are UTC days, and days with no usage are included. Organization admins see all Grid usage in the organization. Team admins see usage in teams they manage. Other members, including viewers, see only usage from Routes keys they created, including keys that have since expired, been revoked, or been deleted. Usage can be filtered and grouped by the team it was metered in. Usage is metered every 15 minutes, so the current hour can lag. Model API costs use your prices at the time of each request and include tool calls. xAI costs are the charges xAI reports. OpenAI and Anthropic costs are estimated from Baseten's reference prices and may differ from your provider's bill. Vertex and OpenAI-compatible usage is not included. Costs for OpenAI, Anthropic, and xAI estimate what you pay those providers; they are not Baseten charges. Usage is retained for 92 days.", + "description": "Lists the trust rules you administer: every rule for an organization admin, and rules for your teams' service accounts for a team admin.", "parameters": [ { "name": "cursor", @@ -10685,23 +11229,24 @@ "name": "limit", "in": "query", "required": false, - "description": "Number of daily buckets to return. Defaults to 7; maximum 31.", + "description": "Maximum number of items to return.", "schema": { - "default": 7, - "maximum": 31, + "default": 100, + "maximum": 1000, "minimum": 1, "title": "Limit", "type": "integer" } }, { - "name": "team_id", + "name": "name", "in": "query", "required": false, - "description": "Limit usage to a team you can access. Organization admins can view all usage in the team, team admins can view usage in teams they manage, and other members can view only their own usage. Without a team, organization admins see all organization usage, team admins see their managed teams, and other members see their own usage.", + "description": "Only the rule with this name, ignoring case", "schema": { "anyOf": [ { + "minLength": 1, "type": "string" }, { @@ -10709,18 +11254,17 @@ } ], "default": null, - "title": "Team Id" + "title": "Name" } }, { - "name": "start_date", + "name": "identity_provider_id", "in": "query", "required": false, - "description": "Inclusive UTC calendar day at the start of the query range. Defaults to the previous UTC date, and is ignored when you pass a cursor.", + "description": "Only this provider's rules", "schema": { "anyOf": [ { - "format": "date", "type": "string" }, { @@ -10728,18 +11272,17 @@ } ], "default": null, - "title": "Start Date" + "title": "Identity Provider Id" } }, { - "name": "end_date", + "name": "service_account_id", "in": "query", "required": false, - "description": "Exclusive UTC calendar day at the end of the query range. Defaults to the day after the current UTC date so current-day usage is included.", + "description": "Only rules for this service account", "schema": { "anyOf": [ { - "format": "date", "type": "string" }, { @@ -10747,82 +11290,111 @@ } ], "default": null, - "title": "End Date" + "title": "Service Account Id" } }, { - "name": "group_by", + "name": "team_id", "in": "query", "required": false, - "description": "Dimensions to break usage down by, repeated once per dimension: USER, TEAM, MODEL, PROVIDER, INTELLIGENT_ROUTE, or HARNESS. Each result represents one observed combination of the requested dimensions within that day, and results are sorted by those values. Combinations without usage are omitted, so result counts can differ between days. INTELLIGENT_ROUTE returns only usage sent through an intelligent route, one row per intelligent route, or per intelligent route and model with MODEL. These rows repeat usage already counted in other groupings, so don't add them to model totals. HARNESS includes usage with no recorded harness as a null group. Defaults to MODEL.", + "description": "Only rules for this team's service accounts", "schema": { - "items": { - "$ref": "#/components/schemas/GridRouteUsageDimensionV1" - }, - "title": "Group By", - "type": "array" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Team Id" } - }, - { - "name": "user_ids", - "in": "query", - "required": false, - "description": "Return only usage from Routes keys created by these user IDs, repeated once per ID.", - "schema": { - "items": { - "type": "string" - }, - "title": "User Ids", - "type": "array" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccessTrustRulesV1" + } + } } + } + }, + "x-stability": "unstable" + }, + "post": { + "summary": "Creates a trust rule", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request POST \\\n--url https://api.baseten.co/v1/access/trust_rules \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"name\": \"models-main-deploy\",\n \"identity_provider_id\": \"abcd1234\",\n \"service_account_id\": \"wxyz5678\",\n \"condition\": \"claims.repository_owner_id == '12345' && claims.sub == 'repo:acme/models:ref:refs/heads/main'\",\n \"audience\": \"https://api.baseten.co\"\n}'" }, { - "name": "models", - "in": "query", - "required": false, - "description": "Return only usage for these exact model names, repeated once per model.", - "schema": { - "items": { - "type": "string" - }, - "title": "Models", - "type": "array" + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/access/trust_rules\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'name': 'models-main-deploy', 'identity_provider_id': 'abcd1234', 'service_account_id': 'wxyz5678', 'condition': \"claims.repository_owner_id == '12345' && claims.sub == 'repo:acme/models:ref:refs/heads/main'\", 'audience': 'https://api.baseten.co'}\n)\n\nprint(response.text)" + } + ], + "description": "Creates a rule that lets tokens from an identity provider act as a service account. Organization admins can create rules for any service account, team admins for their own team's. An organization API key manager key can't target organization accounts.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateAccessTrustRuleRequestV1" + } } }, - { - "name": "providers", - "in": "query", - "required": false, - "description": "Return only usage for these providers, repeated once per provider.", - "schema": { - "items": { - "$ref": "#/components/schemas/GridProviderV1" - }, - "title": "Providers", - "type": "array" + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AccessTrustRuleV1" + } + } } + } + }, + "x-stability": "unstable" + } + }, + "/v1/access/trust_rules/verify": { + "post": { + "summary": "Checks a trust rule's condition and audience", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request POST \\\n--url https://api.baseten.co/v1/access/trust_rules/verify \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"identity_provider_id\": \"abcd1234\",\n \"condition\": \"claims.repository_owner_id == '12345' && claims.sub == 'repo:acme/models:ref:refs/heads/main'\",\n \"audience\": \"https://api.baseten.co\"\n}'" }, { - "name": "harnesses", - "in": "query", - "required": false, - "description": "Return only usage for these harnesses, repeated once per harness. Omit to include all usage, including usage with no recorded harness.", - "schema": { - "items": { - "$ref": "#/components/schemas/GridRouteUsageHarnessV1" - }, - "title": "Harnesses", - "type": "array" - } + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/access/trust_rules/verify\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'identity_provider_id': 'abcd1234', 'condition': \"claims.repository_owner_id == '12345' && claims.sub == 'repo:acme/models:ref:refs/heads/main'\", 'audience': 'https://api.baseten.co'}\n)\n\nprint(response.text)" } ], + "description": "Runs the checks that creating or updating a trust rule runs on its condition and audience, without saving anything: that the condition compiles and pins the claims the identity provider requires. A failed check returns 200 with `valid` false and the reason.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VerifyAccessTrustRuleRequestV1" + } + } + }, + "required": true + }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridRouteUsageResponseV1" + "$ref": "#/components/schemas/VerificationV1" } } } @@ -10831,26 +11403,27 @@ "x-stability": "unstable" } }, - "/v1/grid/routes/{route_id}": { + "/v1/access/trust_rules/{trust_rule_id}": { "delete": { - "summary": "Deletes a route", + "summary": "Deletes a trust rule", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/grid/routes/{route_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/access/trust_rules/{trust_rule_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/routes/{route_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"DELETE\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/access/trust_rules/{trust_rule_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"DELETE\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" } ], + "description": "New exchanges through the rule fail at once; tokens already issued keep working until they expire.", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridRouteTombstoneV1" + "$ref": "#/components/schemas/DeletedAccessTrustRuleV1" } } } @@ -10860,19 +11433,19 @@ }, "parameters": [ { - "$ref": "#/components/parameters/route_id" + "$ref": "#/components/parameters/trust_rule_id" } ], "get": { - "summary": "Gets a route", + "summary": "Gets a trust rule", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/routes/{route_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/access/trust_rules/{trust_rule_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/routes/{route_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/access/trust_rules/{trust_rule_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" } ], "responses": { @@ -10881,7 +11454,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridRouteV1" + "$ref": "#/components/schemas/AccessTrustRuleV1" } } } @@ -10890,23 +11463,23 @@ "x-stability": "unstable" }, "patch": { - "summary": "Updates a route", + "summary": "Updates a trust rule", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/grid/routes/{route_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"description\": \"Assistant for code review and debugging.\",\n \"display_name\": \"Assistant\",\n \"target\": null\n}'" + "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/access/trust_rules/{trust_rule_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"name\": \"models-release-deploy\"\n}'" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/routes/{route_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PATCH\",\n url,\n headers=headers,\n json={'description': 'Assistant for code review and debugging.', 'display_name': 'Assistant', 'target': None}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/access/trust_rules/{trust_rule_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PATCH\",\n url,\n headers=headers,\n json={'name': 'models-release-deploy'}\n)\n\nprint(response.text)" } ], - "description": "The route name, target type, and owning team are immutable.", + "description": "Updates the fields you send. Changes apply to new exchanges only. The identity provider can't change.", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateGridRouteRequestV1" + "$ref": "#/components/schemas/UpdateAccessTrustRuleRequestV1" } } }, @@ -10918,7 +11491,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridRouteV1" + "$ref": "#/components/schemas/AccessTrustRuleV1" } } } @@ -10927,30 +11500,64 @@ "x-stability": "unstable" } }, - "/v1/grid/team_settings": { + "/v1/auth/token": { + "post": { + "summary": "Exchanges an identity provider's JWT for an access token", + "security": [], + "description": "Exchanges a JWT from your identity provider for a short-lived Baseten access token, as described in RFC 8693. Send no API key: the JWT is the credential. Name the trust rule to check the JWT against as the `audience`, and send the access token as `Authorization: Bearer` on later requests. Errors follow RFC 6749 section 5.2: a 400 response with an `error` of `invalid_request`, `unsupported_grant_type`, or `invalid_grant`. A well-formed request that is refused always returns `invalid_grant`, whatever the reason.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TokenExchangeRequestV1" + } + }, + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/TokenExchangeRequestV1" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TokenExchangeResponseV1" + } + } + } + } + }, + "x-stability": "unstable" + } + }, + "/v1/gateway/events": { "get": { - "summary": "Gets a team's Grid settings by team ID or your only team", + "summary": "Lists gateway events", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/team_settings \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/gateway/events \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/team_settings\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'team_id': 'abc1234'}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/gateway/events\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'start_time': None, 'end_time': None, 'limit': None, 'cursor': None}\n)\n\nprint(response.text)" } ], - "description": "Returns the settings that apply to the team, including the default models for each coding harness and the team's spend limits. Any member who can invoke the team's routes can read them. The team comes from `team_id` instead of the path. Omit it to use the team you belong to; when you belong to several, the request fails with a 400.", "parameters": [ { - "name": "team_id", + "name": "start_time", "in": "query", "required": false, - "description": "ID of the team. When omitted, the team you belong to; required when you belong to several.", + "description": "Inclusive start (ISO 8601, UTC). Required without a cursor.", "schema": { "anyOf": [ { - "minLength": 1, + "format": "date-time", "type": "string" }, { @@ -10958,79 +11565,121 @@ } ], "default": null, - "examples": [ - "abc1234" + "title": "Start Time" + } + }, + { + "name": "end_time", + "in": "query", + "required": false, + "description": "Exclusive end (ISO 8601, UTC). Defaults to now.", + "schema": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } ], - "title": "Team Id" + "default": null, + "title": "End Time" } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GridTeamSettingsV1" + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "Max events. Default 100, max 1000.", + "schema": { + "anyOf": [ + { + "maximum": 1000, + "minimum": 1, + "type": "integer" + }, + { + "type": "null" } - } + ], + "default": null, + "title": "Limit" } - } - }, - "x-stability": "unstable" - }, - "patch": { - "summary": "Updates a team's Grid settings by team ID or your only team", - "x-codeSamples": [ + }, { - "lang": "bash", - "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/grid/team_settings \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"harness_defaults\": null,\n \"spend_limit\": null,\n \"team_id\": \"abc1234\"\n}'" + "name": "api_keys", + "in": "query", + "required": false, + "description": "Return only events for these API key prefixes, repeated once per prefix.", + "schema": { + "items": { + "type": "string" + }, + "title": "Api Keys", + "type": "array" + } }, { - "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/team_settings\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PATCH\",\n url,\n headers=headers,\n json={'harness_defaults': None, 'spend_limit': None, 'team_id': 'abc1234'}\n)\n\nprint(response.text)" - } - ], - "description": "Changes only the fields in the request, all or nothing. Requires team admin, and organization admin to change the team-wide spend limit. The team comes from `team_id` instead of the path. Omit it to use the team you belong to; when you belong to several, the request fails with a 400.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateGridTeamSettingsRequestV1" - } + "name": "external_entity_ids", + "in": "query", + "required": false, + "description": "Return only events for these external entity IDs, repeated once per ID.", + "schema": { + "items": { + "type": "string" + }, + "title": "External Entity Ids", + "type": "array" } }, - "required": true - }, + { + "name": "cursor", + "in": "query", + "required": false, + "description": "Next-page cursor. Other parameters are ignored.", + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Cursor" + } + } + ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridTeamSettingsV1" + "$ref": "#/components/schemas/GatewayEventsResponseV1" } } } } - }, - "x-stability": "unstable" + } } }, - "/v1/grid/team_settings/users": { + "/v1/explore/metadata": { "get": { - "summary": "Lists members' Grid settings", + "summary": "Lists model metadata", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/team_settings/users \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/explore/metadata \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/team_settings/users\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'team_id': 'abc1234'}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/explore/metadata\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'provider': None, 'q': None}\n)\n\nprint(response.text)" } ], - "description": "Returns each member's settings in each team, including organization admins and Grid service accounts, one row per team membership. With `team_id`, one team, which requires team admin for it or organization admin; without it, every team you administer, which is none for members.", + "description": "Lists all live model metadata rows, e.g. for model pickers.", "parameters": [ { "name": "cursor", @@ -11064,14 +11713,13 @@ } }, { - "name": "team_id", + "name": "provider", "in": "query", "required": false, - "description": "Limit the list to this team. Without it, the members of every team you administer, one row per team.", + "description": "Filter to a provider by slug prefix, e.g. 'anthropic'. Preserved by the cursor; if repeated, must match the original filter.", "schema": { "anyOf": [ { - "minLength": 1, "type": "string" }, { @@ -11079,10 +11727,25 @@ } ], "default": null, - "examples": [ - "abc1234" + "title": "Provider" + } + }, + { + "name": "q", + "in": "query", + "required": false, + "description": "Case-insensitive substring search over metadata slugs. Preserved by the cursor; if repeated, must match the original filter.", + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ], - "title": "Team Id" + "default": null, + "title": "Q" } } ], @@ -11092,7 +11755,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridTeamUserSettingsListV1" + "$ref": "#/components/schemas/ExploreMetadataResponseV1" } } } @@ -11101,30 +11764,68 @@ "x-stability": "unstable" } }, - "/v1/grid/team_settings/users/{user_id}": { - "get": { - "summary": "Gets a user's Grid settings by team ID or your only team", + "/v1/grid/token": { + "post": { + "summary": "Creates a Grid access token", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/team_settings/users/{user_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request POST \\\n--url https://api.baseten.co/v1/grid/token \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"team_id\": \"abc1234\"\n}'" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/team_settings/users/{user_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'team_id': 'abc1234'}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/token\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'team_id': 'abc1234'}\n)\n\nprint(response.text)" } ], - "description": "Returns the user's spend limit for Baseten Grid in the team, their spend in the team this month, and whether that spend reached the limit. Members can read their own settings; team admins can read members' settings in teams they administer, and organization admins can read anyone's. The team comes from `team_id` instead of the path. Omit it to use the team you belong to; when you belong to several, the request fails with a 400.", + "description": "Exchanges your Baseten credentials for a short-lived token that authenticates against the Grid gateway as you, in the given team. Tokens expire after four hours and cannot be renewed; request a new one when needed. Routes keys cannot create tokens.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateGridTokenRequestV1" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GridTokenV1" + } + } + } + } + }, + "x-stability": "unstable" + } + }, + "/v1/grid/routes": { + "get": { + "summary": "Lists routes", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/routes \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/routes\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'team_id': None, 'name': None}\n)\n\nprint(response.text)" + } + ], + "description": "Lists routes you can invoke, newest first, optionally filtered by exact name. Without `team_id`, routes from every team where you can invoke routes. With `for_harnesses`, exactly one team: `team_id`, else the team you belong to; when you belong to several and name none, the request fails with a 400.", "parameters": [ { - "name": "team_id", + "name": "cursor", "in": "query", "required": false, - "description": "ID of the team. When omitted, the team you belong to; required when you belong to several.", + "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", "schema": { "anyOf": [ { - "minLength": 1, "type": "string" }, { @@ -11132,11 +11833,68 @@ } ], "default": null, - "examples": [ - "abc1234" + "title": "Cursor" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "Maximum number of items to return.", + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "name": "team_id", + "in": "query", + "required": false, + "description": "Limit routes to this team. Without it, routes from every team where you can invoke routes.", + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ], + "default": null, "title": "Team Id" } + }, + { + "name": "for_harnesses", + "in": "query", + "required": false, + "description": "Set by harness setup and sync. Returns routes from exactly one team: `team_id`, else the team you belong to; when you belong to several and name none, the request fails with a 400.", + "schema": { + "default": false, + "title": "For Harnesses", + "type": "boolean" + } + }, + { + "name": "name", + "in": "query", + "required": false, + "description": "Filter by exact route name, the value to send in the inference request's `model` field. Matches a route's name or any of its aliases. Preserved by the cursor; if repeated, must match the original filter.", + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Name" + } } ], "responses": { @@ -11145,7 +11903,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridTeamUserSettingsV1" + "$ref": "#/components/schemas/GridRoutesResponseV1" } } } @@ -11153,29 +11911,24 @@ }, "x-stability": "unstable" }, - "parameters": [ - { - "$ref": "#/components/parameters/user_id" - } - ], - "patch": { - "summary": "Updates a user's Grid settings by team ID or your only team", + "post": { + "summary": "Creates a route", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/grid/team_settings/users/{user_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"spend_limit\": null,\n \"team_id\": \"abc1234\"\n}'" + "source": "curl --request POST \\\n--url https://api.baseten.co/v1/grid/routes \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"team_id\": \"abc1234\",\n \"display_name\": \"Assistant\",\n \"target\": {\n \"model\": \"zai-org/GLM-5.3\",\n \"type\": \"BASETEN_MODEL_API\"\n },\n \"description\": \"Assistant for code review and debugging.\"\n}'" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/team_settings/users/{user_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PATCH\",\n url,\n headers=headers,\n json={'spend_limit': None, 'team_id': 'abc1234'}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/routes\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'team_id': 'abc1234', 'display_name': 'Assistant', 'target': {'model': 'zai-org/GLM-5.3', 'type': 'BASETEN_MODEL_API'}, 'description': 'Assistant for code review and debugging.'}\n)\n\nprint(response.text)" } ], - "description": "Changes only the fields in the request. Once the user's metered spend in the team in a month reaches the spend limit, requests with Routes keys they created in the team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. Requires team admin for the specified team or organization admin. The team comes from `team_id` instead of the path. Omit it to use the team you belong to; when you belong to several, the request fails with a 400.", + "description": "Creates and derives a name for the provided route configuration. CONNECTION targets reference a connection owned by the route's team; create the connection first. INTELLIGENT targets reference a route classifier from GET /v1/grid/route_classifiers.", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateGridUserSettingsRequestV1" + "$ref": "#/components/schemas/CreateGridRouteRequestV1" } } }, @@ -11187,7 +11940,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridTeamUserSettingsV1" + "$ref": "#/components/schemas/GridRouteV1" } } } @@ -11196,20 +11949,20 @@ "x-stability": "unstable" } }, - "/v1/grid/connections": { + "/v1/grid/routes/usage": { "get": { - "summary": "Lists connections", + "summary": "Gets daily Grid usage and estimated costs", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/connections \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/routes/usage \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/connections\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'team_id': None}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/routes/usage\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'team_id': None, 'start_date': None, 'end_date': None}\n)\n\nprint(response.text)" } ], - "description": "Lists connections, newest first: the team's with `team_id`, else those of every team where you can invoke routes.", + "description": "Buckets are UTC days, and days with no usage are included. Organization admins see all Grid usage in the organization. Team admins see usage in teams they manage. Other members, including viewers, see only usage from Routes keys they created, including keys that have since expired, been revoked, or been deleted. Usage can be filtered and grouped by the team it was metered in. Usage is metered every 15 minutes, so the current hour can lag. Model API costs use your prices at the time of each request and include tool calls. xAI costs are the charges xAI reports. OpenAI and Anthropic costs are estimated from Baseten's reference prices and may differ from your provider's bill. Vertex and OpenAI-compatible usage is not included. Costs for OpenAI, Anthropic, and xAI estimate what you pay those providers; they are not Baseten charges. Usage is retained for 92 days.", "parameters": [ { "name": "cursor", @@ -11233,10 +11986,10 @@ "name": "limit", "in": "query", "required": false, - "description": "Maximum number of items to return.", + "description": "Number of daily buckets to return. Defaults to 7; maximum 31.", "schema": { - "default": 100, - "maximum": 1000, + "default": 7, + "maximum": 31, "minimum": 1, "title": "Limit", "type": "integer" @@ -11246,7 +11999,7 @@ "name": "team_id", "in": "query", "required": false, - "description": "Limit connections to this team. Without it, connections from every team where you can invoke routes.", + "description": "Limit usage to a team you can access. Organization admins can view all usage in the team, team admins can view usage in teams they manage, and other members can view only their own usage. Without a team, organization admins see all organization usage, team admins see their managed teams, and other members see their own usage.", "schema": { "anyOf": [ { @@ -11259,52 +12012,131 @@ "default": null, "title": "Team Id" } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GridConnectionsResponseV1" + }, + { + "name": "start_date", + "in": "query", + "required": false, + "description": "Inclusive UTC calendar day at the start of the query range. Defaults to the previous UTC date, and is ignored when you pass a cursor.", + "schema": { + "anyOf": [ + { + "format": "date", + "type": "string" + }, + { + "type": "null" } - } + ], + "default": null, + "title": "Start Date" } - } - }, - "x-stability": "unstable" - }, - "post": { - "summary": "Creates a connection", - "x-codeSamples": [ + }, { - "lang": "bash", - "source": "curl --request POST \\\n--url https://api.baseten.co/v1/grid/connections \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"team_id\": \"abc1234\",\n \"config\": {\n \"provider\": \"ANTHROPIC\",\n \"secret_name\": \"anthropic-key\"\n }\n}'" + "name": "end_date", + "in": "query", + "required": false, + "description": "Exclusive UTC calendar day at the end of the query range. Defaults to the day after the current UTC date so current-day usage is included.", + "schema": { + "anyOf": [ + { + "format": "date", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "End Date" + } }, { - "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/connections\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'team_id': 'abc1234', 'config': {'provider': 'ANTHROPIC', 'secret_name': 'anthropic-key'}}\n)\n\nprint(response.text)" - } - ], - "description": "Creates a connection from the team to an upstream provider.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateGridConnectionRequestV1" - } + "name": "group_by", + "in": "query", + "required": false, + "description": "Dimensions to break usage down by, repeated once per dimension: USER, TEAM, MODEL, PROVIDER, INTELLIGENT_ROUTE, HARNESS, or API_KEY. Each result represents one observed combination of the requested dimensions within that day, and results are sorted by those values. Combinations without usage are omitted, so result counts can differ between days. INTELLIGENT_ROUTE returns only usage sent through an intelligent route, one row per intelligent route, or per intelligent route and model with MODEL. These rows repeat usage already counted in other groupings, so don't add them to model totals. HARNESS includes usage with no recorded harness as a null group. API_KEY includes usage without an API key, such as requests authenticated by a signed-in session, as a null group. Defaults to MODEL.", + "schema": { + "items": { + "$ref": "#/components/schemas/GridRouteUsageDimensionV1" + }, + "title": "Group By", + "type": "array" } }, - "required": true - }, + { + "name": "user_ids", + "in": "query", + "required": false, + "description": "Return only usage from Routes keys created by these user IDs, repeated once per ID.", + "schema": { + "items": { + "type": "string" + }, + "title": "User Ids", + "type": "array" + } + }, + { + "name": "models", + "in": "query", + "required": false, + "description": "Return only usage for these exact model names, repeated once per model.", + "schema": { + "items": { + "type": "string" + }, + "title": "Models", + "type": "array" + } + }, + { + "name": "providers", + "in": "query", + "required": false, + "description": "Return only usage for these providers, repeated once per provider.", + "schema": { + "items": { + "$ref": "#/components/schemas/GridProviderV1" + }, + "title": "Providers", + "type": "array" + } + }, + { + "name": "harnesses", + "in": "query", + "required": false, + "description": "Return only usage for these harnesses, repeated once per harness. Omit to include all usage, including usage with no recorded harness.", + "schema": { + "items": { + "$ref": "#/components/schemas/GridRouteUsageHarnessV1" + }, + "title": "Harnesses", + "type": "array" + } + }, + { + "name": "api_key_prefixes", + "in": "query", + "required": false, + "description": "Return only usage made with these API keys, repeated once per key prefix. Omit to include all usage, including usage without an API key.", + "schema": { + "items": { + "type": "string" + }, + "title": "Api Key Prefixes", + "type": "array" + } + } + ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridConnectionV1" + "$ref": "#/components/schemas/GridRouteUsageResponseV1" } } } @@ -11313,27 +12145,26 @@ "x-stability": "unstable" } }, - "/v1/grid/connections/{connection_id}": { + "/v1/grid/routes/{route_id}": { "delete": { - "summary": "Deletes a connection", + "summary": "Deletes a route", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/grid/connections/{connection_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/grid/routes/{route_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/connections/{connection_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"DELETE\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/routes/{route_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"DELETE\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" } ], - "description": "Deletes the connection. The team secret it points at is left in place.", "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridConnectionTombstoneV1" + "$ref": "#/components/schemas/GridRouteTombstoneV1" } } } @@ -11343,19 +12174,19 @@ }, "parameters": [ { - "$ref": "#/components/parameters/connection_id" + "$ref": "#/components/parameters/route_id" } ], "get": { - "summary": "Gets a connection", + "summary": "Gets a route", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/connections/{connection_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/routes/{route_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/connections/{connection_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/routes/{route_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" } ], "responses": { @@ -11364,7 +12195,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridConnectionV1" + "$ref": "#/components/schemas/GridRouteV1" } } } @@ -11373,23 +12204,23 @@ "x-stability": "unstable" }, "patch": { - "summary": "Updates a connection", + "summary": "Updates a route", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/grid/connections/{connection_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"config\": {\n \"provider\": \"ANTHROPIC\",\n \"secret_name\": \"anthropic-key\"\n }\n}'" + "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/grid/routes/{route_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"description\": \"Assistant for code review and debugging.\",\n \"display_name\": \"Assistant\"\n}'" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/connections/{connection_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PATCH\",\n url,\n headers=headers,\n json={'config': {'provider': 'ANTHROPIC', 'secret_name': 'anthropic-key'}}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/routes/{route_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PATCH\",\n url,\n headers=headers,\n json={'description': 'Assistant for code review and debugging.', 'display_name': 'Assistant'}\n)\n\nprint(response.text)" } ], - "description": "Updates the connection's fields. The provider and owning team are immutable; point the connection at a new team secret to change its API key, or rotate the key itself by updating the secret.", + "description": "The route name, target, and owning team are immutable.", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateGridConnectionRequestV1" + "$ref": "#/components/schemas/UpdateGridRouteRequestV1" } } }, @@ -11401,7 +12232,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridConnectionV1" + "$ref": "#/components/schemas/GridRouteV1" } } } @@ -11410,29 +12241,30 @@ "x-stability": "unstable" } }, - "/v1/grid/classifiers": { + "/v1/grid/team_settings": { "get": { - "summary": "Lists classifiers available for intelligent routes", + "summary": "Gets a team's Grid settings by team ID or your only team", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/classifiers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/team_settings \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/classifiers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/team_settings\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'team_id': 'abc1234'}\n)\n\nprint(response.text)" } ], - "description": "Returns Baseten-managed classifiers available to your organization, ordered by identifier. Classifiers cannot be created or modified through this API.", + "description": "Returns the settings that apply to the team, including the default models for each coding harness and the team's spend limits. Any member who can invoke the team's routes can read them. The team comes from `team_id` instead of the path. Omit it to use the team you belong to; when you belong to several, the request fails with a 400.", "parameters": [ { - "name": "cursor", + "name": "team_id", "in": "query", "required": false, - "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", + "description": "ID of the team. When omitted, the team you belong to; required when you belong to several.", "schema": { "anyOf": [ { + "minLength": 1, "type": "string" }, { @@ -11440,20 +12272,10 @@ } ], "default": null, - "title": "Cursor" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "Maximum number of items to return.", - "schema": { - "default": 100, - "maximum": 1000, - "minimum": 1, - "title": "Limit", - "type": "integer" + "examples": [ + "abc1234" + ], + "title": "Team Id" } } ], @@ -11463,62 +12285,66 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridClassifiersResponseV1" + "$ref": "#/components/schemas/GridTeamSettingsV1" } } } } }, "x-stability": "unstable" - } - }, - "/v1/grid/classifiers/{classifier_id}": { - "get": { - "summary": "Gets a classifier available for intelligent routes", + }, + "patch": { + "summary": "Updates a team's Grid settings by team ID or your only team", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/classifiers/{classifier_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/grid/team_settings \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"harness_defaults\": null,\n \"spend_limit\": null,\n \"team_id\": \"abc1234\"\n}'" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/classifiers/{classifier_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/team_settings\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PATCH\",\n url,\n headers=headers,\n json={'harness_defaults': None, 'spend_limit': None, 'team_id': 'abc1234'}\n)\n\nprint(response.text)" } ], + "description": "Changes only the fields in the request, all or nothing. Requires team admin, and organization admin to change the team-wide spend limit. The team comes from `team_id` instead of the path. Omit it to use the team you belong to; when you belong to several, the request fails with a 400.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateGridTeamSettingsRequestV1" + } + } + }, + "required": true + }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridClassifierV1" + "$ref": "#/components/schemas/GridTeamSettingsV1" } } } } }, "x-stability": "unstable" - }, - "parameters": [ - { - "$ref": "#/components/parameters/classifier_id" - } - ] + } }, - "/v1/grid/route_classifiers": { + "/v1/grid/team_settings/users": { "get": { - "summary": "Lists route classifiers available for intelligent routes", + "summary": "Lists members' Grid settings", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/route_classifiers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/team_settings/users \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/route_classifiers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/team_settings/users\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'team_id': 'abc1234'}\n)\n\nprint(response.text)" } ], - "description": "Returns Baseten-managed route classifiers available to your organization, ordered by identifier. Route classifiers cannot be created or modified through this API.", + "description": "Returns each member's settings in each team, including organization admins and Grid service accounts, one row per team membership. With `team_id`, one team, which requires team admin for it or organization admin; without it, every team you administer, which is none for members.", "parameters": [ { "name": "cursor", @@ -11550,6 +12376,28 @@ "title": "Limit", "type": "integer" } + }, + { + "name": "team_id", + "in": "query", + "required": false, + "description": "Limit the list to this team. Without it, the members of every team you administer, one row per team.", + "schema": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "examples": [ + "abc1234" + ], + "title": "Team Id" + } } ], "responses": { @@ -11558,7 +12406,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridRouteClassifiersResponseV1" + "$ref": "#/components/schemas/GridTeamUserSettingsListV1" } } } @@ -11567,17 +12415,42 @@ "x-stability": "unstable" } }, - "/v1/grid/route_classifiers/{route_classifier_id}": { + "/v1/grid/team_settings/users/{user_id}": { "get": { - "summary": "Gets a route classifier available for intelligent routes", + "summary": "Gets a user's Grid settings by team ID or your only team", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/route_classifiers/{route_classifier_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/team_settings/users/{user_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/route_classifiers/{route_classifier_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/team_settings/users/{user_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'team_id': 'abc1234'}\n)\n\nprint(response.text)" + } + ], + "description": "Returns the user's spend limit for Baseten Grid in the team, their spend in the team this month, and whether that spend reached the limit. Members can read their own settings; team admins can read members' settings in teams they administer, and organization admins can read anyone's. The team comes from `team_id` instead of the path. Omit it to use the team you belong to; when you belong to several, the request fails with a 400.", + "parameters": [ + { + "name": "team_id", + "in": "query", + "required": false, + "description": "ID of the team. When omitted, the team you belong to; required when you belong to several.", + "schema": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "examples": [ + "abc1234" + ], + "title": "Team Id" + } } ], "responses": { @@ -11586,7 +12459,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridRouteClassifierV1" + "$ref": "#/components/schemas/GridTeamUserSettingsV1" } } } @@ -11596,24 +12469,61 @@ }, "parameters": [ { - "$ref": "#/components/parameters/route_classifier_id" + "$ref": "#/components/parameters/user_id" } - ] + ], + "patch": { + "summary": "Updates a user's Grid settings by team ID or your only team", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/grid/team_settings/users/{user_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"spend_limit\": null,\n \"team_id\": \"abc1234\"\n}'" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/team_settings/users/{user_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PATCH\",\n url,\n headers=headers,\n json={'spend_limit': None, 'team_id': 'abc1234'}\n)\n\nprint(response.text)" + } + ], + "description": "Changes only the fields in the request. Once the user's metered spend in the team in a month reaches the spend limit, requests with Routes keys they created in the team are rejected until the limit is raised or the next month starts. Spend is metered every 15 minutes and can lag, so a user can go over the limit. Requires team admin for the specified team or organization admin. The team comes from `team_id` instead of the path. Omit it to use the team you belong to; when you belong to several, the request fails with a 400.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateGridUserSettingsRequestV1" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GridTeamUserSettingsV1" + } + } + } + } + }, + "x-stability": "unstable" + } }, - "/v1/grid/machine_users": { + "/v1/grid/connections": { "get": { - "summary": "Lists machine users", + "summary": "Lists connections", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/machine_users \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/connections \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/machine_users\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'team_id': None}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/connections\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'team_id': None}\n)\n\nprint(response.text)" } ], - "description": "Lists machine users, newest first: the team's with `team_id`, which requires team admin for it, else those of every team you administer.", + "description": "Lists connections, newest first: the team's with `team_id`, else those of every team where you can invoke routes.", "parameters": [ { "name": "cursor", @@ -11650,7 +12560,7 @@ "name": "team_id", "in": "query", "required": false, - "description": "Limit machine users to this team. Without it, every team you administer.", + "description": "Limit connections to this team. Without it, connections from every team where you can invoke routes.", "schema": { "anyOf": [ { @@ -11671,7 +12581,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GridMachineUsersResponseV1" + "$ref": "#/components/schemas/GridConnectionsResponseV1" } } } @@ -11680,23 +12590,23 @@ "x-stability": "unstable" }, "post": { - "summary": "Creates a machine user", + "summary": "Creates a connection", "x-codeSamples": [ { "lang": "bash", - "source": "curl --request POST \\\n--url https://api.baseten.co/v1/grid/machine_users \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"team_id\": \"abc1234\",\n \"name\": \"night-shift\",\n \"api_key\": null\n}'" + "source": "curl --request POST \\\n--url https://api.baseten.co/v1/grid/connections \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"team_id\": \"abc1234\",\n \"config\": {\n \"provider\": \"ANTHROPIC\",\n \"secret_name\": \"anthropic-key\"\n }\n}'" }, { "lang": "python", - "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/machine_users\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'team_id': 'abc1234', 'name': 'night-shift', 'api_key': None}\n)\n\nprint(response.text)" + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/connections\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'team_id': 'abc1234', 'config': {'provider': 'ANTHROPIC', 'secret_name': 'anthropic-key'}}\n)\n\nprint(response.text)" } ], - "description": "Creates a team-owned identity for an application, with its own Grid budget. Set `api_key` to also create its first API key, which the response returns only once. Set the machine user's spend limit with the user settings endpoint, using its `id` as the user ID. Requires team admin.", + "description": "Creates a connection from the team to an upstream provider.", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateGridMachineUserRequestV1" + "$ref": "#/components/schemas/CreateGridConnectionRequestV1" } } }, @@ -11708,7 +12618,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreatedGridMachineUserV1" + "$ref": "#/components/schemas/GridConnectionV1" } } } @@ -11717,7 +12627,316 @@ "x-stability": "unstable" } }, - "/v1/grid/machine_users/{machine_user_id}": { + "/v1/grid/connections/{connection_id}": { + "delete": { + "summary": "Deletes a connection", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request DELETE \\\n--url https://api.baseten.co/v1/grid/connections/{connection_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/connections/{connection_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"DELETE\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + } + ], + "description": "Deletes the connection. The team secret it points at is left in place.", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GridConnectionTombstoneV1" + } + } + } + } + }, + "x-stability": "unstable" + }, + "parameters": [ + { + "$ref": "#/components/parameters/connection_id" + } + ], + "get": { + "summary": "Gets a connection", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/connections/{connection_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/connections/{connection_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GridConnectionV1" + } + } + } + } + }, + "x-stability": "unstable" + }, + "patch": { + "summary": "Updates a connection", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request PATCH \\\n--url https://api.baseten.co/v1/grid/connections/{connection_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"config\": {\n \"provider\": \"ANTHROPIC\",\n \"secret_name\": \"anthropic-key\"\n }\n}'" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/connections/{connection_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"PATCH\",\n url,\n headers=headers,\n json={'config': {'provider': 'ANTHROPIC', 'secret_name': 'anthropic-key'}}\n)\n\nprint(response.text)" + } + ], + "description": "Updates the connection's fields. The provider and owning team are immutable; point the connection at a new team secret to change its API key, or rotate the key itself by updating the secret.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateGridConnectionRequestV1" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GridConnectionV1" + } + } + } + } + }, + "x-stability": "unstable" + } + }, + "/v1/grid/route_classifiers": { + "get": { + "summary": "Lists route classifiers available for intelligent routes", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/route_classifiers \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/route_classifiers\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None}\n)\n\nprint(response.text)" + } + ], + "description": "Returns Baseten-managed route classifiers available to your organization, ordered by identifier. Route classifiers cannot be created or modified through this API.", + "parameters": [ + { + "name": "cursor", + "in": "query", + "required": false, + "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Cursor" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "Maximum number of items to return.", + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GridRouteClassifiersResponseV1" + } + } + } + } + }, + "x-stability": "unstable" + } + }, + "/v1/grid/route_classifiers/{route_classifier_id}": { + "get": { + "summary": "Gets a route classifier available for intelligent routes", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/route_classifiers/{route_classifier_id} \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/route_classifiers/{route_classifier_id}\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n json={}\n)\n\nprint(response.text)" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GridRouteClassifierV1" + } + } + } + } + }, + "x-stability": "unstable" + }, + "parameters": [ + { + "$ref": "#/components/parameters/route_classifier_id" + } + ] + }, + "/v1/grid/machine_users": { + "get": { + "summary": "Lists machine users", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request GET \\\n--url https://api.baseten.co/v1/grid/machine_users \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\"\n" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/machine_users\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"GET\",\n url,\n headers=headers,\n params={'cursor': None, 'team_id': None}\n)\n\nprint(response.text)" + } + ], + "description": "Lists machine users, newest first: the team's with `team_id`, which requires team admin for it, else those of every team you administer.", + "parameters": [ + { + "name": "cursor", + "in": "query", + "required": false, + "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Cursor" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "Maximum number of items to return.", + "schema": { + "default": 100, + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + } + }, + { + "name": "team_id", + "in": "query", + "required": false, + "description": "Limit machine users to this team. Without it, every team you administer.", + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Team Id" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GridMachineUsersResponseV1" + } + } + } + } + }, + "x-stability": "unstable" + }, + "post": { + "summary": "Creates a machine user", + "x-codeSamples": [ + { + "lang": "bash", + "source": "curl --request POST \\\n--url https://api.baseten.co/v1/grid/machine_users \\\n--header \"Authorization: Bearer $BASETEN_API_KEY\" \\\n--data '{\n \"team_id\": \"abc1234\",\n \"name\": \"night-shift\",\n \"api_key\": null\n}'" + }, + { + "lang": "python", + "source": "import requests\nimport os\nAPI_KEY = os.environ.get(\"BASETEN_API_KEY\", \"\")\nurl = \"https://api.baseten.co/v1/grid/machine_users\"\n\nheaders = {\"Authorization\": f\"Bearer {API_KEY}\"}\n\nresponse = requests.request(\n \"POST\",\n url,\n headers=headers,\n json={'team_id': 'abc1234', 'name': 'night-shift', 'api_key': None}\n)\n\nprint(response.text)" + } + ], + "description": "Creates a team-owned identity for an application, with its own Grid budget. Set `api_key` to also create its first API key, which the response returns only once. Set the machine user's spend limit with the user settings endpoint, using its `id` as the user ID. Requires team admin.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateGridMachineUserRequestV1" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatedGridMachineUserV1" + } + } + } + } + }, + "x-stability": "unstable" + } + }, + "/v1/grid/machine_users/{machine_user_id}": { "delete": { "summary": "Deletes a machine user", "x-codeSamples": [ @@ -18102,6 +19321,25 @@ "title": "PrepareModelUploadResponseV1", "type": "object" }, + "AuditFieldChangeV1": { + "description": "A field's value before and after an update.", + "properties": { + "old": { + "description": "The value before the update.", + "title": "Old" + }, + "new": { + "description": "The value after the update.", + "title": "New" + } + }, + "required": [ + "old", + "new" + ], + "title": "AuditFieldChangeV1", + "type": "object" + }, "AuditLogActorTypeV1": { "description": "Kind of actor that performed an audited action.", "enum": [ @@ -18109,7 +19347,8 @@ "API_KEY", "BASETEN_USER", "BASETEN_SYSTEM", - "TOMBSTONE_USER" + "TOMBSTONE_USER", + "SERVICE_ACCOUNT" ], "title": "AuditLogActorTypeV1", "type": "string" @@ -18159,6 +19398,45 @@ "default": null, "description": "Display name of the acting API key, when the actor is an API key.", "title": "Api Key Name" + }, + "service_account_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "ID of the acting service account, when the actor is a service account.", + "title": "Service Account Id" + }, + "service_account_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Current name of the acting service account, when the actor is a service account.", + "title": "Service Account Name" + }, + "trust_rule_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "ID of the trust rule the acting workload identity federation token was exchanged through, when the actor is a service account.", + "title": "Trust Rule Id" } }, "required": [ @@ -18170,7 +19448,8 @@ "AuditLogApiKeyRevocationReasonV1": { "description": "Reason an API key was revoked.", "enum": [ - "INACTIVITY" + "INACTIVITY", + "CREDENTIAL_EXPOSURE" ], "title": "AuditLogApiKeyRevocationReasonV1", "type": "string" @@ -18182,6 +19461,7 @@ "CREATOR_SERVICE_ACCOUNT", "MANAGE_API_KEYS_SERVICE_ACCOUNT", "INVOKE_ALL_MODELS_SERVICE_ACCOUNT", + "INVOKE_ALL_DEDICATED_MODELS_SERVICE_ACCOUNT", "INVOKE_ALLOWED_MODELS_SERVICE_ACCOUNT", "INVOKE_SCOPED_ENVS_AND_MODELS_SERVICE_ACCOUNT", "EXPORT_METRICS_ALL_MODELS_SERVICE_ACCOUNT", @@ -18238,6 +19518,9 @@ "GRID_MACHINE_USER_CREATED": "#/components/schemas/AuditLogEventGridMachineUserCreatedV1", "GRID_MACHINE_USER_DELETED": "#/components/schemas/AuditLogEventGridMachineUserDeletedV1", "GRID_MACHINE_USER_UPDATED": "#/components/schemas/AuditLogEventGridMachineUserUpdatedV1", + "IDENTITY_PROVIDER_CREATED": "#/components/schemas/AuditLogEventIdentityProviderCreatedV1", + "IDENTITY_PROVIDER_DELETED": "#/components/schemas/AuditLogEventIdentityProviderDeletedV1", + "IDENTITY_PROVIDER_UPDATED": "#/components/schemas/AuditLogEventIdentityProviderUpdatedV1", "MODEL_DELETED": "#/components/schemas/AuditLogEventModelDeletedV1", "MODEL_DEPLOYED": "#/components/schemas/AuditLogEventModelDeployedV1", "MODEL_DEPLOYMENT_ACTIVATED": "#/components/schemas/AuditLogEventModelDeploymentActivatedV1", @@ -18250,6 +19533,7 @@ "MODEL_DEPLOYMENT_RETRIED": "#/components/schemas/AuditLogEventModelDeploymentRetriedV1", "MODEL_PROMOTION_CONTROL_ACTION": "#/components/schemas/AuditLogEventModelPromotionControlActionV1", "MODEL_RENAMED": "#/components/schemas/AuditLogEventModelRenamedV1", + "ORGANIZATION_API_KEY_SETTINGS_UPDATED": "#/components/schemas/AuditLogEventOrganizationApiKeySettingsUpdatedV1", "PROVIDER_CONNECTION_CREATED": "#/components/schemas/AuditLogEventProviderConnectionCreatedV1", "PROVIDER_CONNECTION_DELETED": "#/components/schemas/AuditLogEventProviderConnectionDeletedV1", "PROVIDER_CONNECTION_UPDATED": "#/components/schemas/AuditLogEventProviderConnectionUpdatedV1", @@ -18257,10 +19541,16 @@ "REQUIRE_GROUP_BASED_ADMINS_ENABLED": "#/components/schemas/AuditLogEventRequireGroupBasedAdminsEnabledV1", "SECRET_DELETED": "#/components/schemas/AuditLogEventSecretDeletedV1", "SECRET_UPDATED": "#/components/schemas/AuditLogEventSecretUpdatedV1", + "SERVICE_ACCOUNT_CREATED": "#/components/schemas/AuditLogEventServiceAccountCreatedV1", + "SERVICE_ACCOUNT_DELETED": "#/components/schemas/AuditLogEventServiceAccountDeletedV1", + "SERVICE_ACCOUNT_UPDATED": "#/components/schemas/AuditLogEventServiceAccountUpdatedV1", "SSH_CERTIFICATE_SIGNED": "#/components/schemas/AuditLogEventSshCertificateSignedV1", "TELEMETRY_EXPORT_CREATED": "#/components/schemas/AuditLogEventTelemetryExportCreatedV1", "TELEMETRY_EXPORT_DELETED": "#/components/schemas/AuditLogEventTelemetryExportDeletedV1", "TELEMETRY_EXPORT_UPDATED": "#/components/schemas/AuditLogEventTelemetryExportUpdatedV1", + "TRUST_RULE_CREATED": "#/components/schemas/AuditLogEventTrustRuleCreatedV1", + "TRUST_RULE_DELETED": "#/components/schemas/AuditLogEventTrustRuleDeletedV1", + "TRUST_RULE_UPDATED": "#/components/schemas/AuditLogEventTrustRuleUpdatedV1", "USER_INVITED": "#/components/schemas/AuditLogEventUserInvitedV1", "USER_JOINED_ORGANIZATION": "#/components/schemas/AuditLogEventUserJoinedOrganizationV1", "USER_REMOVED": "#/components/schemas/AuditLogEventUserRemovedV1", @@ -18357,6 +19647,9 @@ { "$ref": "#/components/schemas/AuditLogEventApiKeyLifetimeLimitsUpdatedV1" }, + { + "$ref": "#/components/schemas/AuditLogEventOrganizationApiKeySettingsUpdatedV1" + }, { "$ref": "#/components/schemas/AuditLogEventGatewayEndpointCreatedV1" }, @@ -18458,6 +19751,33 @@ }, { "$ref": "#/components/schemas/AuditLogEventTelemetryExportDeletedV1" + }, + { + "$ref": "#/components/schemas/AuditLogEventServiceAccountCreatedV1" + }, + { + "$ref": "#/components/schemas/AuditLogEventServiceAccountUpdatedV1" + }, + { + "$ref": "#/components/schemas/AuditLogEventServiceAccountDeletedV1" + }, + { + "$ref": "#/components/schemas/AuditLogEventIdentityProviderCreatedV1" + }, + { + "$ref": "#/components/schemas/AuditLogEventIdentityProviderUpdatedV1" + }, + { + "$ref": "#/components/schemas/AuditLogEventIdentityProviderDeletedV1" + }, + { + "$ref": "#/components/schemas/AuditLogEventTrustRuleCreatedV1" + }, + { + "$ref": "#/components/schemas/AuditLogEventTrustRuleUpdatedV1" + }, + { + "$ref": "#/components/schemas/AuditLogEventTrustRuleDeletedV1" } ], "title": "Event Data" @@ -21022,6 +22342,108 @@ "title": "AuditLogEventGridMachineUserUpdatedV1", "type": "object" }, + "AuditLogEventIdentityProviderCreatedV1": { + "description": "An identity provider was added.", + "properties": { + "event_type": { + "const": "IDENTITY_PROVIDER_CREATED", + "title": "Event Type", + "type": "string" + }, + "identity_provider_id": { + "title": "Identity Provider Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Null when the provider was added without one.", + "title": "Description" + }, + "predefined": { + "$ref": "#/components/schemas/AuditLogEventPredefinedIdentityProviderConfigV1", + "description": "The provider's settings, as the identity provider resource returns them." + } + }, + "required": [ + "event_type", + "identity_provider_id", + "name", + "predefined" + ], + "title": "AuditLogEventIdentityProviderCreatedV1", + "type": "object" + }, + "AuditLogEventIdentityProviderDeletedV1": { + "description": "An identity provider was deleted.", + "properties": { + "event_type": { + "const": "IDENTITY_PROVIDER_DELETED", + "title": "Event Type", + "type": "string" + }, + "identity_provider_id": { + "title": "Identity Provider Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "event_type", + "identity_provider_id", + "name" + ], + "title": "AuditLogEventIdentityProviderDeletedV1", + "type": "object" + }, + "AuditLogEventIdentityProviderUpdatedV1": { + "description": "An identity provider was updated.", + "properties": { + "event_type": { + "const": "IDENTITY_PROVIDER_UPDATED", + "title": "Event Type", + "type": "string" + }, + "identity_provider_id": { + "title": "Identity Provider Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "changes": { + "additionalProperties": { + "$ref": "#/components/schemas/AuditFieldChangeV1" + }, + "description": "The fields the update changed, keyed by field name.", + "title": "Changes", + "type": "object" + } + }, + "required": [ + "event_type", + "identity_provider_id", + "name", + "changes" + ], + "title": "AuditLogEventIdentityProviderUpdatedV1", + "type": "object" + }, "AuditLogEventModelDeletedV1": { "description": "A model was deleted.", "properties": { @@ -21789,6 +23211,67 @@ "title": "AuditLogEventModelRenamedV1", "type": "object" }, + "AuditLogEventOrganizationApiKeySettingsUpdatedV1": { + "description": "An administrator changed which classes of API key the organization allows creating.", + "properties": { + "event_type": { + "const": "ORGANIZATION_API_KEY_SETTINGS_UPDATED", + "title": "Event Type", + "type": "string" + }, + "organization_id": { + "title": "Organization Id", + "type": "string" + }, + "previous_allow_personal_api_keys": { + "title": "Previous Allow Personal Api Keys", + "type": "boolean" + }, + "new_allow_personal_api_keys": { + "title": "New Allow Personal Api Keys", + "type": "boolean" + }, + "previous_allow_service_account_api_keys": { + "title": "Previous Allow Service Account Api Keys", + "type": "boolean" + }, + "new_allow_service_account_api_keys": { + "title": "New Allow Service Account Api Keys", + "type": "boolean" + } + }, + "required": [ + "event_type", + "organization_id", + "previous_allow_personal_api_keys", + "new_allow_personal_api_keys", + "previous_allow_service_account_api_keys", + "new_allow_service_account_api_keys" + ], + "title": "AuditLogEventOrganizationApiKeySettingsUpdatedV1", + "type": "object" + }, + "AuditLogEventPredefinedIdentityProviderConfigV1": { + "description": "Settings of a predefined identity provider, as recorded on an identity provider event. Not\nitself an event payload.", + "properties": { + "kind": { + "description": "Which predefined provider, for example `AWS_EKS`.", + "title": "Kind", + "type": "string" + }, + "issuer_url": { + "description": "The `iss` claim of the provider's tokens.", + "title": "Issuer Url", + "type": "string" + } + }, + "required": [ + "kind", + "issuer_url" + ], + "title": "AuditLogEventPredefinedIdentityProviderConfigV1", + "type": "object" + }, "AuditLogEventPromotionSettingsOverrideV1": { "description": "Promotion settings overridden for one promotion. Null means the environment's value. Not\nitself a payload in the discriminated union.", "properties": { @@ -22112,6 +23595,162 @@ "title": "AuditLogEventSecretUpdatedV1", "type": "object" }, + "AuditLogEventServiceAccountCreatedV1": { + "description": "A service account was created.", + "properties": { + "event_type": { + "const": "SERVICE_ACCOUNT_CREATED", + "title": "Event Type", + "type": "string" + }, + "service_account_id": { + "title": "Service Account Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Null when the account was created without one.", + "title": "Description" + }, + "owner_team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The team that owns the account. Null for an organization account.", + "title": "Owner Team Id" + }, + "preset_permissions": { + "$ref": "#/components/schemas/AuditLogEventServiceAccountPresetPermissionsV1" + } + }, + "required": [ + "event_type", + "service_account_id", + "name", + "preset_permissions" + ], + "title": "AuditLogEventServiceAccountCreatedV1", + "type": "object" + }, + "AuditLogEventServiceAccountDeletedV1": { + "description": "A service account was deleted.", + "properties": { + "event_type": { + "const": "SERVICE_ACCOUNT_DELETED", + "title": "Event Type", + "type": "string" + }, + "service_account_id": { + "title": "Service Account Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "event_type", + "service_account_id", + "name" + ], + "title": "AuditLogEventServiceAccountDeletedV1", + "type": "object" + }, + "AuditLogEventServiceAccountPresetPermissionsV1": { + "description": "A service account's access, as recorded on a service account event. Not itself an event\npayload.", + "properties": { + "api_key_type": { + "description": "The API key type whose permissions the account has, as API key events record it.", + "title": "Api Key Type", + "type": "string" + }, + "model_ids": { + "description": "Models the access is limited to; empty for all.", + "items": { + "type": "string" + }, + "title": "Model Ids", + "type": "array" + }, + "environment_names": { + "description": "Environments the access is limited to, or may also manage; empty for none.", + "items": { + "type": "string" + }, + "title": "Environment Names", + "type": "array" + }, + "model_api_slugs": { + "description": "Model APIs the access is limited to; empty for all.", + "items": { + "type": "string" + }, + "title": "Model Api Slugs", + "type": "array" + } + }, + "required": [ + "api_key_type", + "model_ids", + "environment_names", + "model_api_slugs" + ], + "title": "AuditLogEventServiceAccountPresetPermissionsV1", + "type": "object" + }, + "AuditLogEventServiceAccountUpdatedV1": { + "description": "A service account was updated. Disabling or enabling it is a change to `disabled`.", + "properties": { + "event_type": { + "const": "SERVICE_ACCOUNT_UPDATED", + "title": "Event Type", + "type": "string" + }, + "service_account_id": { + "title": "Service Account Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "changes": { + "additionalProperties": { + "$ref": "#/components/schemas/AuditFieldChangeV1" + }, + "description": "The fields the update changed, keyed by field name.", + "title": "Changes", + "type": "object" + } + }, + "required": [ + "event_type", + "service_account_id", + "name", + "changes" + ], + "title": "AuditLogEventServiceAccountUpdatedV1", + "type": "object" + }, "AuditLogEventSshCertificateSignedV1": { "description": "An SSH certificate was signed for a workload.", "properties": { @@ -22234,6 +23873,131 @@ "title": "AuditLogEventTelemetryExportUpdatedV1", "type": "object" }, + "AuditLogEventTrustRuleCreatedV1": { + "description": "A trust rule was created.", + "properties": { + "event_type": { + "const": "TRUST_RULE_CREATED", + "title": "Event Type", + "type": "string" + }, + "trust_rule_id": { + "title": "Trust Rule Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Null when the rule was created without one.", + "title": "Description" + }, + "identity_provider_id": { + "title": "Identity Provider Id", + "type": "string" + }, + "service_account_id": { + "title": "Service Account Id", + "type": "string" + }, + "condition": { + "description": "The CEL expression a token's claims must satisfy.", + "title": "Condition", + "type": "string" + }, + "audience": { + "description": "The `aud` claim a token must carry.", + "title": "Audience", + "type": "string" + }, + "max_access_token_lifetime_seconds": { + "description": "The longest lifetime, in seconds, of an access token the rule issues.", + "title": "Max Access Token Lifetime Seconds", + "type": "integer" + } + }, + "required": [ + "event_type", + "trust_rule_id", + "name", + "identity_provider_id", + "service_account_id", + "condition", + "audience", + "max_access_token_lifetime_seconds" + ], + "title": "AuditLogEventTrustRuleCreatedV1", + "type": "object" + }, + "AuditLogEventTrustRuleDeletedV1": { + "description": "A trust rule was deleted.", + "properties": { + "event_type": { + "const": "TRUST_RULE_DELETED", + "title": "Event Type", + "type": "string" + }, + "trust_rule_id": { + "title": "Trust Rule Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "event_type", + "trust_rule_id", + "name" + ], + "title": "AuditLogEventTrustRuleDeletedV1", + "type": "object" + }, + "AuditLogEventTrustRuleUpdatedV1": { + "description": "A trust rule was updated.", + "properties": { + "event_type": { + "const": "TRUST_RULE_UPDATED", + "title": "Event Type", + "type": "string" + }, + "trust_rule_id": { + "title": "Trust Rule Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "changes": { + "additionalProperties": { + "$ref": "#/components/schemas/AuditFieldChangeV1" + }, + "description": "The fields the update changed, keyed by field name.", + "title": "Changes", + "type": "object" + } + }, + "required": [ + "event_type", + "trust_rule_id", + "name", + "changes" + ], + "title": "AuditLogEventTrustRuleUpdatedV1", + "type": "object" + }, "AuditLogEventTypeV1": { "description": "Type of action recorded by an audit-log entry.", "enum": [ @@ -22296,7 +24060,17 @@ "VOLUME_UPDATED", "TELEMETRY_EXPORT_CREATED", "TELEMETRY_EXPORT_UPDATED", - "TELEMETRY_EXPORT_DELETED" + "TELEMETRY_EXPORT_DELETED", + "SERVICE_ACCOUNT_CREATED", + "SERVICE_ACCOUNT_UPDATED", + "SERVICE_ACCOUNT_DELETED", + "IDENTITY_PROVIDER_CREATED", + "IDENTITY_PROVIDER_UPDATED", + "IDENTITY_PROVIDER_DELETED", + "TRUST_RULE_CREATED", + "TRUST_RULE_UPDATED", + "TRUST_RULE_DELETED", + "ORGANIZATION_API_KEY_SETTINGS_UPDATED" ], "title": "AuditLogEventTypeV1", "type": "string" @@ -22790,7 +24564,8 @@ "USER_MANAGEMENT", "DIRECTORY_GROUP_MANAGEMENT", "SSH", - "TELEMETRY_EXPORT" + "TELEMETRY_EXPORT", + "WORKLOAD_IDENTITY" ], "title": "AuditLogEventTypeGroupV1", "type": "string" @@ -23367,6 +25142,19 @@ "request_backpressure_settings": { "$ref": "#/components/schemas/RequestBackpressureSettingsV1", "description": "Effective request backpressure settings for the deployment." + }, + "failure_reason": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Why the deployment failed. Set only when the status is DEPLOY_FAILED; null otherwise.", + "title": "Failure Reason" } }, "required": [ @@ -25329,6 +27117,146 @@ "title": "GetStartupSummaryRequestV1", "type": "object" }, + "DeploymentReplicaStatusV1": { + "enum": [ + "STARTING", + "ACTIVE", + "UNHEALTHY", + "TERMINATING", + "TERMINATED", + "UNKNOWN" + ], + "title": "DeploymentReplicaStatusV1", + "type": "string" + }, + "DeploymentReplicaV1": { + "properties": { + "id": { + "description": "Pod-name suffix used for replica lookup and termination, usually five characters.", + "title": "Id", + "type": "string" + }, + "deployment_id": { + "description": "ID of the replica's deployment.", + "title": "Deployment Id", + "type": "string" + }, + "deployment_name": { + "description": "Name of the replica's deployment.", + "title": "Deployment Name", + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/DeploymentReplicaStatusV1", + "description": "Current replica lifecycle status." + }, + "created_at": { + "description": "Replica creation time in ISO 8601 format.", + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "terminated_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Observed termination completion time in ISO 8601 format, or null if unavailable.", + "title": "Terminated At" + }, + "age_seconds": { + "description": "Age in seconds since creation, frozen at termination.", + "title": "Age Seconds", + "type": "number" + }, + "restart_count": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Model container lifetime restart count, or null if unavailable.", + "title": "Restart Count" + } + }, + "required": [ + "id", + "deployment_id", + "deployment_name", + "status", + "created_at", + "terminated_at", + "age_seconds", + "restart_count" + ], + "title": "DeploymentReplicaV1", + "type": "object" + }, + "DeploymentReplicasV1": { + "properties": { + "items": { + "description": "Items in this page.", + "items": { + "$ref": "#/components/schemas/DeploymentReplicaV1" + }, + "title": "Items", + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResponseV1", + "description": "Pagination metadata for the page." + } + }, + "required": [ + "items", + "pagination" + ], + "title": "DeploymentReplicasV1", + "type": "object" + }, + "DeploymentReplicasRequestV1": { + "properties": { + "cursor": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", + "title": "Cursor" + }, + "limit": { + "default": 100, + "description": "Maximum number of items to return.", + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + }, + "statuses": { + "description": "Replica statuses to include. Repeat the statuses query parameter to filter by multiple statuses. Omit to include all statuses, including terminated replicas.", + "items": { + "$ref": "#/components/schemas/DeploymentReplicaStatusV1" + }, + "title": "Statuses", + "type": "array" + } + }, + "title": "DeploymentReplicasRequestV1", + "type": "object" + }, "TerminateReplicaResponseV1": { "description": "The response to a request to terminate a replica in a deployment.", "properties": { @@ -26421,7 +28349,8 @@ }, "sampling_mode": { "$ref": "#/components/schemas/TrafficRoutingRuleShadowSamplingModeV1", - "description": "How requests are picked for shadowing" + "default": "USER_SESSION", + "description": "How requests are picked for shadowing. Defaults to USER_SESSION." }, "propagate_client_cancellation": { "description": "Whether a shadow request is cancelled when the original client disconnects", @@ -26434,7 +28363,6 @@ "targets", "percent_traffic", "expires_at", - "sampling_mode", "propagate_client_cancellation" ], "title": "TrafficRoutingRuleUpsertV1", @@ -27893,8 +29821,58 @@ "title": "CheckpointSyncStatus", "type": "string" }, + "TrainingBDNConfigResponseV1": { + "properties": { + "mounts": { + "items": { + "$ref": "#/components/schemas/TrainingBDNMountResponseV1" + }, + "title": "Mounts", + "type": "array" + } + }, + "title": "TrainingBDNConfigResponseV1", + "type": "object" + }, + "TrainingBDNMountResponseV1": { + "properties": { + "source": { + "title": "Source", + "type": "string" + }, + "path": { + "title": "Path", + "type": "string" + }, + "include": { + "description": "Relative glob patterns selecting files to mount; empty includes all files.", + "items": { + "type": "string" + }, + "title": "Include", + "type": "array" + }, + "exclude": { + "description": "Relative glob patterns excluding files from the mount; exclusions win.", + "items": { + "type": "string" + }, + "title": "Exclude", + "type": "array" + } + }, + "required": [ + "source", + "path" + ], + "title": "TrainingBDNMountResponseV1", + "type": "object" + }, "TrainingJobV1": { "properties": { + "bdn": { + "$ref": "#/components/schemas/TrainingBDNConfigResponseV1" + }, "id": { "description": "Unique identifier of the training job.", "title": "Id", @@ -28876,6 +30854,9 @@ "CreateTrainingJobV1": { "description": "Configuration for a training job.", "properties": { + "bdn": { + "$ref": "#/components/schemas/TrainingBDNConfigV1" + }, "image": { "$ref": "#/components/schemas/CreateTrainingJobImageV1", "examples": [ @@ -29352,6 +31333,58 @@ "title": "SecretReferenceV1", "type": "object" }, + "TrainingBDNConfigV1": { + "additionalProperties": false, + "description": "Read-only BDN mounts with the same reference semantics as inference.", + "properties": { + "mounts": { + "items": { + "$ref": "#/components/schemas/TrainingBDNMountV1" + }, + "maxItems": 32, + "title": "Mounts", + "type": "array" + } + }, + "title": "TrainingBDNConfigV1", + "type": "object" + }, + "TrainingBDNMountV1": { + "additionalProperties": false, + "description": "A requested read-only BDN dataset mount.", + "properties": { + "source": { + "title": "Source", + "type": "string" + }, + "path": { + "title": "Path", + "type": "string" + }, + "include": { + "description": "Relative glob patterns selecting files to mount; empty includes all files.", + "items": { + "type": "string" + }, + "title": "Include", + "type": "array" + }, + "exclude": { + "description": "Relative glob patterns excluding files from the mount; exclusions win.", + "items": { + "type": "string" + }, + "title": "Exclude", + "type": "array" + } + }, + "required": [ + "source", + "path" + ], + "title": "TrainingBDNMountV1", + "type": "object" + }, "TrainingWeightAuthV1": { "description": "Authentication configuration for a training weight source.", "properties": { @@ -29850,7 +31883,7 @@ }, "type": "array" }, - "description": "A map of GPU rank to memory usage for the training job. For multinode jobs, this is the memory usage of the leader unless specified otherwise.", + "description": "A map of GPU rank to memory usage for the training job. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", "title": "Gpu Memory Usage Bytes", "type": "object" }, @@ -29861,12 +31894,56 @@ }, "type": "array" }, - "description": "A map of GPU rank to fractional GPU utilization. For multinode jobs, this is the GPU utilization of the leader unless specified otherwise.", + "description": "A map of GPU rank to the share of time the GPU's streaming multiprocessors have work assigned, from 0 to 1. This counts any GPU work, not only tensor core math; see gpu_tensor_core_utilization for that. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", "title": "Gpu Utilization", "type": "object" }, + "gpu_temperature_celsius": { + "additionalProperties": { + "items": { + "$ref": "#/components/schemas/TrainingJobMetricV1" + }, + "type": "array" + }, + "description": "A map of GPU rank to GPU temperature in degrees Celsius. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", + "title": "Gpu Temperature Celsius", + "type": "object" + }, + "gpu_power_usage_watts": { + "additionalProperties": { + "items": { + "$ref": "#/components/schemas/TrainingJobMetricV1" + }, + "type": "array" + }, + "description": "A map of GPU rank to GPU power draw in watts. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", + "title": "Gpu Power Usage Watts", + "type": "object" + }, + "gpu_tensor_core_utilization": { + "additionalProperties": { + "items": { + "$ref": "#/components/schemas/TrainingJobMetricV1" + }, + "type": "array" + }, + "description": "A map of GPU rank to the share of time the GPU tensor cores are active, from 0 to 1. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", + "title": "Gpu Tensor Core Utilization", + "type": "object" + }, + "gpu_memory_bandwidth_utilization": { + "additionalProperties": { + "items": { + "$ref": "#/components/schemas/TrainingJobMetricV1" + }, + "type": "array" + }, + "description": "A map of GPU rank to the share of cycles GPU memory is actively reading or writing, from 0 to 1. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", + "title": "Gpu Memory Bandwidth Utilization", + "type": "object" + }, "cpu_usage": { - "description": "The CPU usage measured in cores. For multinode jobs, this is the CPU usage of the leader unless specified otherwise.", + "description": "The CPU usage measured in cores. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", "items": { "$ref": "#/components/schemas/TrainingJobMetricV1" }, @@ -29874,7 +31951,7 @@ "type": "array" }, "cpu_memory_usage_bytes": { - "description": "The CPU memory usage for the training job. For multinode jobs, this is the CPU memory usage of the leader unless specified otherwise.", + "description": "The CPU memory usage for the training job. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", "items": { "$ref": "#/components/schemas/TrainingJobMetricV1" }, @@ -29883,12 +31960,16 @@ }, "ephemeral_storage": { "$ref": "#/components/schemas/StorageMetricsV1", - "description": "The storage usage for the ephemeral storage. For multinode jobs, this is the ephemeral storage usage of the leader unless specified otherwise." + "description": "The storage usage for the ephemeral storage. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node." } }, "required": [ "gpu_memory_usage_bytes", "gpu_utilization", + "gpu_temperature_celsius", + "gpu_power_usage_watts", + "gpu_tensor_core_utilization", + "gpu_memory_bandwidth_utilization", "cpu_usage", "cpu_memory_usage_bytes", "ephemeral_storage" @@ -29926,7 +32007,7 @@ }, "type": "array" }, - "description": "A map of GPU rank to memory usage for the training job. For multinode jobs, this is the memory usage of the leader unless specified otherwise.", + "description": "A map of GPU rank to memory usage for the training job. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", "title": "Gpu Memory Usage Bytes", "type": "object" }, @@ -29937,12 +32018,56 @@ }, "type": "array" }, - "description": "A map of GPU rank to fractional GPU utilization. For multinode jobs, this is the GPU utilization of the leader unless specified otherwise.", + "description": "A map of GPU rank to the share of time the GPU's streaming multiprocessors have work assigned, from 0 to 1. This counts any GPU work, not only tensor core math; see gpu_tensor_core_utilization for that. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", "title": "Gpu Utilization", "type": "object" }, + "gpu_temperature_celsius": { + "additionalProperties": { + "items": { + "$ref": "#/components/schemas/TrainingJobMetricV1" + }, + "type": "array" + }, + "description": "A map of GPU rank to GPU temperature in degrees Celsius. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", + "title": "Gpu Temperature Celsius", + "type": "object" + }, + "gpu_power_usage_watts": { + "additionalProperties": { + "items": { + "$ref": "#/components/schemas/TrainingJobMetricV1" + }, + "type": "array" + }, + "description": "A map of GPU rank to GPU power draw in watts. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", + "title": "Gpu Power Usage Watts", + "type": "object" + }, + "gpu_tensor_core_utilization": { + "additionalProperties": { + "items": { + "$ref": "#/components/schemas/TrainingJobMetricV1" + }, + "type": "array" + }, + "description": "A map of GPU rank to the share of time the GPU tensor cores are active, from 0 to 1. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", + "title": "Gpu Tensor Core Utilization", + "type": "object" + }, + "gpu_memory_bandwidth_utilization": { + "additionalProperties": { + "items": { + "$ref": "#/components/schemas/TrainingJobMetricV1" + }, + "type": "array" + }, + "description": "A map of GPU rank to the share of cycles GPU memory is actively reading or writing, from 0 to 1. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", + "title": "Gpu Memory Bandwidth Utilization", + "type": "object" + }, "cpu_usage": { - "description": "The CPU usage measured in cores. For multinode jobs, this is the CPU usage of the leader unless specified otherwise.", + "description": "The CPU usage measured in cores. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", "items": { "$ref": "#/components/schemas/TrainingJobMetricV1" }, @@ -29950,7 +32075,7 @@ "type": "array" }, "cpu_memory_usage_bytes": { - "description": "The CPU memory usage for the training job. For multinode jobs, this is the CPU memory usage of the leader unless specified otherwise.", + "description": "The CPU memory usage for the training job. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node.", "items": { "$ref": "#/components/schemas/TrainingJobMetricV1" }, @@ -29959,7 +32084,7 @@ }, "ephemeral_storage": { "$ref": "#/components/schemas/StorageMetricsV1", - "description": "The storage usage for the ephemeral storage. For multinode jobs, this is the ephemeral storage usage of the leader unless specified otherwise." + "description": "The storage usage for the ephemeral storage. At the top level of a multinode job this is the leader node; under per_node_metrics it is that node." }, "training_job": { "$ref": "#/components/schemas/TrainingJobV1", @@ -29988,6 +32113,10 @@ "required": [ "gpu_memory_usage_bytes", "gpu_utilization", + "gpu_temperature_celsius", + "gpu_power_usage_watts", + "gpu_tensor_core_utilization", + "gpu_memory_bandwidth_utilization", "cpu_usage", "cpu_memory_usage_bytes", "ephemeral_storage", @@ -31508,9 +33637,27 @@ } ], "default": null, - "description": "Optional Hugging Face checkpoint to start training from instead of the base model's weights. Form: hf:///[@]. It must be a complete, merged checkpoint in safetensors format with the same architecture as base_model, which still selects the hardware and training configuration. It must include its tokenizer files: the run's sampler and the SDK load the tokenizer and chat template from the checkpoint. A private or gated repository needs a Hugging Face token in the team secret hf_access_token. The revision is pinned to a commit when the run is created. Cannot be combined with path, reuse_from_run_id, or reuse_from_session_id.", + "description": "Optional checkpoint to start training from instead of the base model's weights: a Hugging Face repo (hf:///[@]), an object store path (s3://, gs://, r2://, cw://, or azure://), or a full Baseten Training checkpoint in the run's team (bt://@/, with the checkpoint named). It must be a complete, merged checkpoint in safetensors format with the same architecture as base_model, which still selects the hardware and training configuration. It must include tokenizer files: the run's sampler loads the tokenizer and chat template from the checkpoint. A Hugging Face revision is pinned to a commit when the run is created, and its files are checked then. Any other source is read again by each sampler and resumed run, so do not change it while the run is in use. Checkpoints from a run on a source outside Hugging Face cannot be deployed yet. Cannot be combined with path, reuse_from_run_id, or reuse_from_session_id.", "title": "Base Checkpoint" }, + "base_checkpoint_auth": { + "anyOf": [ + { + "$ref": "#/components/schemas/TrainingWeightAuthV1" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Optional credentials that read base_checkpoint. Only CUSTOM_SECRET is supported: set auth_secret_name to the team secret that holds a Hugging Face token for a Hugging Face repo, or the credentials for an object store. A Baseten Training checkpoint takes no auth. The run, its samplers, resumed runs, and checkpoint deployments all use this secret. When omitted, a Hugging Face repo is read with the team secret hf_access_token if it exists. Requires base_checkpoint.", + "examples": [ + { + "auth_method": "CUSTOM_SECRET", + "auth_secret_name": "hf_read_my_checkpoint" + } + ] + }, "sampler_num_replicas": { "anyOf": [ { @@ -31571,6 +33718,198 @@ "title": "DeactivateLoopsRunResponseV1", "type": "object" }, + "LoopsCheckpointV1": { + "description": "A checkpoint saved by a Loops run.", + "properties": { + "checkpoint_id": { + "description": "The ID of the checkpoint.", + "title": "Checkpoint Id", + "type": "string" + }, + "created_at": { + "description": "The timestamp of the checkpoint in ISO 8601 format.", + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "checkpoint_type": { + "description": "The type of checkpoint.", + "title": "Checkpoint Type", + "type": "string" + }, + "base_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The base model of the checkpoint.", + "title": "Base Model" + }, + "lora_adapter_config": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "description": "The adapter config of the checkpoint.", + "title": "Lora Adapter Config" + }, + "size_bytes": { + "description": "The size of the checkpoint in bytes.", + "title": "Size Bytes", + "type": "integer" + }, + "sync_status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Sync state of the checkpoint: SYNCING or COMPLETE.", + "title": "Sync Status" + }, + "id": { + "description": "The checkpoint ID.", + "title": "Id", + "type": "string" + }, + "lora_config": { + "anyOf": [ + { + "$ref": "#/components/schemas/LoopsLoRAConfigV1" + }, + { + "type": "null" + } + ], + "description": "The immutable LoRA config used to save this checkpoint. Null means the checkpoint is unsupported and cannot be loaded." + }, + "run_id": { + "description": "The ID of the run that produced the checkpoint.", + "title": "Run Id", + "type": "string" + }, + "target": { + "$ref": "#/components/schemas/TrainerCheckpointTarget", + "description": "Whether this checkpoint is loadable by the sampler or by the run." + }, + "expires_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "When the checkpoint expires and is deleted, set from the TTL it was saved with. Null means it's kept until you delete it. A checkpoint that's still in use when it expires, for example deployed, is deleted once it's released.", + "title": "Expires At" + } + }, + "required": [ + "checkpoint_id", + "created_at", + "checkpoint_type", + "base_model", + "lora_adapter_config", + "size_bytes", + "id", + "lora_config", + "run_id", + "target", + "expires_at" + ], + "title": "LoopsCheckpointV1", + "type": "object" + }, + "LoopsLoRAConfigV1": { + "description": "A published LoRA config: which modules the adapter targets and how experts are laid out.", + "properties": { + "config_version": { + "description": "The config version, like v1.", + "title": "Config Version", + "type": "string" + }, + "targets": { + "description": "The module names the LoRA adapter targets.", + "items": { + "type": "string" + }, + "title": "Targets", + "type": "array" + }, + "expert_layout": { + "anyOf": [ + { + "enum": [ + "per_expert", + "shared_outer", + "shared_adapter" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "How routed-expert LoRA weights are laid out. Null when no experts are targeted.", + "title": "Expert Layout" + } + }, + "required": [ + "config_version", + "targets" + ], + "title": "LoopsLoRAConfigV1", + "type": "object" + }, + "TrainerCheckpointTarget": { + "description": "Whether a TrainerServerCheckpoint is loadable by the sampler or the trainer.\n\nSAMPLER checkpoints are consumed by the sampling server for inference;\nTRAINER checkpoints capture full trainer state for resuming training.\nMirrored in the bt:// URI as\n``bt://loops:/(sampler_weights|weights)/``.", + "enum": [ + "sampler", + "trainer" + ], + "title": "TrainerCheckpointTarget", + "type": "string" + }, + "DeleteLoopsRunResponseV1": { + "description": "A Loops run whose delete was accepted.", + "properties": { + "id": { + "description": "The deleted Loops run ID.", + "title": "Id", + "type": "string" + }, + "kept_checkpoints": { + "description": "The run's checkpoints that were not deleted because something still uses them, such as a deployment. They stay usable until that stops.", + "items": { + "$ref": "#/components/schemas/LoopsCheckpointV1" + }, + "title": "Kept Checkpoints", + "type": "array" + } + }, + "required": [ + "id", + "kept_checkpoints" + ], + "title": "DeleteLoopsRunResponseV1", + "type": "object" + }, "GetLoopsRunResponseV1": { "description": "Response for ``GET /v1/loops/runs/``.", "properties": { @@ -31730,9 +34069,27 @@ } ], "default": null, - "description": "Optional Hugging Face checkpoint to start training from instead of the base model's weights. Form: hf:///[@]. It must be a complete, merged checkpoint in safetensors format with the same architecture as base_model, which still selects the hardware and training configuration. It must include its tokenizer files: the run's sampler and the SDK load the tokenizer and chat template from the checkpoint. A private or gated repository needs a Hugging Face token in the team secret hf_access_token. The revision is pinned to a commit when the run is created. Cannot be combined with path, reuse_from_run_id, or reuse_from_session_id.", + "description": "Optional checkpoint to start training from instead of the base model's weights: a Hugging Face repo (hf:///[@]), an object store path (s3://, gs://, r2://, cw://, or azure://), or a full Baseten Training checkpoint in the run's team (bt://@/, with the checkpoint named). It must be a complete, merged checkpoint in safetensors format with the same architecture as base_model, which still selects the hardware and training configuration. It must include tokenizer files: the run's sampler loads the tokenizer and chat template from the checkpoint. A Hugging Face revision is pinned to a commit when the run is created, and its files are checked then. Any other source is read again by each sampler and resumed run, so do not change it while the run is in use. Checkpoints from a run on a source outside Hugging Face cannot be deployed yet. Cannot be combined with path, reuse_from_run_id, or reuse_from_session_id.", "title": "Base Checkpoint" }, + "base_checkpoint_auth": { + "anyOf": [ + { + "$ref": "#/components/schemas/TrainingWeightAuthV1" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Optional credentials that read base_checkpoint. Only CUSTOM_SECRET is supported: set auth_secret_name to the team secret that holds a Hugging Face token for a Hugging Face repo, or the credentials for an object store. A Baseten Training checkpoint takes no auth. The run, its samplers, resumed runs, and checkpoint deployments all use this secret. When omitted, a Hugging Face repo is read with the team secret hf_access_token if it exists. Requires base_checkpoint.", + "examples": [ + { + "auth_method": "CUSTOM_SECRET", + "auth_secret_name": "hf_read_my_checkpoint" + } + ] + }, "scope": { "$ref": "#/components/schemas/LoopsPlacementScopeV1", "default": "default", @@ -31968,160 +34325,6 @@ "title": "GetLoopsSamplerResponseV1", "type": "object" }, - "LoopsCheckpointV1": { - "description": "A checkpoint saved by a Loops run.", - "properties": { - "checkpoint_id": { - "description": "The ID of the checkpoint.", - "title": "Checkpoint Id", - "type": "string" - }, - "created_at": { - "description": "The timestamp of the checkpoint in ISO 8601 format.", - "format": "date-time", - "title": "Created At", - "type": "string" - }, - "checkpoint_type": { - "description": "The type of checkpoint.", - "title": "Checkpoint Type", - "type": "string" - }, - "base_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The base model of the checkpoint.", - "title": "Base Model" - }, - "lora_adapter_config": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "description": "The adapter config of the checkpoint.", - "title": "Lora Adapter Config" - }, - "size_bytes": { - "description": "The size of the checkpoint in bytes.", - "title": "Size Bytes", - "type": "integer" - }, - "sync_status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Sync state of the checkpoint: SYNCING or COMPLETE.", - "title": "Sync Status" - }, - "id": { - "description": "The checkpoint ID.", - "title": "Id", - "type": "string" - }, - "lora_config": { - "anyOf": [ - { - "$ref": "#/components/schemas/LoopsLoRAConfigV1" - }, - { - "type": "null" - } - ], - "description": "The immutable LoRA config used to save this checkpoint. Null means the checkpoint is unsupported and cannot be loaded." - }, - "run_id": { - "description": "The ID of the run that produced the checkpoint.", - "title": "Run Id", - "type": "string" - }, - "target": { - "$ref": "#/components/schemas/TrainerCheckpointTarget", - "description": "Whether this checkpoint is loadable by the sampler or by the run." - } - }, - "required": [ - "checkpoint_id", - "created_at", - "checkpoint_type", - "base_model", - "lora_adapter_config", - "size_bytes", - "id", - "lora_config", - "run_id", - "target" - ], - "title": "LoopsCheckpointV1", - "type": "object" - }, - "LoopsLoRAConfigV1": { - "description": "A published LoRA config: which modules the adapter targets and how experts are laid out.", - "properties": { - "config_version": { - "description": "The config version, like v1.", - "title": "Config Version", - "type": "string" - }, - "targets": { - "description": "The module names the LoRA adapter targets.", - "items": { - "type": "string" - }, - "title": "Targets", - "type": "array" - }, - "expert_layout": { - "anyOf": [ - { - "enum": [ - "per_expert", - "shared_outer", - "shared_adapter" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "How routed-expert LoRA weights are laid out. Null when no experts are targeted.", - "title": "Expert Layout" - } - }, - "required": [ - "config_version", - "targets" - ], - "title": "LoopsLoRAConfigV1", - "type": "object" - }, - "TrainerCheckpointTarget": { - "description": "Whether a TrainerServerCheckpoint is loadable by the sampler or the trainer.\n\nSAMPLER checkpoints are consumed by the sampling server for inference;\nTRAINER checkpoints capture full trainer state for resuming training.\nMirrored in the bt:// URI as\n``bt://loops:/(sampler_weights|weights)/``.", - "enum": [ - "sampler", - "trainer" - ], - "title": "TrainerCheckpointTarget", - "type": "string" - }, "ListLoopsCheckpointsResponseV1": { "description": "Checkpoints matching the query filter.", "properties": { @@ -32293,6 +34496,44 @@ "title": "DeployLoopsCheckpointResponseV1", "type": "object" }, + "LoopsCheckpointTombstoneV1": { + "description": "A Loops checkpoint whose delete was accepted.", + "properties": { + "id": { + "description": "The deleted checkpoint ID.", + "title": "Id", + "type": "string" + }, + "run_id": { + "description": "The ID of the run that produced the checkpoint.", + "title": "Run Id", + "type": "string" + }, + "checkpoint_id": { + "description": "The name the checkpoint was saved under.", + "title": "Checkpoint Id", + "type": "string" + }, + "target": { + "$ref": "#/components/schemas/TrainerCheckpointTarget", + "description": "Whether the checkpoint was loadable by the sampler or by the run." + }, + "path": { + "description": "The checkpoint's bt:// path.", + "title": "Path", + "type": "string" + } + }, + "required": [ + "id", + "run_id", + "checkpoint_id", + "target", + "path" + ], + "title": "LoopsCheckpointTombstoneV1", + "type": "object" + }, "LoopsCheckpointFilesResponseV1": { "description": "Response with presigned URLs for files under a Loops checkpoint.", "properties": { @@ -32420,6 +34661,29 @@ "title": "LoopsCheckpointSourceResponseV1", "type": "object" }, + "SetLoopsCheckpointTtlRequestV1": { + "properties": { + "ttl_seconds": { + "anyOf": [ + { + "maximum": 315360000, + "minimum": 3600, + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Seconds from now until the checkpoint expires and is deleted, from 3600 (1 hour) to 315360000 (10 years). Null removes the TTL, so the checkpoint is kept until you delete it.", + "title": "Ttl Seconds" + } + }, + "required": [ + "ttl_seconds" + ], + "title": "SetLoopsCheckpointTtlRequestV1", + "type": "object" + }, "LoopsDeploymentStatusV1": { "description": "Latest deployment status for a Loops deployment.", "properties": { @@ -33118,12 +35382,12 @@ "type": "string" }, "baseline": { - "description": "Baseline GPU allocation for the team. 0 if not configured.", + "description": "Configured minimum GPU allocation for the team. Not enforced. 0 if not configured.", "title": "Baseline", "type": "integer" }, "limit": { - "description": "Maximum concurrent GPUs of this type for this team", + "description": "The team's GPU quota for this type. It counts the team's on-demand jobs, plus its spot jobs when the organization has no separate on-demand quota. On-demand jobs can run past it by borrowing from the organization's shared pool, when one exists.", "title": "Limit", "type": "integer" }, @@ -33134,7 +35398,7 @@ }, "dedicated_usage_count": { "default": 0, - "description": "Portion of usage_count from standard (non-spot) jobs.", + "description": "Portion of usage_count from on-demand (non-spot) jobs.", "title": "Dedicated Usage Count", "type": "integer" }, @@ -33165,15 +35429,33 @@ "type": "string" }, "baseline": { - "description": "Baseline GPU allocation; jobs below this threshold are expected to run immediately. 0 if not configured.", + "description": "Configured minimum GPU allocation (`min_gpus`). 0 if not configured. Use `on_demand_quota` for the quota applied to on-demand jobs.", "title": "Baseline", "type": "integer" }, "limit": { - "description": "Maximum concurrent GPUs of this type for this org", + "description": "Configured maximum GPU allocation (`max_gpus`). Use `on_demand_quota` and `spot_quota` for the quotas applied to jobs.", "title": "Limit", "type": "integer" }, + "on_demand_quota": { + "description": "GPU quota for this type for on-demand (non-spot) jobs: the most GPUs they can use at once.", + "title": "On Demand Quota", + "type": "integer" + }, + "spot_quota": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "GPU quota for this type for spot jobs. Spot shares this quota with on-demand jobs: spot can use up to the quota minus on-demand GPUs in use. Null if spot is not enabled for the organization.", + "title": "Spot Quota" + }, "usage_count": { "description": "GPUs currently in use by active training jobs", "title": "Usage Count", @@ -33181,13 +35463,13 @@ }, "dedicated_usage_count": { "default": 0, - "description": "Portion of usage_count from standard (non-spot) jobs, which run against the baseline.", + "description": "Portion of usage_count from on-demand (non-spot) jobs.", "title": "Dedicated Usage Count", "type": "integer" }, "spot_usage_count": { "default": 0, - "description": "Portion of usage_count from spot jobs, which burst into the peak and may push usage above the limit.", + "description": "Portion of usage_count from spot jobs.", "title": "Spot Usage Count", "type": "integer" } @@ -33196,6 +35478,7 @@ "gpu_type", "baseline", "limit", + "on_demand_quota", "usage_count" ], "title": "TrainingGpuCapacityItemV1", @@ -33205,7 +35488,7 @@ "description": "Response for the training GPU capacity endpoint.", "properties": { "gpu_capacities": { - "description": "Org-level GPU capacity limits and current usage per GPU type", + "description": "Organization GPU quotas and current usage per GPU type", "items": { "$ref": "#/components/schemas/TrainingGpuCapacityItemV1" }, @@ -33213,12 +35496,18 @@ "type": "array" }, "team_gpu_capacities": { - "description": "Per-team GPU capacity limits and current usage per GPU type", + "description": "Per-team GPU quotas and current usage per GPU type", "items": { "$ref": "#/components/schemas/TeamTrainingGpuCapacityItemV1" }, "title": "Team Gpu Capacities", "type": "array" + }, + "spot_enabled": { + "default": false, + "description": "Whether the organization can submit spot training jobs.", + "title": "Spot Enabled", + "type": "boolean" } }, "required": [ @@ -33228,7 +35517,7 @@ "type": "object" }, "PatchTeamTrainingGpuCapacityRequestV1": { - "description": "A request to set the GPU capacity ceiling for a (team, gpu_type) pair.\n\nCreates the limit if one doesn't already exist for this team and GPU type,\notherwise updates it in place.", + "description": "A request to set the GPU quota for a (team, gpu_type) pair.\n\nCreates the quota if one doesn't already exist for this team and GPU type,\notherwise updates it in place.", "properties": { "team_id": { "description": "Team identifier", @@ -33241,7 +35530,7 @@ "type": "string" }, "max_gpus": { - "description": "Max concurrent GPUs of this type the team may use", + "description": "The team's GPU quota for this type. It counts the team's on-demand jobs, plus its spot jobs when the organization has no separate on-demand quota. On-demand jobs can run past it by borrowing from the organization's shared pool, when one exists.", "examples": [ 8, 16, @@ -33260,11 +35549,11 @@ "type": "object" }, "PatchTeamTrainingGpuCapacityResponseV1": { - "description": "Response for setting a team's GPU capacity ceiling.", + "description": "Response for setting a team's GPU quota.", "properties": { "team_gpu_capacity": { "$ref": "#/components/schemas/TeamTrainingGpuCapacityItemV1", - "description": "The updated per-team GPU capacity limit" + "description": "The updated per-team GPU quota" } }, "required": [ @@ -34747,6 +37036,14 @@ }, "title": "Metrics", "type": "array" + }, + "team_ids": { + "description": "Return only metrics for these teams, repeated once per team. Defaults to all teams you can manage. Any unauthorized team causes a 403.", + "items": { + "type": "string" + }, + "title": "Team Ids", + "type": "array" } }, "title": "GetModelAPIMetricsRequestV1", @@ -36885,7 +39182,7 @@ "type": "string" } ], - "description": "Subtotal cost in dollars after applying credits used", + "description": "Usage charges in dollars before applying credits", "title": "Subtotal" }, "credits_used": { @@ -37175,6 +39472,32 @@ "description": "Subtotal cost in dollars for this model", "title": "Subtotal" }, + "team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Team ID for multi-team organizations; otherwise null", + "title": "Team Id" + }, + "team_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Team name, including historical teams; null if unavailable", + "title": "Team Name" + }, "input_tokens": { "description": "Total input tokens for this model", "title": "Input Tokens", @@ -37221,7 +39544,7 @@ "type": "string" } ], - "description": "Subtotal cost in dollars after applying credits used", + "description": "Usage charges in dollars before applying credits", "title": "Subtotal" }, "credits_used": { @@ -37247,11 +39570,11 @@ "type": "string" } ], - "description": "Total cost in dollars", + "description": "Usage charges in dollars after applying credits, floored at zero", "title": "Total" }, "breakdown": { - "description": "Per-model usage breakdown", + "description": "Per-model usage breakdown, split by team for multi-team organizations", "items": { "$ref": "#/components/schemas/ModelApiItemV1" }, @@ -37332,7 +39655,7 @@ "type": "string" } ], - "description": "Subtotal cost in dollars after applying credits used", + "description": "Usage charges in dollars before applying credits", "title": "Subtotal" }, "credits_used": { @@ -37390,169 +39713,1730 @@ "dedicated_usage": { "anyOf": [ { - "$ref": "#/components/schemas/DedicatedUsageV1" + "$ref": "#/components/schemas/DedicatedUsageV1" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Dedicated model serving usage" + }, + "training_usage": { + "anyOf": [ + { + "$ref": "#/components/schemas/TrainingUsageV1" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Training usage" + }, + "model_apis_usage": { + "anyOf": [ + { + "$ref": "#/components/schemas/ModelApisUsageV1" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Model APIs usage" + }, + "loops_usage": { + "anyOf": [ + { + "$ref": "#/components/schemas/LoopsUsageV1" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Serverless Loops usage, billed per token. Loops usage on dedicated trainers and samplers is billed by the minute and is part of training usage." + } + }, + "title": "UsageSummaryV1", + "type": "object" + }, + "UsageSummaryRequestV1": { + "properties": { + "start_date": { + "description": "Inclusive start date (ISO 8601, normalized to midnight UTC). Earliest queryable: 2026-01-01.", + "format": "date-time", + "title": "Start Date", + "type": "string" + }, + "end_date": { + "description": "Exclusive end date (ISO 8601, normalized to midnight UTC). Date range cannot exceed 31 days.", + "format": "date-time", + "title": "End Date", + "type": "string" + } + }, + "required": [ + "start_date", + "end_date" + ], + "title": "UsageSummaryRequestV1", + "type": "object" + }, + "ToolCallUsageBucketV1": { + "description": "Server-side tool call usage for one day, provider, charge unit, and model.", + "properties": { + "date": { + "description": "UTC day the usage was recorded on.", + "format": "date", + "title": "Date", + "type": "string" + }, + "provider": { + "description": "Tool provider, such as exa or parallel.", + "title": "Provider", + "type": "string" + }, + "sku": { + "description": "Charge unit, as `/`. The unit is what the provider reported, or the tool name when it reported none. Its meaning varies by provider.", + "title": "Sku", + "type": "string" + }, + "model": { + "description": "Model that made the tool calls.", + "title": "Model", + "type": "string" + }, + "calls": { + "description": "Number of tool calls.", + "title": "Calls", + "type": "integer" + }, + "quantity": { + "description": "Billable quantity in the provider's sku unit, summed over the calls.", + "title": "Quantity", + "type": "number" + }, + "team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Team attributed to the usage. Null when not grouping by team or when historical team attribution is unavailable.", + "title": "Team Id" + } + }, + "required": [ + "date", + "provider", + "sku", + "model", + "calls", + "quantity" + ], + "title": "ToolCallUsageBucketV1", + "type": "object" + }, + "ToolCallUsageResponseV1": { + "description": "Daily server-side tool call usage, ordered by day, provider, sku, and model.", + "properties": { + "items": { + "items": { + "$ref": "#/components/schemas/ToolCallUsageBucketV1" + }, + "title": "Items", + "type": "array" + } + }, + "title": "ToolCallUsageResponseV1", + "type": "object" + }, + "ToolCallUsageDimensionV1": { + "enum": [ + "TEAM" + ], + "title": "ToolCallUsageDimensionV1", + "type": "string" + }, + "ToolCallUsageRequestV1": { + "properties": { + "start_date": { + "description": "Inclusive UTC calendar day at the start of the query range.", + "format": "date", + "title": "Start Date", + "type": "string" + }, + "end_date": { + "anyOf": [ + { + "format": "date", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Exclusive UTC calendar day at the end of the query range. Defaults to the day after the current UTC date so current-day usage is included. The date range cannot exceed 90 days.", + "title": "End Date" + }, + "team_ids": { + "description": "Return only usage for these teams, repeated once per team. Defaults to all teams you can manage. An unauthorized team ID causes a 403 response.", + "items": { + "type": "string" + }, + "title": "Team Ids", + "type": "array" + }, + "group_by": { + "description": "Pass TEAM to split daily rows by team. Defaults to aggregating across teams.", + "items": { + "$ref": "#/components/schemas/ToolCallUsageDimensionV1" + }, + "title": "Group By", + "type": "array" + } + }, + "required": [ + "start_date" + ], + "title": "ToolCallUsageRequestV1", + "type": "object" + }, + "UserInfoV1": { + "description": "A Baseten user.", + "properties": { + "user_id": { + "description": "Unique identifier for the user", + "title": "User Id", + "type": "string" + }, + "email": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Email address of the user", + "title": "Email" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Display name of the user", + "title": "Name" + }, + "workspace_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Name of the user's workspace", + "title": "Workspace Name" + } + }, + "required": [ + "user_id" + ], + "title": "UserInfoV1", + "type": "object" + }, + "UsersResponseV1": { + "description": "A page of users in the caller's workspace.", + "properties": { + "items": { + "description": "Items in this page.", + "items": { + "$ref": "#/components/schemas/UserInfoV1" + }, + "title": "Items", + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResponseV1", + "description": "Pagination metadata for the page." + } + }, + "required": [ + "items", + "pagination" + ], + "title": "UsersResponseV1", + "type": "object" + }, + "UsersRequestV1": { + "description": "Request parameters for listing users.", + "properties": { + "cursor": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", + "title": "Cursor" + }, + "limit": { + "default": 100, + "description": "Maximum number of items to return.", + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + }, + "email": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "When set, returns only users with this exact email, if any.", + "title": "Email" + } + }, + "title": "UsersRequestV1", + "type": "object" + }, + "AwsAssumeRoleV1": { + "description": "AWS AssumeRole trust-policy inputs for the organization.", + "properties": { + "baseten_role_arn": { + "description": "Baseten role ARN to allow in an IAM role's trust policy", + "title": "Baseten Role Arn", + "type": "string" + }, + "external_id": { + "description": "sts:ExternalId Baseten presents when assuming the role", + "title": "External Id", + "type": "string" + } + }, + "required": [ + "baseten_role_arn", + "external_id" + ], + "title": "AwsAssumeRoleV1", + "type": "object" + }, + "OrganizationInfoV1": { + "description": "The caller's organization.", + "properties": { + "org_id": { + "description": "Unique identifier for the organization", + "title": "Org Id", + "type": "string" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Display name of the organization", + "title": "Name" + }, + "created_at": { + "description": "Time the organization was created in ISO 8601 format", + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "aws_assume_role": { + "anyOf": [ + { + "$ref": "#/components/schemas/AwsAssumeRoleV1" + }, + { + "type": "null" + } + ], + "default": null, + "description": "AWS AssumeRole trust-policy inputs; null while the method is not enabled for the organization" + }, + "allow_personal_api_keys": { + "description": "Whether members can create new personal API keys. Existing keys keep working.", + "title": "Allow Personal Api Keys", + "type": "boolean" + }, + "allow_service_account_api_keys": { + "description": "Whether new team and organization API keys can be created. Existing keys keep working.", + "title": "Allow Service Account Api Keys", + "type": "boolean" + } + }, + "required": [ + "org_id", + "created_at", + "allow_personal_api_keys", + "allow_service_account_api_keys" + ], + "title": "OrganizationInfoV1", + "type": "object" + }, + "UpdateOrganizationRequestV1": { + "additionalProperties": false, + "description": "Partial update of the caller's organization settings. Omitted fields are unchanged.", + "properties": { + "allow_personal_api_keys": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Whether members can create new personal API keys. Null is not accepted.", + "title": "Allow Personal Api Keys" + }, + "allow_service_account_api_keys": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Whether new team and organization API keys can be created. Null is not accepted.", + "title": "Allow Service Account Api Keys" + } + }, + "title": "UpdateOrganizationRequestV1", + "type": "object" + }, + "ServiceAccountPresetPermissionsV1": { + "description": "A service account's access: one of the access types API keys have.\n\nTemporary: mirrors API key access until fine-grained access control is available, and may be removed.", + "properties": { + "type": { + "$ref": "#/components/schemas/ServiceAccountPresetTypeV1", + "description": "What the service account may do. WORKSPACE_MANAGE_API_KEYS is for organization-level accounts only; every other type needs a team.", + "examples": [ + "WORKSPACE_MANAGE_ALL" + ] + }, + "model_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "WORKSPACE_INVOKE and WORKSPACE_EXPORT_METRICS only. Models the account covers. Omit for every model in the team, including models added later.", + "examples": [ + [ + "abcd1234" + ] + ], + "title": "Model Ids" + }, + "environment_names": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "WORKSPACE_INVOKE: environments the account may call; omit for all. With model_ids, each model must have each environment. WORKSPACE_MANAGE_ALL: restricted environments the account may also manage.", + "examples": [ + [ + "production" + ] + ], + "title": "Environment Names" + }, + "model_api_slugs": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "WORKSPACE_INVOKE_MODEL_APIS only. Model APIs the account may call; omit for all.", + "examples": [ + [ + "my-model-api" + ] + ], + "title": "Model Api Slugs" + } + }, + "required": [ + "type" + ], + "title": "ServiceAccountPresetPermissionsV1", + "type": "object" + }, + "ServiceAccountPresetTypeV1": { + "description": "What a service account may do: the workspace API key categories, plus Model APIs.\n\nTemporary: mirrors API key access until fine-grained access control is available, and may be removed.", + "enum": [ + "WORKSPACE_MANAGE_ALL", + "WORKSPACE_INVOKE", + "WORKSPACE_EXPORT_METRICS", + "WORKSPACE_MANAGE_API_KEYS", + "WORKSPACE_INVOKE_MODEL_APIS" + ], + "title": "ServiceAccountPresetTypeV1", + "type": "string" + }, + "ServiceAccountV1": { + "description": "A named service account that workload identity federation tokens act as.", + "properties": { + "id": { + "description": "Service account ID", + "title": "Id", + "type": "string" + }, + "name": { + "description": "Name, unique in the organization", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Description", + "title": "Description" + }, + "team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The team that owns the account. Null for an organization account.", + "title": "Team Id" + }, + "preset_permissions": { + "$ref": "#/components/schemas/ServiceAccountPresetPermissionsV1", + "description": "What the service account may do. Temporary; may be removed once fine-grained access control is available." + }, + "disabled": { + "description": "Whether the account is disabled. A disabled account can't be used.", + "title": "Disabled", + "type": "boolean" + }, + "last_used_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Last time a request authenticated as this account, to within an hour. Null until the first.", + "title": "Last Used At" + }, + "created_at": { + "description": "Time the account was created", + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "updated_at": { + "description": "Time the account was last updated", + "format": "date-time", + "title": "Updated At", + "type": "string" + } + }, + "required": [ + "id", + "name", + "preset_permissions", + "disabled", + "created_at", + "updated_at" + ], + "title": "ServiceAccountV1", + "type": "object" + }, + "ServiceAccountsV1": { + "description": "A page of service accounts.", + "properties": { + "items": { + "description": "Items in this page.", + "items": { + "$ref": "#/components/schemas/ServiceAccountV1" + }, + "title": "Items", + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResponseV1", + "description": "Pagination metadata for the page." + } + }, + "required": [ + "items", + "pagination" + ], + "title": "ServiceAccountsV1", + "type": "object" + }, + "ServiceAccountsRequestV1": { + "properties": { + "cursor": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", + "title": "Cursor" + }, + "limit": { + "default": 100, + "description": "Maximum number of items to return.", + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + }, + "name": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Only the account with this name, ignoring case", + "title": "Name" + }, + "team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Only this team's accounts", + "title": "Team Id" + }, + "disabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Only disabled or enabled accounts", + "title": "Disabled" + } + }, + "title": "ServiceAccountsRequestV1", + "type": "object" + }, + "ServiceAccountPresetPermissionsRequestV1": { + "additionalProperties": false, + "description": "A service account's access, as sent. Omit a list for no restriction; never send it empty.", + "properties": { + "type": { + "$ref": "#/components/schemas/ServiceAccountPresetTypeV1", + "description": "What the service account may do. WORKSPACE_MANAGE_API_KEYS is for organization-level accounts only; every other type needs a team.", + "examples": [ + "WORKSPACE_MANAGE_ALL" + ] + }, + "model_ids": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "WORKSPACE_INVOKE and WORKSPACE_EXPORT_METRICS only. Models the account covers. Omit for every model in the team, including models added later.", + "examples": [ + [ + "abcd1234" + ] + ], + "title": "Model Ids" + }, + "environment_names": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "WORKSPACE_INVOKE: environments the account may call; omit for all. With model_ids, each model must have each environment. WORKSPACE_MANAGE_ALL: restricted environments the account may also manage.", + "examples": [ + [ + "production" + ] + ], + "title": "Environment Names" + }, + "model_api_slugs": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "WORKSPACE_INVOKE_MODEL_APIS only. Model APIs the account may call; omit for all.", + "examples": [ + [ + "my-model-api" + ] + ], + "title": "Model Api Slugs" + } + }, + "required": [ + "type" + ], + "title": "ServiceAccountPresetPermissionsRequestV1", + "type": "object" + }, + "CreateServiceAccountRequestV1": { + "additionalProperties": false, + "description": "Request to create a service account.", + "properties": { + "name": { + "description": "Name, unique in the organization. Can be changed later.", + "examples": [ + "ci-deployer" + ], + "maxLength": 255, + "minLength": 1, + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "maxLength": 1024, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Optional description, up to 1,024 characters", + "title": "Description" + }, + "team_id": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The team that owns the account. Omit for an organization account. Can't be changed.", + "title": "Team Id" + }, + "preset_permissions": { + "$ref": "#/components/schemas/ServiceAccountPresetPermissionsRequestV1", + "description": "What the service account may do. Can be changed later. Temporary; may be removed once fine-grained access control is available." + } + }, + "required": [ + "name", + "preset_permissions" + ], + "title": "CreateServiceAccountRequestV1", + "type": "object" + }, + "DeletedServiceAccountV1": { + "properties": { + "id": { + "description": "ID of the deleted service account", + "title": "Id", + "type": "string" + }, + "deleted": { + "description": "Always true", + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id", + "deleted" + ], + "title": "DeletedServiceAccountV1", + "type": "object" + }, + "UpdateServiceAccountRequestV1": { + "additionalProperties": false, + "description": "Request to update a service account. Only the fields sent change.", + "properties": { + "name": { + "anyOf": [ + { + "maxLength": 255, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Name, unique in the organization", + "title": "Name" + }, + "description": { + "anyOf": [ + { + "maxLength": 1024, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Description, up to 1,024 characters; null clears it", + "title": "Description", + "x-null-distinct": true + }, + "disabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Disable the account to stop it being used, or enable it again", + "title": "Disabled" + }, + "preset_permissions": { + "anyOf": [ + { + "$ref": "#/components/schemas/ServiceAccountPresetPermissionsRequestV1" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Replaces the account's access as a whole. Temporary; may be removed once fine-grained access control is available." + } + }, + "title": "UpdateServiceAccountRequestV1", + "type": "object" + }, + "PredefinedIdentityProviderKindV1": { + "description": "An identity provider Baseten supports.", + "enum": [ + "GITHUB_ACTIONS", + "GCP", + "BASETEN", + "AWS_IAM", + "AWS_EKS", + "AZURE_MANAGED_IDENTITY_V1", + "AZURE_MANAGED_IDENTITY_V2", + "AZURE_AKS" + ], + "title": "PredefinedIdentityProviderKindV1", + "type": "string" + }, + "PredefinedIdentityProviderV1": { + "properties": { + "kind": { + "$ref": "#/components/schemas/PredefinedIdentityProviderKindV1", + "description": "Pass as `kind` when adding the provider" + }, + "name": { + "description": "Display name", + "title": "Name", + "type": "string" + }, + "issuer_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The `iss` claim its tokens carry. Null when each account, tenant, or cluster has its own issuer, which you pass as `issuer_url` when adding the provider.", + "title": "Issuer Url" + }, + "issuer_url_example": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "An example of the `issuer_url` to pass. Null when the issuer is fixed.", + "title": "Issuer Url Example" + } + }, + "required": [ + "kind", + "name" + ], + "title": "PredefinedIdentityProviderV1", + "type": "object" + }, + "PredefinedIdentityProvidersV1": { + "properties": { + "items": { + "description": "Identity providers Baseten supports", + "items": { + "$ref": "#/components/schemas/PredefinedIdentityProviderV1" + }, + "title": "Items", + "type": "array" + } + }, + "required": [ + "items" + ], + "title": "PredefinedIdentityProvidersV1", + "type": "object" + }, + "IdentityProviderV1": { + "description": "An OIDC issuer whose tokens the organization accepts for workload identity federation.", + "properties": { + "id": { + "description": "Identity provider ID", + "title": "Id", + "type": "string" + }, + "name": { + "description": "Name, unique in the organization", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Description", + "title": "Description" + }, + "predefined": { + "$ref": "#/components/schemas/PredefinedIdentityProviderConfigV1", + "description": "Settings of the predefined provider" + }, + "created_by": { + "description": "ID of the user who added the provider", + "title": "Created By", + "type": "string" + }, + "created_at": { + "description": "Time the provider was added", + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "updated_at": { + "description": "Time the provider was last updated", + "format": "date-time", + "title": "Updated At", + "type": "string" + } + }, + "required": [ + "id", + "name", + "predefined", + "created_by", + "created_at", + "updated_at" + ], + "title": "IdentityProviderV1", + "type": "object" + }, + "PredefinedIdentityProviderConfigV1": { + "description": "Settings of an identity provider that Baseten defines.", + "properties": { + "kind": { + "$ref": "#/components/schemas/PredefinedIdentityProviderKindV1", + "description": "Which predefined provider. Can't be changed." + }, + "issuer_url": { + "anyOf": [ + { + "maxLength": 1024, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The `iss` claim of the provider's tokens. When adding AWS IAM, Amazon EKS, Azure managed identity, or Azure Kubernetes Service, pass your issuer in the format the predefined identity providers endpoint shows; it's unique in the organization. Can't be passed for other providers, or changed. Always set in responses.", + "title": "Issuer Url" + } + }, + "required": [ + "kind" + ], + "title": "PredefinedIdentityProviderConfigV1", + "type": "object" + }, + "IdentityProvidersV1": { + "description": "A page of identity providers.", + "properties": { + "items": { + "description": "Items in this page.", + "items": { + "$ref": "#/components/schemas/IdentityProviderV1" + }, + "title": "Items", + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResponseV1", + "description": "Pagination metadata for the page." + } + }, + "required": [ + "items", + "pagination" + ], + "title": "IdentityProvidersV1", + "type": "object" + }, + "IdentityProvidersRequestV1": { + "properties": { + "cursor": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", + "title": "Cursor" + }, + "limit": { + "default": 100, + "description": "Maximum number of items to return.", + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + }, + "name": { + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Only the provider with this name, ignoring case", + "title": "Name" + }, + "predefined_kind": { + "anyOf": [ + { + "$ref": "#/components/schemas/PredefinedIdentityProviderKindV1" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Only this predefined provider's issuers" + } + }, + "title": "IdentityProvidersRequestV1", + "type": "object" + }, + "CreatePredefinedIdentityProviderConfigV1": { + "additionalProperties": false, + "description": "Settings of the predefined identity provider to add.", + "properties": { + "kind": { + "$ref": "#/components/schemas/PredefinedIdentityProviderKindV1", + "description": "Which predefined provider. Can't be changed." + }, + "issuer_url": { + "anyOf": [ + { + "maxLength": 1024, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The `iss` claim of the provider's tokens. When adding AWS IAM, Amazon EKS, Azure managed identity, or Azure Kubernetes Service, pass your issuer in the format the predefined identity providers endpoint shows; it's unique in the organization. Can't be passed for other providers, or changed. Always set in responses.", + "title": "Issuer Url" + } + }, + "required": [ + "kind" + ], + "title": "CreatePredefinedIdentityProviderConfigV1", + "type": "object" + }, + "CreateIdentityProviderRequestV1": { + "additionalProperties": false, + "description": "Request to add an identity provider.", + "properties": { + "name": { + "anyOf": [ + { + "maxLength": 255, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Name, unique in the organization. Defaults to the provider's display name, so pass one when adding a second issuer of the same provider.", + "title": "Name" + }, + "description": { + "anyOf": [ + { + "maxLength": 1024, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Optional description", + "title": "Description" + }, + "predefined": { + "$ref": "#/components/schemas/CreatePredefinedIdentityProviderConfigV1", + "description": "The predefined provider to add" + } + }, + "required": [ + "predefined" + ], + "title": "CreateIdentityProviderRequestV1", + "type": "object" + }, + "VerifyPredefinedIdentityProviderConfigV1": { + "additionalProperties": false, + "description": "Settings of the predefined identity provider to check.", + "properties": { + "kind": { + "$ref": "#/components/schemas/PredefinedIdentityProviderKindV1", + "description": "Which predefined provider" + }, + "issuer_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The issuer to check, for AWS IAM, Amazon EKS, Azure managed identity, and Azure Kubernetes Service, in the format the predefined identity providers endpoint shows", + "title": "Issuer Url" + } + }, + "required": [ + "kind" + ], + "title": "VerifyPredefinedIdentityProviderConfigV1", + "type": "object" + }, + "VerifyIdentityProviderRequestV1": { + "additionalProperties": false, + "description": "Request to check an identity provider before adding it.", + "properties": { + "predefined": { + "$ref": "#/components/schemas/VerifyPredefinedIdentityProviderConfigV1", + "description": "The predefined provider to check, as you'd pass it when adding it" + } + }, + "required": [ + "predefined" + ], + "title": "VerifyIdentityProviderRequestV1", + "type": "object" + }, + "VerificationV1": { + "description": "Whether a create request would pass the checks the server runs on it.", + "properties": { + "valid": { + "description": "Whether the input passes every check", + "title": "Valid", + "type": "boolean" + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Why the input fails, as creating it would report. Null when it's valid.", + "title": "Error" + } + }, + "required": [ + "valid" + ], + "title": "VerificationV1", + "type": "object" + }, + "DeletedIdentityProviderV1": { + "properties": { + "id": { + "description": "ID of the deleted identity provider", + "title": "Id", + "type": "string" + }, + "deleted": { + "description": "Always true", + "title": "Deleted", + "type": "boolean" + } + }, + "required": [ + "id", + "deleted" + ], + "title": "DeletedIdentityProviderV1", + "type": "object" + }, + "UpdateIdentityProviderRequestV1": { + "additionalProperties": false, + "description": "Request to update an identity provider. Only the fields sent change.", + "properties": { + "name": { + "anyOf": [ + { + "maxLength": 255, + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Name, unique in the organization", + "title": "Name" + }, + "description": { + "anyOf": [ + { + "maxLength": 1024, + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Description; null clears it", + "title": "Description", + "x-null-distinct": true + } + }, + "title": "UpdateIdentityProviderRequestV1", + "type": "object" + }, + "AccessTrustRuleV1": { + "description": "Which tokens from an identity provider may act as a service account.", + "properties": { + "id": { + "description": "Trust rule ID. Workloads pass it when they exchange a token.", + "title": "Id", + "type": "string" + }, + "name": { + "description": "Name, unique in the organization", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Description", + "title": "Description" + }, + "identity_provider_id": { + "description": "The identity provider whose tokens it accepts", + "title": "Identity Provider Id", + "type": "string" + }, + "identity_provider_name": { + "description": "Name of the identity provider", + "title": "Identity Provider Name", + "type": "string" + }, + "service_account_id": { + "description": "The service account its tokens act as", + "title": "Service Account Id", + "type": "string" + }, + "service_account_name": { + "description": "Name of the service account", + "title": "Service Account Name", + "type": "string" + }, + "team_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The service account's team. Null for an organization service account.", + "title": "Team Id" + }, + "team_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Name of the service account's team. Null for an organization service account.", + "title": "Team Name" + }, + "condition": { + "description": "A CEL expression over the token's `claims` that must evaluate to true. It must pin a specific `claims.sub` in a top-level `&&` clause, plus any provider-required checks. Up to 4,096 characters.", + "examples": [ + "claims.repository_owner_id == '12345' && claims.sub.startsWith('repo:acme/models:') && claims.ref == 'refs/heads/main'" + ], + "title": "Condition", + "type": "string" + }, + "audience": { + "description": "The token's `aud` must equal this, or contain it when `aud` is a list. Up to 1,024 characters.", + "title": "Audience", + "type": "string" + }, + "max_access_token_lifetime_seconds": { + "description": "Longest lifetime of a token the rule issues, in seconds", + "title": "Max Access Token Lifetime Seconds", + "type": "integer" + }, + "last_used_at": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Last time a request authenticated with a token the rule issued, to within an hour. Null until the first.", + "title": "Last Used At" + }, + "created_by": { + "description": "ID of the user who created the rule", + "title": "Created By", + "type": "string" + }, + "created_at": { + "description": "Time the rule was created", + "format": "date-time", + "title": "Created At", + "type": "string" + }, + "updated_at": { + "description": "Time the rule was last updated", + "format": "date-time", + "title": "Updated At", + "type": "string" + } + }, + "required": [ + "id", + "name", + "identity_provider_id", + "identity_provider_name", + "service_account_id", + "service_account_name", + "condition", + "audience", + "max_access_token_lifetime_seconds", + "created_by", + "created_at", + "updated_at" + ], + "title": "AccessTrustRuleV1", + "type": "object" + }, + "AccessTrustRulesV1": { + "description": "A page of trust rules.", + "properties": { + "items": { + "description": "Items in this page.", + "items": { + "$ref": "#/components/schemas/AccessTrustRuleV1" + }, + "title": "Items", + "type": "array" + }, + "pagination": { + "$ref": "#/components/schemas/PaginationResponseV1", + "description": "Pagination metadata for the page." + } + }, + "required": [ + "items", + "pagination" + ], + "title": "AccessTrustRulesV1", + "type": "object" + }, + "AccessTrustRulesRequestV1": { + "properties": { + "cursor": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", + "title": "Cursor" + }, + "limit": { + "default": 100, + "description": "Maximum number of items to return.", + "maximum": 1000, + "minimum": 1, + "title": "Limit", + "type": "integer" + }, + "name": { + "anyOf": [ + { + "minLength": 1, + "type": "string" }, { "type": "null" } ], "default": null, - "description": "Dedicated model serving usage" + "description": "Only the rule with this name, ignoring case", + "title": "Name" }, - "training_usage": { + "identity_provider_id": { "anyOf": [ { - "$ref": "#/components/schemas/TrainingUsageV1" + "type": "string" }, { "type": "null" } ], "default": null, - "description": "Training usage" + "description": "Only this provider's rules", + "title": "Identity Provider Id" }, - "model_apis_usage": { + "service_account_id": { "anyOf": [ { - "$ref": "#/components/schemas/ModelApisUsageV1" + "type": "string" }, { "type": "null" } ], "default": null, - "description": "Model APIs usage" + "description": "Only rules for this service account", + "title": "Service Account Id" }, - "loops_usage": { + "team_id": { "anyOf": [ { - "$ref": "#/components/schemas/LoopsUsageV1" + "type": "string" }, { "type": "null" } ], "default": null, - "description": "Serverless Loops usage, billed per token. Loops usage on dedicated trainers and samplers is billed by the minute and is part of training usage." + "description": "Only rules for this team's service accounts", + "title": "Team Id" } }, - "title": "UsageSummaryV1", + "title": "AccessTrustRulesRequestV1", "type": "object" }, - "UsageSummaryRequestV1": { + "CreateAccessTrustRuleRequestV1": { + "additionalProperties": false, + "description": "Request to create a trust rule.", "properties": { - "start_date": { - "description": "Inclusive start date (ISO 8601, normalized to midnight UTC). Earliest queryable: 2026-01-01.", - "format": "date-time", - "title": "Start Date", + "name": { + "description": "Name, unique in the organization. Can be changed later.", + "maxLength": 255, + "minLength": 1, + "title": "Name", "type": "string" }, - "end_date": { - "description": "Exclusive end date (ISO 8601, normalized to midnight UTC). Date range cannot exceed 31 days.", - "format": "date-time", - "title": "End Date", + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Optional description", + "title": "Description" + }, + "identity_provider_id": { + "description": "Whose tokens the rule accepts. Can't be changed.", + "title": "Identity Provider Id", + "type": "string" + }, + "service_account_id": { + "description": "The service account its tokens act as. Can be changed later.", + "title": "Service Account Id", + "type": "string" + }, + "condition": { + "description": "A CEL expression over the token's `claims` that must evaluate to true. It must pin a specific `claims.sub` in a top-level `&&` clause, plus any provider-required checks. Up to 4,096 characters. Can be changed later.", + "examples": [ + "claims.repository_owner_id == '12345' && claims.sub.startsWith('repo:acme/models:') && claims.ref == 'refs/heads/main'" + ], + "title": "Condition", + "type": "string" + }, + "audience": { + "description": "The token's `aud` must equal this, or contain it when `aud` is a list. Up to 1,024 characters. Can be changed later.", + "title": "Audience", "type": "string" + }, + "max_access_token_lifetime_seconds": { + "default": 3600, + "description": "Longest lifetime of a token the rule issues, 60 to 3600 seconds. Can be changed later.", + "maximum": 3600, + "minimum": 60, + "title": "Max Access Token Lifetime Seconds", + "type": "integer" } }, "required": [ - "start_date", - "end_date" + "name", + "identity_provider_id", + "service_account_id", + "condition", + "audience" ], - "title": "UsageSummaryRequestV1", + "title": "CreateAccessTrustRuleRequestV1", "type": "object" }, - "ToolCallUsageBucketV1": { - "description": "Server-side tool call usage for one day, provider, charge unit, and model.", + "VerifyAccessTrustRuleRequestV1": { + "additionalProperties": false, + "description": "Request to check a trust rule's condition and audience before saving them.", "properties": { - "date": { - "description": "UTC day the usage was recorded on.", - "format": "date", - "title": "Date", - "type": "string" - }, - "provider": { - "description": "Tool provider, such as exa or parallel.", - "title": "Provider", + "identity_provider_id": { + "description": "The identity provider the rule is for, which decides the claims it must pin", + "title": "Identity Provider Id", "type": "string" }, - "sku": { - "description": "Charge unit, as `/`. The unit is what the provider reported, or the tool name when it reported none. Its meaning varies by provider.", - "title": "Sku", + "condition": { + "description": "A CEL expression over the token's `claims` that must evaluate to true. It must pin a specific `claims.sub` in a top-level `&&` clause, plus any provider-required checks. Up to 4,096 characters.", + "examples": [ + "claims.repository_owner_id == '12345' && claims.sub.startsWith('repo:acme/models:') && claims.ref == 'refs/heads/main'" + ], + "title": "Condition", "type": "string" }, - "model": { - "description": "Model that made the tool calls.", - "title": "Model", + "audience": { + "description": "The token's `aud` must equal this, or contain it when `aud` is a list. Up to 1,024 characters.", + "title": "Audience", "type": "string" - }, - "calls": { - "description": "Number of tool calls.", - "title": "Calls", - "type": "integer" - }, - "quantity": { - "description": "Billable quantity in the provider's sku unit, summed over the calls.", - "title": "Quantity", - "type": "number" - }, - "team_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Team attributed to the usage. Null when not grouping by team or when historical team attribution is unavailable.", - "title": "Team Id" } }, "required": [ - "date", - "provider", - "sku", - "model", - "calls", - "quantity" + "identity_provider_id", + "condition", + "audience" ], - "title": "ToolCallUsageBucketV1", + "title": "VerifyAccessTrustRuleRequestV1", "type": "object" }, - "ToolCallUsageResponseV1": { - "description": "Daily server-side tool call usage, ordered by day, provider, sku, and model.", + "DeletedAccessTrustRuleV1": { "properties": { - "items": { - "items": { - "$ref": "#/components/schemas/ToolCallUsageBucketV1" - }, - "title": "Items", - "type": "array" + "id": { + "description": "ID of the deleted trust rule", + "title": "Id", + "type": "string" + }, + "deleted": { + "description": "Always true", + "title": "Deleted", + "type": "boolean" } }, - "title": "ToolCallUsageResponseV1", - "type": "object" - }, - "ToolCallUsageDimensionV1": { - "enum": [ - "TEAM" + "required": [ + "id", + "deleted" ], - "title": "ToolCallUsageDimensionV1", - "type": "string" + "title": "DeletedAccessTrustRuleV1", + "type": "object" }, - "ToolCallUsageRequestV1": { + "UpdateAccessTrustRuleRequestV1": { + "additionalProperties": false, + "description": "Request to update a trust rule. Only the fields sent change.", "properties": { - "start_date": { - "description": "Inclusive UTC calendar day at the start of the query range.", - "format": "date", - "title": "Start Date", - "type": "string" - }, - "end_date": { + "name": { "anyOf": [ { - "format": "date", + "maxLength": 255, + "minLength": 1, "type": "string" }, { @@ -37560,41 +41444,10 @@ } ], "default": null, - "description": "Exclusive UTC calendar day at the end of the query range. Defaults to the day after the current UTC date so current-day usage is included. The date range cannot exceed 90 days.", - "title": "End Date" - }, - "team_ids": { - "description": "Return only usage for these teams, repeated once per team. Defaults to all teams you can manage. An unauthorized team ID causes a 403 response.", - "items": { - "type": "string" - }, - "title": "Team Ids", - "type": "array" - }, - "group_by": { - "description": "Pass TEAM to split daily rows by team. Defaults to aggregating across teams.", - "items": { - "$ref": "#/components/schemas/ToolCallUsageDimensionV1" - }, - "title": "Group By", - "type": "array" - } - }, - "required": [ - "start_date" - ], - "title": "ToolCallUsageRequestV1", - "type": "object" - }, - "UserInfoV1": { - "description": "A Baseten user.", - "properties": { - "user_id": { - "description": "Unique identifier for the user", - "title": "User Id", - "type": "string" + "description": "Name, unique in the organization", + "title": "Name" }, - "email": { + "description": { "anyOf": [ { "type": "string" @@ -37604,10 +41457,11 @@ } ], "default": null, - "description": "Email address of the user", - "title": "Email" + "description": "Description; null clears it", + "title": "Description", + "x-null-distinct": true }, - "name": { + "condition": { "anyOf": [ { "type": "string" @@ -37617,10 +41471,10 @@ } ], "default": null, - "description": "Display name of the user", - "title": "Name" + "description": "A CEL expression over the token's `claims` that must evaluate to true. It must pin a specific `claims.sub` in a top-level `&&` clause, plus any provider-required checks. Up to 4,096 characters.", + "title": "Condition" }, - "workspace_name": { + "audience": { "anyOf": [ { "type": "string" @@ -37630,64 +41484,25 @@ } ], "default": null, - "description": "Name of the user's workspace", - "title": "Workspace Name" - } - }, - "required": [ - "user_id" - ], - "title": "UserInfoV1", - "type": "object" - }, - "UsersResponseV1": { - "description": "A page of users in the caller's workspace.", - "properties": { - "items": { - "description": "Items in this page.", - "items": { - "$ref": "#/components/schemas/UserInfoV1" - }, - "title": "Items", - "type": "array" + "description": "The token's `aud` must equal this, or contain it when `aud` is a list. Up to 1,024 characters.", + "title": "Audience" }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponseV1", - "description": "Pagination metadata for the page." - } - }, - "required": [ - "items", - "pagination" - ], - "title": "UsersResponseV1", - "type": "object" - }, - "UsersRequestV1": { - "description": "Request parameters for listing users.", - "properties": { - "cursor": { + "max_access_token_lifetime_seconds": { "anyOf": [ { - "type": "string" + "maximum": 3600, + "minimum": 60, + "type": "integer" }, { "type": "null" } ], "default": null, - "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", - "title": "Cursor" - }, - "limit": { - "default": 100, - "description": "Maximum number of items to return.", - "maximum": 1000, - "minimum": 1, - "title": "Limit", - "type": "integer" + "description": "Longest lifetime of a token the rule issues, 60 to 3600 seconds. Tokens already issued keep their lifetime.", + "title": "Max Access Token Lifetime Seconds" }, - "email": { + "service_account_id": { "anyOf": [ { "type": "string" @@ -37697,43 +41512,51 @@ } ], "default": null, - "description": "When set, returns only users with this exact email, if any.", - "title": "Email" + "description": "Moves the rule to another service account. Tokens already issued keep the old account until they expire.", + "title": "Service Account Id" } }, - "title": "UsersRequestV1", + "title": "UpdateAccessTrustRuleRequestV1", "type": "object" }, - "AwsAssumeRoleV1": { - "description": "AWS AssumeRole trust-policy inputs for the organization.", + "TokenExchangeRequestV1": { + "description": "An RFC 8693 token exchange request naming the trust rule to check as its audience.", "properties": { - "baseten_role_arn": { - "description": "Baseten role ARN to allow in an IAM role's trust policy", - "title": "Baseten Role Arn", + "grant_type": { + "description": "Always `urn:ietf:params:oauth:grant-type:token-exchange`", + "examples": [ + "urn:ietf:params:oauth:grant-type:token-exchange" + ], + "title": "Grant Type", "type": "string" }, - "external_id": { - "description": "sts:ExternalId Baseten presents when assuming the role", - "title": "External Id", + "subject_token": { + "description": "The identity provider's JWT", + "examples": [ + "" + ], + "maxLength": 16384, + "title": "Subject Token", "type": "string" - } - }, - "required": [ - "baseten_role_arn", - "external_id" - ], - "title": "AwsAssumeRoleV1", - "type": "object" - }, - "OrganizationInfoV1": { - "description": "The caller's organization.", - "properties": { - "org_id": { - "description": "Unique identifier for the organization", - "title": "Org Id", + }, + "subject_token_type": { + "description": "`urn:ietf:params:oauth:token-type:jwt` or `urn:ietf:params:oauth:token-type:id_token`", + "examples": [ + "urn:ietf:params:oauth:token-type:jwt" + ], + "title": "Subject Token Type", "type": "string" }, - "name": { + "audience": { + "description": "ID of the trust rule to check the JWT against", + "examples": [ + "abcd1234" + ], + "maxLength": 64, + "title": "Audience", + "type": "string" + }, + "requested_token_type": { "anyOf": [ { "type": "string" @@ -37743,33 +41566,63 @@ } ], "default": null, - "description": "Display name of the organization", - "title": "Name" - }, - "created_at": { - "description": "Time the organization was created in ISO 8601 format", - "format": "date-time", - "title": "Created At", - "type": "string" + "description": "Optional; only `urn:ietf:params:oauth:token-type:access_token` is issued", + "title": "Requested Token Type" }, - "aws_assume_role": { + "access_token_lifetime_seconds": { "anyOf": [ { - "$ref": "#/components/schemas/AwsAssumeRoleV1" + "minimum": 1, + "type": "integer" }, { "type": "null" } ], "default": null, - "description": "AWS AssumeRole trust-policy inputs; null while the method is not enabled for the organization" + "description": "Lifetime of the access token, in seconds. At most the rule's maximum.", + "title": "Access Token Lifetime Seconds" } }, "required": [ - "org_id", - "created_at" + "grant_type", + "subject_token", + "subject_token_type", + "audience" ], - "title": "OrganizationInfoV1", + "title": "TokenExchangeRequestV1", + "type": "object" + }, + "TokenExchangeResponseV1": { + "properties": { + "access_token": { + "description": "Send as `Authorization: Bearer`", + "title": "Access Token", + "type": "string" + }, + "issued_token_type": { + "description": "Always `urn:ietf:params:oauth:token-type:access_token`", + "title": "Issued Token Type", + "type": "string" + }, + "token_type": { + "description": "Always `Bearer`", + "title": "Token Type", + "type": "string" + }, + "expires_in": { + "description": "Seconds until the access token expires", + "title": "Expires In", + "type": "integer" + } + }, + "required": [ + "access_token", + "issued_token_type", + "token_type", + "expires_in" + ], + "title": "TokenExchangeResponseV1", "type": "object" }, "GatewayEventTokensV1": { @@ -38403,30 +42256,31 @@ "title": "GridTokenV1", "type": "object" }, - "GridClassifierV1": { + "GridRouteAliasKindV1": { + "enum": [ + "CLAUDE_DESKTOP", + "ALIAS" + ], + "title": "GridRouteAliasKindV1", + "type": "string" + }, + "GridRouteAliasV1": { "properties": { - "id": { - "description": "Stable classifier identifier.", - "examples": [ - "general-v1" - ], - "title": "Id", - "type": "string" - }, "name": { - "description": "Display name of the classifier.", - "examples": [ - "General" - ], + "description": "Name to send in the inference request's `model` field instead of the route's `name`.", "title": "Name", "type": "string" + }, + "kind": { + "$ref": "#/components/schemas/GridRouteAliasKindV1", + "description": "Purpose of the alias. CLAUDE_DESKTOP is for Claude Code desktop, which rejects model names without a `claude` substring. ALIAS is any other name the team's clients send for the route." } }, "required": [ - "id", - "name" + "name", + "kind" ], - "title": "GridClassifierV1", + "title": "GridRouteAliasV1", "type": "object" }, "GridRouteClassifierV1": { @@ -38434,17 +42288,17 @@ "id": { "description": "Stable route classifier identifier.", "examples": [ - "general-v1" + "abc1234" ], "title": "Id", "type": "string" }, - "name": { + "display_name": { "description": "Display name of the route classifier.", "examples": [ "General" ], - "title": "Name", + "title": "Display Name", "type": "string" }, "supported_tradeoffs": { @@ -38461,8 +42315,8 @@ "title": "Supported Tradeoffs", "type": "array" }, - "decidable_models": { - "description": "Model identities the route classifier picks from.", + "decidable_canonical_model_ids": { + "description": "Canonical model ids the route classifier picks from.", "examples": [ [ "zai-org/GLM-5.3", @@ -38472,37 +42326,195 @@ "items": { "type": "string" }, - "title": "Decidable Models", + "title": "Decidable Canonical Model Ids", "type": "array" } }, "required": [ "id", - "name", + "display_name", "supported_tradeoffs", - "decidable_models" + "decidable_canonical_model_ids" ], "title": "GridRouteClassifierV1", "type": "object" }, - "GridRouteRefV1": { + "GridRouteMetadataV1": { "properties": { - "id": { - "description": "Stable route identifier.", - "title": "Id", - "type": "string" - }, "slug": { - "description": "Name of the route to send in the inference request's model field.", - "title": "Slug", - "type": "string" + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Metadata slug, e.g. 'anthropic/claude-opus-4'; null for rows without one.", + "title": "Slug" + }, + "display_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Model display name, when available.", + "title": "Display Name" + }, + "release_date": { + "anyOf": [ + { + "format": "date", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Model release date. Month-only source dates use the first day of that month.", + "title": "Release Date" + }, + "provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Provider key derived from the slug prefix, e.g. 'anthropic'; null for unprefixed slugs.", + "title": "Provider" + }, + "context_window": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Total context window in tokens.", + "title": "Context Window" + }, + "max_output_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Maximum output tokens per response.", + "title": "Max Output Tokens" + }, + "input_modalities": { + "description": "Accepted input modalities.", + "items": { + "type": "string" + }, + "title": "Input Modalities", + "type": "array" + }, + "tools": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Whether the model supports tool calling.", + "title": "Tools" + }, + "reasoning_effort_levels": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "description": "Reasoning effort levels the model supports.", + "title": "Reasoning Effort Levels" + }, + "parallel_tool_calls": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Whether the model supports parallel tool calls.", + "title": "Parallel Tool Calls" + }, + "supported_api_formats": { + "anyOf": [ + { + "$ref": "#/components/schemas/ExploreMetadataAPIFormatsV1" + }, + { + "type": "null" + } + ], + "description": "API formats the model supports." + }, + "cost": { + "anyOf": [ + { + "$ref": "#/components/schemas/ExploreCostV1" + }, + { + "type": "null" + } + ], + "description": "Provider list prices in USD per 1M tokens, when available." + }, + "api_formats": { + "description": "API formats the route supports, most preferred first: `chat_completions`, `messages`, `responses` for a BASETEN_MODEL_API target and `messages`, `responses`, `chat_completions` for any other target, keeping only the formats the route supports. Never empty.", + "items": { + "enum": [ + "messages", + "responses", + "chat_completions" + ], + "title": "GridRouteAPIFormatV1", + "type": "string" + }, + "minItems": 1, + "title": "Api Formats", + "type": "array" } }, "required": [ - "id", - "slug" + "slug", + "display_name", + "release_date", + "provider", + "context_window", + "max_output_tokens", + "input_modalities", + "tools", + "reasoning_effort_levels", + "parallel_tool_calls", + "supported_api_formats", + "cost", + "api_formats" ], - "title": "GridRouteRefV1", + "title": "GridRouteMetadataV1", "type": "object" }, "GridRouteTargetBasetenModelAPIV1": { @@ -38527,47 +42539,6 @@ "title": "GridRouteTargetBasetenModelAPIV1", "type": "object" }, - "GridRouteTargetClassifierV1": { - "properties": { - "type": { - "const": "CLASSIFIER", - "description": "Target kind for a classifier-based route.", - "title": "Type", - "type": "string" - }, - "classifier": { - "anyOf": [ - { - "$ref": "#/components/schemas/GridClassifierV1" - }, - { - "type": "null" - } - ], - "description": "Classifier that picks a route for each request. Null for routers created before classifiers could be selected." - }, - "default_route": { - "$ref": "#/components/schemas/GridRouteRefV1", - "description": "Route used when the classifier picks none." - }, - "allowed_routes": { - "description": "Routes the classifier may pick, in creation order.", - "items": { - "$ref": "#/components/schemas/GridRouteRefV1" - }, - "title": "Allowed Routes", - "type": "array" - } - }, - "required": [ - "type", - "classifier", - "default_route", - "allowed_routes" - ], - "title": "GridRouteTargetClassifierV1", - "type": "object" - }, "GridRouteTargetConnectionV1": { "properties": { "type": { @@ -38635,10 +42606,23 @@ "type": "string" }, "name": { - "description": "Name to send in the inference request's model field.", + "description": "Name to send in the inference request's `model` field. Unique within the team; immutable.", "title": "Name", "type": "string" }, + "display_name": { + "description": "Display label, defaulting to the route's name.", + "title": "Display Name", + "type": "string" + }, + "aliases": { + "description": "The route's other names, one per purpose. Empty for routes created before aliases existed.", + "items": { + "$ref": "#/components/schemas/GridRouteAliasV1" + }, + "title": "Aliases", + "type": "array" + }, "team_id": { "description": "Identifier of the owning team.", "title": "Team Id", @@ -38649,11 +42633,6 @@ "title": "Team Name", "type": "string" }, - "display_name": { - "description": "Display label, defaulting to the route name.", - "title": "Display Name", - "type": "string" - }, "description": { "description": "Short description of the route, empty when unset.", "title": "Description", @@ -38664,7 +42643,6 @@ "discriminator": { "mapping": { "BASETEN_MODEL_API": "#/components/schemas/GridRouteTargetBasetenModelAPIV1", - "CLASSIFIER": "#/components/schemas/GridRouteTargetClassifierV1", "CONNECTION": "#/components/schemas/GridRouteTargetConnectionV1", "INTELLIGENT": "#/components/schemas/GridRouteTargetIntelligentV1" }, @@ -38677,9 +42655,6 @@ { "$ref": "#/components/schemas/GridRouteTargetConnectionV1" }, - { - "$ref": "#/components/schemas/GridRouteTargetClassifierV1" - }, { "$ref": "#/components/schemas/GridRouteTargetIntelligentV1" } @@ -38689,13 +42664,13 @@ "metadata": { "anyOf": [ { - "$ref": "#/components/schemas/ExploreMetadataV1" + "$ref": "#/components/schemas/GridRouteMetadataV1" }, { "type": "null" } ], - "description": "Resolved model metadata; for a router, the envelope of its allowed routes' metadata. Null when nothing is linked." + "description": "Resolved model metadata; for an intelligent route, the envelope of its servable models' metadata. Null when nothing is linked or the metadata has no supported API formats." }, "invoke_url": { "description": "Base URL for inference requests using this route.", @@ -38712,9 +42687,9 @@ "required": [ "id", "name", + "display_name", "team_id", "team_name", - "display_name", "description", "target", "metadata", @@ -38798,7 +42773,7 @@ } ], "default": null, - "description": "Filter by exact route name. Preserved by the cursor; if repeated, must match the original filter.", + "description": "Filter by exact route name, the value to send in the inference request's `model` field. Matches a route's name or any of its aliases. Preserved by the cursor; if repeated, must match the original filter.", "title": "Name" } }, @@ -38828,87 +42803,74 @@ "title": "UpsertGridRouteTargetBasetenModelAPIV1", "type": "object" }, - "UpsertGridRouteTargetClassifierV1": { + "UpsertGridRouteTargetConnectionV1": { "additionalProperties": false, "properties": { "type": { - "const": "CLASSIFIER", - "description": "Target kind for a classifier-based route.", + "const": "CONNECTION", + "description": "Target kind for a provider reached through a team connection.", "title": "Type", "type": "string" }, - "classifier_id": { - "description": "ID of the classifier that picks a route for each request.", - "examples": [ - "general-v1" - ], + "model": { + "description": "Model name sent to the provider.", "minLength": 1, - "title": "Classifier Id", + "title": "Model", "type": "string" }, - "allowed_route_ids": { - "description": "IDs of the routes the classifier may pick. All must belong to the route's team and must not be routers themselves.", - "examples": [ - [ - "abc1234", - "def5678" - ] - ], - "items": { - "type": "string" - }, - "title": "Allowed Route Ids", - "type": "array" - }, - "default_route_id": { - "description": "ID of the allowed route used when the classifier picks none.", + "connection_id": { + "description": "Identifier of a connection owned by the route's team. Its provider serves the route.", "examples": [ "abc1234" ], - "title": "Default Route Id", + "minLength": 1, + "title": "Connection Id", "type": "string" } }, "required": [ "type", - "classifier_id", - "allowed_route_ids", - "default_route_id" + "model", + "connection_id" ], - "title": "UpsertGridRouteTargetClassifierV1", + "title": "UpsertGridRouteTargetConnectionV1", "type": "object" }, - "UpsertGridRouteTargetConnectionV1": { + "UpsertGridRouteTargetIntelligentV1": { "additionalProperties": false, "properties": { "type": { - "const": "CONNECTION", - "description": "Target kind for a provider reached through a team connection.", + "const": "INTELLIGENT", + "description": "Target kind for an intelligent route: Baseten picks the model per request.", "title": "Type", "type": "string" }, - "model": { - "description": "Model name sent to the provider.", - "minLength": 1, - "title": "Model", - "type": "string" - }, - "connection_id": { - "description": "Identifier of a connection owned by the route's team. Its provider serves the route.", + "route_classifier_id": { + "description": "Identifier of the route classifier that picks the model. List them with GET /v1/grid/route_classifiers.", "examples": [ "abc1234" ], "minLength": 1, - "title": "Connection Id", + "title": "Route Classifier Id", + "type": "string" + }, + "tradeoff": { + "description": "How the classifier weighs cost against quality. Must be one of the classifier's supported tradeoffs.", + "enum": [ + "cost", + "balanced", + "intelligence" + ], + "title": "GridRouteTradeoffV1", "type": "string" } }, "required": [ "type", - "model", - "connection_id" + "route_classifier_id", + "tradeoff" ], - "title": "UpsertGridRouteTargetConnectionV1", + "title": "UpsertGridRouteTargetIntelligentV1", "type": "object" }, "CreateGridRouteRequestV1": { @@ -38943,19 +42905,19 @@ } ], "default": null, - "description": "Display label. Omit to use the route name; null is not accepted.", + "description": "Display label. Omit to use the route's name; required for INTELLIGENT targets. Null is not accepted.", "examples": [ "Assistant" ], "title": "Display Name" }, "target": { - "description": "Upstream target for the route. CONNECTION targets use the provider and credentials of a connection owned by the route's team.", + "description": "Upstream target for the route. CONNECTION targets use the provider and credentials of a connection owned by the route's team. INTELLIGENT targets need at least one of the route classifier's models, and one of its fallback models, servable by the team.", "discriminator": { "mapping": { "BASETEN_MODEL_API": "#/components/schemas/UpsertGridRouteTargetBasetenModelAPIV1", - "CLASSIFIER": "#/components/schemas/UpsertGridRouteTargetClassifierV1", - "CONNECTION": "#/components/schemas/UpsertGridRouteTargetConnectionV1" + "CONNECTION": "#/components/schemas/UpsertGridRouteTargetConnectionV1", + "INTELLIGENT": "#/components/schemas/UpsertGridRouteTargetIntelligentV1" }, "propertyName": "type" }, @@ -38973,7 +42935,7 @@ "$ref": "#/components/schemas/UpsertGridRouteTargetConnectionV1" }, { - "$ref": "#/components/schemas/UpsertGridRouteTargetClassifierV1" + "$ref": "#/components/schemas/UpsertGridRouteTargetIntelligentV1" } ], "title": "Target" @@ -39011,7 +42973,8 @@ "XAI", "VERTEX", "OPENAI_COMPATIBLE", - "BEDROCK" + "BEDROCK", + "AZURE" ], "title": "GridProviderV1", "type": "string" @@ -39116,7 +43079,7 @@ "default": null, "description": "Provider that served the requests. Null when not grouping by PROVIDER." }, - "intelligent_route": { + "intelligent_route_id": { "anyOf": [ { "type": "string" @@ -39126,8 +43089,21 @@ } ], "default": null, - "description": "Name of the intelligent route, as in `GET /v1/grid/routes`. Null when not grouping by INTELLIGENT_ROUTE.", - "title": "Intelligent Route" + "description": "ID of the intelligent route, as `id` in GET /v1/grid/routes. Null when not grouping by INTELLIGENT_ROUTE.", + "title": "Intelligent Route Id" + }, + "intelligent_route_display_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Display name of the intelligent route. Null when `intelligent_route_id` is null or the route cannot be resolved.", + "title": "Intelligent Route Display Name" }, "harness": { "anyOf": [ @@ -39141,6 +43117,32 @@ "default": null, "description": "Coding harness. Null when not grouping by HARNESS, when no harness was recorded (including usage from before harness tracking), or when the recorded harness is not recognized by this API version." }, + "api_key_prefix": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Prefix of the API key that made the requests, matching `GET /v1/api_keys`. Null when not grouping by API_KEY, for usage without an API key, and for usage recorded before API key tracking.", + "title": "Api Key Prefix" + }, + "api_key_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Name of the API key. Null when `api_key_prefix` is null or the key has no name.", + "title": "Api Key Name" + }, "cost_usd": { "description": "Estimated cost in USD, returned as an exact decimal string. Costs for OpenAI, Anthropic, and xAI estimate what you pay those providers; they are not Baseten charges.", "examples": [ @@ -39215,7 +43217,8 @@ "MODEL", "PROVIDER", "INTELLIGENT_ROUTE", - "HARNESS" + "HARNESS", + "API_KEY" ], "title": "GridRouteUsageDimensionV1", "type": "string" @@ -39285,7 +43288,7 @@ "title": "End Date" }, "group_by": { - "description": "Dimensions to break usage down by, repeated once per dimension: USER, TEAM, MODEL, PROVIDER, INTELLIGENT_ROUTE, or HARNESS. Each result represents one observed combination of the requested dimensions within that day, and results are sorted by those values. Combinations without usage are omitted, so result counts can differ between days. INTELLIGENT_ROUTE returns only usage sent through an intelligent route, one row per intelligent route, or per intelligent route and model with MODEL. These rows repeat usage already counted in other groupings, so don't add them to model totals. HARNESS includes usage with no recorded harness as a null group. Defaults to MODEL.", + "description": "Dimensions to break usage down by, repeated once per dimension: USER, TEAM, MODEL, PROVIDER, INTELLIGENT_ROUTE, HARNESS, or API_KEY. Each result represents one observed combination of the requested dimensions within that day, and results are sorted by those values. Combinations without usage are omitted, so result counts can differ between days. INTELLIGENT_ROUTE returns only usage sent through an intelligent route, one row per intelligent route, or per intelligent route and model with MODEL. These rows repeat usage already counted in other groupings, so don't add them to model totals. HARNESS includes usage with no recorded harness as a null group. API_KEY includes usage without an API key, such as requests authenticated by a signed-in session, as a null group. Defaults to MODEL.", "items": { "$ref": "#/components/schemas/GridRouteUsageDimensionV1" }, @@ -39323,6 +43326,14 @@ }, "title": "Harnesses", "type": "array" + }, + "api_key_prefixes": { + "description": "Return only usage made with these API keys, repeated once per key prefix. Omit to include all usage, including usage without an API key.", + "items": { + "type": "string" + }, + "title": "Api Key Prefixes", + "type": "array" } }, "title": "GridRouteUsageRequestV1", @@ -39386,37 +43397,6 @@ "Assistant" ], "title": "Display Name" - }, - "target": { - "anyOf": [ - { - "discriminator": { - "mapping": { - "BASETEN_MODEL_API": "#/components/schemas/UpsertGridRouteTargetBasetenModelAPIV1", - "CLASSIFIER": "#/components/schemas/UpsertGridRouteTargetClassifierV1", - "CONNECTION": "#/components/schemas/UpsertGridRouteTargetConnectionV1" - }, - "propertyName": "type" - }, - "oneOf": [ - { - "$ref": "#/components/schemas/UpsertGridRouteTargetBasetenModelAPIV1" - }, - { - "$ref": "#/components/schemas/UpsertGridRouteTargetConnectionV1" - }, - { - "$ref": "#/components/schemas/UpsertGridRouteTargetClassifierV1" - } - ] - }, - { - "type": "null" - } - ], - "description": "Complete new target configuration. Omit to keep the current configuration; null is not accepted. Only the CLASSIFIER configuration of a router route is mutable.", - "title": "Target", - "x-null-distinct": true } }, "title": "UpdateGridRouteRequestV1", @@ -40240,6 +44220,39 @@ "title": "GridConnectionConfigAnthropicV1", "type": "object" }, + "GridConnectionConfigAzureV1": { + "properties": { + "provider": { + "const": "AZURE", + "description": "Provider kind for Microsoft Azure.", + "title": "Provider", + "type": "string" + }, + "secret_id": { + "description": "Identifier of the team secret holding the provider API key.", + "title": "Secret Id", + "type": "string" + }, + "secret_name": { + "description": "Name of the team secret holding the provider API key.", + "title": "Secret Name", + "type": "string" + }, + "resource_name": { + "description": "Name of the Azure AI Foundry or Azure OpenAI resource.", + "title": "Resource Name", + "type": "string" + } + }, + "required": [ + "provider", + "secret_id", + "secret_name", + "resource_name" + ], + "title": "GridConnectionConfigAzureV1", + "type": "object" + }, "GridConnectionConfigBedrockV1": { "properties": { "provider": { @@ -40408,6 +44421,7 @@ "discriminator": { "mapping": { "ANTHROPIC": "#/components/schemas/GridConnectionConfigAnthropicV1", + "AZURE": "#/components/schemas/GridConnectionConfigAzureV1", "BEDROCK": "#/components/schemas/GridConnectionConfigBedrockV1", "OPENAI": "#/components/schemas/GridConnectionConfigOpenAIV1", "VERTEX": "#/components/schemas/GridConnectionConfigVertexV1", @@ -40430,6 +44444,9 @@ }, { "$ref": "#/components/schemas/GridConnectionConfigBedrockV1" + }, + { + "$ref": "#/components/schemas/GridConnectionConfigAzureV1" } ], "title": "Config" @@ -40578,6 +44595,42 @@ "title": "UpsertGridConnectionConfigAnthropicV1", "type": "object" }, + "UpsertGridConnectionConfigAzureV1": { + "additionalProperties": false, + "properties": { + "provider": { + "const": "AZURE", + "description": "Provider kind for Microsoft Azure. Route targets name a deployment, which must be named after its Azure model. Claude models (`claude-*`) use the Anthropic Messages API, and other models use the OpenAI-compatible APIs.", + "title": "Provider", + "type": "string" + }, + "secret_name": { + "description": "Name of an existing secret, owned by the same team, that holds the provider API key.", + "examples": [ + "anthropic-key" + ], + "minLength": 1, + "title": "Secret Name", + "type": "string" + }, + "resource_name": { + "description": "Name of the Azure AI Foundry or Azure OpenAI resource, the subdomain of `.openai.azure.com`.", + "examples": [ + "my-foundry-resource" + ], + "minLength": 1, + "title": "Resource Name", + "type": "string" + } + }, + "required": [ + "provider", + "secret_name", + "resource_name" + ], + "title": "UpsertGridConnectionConfigAzureV1", + "type": "object" + }, "UpsertGridConnectionConfigBedrockV1": { "additionalProperties": false, "properties": { @@ -40757,6 +44810,7 @@ "discriminator": { "mapping": { "ANTHROPIC": "#/components/schemas/UpsertGridConnectionConfigAnthropicV1", + "AZURE": "#/components/schemas/UpsertGridConnectionConfigAzureV1", "BEDROCK": "#/components/schemas/UpsertGridConnectionConfigBedrockV1", "OPENAI": "#/components/schemas/UpsertGridConnectionConfigOpenAIV1", "VERTEX": "#/components/schemas/UpsertGridConnectionConfigVertexV1", @@ -40785,6 +44839,9 @@ }, { "$ref": "#/components/schemas/UpsertGridConnectionConfigBedrockV1" + }, + { + "$ref": "#/components/schemas/UpsertGridConnectionConfigAzureV1" } ], "title": "Config" @@ -40818,6 +44875,7 @@ "discriminator": { "mapping": { "ANTHROPIC": "#/components/schemas/UpsertGridConnectionConfigAnthropicV1", + "AZURE": "#/components/schemas/UpsertGridConnectionConfigAzureV1", "BEDROCK": "#/components/schemas/UpsertGridConnectionConfigBedrockV1", "OPENAI": "#/components/schemas/UpsertGridConnectionConfigOpenAIV1", "VERTEX": "#/components/schemas/UpsertGridConnectionConfigVertexV1", @@ -40846,6 +44904,9 @@ }, { "$ref": "#/components/schemas/UpsertGridConnectionConfigBedrockV1" + }, + { + "$ref": "#/components/schemas/UpsertGridConnectionConfigAzureV1" } ], "title": "Config" @@ -40857,55 +44918,6 @@ "title": "UpdateGridConnectionRequestV1", "type": "object" }, - "GridClassifiersResponseV1": { - "properties": { - "items": { - "description": "Items in this page.", - "items": { - "$ref": "#/components/schemas/GridClassifierV1" - }, - "title": "Items", - "type": "array" - }, - "pagination": { - "$ref": "#/components/schemas/PaginationResponseV1", - "description": "Pagination metadata for the page." - } - }, - "required": [ - "items", - "pagination" - ], - "title": "GridClassifiersResponseV1", - "type": "object" - }, - "GridClassifiersRequestV1": { - "properties": { - "cursor": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Opaque cursor returned by a previous page. Omit to fetch the first page.", - "title": "Cursor" - }, - "limit": { - "default": 100, - "description": "Maximum number of items to return.", - "maximum": 1000, - "minimum": 1, - "title": "Limit", - "type": "integer" - } - }, - "title": "GridClassifiersRequestV1", - "type": "object" - }, "GridRouteClassifiersResponseV1": { "properties": { "items": { @@ -44919,27 +48931,43 @@ "in": "path", "required": true }, - "route_id": { + "service_account_id": { "schema": { "type": "string" }, - "name": "route_id", + "name": "service_account_id", "in": "path", "required": true }, - "connection_id": { + "identity_provider_id": { "schema": { "type": "string" }, - "name": "connection_id", + "name": "identity_provider_id", "in": "path", "required": true }, - "classifier_id": { + "trust_rule_id": { "schema": { "type": "string" }, - "name": "classifier_id", + "name": "trust_rule_id", + "in": "path", + "required": true + }, + "route_id": { + "schema": { + "type": "string" + }, + "name": "route_id", + "in": "path", + "required": true + }, + "connection_id": { + "schema": { + "type": "string" + }, + "name": "connection_id", "in": "path", "required": true },