AsyncApiClient

class baseten.client.managementapi.AsyncApiClient(http_client)

Bases: object

Generated HTTP client for the Baseten API.

Methods on this client are generated from the OpenAPI specification and are NOT covered by any stability or compatibility guarantees. They may change without notice between versions.

Parameters:

http_client (httpx.AsyncClient)

async delete_api_keys(*, api_key_prefix)

Deletes an API key by prefix

Parameters:

api_key_prefix (str)

Return type:

APIKeyTombstone

async delete_chains(*, chain_id)

Deletes a chain by ID

Parameters:

chain_id (str)

Return type:

ChainTombstone

async delete_chains_deployments(*, chain_id, chain_deployment_id)

Deletes a chain deployment by ID

Parameters:
  • chain_id (str)

  • chain_deployment_id (str)

Return type:

ChainDeploymentTombstone

async delete_library_listings(*, user_defined_listing_id)

Deletes a library listing

Parameters:

user_defined_listing_id (str)

Return type:

LibraryListingTombstone

async delete_library_listings_versions(*, user_defined_listing_id, version_tag)

Deletes a library listing version

Parameters:
  • user_defined_listing_id (str)

  • version_tag (str)

Return type:

LibraryListingVersionTombstone

async delete_models(*, model_id)

Deletes a model by ID

Parameters:

model_id (str)

Return type:

ModelTombstone

async delete_models_deployments(*, model_id, deployment_id)

Deletes a model’s deployment by ID

Parameters:
  • model_id (str)

  • deployment_id (str)

Return type:

DeploymentTombstone

async delete_models_deployments_replicas(*, model_id, deployment_id, replica_id)

Terminates a replica in a deployment

Parameters:
  • model_id (str)

  • deployment_id (str)

  • replica_id (str)

Return type:

TerminateReplicaResponse

async delete_secrets(*, secret_name)

Deletes a secret by name

Parameters:

secret_name (str)

Return type:

SecretTombstone

async delete_teams_secrets(*, team_id, secret_name)

Deletes a secret by name

Parameters:
  • team_id (str)

  • secret_name (str)

Return type:

SecretTombstone

async delete_training_projects(*, training_project_id)

Delete a training project.

Parameters:

training_project_id (str)

Return type:

TrainingProjectTombstone

async delete_training_projects_jobs(*, training_project_id, training_job_id)

Delete a training job.

Parameters:
  • training_project_id (str)

  • training_job_id (str)

Return type:

TrainingJobTombstone

async get_api_keys()

Lists the user’s API keys (metadata only, no plain text keys)

Return type:

APIKeys

async get_billing_usage_summary()

Gets billing usage summary for a date range

Return type:

UsageSummary

async get_blobs_credentials_model()

Get blob credentials for models.

Return type:

GetBlobCredentialsResponse

async get_blobs_credentials_train()

Get blob credentials for training.

Return type:

GetBlobCredentialsResponse

async get_chains()

Gets all chains

Return type:

Chains

async get_chains_chain_id(*, chain_id)

Gets a chain by ID

Parameters:

chain_id (str)

Return type:

Chain

async get_chains_deployments(*, chain_id)

Gets all chain deployments

Parameters:

chain_id (str)

Return type:

ChainDeployments

async get_chains_deployments_chain_deployment_id(*, chain_id, chain_deployment_id)

Gets a chain deployment by ID

Parameters:
  • chain_id (str)

  • chain_deployment_id (str)

Return type:

ChainDeployment

async get_chains_deployments_chainlets_logs(*, chain_id, chain_deployment_id, chainlet_id)

Gets the logs for a chainlet within a chain deployment.

Parameters:
  • chain_id (str)

  • chain_deployment_id (str)

  • chainlet_id (str)

Return type:

GetLogsResponse

async get_chains_environments(*, chain_id)

Get all chain environments

Parameters:

chain_id (str)

Return type:

Environments

async get_chains_environments_env_name(*, chain_id, env_name)

Get a chain environment’s details

Parameters:
  • chain_id (str)

  • env_name (str)

Return type:

ChainEnvironment

async get_gateway_groups()

List groups

Return type:

GroupsResponse

async get_gateway_groups_api_keys(*, group_id)

List API keys for a group

Parameters:

group_id (str)

Return type:

KeysForGroupResponse

async get_gateway_groups_api_keys_api_key_prefix(*, group_id, api_key_prefix)

Get an API key for a group

Parameters:
  • group_id (str)

  • api_key_prefix (str)

Return type:

GatewayKeyInfo

async get_gateway_groups_group_id(*, group_id)

Get a group

Parameters:

group_id (str)

Return type:

Group

async get_instance_type_prices()

Gets prices for available instance types.

Return type:

InstanceTypePrices

async get_instance_types()

Gets all available instance types

Return type:

InstanceTypes

async get_library_listings()

Gets all library listings

Return type:

LibraryListings

async get_library_listings_user_defined_listing_id(*, user_defined_listing_id)

Gets a library listing

Parameters:

user_defined_listing_id (str)

Return type:

LibraryListing

async get_library_listings_versions(*, user_defined_listing_id)

Gets all versions for a library listing

Parameters:

user_defined_listing_id (str)

Return type:

LibraryListingVersions

async get_library_listings_versions_version_tag(*, user_defined_listing_id, version_tag)

Gets a library listing version

Parameters:
  • user_defined_listing_id (str)

  • version_tag (str)

Return type:

LibraryListingVersion

async get_loops_capabilities()

Get Loops server capabilities.

Return type:

GetLoopsCapabilitiesResponse

async get_loops_checkpoints()

List Loops checkpoints.

Return type:

ListLoopsCheckpointsResponse

async get_loops_checkpoints_files(*, checkpoint_id)

Get Loops checkpoint files.

Parameters:

checkpoint_id (str)

Return type:

LoopsCheckpointFilesResponse

async get_loops_deployments()

List Loops deployments.

Return type:

ListLoopsDeploymentsResponse

async get_loops_deployments_deployment_id(*, deployment_id)

Get a Loops deployment.

Parameters:

deployment_id (str)

Return type:

GetLoopsDeploymentResponse

async get_loops_deployments_logs(*, deployment_id)

Get logs for a Loops trainer deployment.

Parameters:

deployment_id (str)

Return type:

GetLogsResponse

async get_loops_runs()

List Loops runs.

Return type:

ListLoopsRunsResponse

async get_loops_runs_run_id(*, run_id)

Get a Loops run.

Parameters:

run_id (str)

Return type:

GetLoopsRunResponse

async get_loops_samplers()

List Loops samplers.

Return type:

ListLoopsSamplersResponse

async get_loops_samplers_sampler_id(*, sampler_id)

Get a Loops sampler.

Parameters:

sampler_id (str)

Return type:

GetLoopsSamplerResponse

async get_loops_sessions(*, session_id)

Get a Loops session.

Parameters:

session_id (str)

Return type:

GetLoopsSessionResponse

async get_model_apis_snapshots()

Get the latest model weight snapshot

Return type:

ModelWeightSnapshot

async get_model_apis_snapshots_model_id(*, model_id)

Get the latest model weight snapshot

Parameters:

model_id (str)

Return type:

ModelWeightSnapshot

async get_models()

Gets all models

Return type:

Models

async get_models_deployments(*, model_id)

Gets all deployments of a model

Parameters:

model_id (str)

Return type:

Deployments

async get_models_deployments_config(*, model_id, deployment_id)

Gets a deployment’s config

Parameters:
  • model_id (str)

  • deployment_id (str)

Return type:

DeploymentConfigResponse

async get_models_deployments_deployment_id(*, model_id, deployment_id)

Gets a model’s deployment by ID

Parameters:
  • model_id (str)

  • deployment_id (str)

Return type:

Deployment

async get_models_deployments_development(*, model_id)

Gets a model’s development deployment

Parameters:

model_id (str)

Return type:

Deployment

async get_models_deployments_download(*, model_id, deployment_id)

Gets a presigned download URL for a deployment’s truss

Parameters:
  • model_id (str)

  • deployment_id (str)

Return type:

DownloadDeploymentResponse

async get_models_deployments_logs(*, model_id, deployment_id)

Gets the logs for a model deployment.

Parameters:
  • model_id (str)

  • deployment_id (str)

Return type:

GetLogsResponse

async get_models_deployments_production(*, model_id)

Gets a model’s production deployment

Parameters:

model_id (str)

Return type:

Deployment

async get_models_environments(*, model_id)

Get all environments

Parameters:

model_id (str)

Return type:

Environments

async get_models_environments_env_name(*, model_id, env_name)

Get an environment’s details

Parameters:
  • model_id (str)

  • env_name (str)

Return type:

Environment

async get_models_model_id(*, model_id)

Gets a model by ID

Parameters:

model_id (str)

Return type:

Model

async get_secrets()

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

Return type:

Secrets

async get_teams()

Lists all teams

Return type:

Teams

async get_teams_models(*, team_id)

Gets all models

Parameters:

team_id (str)

Return type:

Models

async get_teams_secrets(*, team_id)

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

Parameters:

team_id (str)

Return type:

Secrets

async get_trainer_sessions_trainers_checkpoints(*, session_id, trainer_id)

List trainer server checkpoints.

Parameters:
  • session_id (str)

  • trainer_id (str)

Return type:

GetTrainerServerCheckpointsResponse

async get_trainer_sessions_trainers_checkpoints_files(*, session_id, trainer_id, checkpoint_id)

Get trainer server checkpoint files.

Parameters:
  • session_id (str)

  • trainer_id (str)

  • checkpoint_id (str)

Return type:

GetTrainerServerCheckpointFilesResponse

async get_training_capacity()

Get training GPU capacity.

Return type:

GetTrainingGpuCapacityResponse

async get_training_projects()

List training projects.

Return type:

ListTrainingProjectsResponse

async get_training_projects_cache_summary(*, training_project_id)

Get training project cache summary.

Parameters:

training_project_id (str)

Return type:

GetCacheSummaryResponse

async get_training_projects_jobs(*, training_project_id)

List training jobs.

Parameters:

training_project_id (str)

Return type:

ListTrainingJobsResponse

async get_training_projects_jobs_auth_codes(*, training_project_id, training_job_id)

Get auth codes for a training job.

Parameters:
  • training_project_id (str)

  • training_job_id (str)

Return type:

GetAuthCodesResponse

async get_training_projects_jobs_checkpoint_files(*, training_project_id, training_job_id)

Get training job checkpoint files.

Parameters:
  • training_project_id (str)

  • training_job_id (str)

Return type:

GetTrainingJobCheckpointFilesResponse

async get_training_projects_jobs_checkpoints(*, training_project_id, training_job_id)

Get training job checkpoints.

Parameters:
  • training_project_id (str)

  • training_job_id (str)

Return type:

GetTrainingJobCheckpointsResponse

async get_training_projects_jobs_download(*, training_project_id, training_job_id)

Get the uploaded training job as a S3 Artifact

Parameters:
  • training_project_id (str)

  • training_job_id (str)

Return type:

DownloadTrainingJobResponse

async get_training_projects_jobs_logs(*, training_project_id, training_job_id)

Get the logs for a training job.

Parameters:
  • training_project_id (str)

  • training_job_id (str)

Return type:

GetLogsResponse

async get_training_projects_jobs_metrics(*, training_project_id, training_job_id)

Get the metrics for a training job.

Parameters:
  • training_project_id (str)

  • training_job_id (str)

Return type:

GetTrainingJobMetricsResponse

async get_training_projects_jobs_training_job_id(*, training_project_id, training_job_id)

Get a training job.

Parameters:
  • training_project_id (str)

  • training_job_id (str)

Return type:

GetTrainingJobResponse

async get_training_projects_training_project_id(*, training_project_id)

Get a training project.

Parameters:

training_project_id (str)

Return type:

GetTrainingProjectResponse

async get_users(*, user_id)

Gets a user by ID

Parameters:

user_id (str)

Return type:

UserInfo

async patch_chains_environments(*, chain_id, env_name, body)

Update a chain environment’s settings

Parameters:
Return type:

UpdateChainEnvironmentResponse

async patch_chains_environments_chainlet_settings_autoscaling_settings(*, chain_id, env_name, body)

Update a chainlet environment’s autoscaling settings

Parameters:
Return type:

UpdateAutoscalingSettingsResponse

async patch_gateway_groups(*, group_id, body)

Update a group

Parameters:
Return type:

Group

async patch_library_listings(*, user_defined_listing_id, body)

Updates a library listing

Parameters:
Return type:

LibraryListing

async patch_library_listings_versions(*, user_defined_listing_id, version_tag, body)

Updates a library listing version

Parameters:
Return type:

LibraryListingVersion

async patch_models_deployments_autoscaling_settings(*, model_id, deployment_id, body)

Updates a deployment’s autoscaling settings

Parameters:
Return type:

UpdateAutoscalingSettingsResponse

async patch_models_deployments_development_autoscaling_settings(*, model_id, body)

Updates a development deployment’s autoscaling settings

Parameters:
Return type:

UpdateAutoscalingSettingsResponse

async patch_models_deployments_production_autoscaling_settings(*, model_id, body)

Updates a production deployment’s autoscaling settings

Parameters:
Return type:

UpdateAutoscalingSettingsResponse

async patch_models_environments(*, model_id, env_name, body)

Update an environment’s settings

Parameters:
Return type:

UpdateAutoscalingSettingsResponse

async patch_training_projects_jobs_interactive_sessions(*, training_project_id, training_job_id, session_id, body)

Patch an interactive session.

Parameters:
Return type:

PatchInteractiveSessionResponse

async post_api_keys(*, body)

Creates an API key

Parameters:

body (CreateAPIKeyRequest)

Return type:

APIKey

async post_chains_deployments_deactivate(*, chain_id, chain_deployment_id)

Deactivates a chain deployment

Parameters:
  • chain_id (str)

  • chain_deployment_id (str)

Return type:

DeactivateResponse

async post_chains_environments(*, chain_id, body)

Create a chain environment

Parameters:
Return type:

ChainEnvironment

async post_chains_environments_chainlet_settings_instance_types_update(*, chain_id, env_name, body)

Update a chainlet environment’s instance type settings.

Parameters:
Return type:

UpdateChainletEnvironmentInstanceTypeResponse

async post_chains_environments_promote(*, chain_id, env_name, body)

Promotes a chain deployment to an environment

Parameters:
Return type:

ChainDeployment

async post_gateway_groups(*, body)

Create a group

Parameters:

body (CreateGroupRequest)

Return type:

Group

async post_gateway_groups_api_keys(*, group_id, body)

Create an API key for a group

Parameters:
Return type:

CreateApiKeyForGroupResponse

async post_gateway_groups_api_keys_register(*, group_id, body)

Register an API key for a group

Parameters:
Return type:

RegisterAPIKeyResponse

async post_library_listings(*, body)

Creates a new library listing

Parameters:

body (CreateLibraryListingRequest)

Return type:

LibraryListing

async post_library_listings_versions(*, user_defined_listing_id, body)

Creates a new library listing version

Parameters:
Return type:

LibraryListingVersion

async post_llm_models(*, body)

Creates a new BIS LLM deployment

Parameters:

body (CreateLLMModelRequest)

Return type:

LLMModelHandle

async post_llm_models_deployments(*, model_id, body)

Creates a new BIS LLM deployment version

Parameters:
Return type:

LLMModelHandle

async post_loops_checkpoints_validate(*, body)

Validate a Loops checkpoint bt:// URI.

Parameters:

body (ValidateLoopsCheckpointRequest)

Return type:

ValidateLoopsCheckpointResponse

async post_loops_deployments_deactivate(*, deployment_id)

Deactivate a Loops deployment.

Parameters:

deployment_id (str)

Return type:

DeactivateLoopsDeploymentResponse

async post_loops_deployments_metrics(*, deployment_id, body)

Get metrics for a Loops trainer deployment.

Parameters:
Return type:

GetLoopsDeploymentMetricsResponse

async post_loops_runs(*, body)

Create a Loops run.

Parameters:

body (CreateLoopsRunRequest)

Return type:

CreateLoopsRunResponse

async post_loops_samplers(*, body)

Create a Loops sampler.

Parameters:

body (CreateLoopsSamplerRequest)

Return type:

CreateLoopsSamplerResponse

async post_loops_sessions(*, body)

Create a Loops session.

Parameters:

body (CreateLoopsSessionRequest)

Return type:

CreateLoopsSessionResponse

async post_model_apis_snapshots(*, body)

Create a model weight snapshot

Parameters:

body (CreateModelWeightSnapshotRequest)

Return type:

ModelWeightSnapshot

async post_model_apis_snapshots_model_id(*, model_id, body)

Create a model weight snapshot

Parameters:
Return type:

ModelWeightSnapshot

async post_models(*, body)

Creates a new model from a source

Parameters:

body (CreateModelRequest)

Return type:

CreatedModelDeployment

async post_models_deployments(*, model_id, body)

Adds a new deployment to a model

Parameters:
Return type:

CreatedModelDeployment

async post_models_deployments_activate(*, model_id, deployment_id)

Activates a deployment

Parameters:
  • model_id (str)

  • deployment_id (str)

Return type:

ActivateResponse

async post_models_deployments_deactivate(*, model_id, deployment_id)

Deactivates a deployment

Parameters:
  • model_id (str)

  • deployment_id (str)

Return type:

DeactivateResponse

async post_models_deployments_development_activate(*, model_id)

Activates a development deployment

Parameters:

model_id (str)

Return type:

ActivateResponse

async post_models_deployments_development_deactivate(*, model_id)

Deactivates a development deployment

Parameters:

model_id (str)

Return type:

DeactivateResponse

async post_models_deployments_development_promote(*, model_id, body)

Promotes a development deployment to production

Parameters:
Return type:

Deployment

async post_models_deployments_development_retry(*, model_id)

Retries a failed development deployment

Parameters:

model_id (str)

Return type:

RetryDeploymentResponse

async post_models_deployments_logs(*, model_id, deployment_id, body)

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

Parameters:
Return type:

GetLogsResponse

async post_models_deployments_production_activate(*, model_id)

Activates a production deployment

Parameters:

model_id (str)

Return type:

ActivateResponse

async post_models_deployments_production_deactivate(*, model_id)

Deactivates a production deployment

Parameters:

model_id (str)

Return type:

DeactivateResponse

async post_models_deployments_production_retry(*, model_id)

Retries a failed production deployment

Parameters:

model_id (str)

Return type:

RetryDeploymentResponse

async post_models_deployments_promote(*, model_id, deployment_id, body)

Promotes a deployment to production

Parameters:
Return type:

Deployment

async post_models_deployments_retry(*, model_id, deployment_id)

Retries a failed deployment

Parameters:
  • model_id (str)

  • deployment_id (str)

Return type:

RetryDeploymentResponse

async post_models_deployments_ssh_sign(*, model_id, deployment_id, body)

Sign an SSH certificate for an inference model.

Parameters:
Return type:

SignSSHCertificateResponse

async post_models_environments(*, model_id, body)

Create an environment

Parameters:
Return type:

Environment

async post_models_environments_activate(*, model_id, env_name)

Activates a deployment associated with an environment

Parameters:
  • model_id (str)

  • env_name (str)

Return type:

ActivateResponse

async post_models_environments_cancel_promotion(*, model_id, env_name)

Cancels a promotion to an environment

Parameters:
  • model_id (str)

  • env_name (str)

Return type:

CancelPromotionResponse

async post_models_environments_deactivate(*, model_id, env_name)

Deactivates a deployment associated with an environment

Parameters:
  • model_id (str)

  • env_name (str)

Return type:

DeactivateResponse

async post_models_environments_force_cancel_promotion(*, model_id, env_name)

Force cancels a rolling promotion

Parameters:
  • model_id (str)

  • env_name (str)

Return type:

SignalPromotionResponse

async post_models_environments_force_roll_forward_promotion(*, model_id, env_name)

Force rolls forward a rolling promotion

Parameters:
  • model_id (str)

  • env_name (str)

Return type:

SignalPromotionResponse

async post_models_environments_pause_promotion(*, model_id, env_name)

Pauses a rolling promotion

Parameters:
  • model_id (str)

  • env_name (str)

Return type:

SignalPromotionResponse

async post_models_environments_promote(*, model_id, env_name, body)

Promotes a deployment to an environment

Parameters:
Return type:

Deployment

async post_models_environments_resume_promotion(*, model_id, env_name)

Resumes a paused rolling promotion

Parameters:
  • model_id (str)

  • env_name (str)

Return type:

SignalPromotionResponse

async post_prepare_model_upload(*, body)

Validates a model push payload and issues upload credentials

Parameters:

body (PrepareModelUploadRequest)

Return type:

PrepareModelUploadResponse

async post_secrets(*, body)

Upserts a secret

Parameters:

body (UpsertSecretRequest)

Return type:

Secret

async post_teams_api_keys(*, team_id, body)

Creates a team API key

Parameters:
Return type:

APIKey

async post_teams_llm_models(*, team_id, body)

Creates a new BIS LLM deployment

Parameters:
Return type:

LLMModelHandle

async post_teams_models(*, team_id, body)

Creates a new model from a source

Parameters:
Return type:

CreatedModelDeployment

async post_teams_secrets(*, team_id, body)

Upserts a secret in a team

Parameters:
Return type:

Secret

async post_teams_training_projects(*, team_id, body)

Upsert a training project in a specific team.

Parameters:
Return type:

UpsertTrainingProjectResponse

async post_trainer_sessions(*, body)

Create a trainer session.

Parameters:

body (CreateTrainerSessionRequest)

Return type:

CreateTrainerSessionResponse

async post_trainer_sessions_samplers(*, session_id, body)

Create a sampling server.

Parameters:
Return type:

CreateSamplingServerResponse

async post_trainer_sessions_trainers(*, session_id, body)

Create a trainer server.

Parameters:
Return type:

CreateTrainerServerResponse

Look up trainer checkpoint info by bt:// URI.

Parameters:

body (CheckpointSearchRequest)

Return type:

CheckpointSearchResponse

Search trainers.

Parameters:

body (SearchTrainersRequest)

Return type:

SearchTrainersResponse

Search training jobs.

Parameters:

body (SearchTrainingJobsRequest)

Return type:

SearchTrainingJobsResponse

async post_training_projects(*, body)

Upsert a training project.

Parameters:

body (UpsertTrainingProjectRequest)

Return type:

UpsertTrainingProjectResponse

async post_training_projects_jobs(*, training_project_id, body)

Create a training job.

Parameters:
Return type:

CreateTrainingJobResponse

async post_training_projects_jobs_logs(*, training_project_id, training_job_id, body)

Get the logs for a training job (deprecated; use GET).

Parameters:
Return type:

GetLogsResponse

async post_training_projects_jobs_metrics(*, training_project_id, training_job_id, body)

Get the metrics for a training job (deprecated; use GET).

Parameters:
Return type:

GetTrainingJobMetricsResponse

async post_training_projects_jobs_recreate(*, training_project_id, training_job_id)

Recreate a training job

Parameters:
  • training_project_id (str)

  • training_job_id (str)

Return type:

RecreateTrainingJobResponse

async post_training_projects_jobs_ssh_sign(*, training_project_id, training_job_id, body)

Sign an SSH certificate for a training job.

Parameters:
Return type:

SignSSHCertificateResponse

async post_training_projects_jobs_stop(*, training_project_id, training_job_id, body)

Stop a training job.

Parameters:
Return type:

StopTrainingJobResponse