AsyncApiClient¶
- class baseten.client.managementapi.AsyncApiClient(http_client)¶
Bases:
objectGenerated 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:
- async delete_chains_deployments(*, chain_id, chain_deployment_id)¶
Deletes a chain deployment by ID
- Parameters:
- Return type:
- async delete_library_listings(*, user_defined_listing_id)¶
Deletes a library listing
- Parameters:
user_defined_listing_id (str)
- Return type:
- async delete_library_listings_versions(*, user_defined_listing_id, version_tag)¶
Deletes a library listing version
- Parameters:
- Return type:
- async delete_models_deployments(*, model_id, deployment_id)¶
Deletes a model’s deployment by ID
- Parameters:
- Return type:
- async delete_models_deployments_replicas(*, model_id, deployment_id, replica_id)¶
Terminates a replica in a deployment
- Parameters:
- Return type:
- async delete_secrets(*, secret_name)¶
Deletes a secret by name
- Parameters:
secret_name (str)
- Return type:
- async delete_teams_secrets(*, team_id, secret_name)¶
Deletes a secret by name
- Parameters:
- Return type:
- async delete_training_projects(*, training_project_id)¶
Delete a training project.
- Parameters:
training_project_id (str)
- Return type:
- async delete_training_projects_jobs(*, training_project_id, training_job_id)¶
Delete a training job.
- Parameters:
- Return type:
- async get_api_keys()¶
Lists the user’s API keys (metadata only, no plain text keys)
- Return type:
- async get_billing_usage_summary()¶
Gets billing usage summary for a date range
- Return type:
- async get_blobs_credentials_model()¶
Get blob credentials for models.
- Return type:
- async get_blobs_credentials_train()¶
Get blob credentials for training.
- Return type:
- async get_chains_chain_id(*, chain_id)¶
Gets a chain by ID
- async get_chains_deployments(*, chain_id)¶
Gets all chain deployments
- Parameters:
chain_id (str)
- Return type:
- async get_chains_deployments_chain_deployment_id(*, chain_id, chain_deployment_id)¶
Gets a chain deployment by ID
- Parameters:
- Return type:
- async get_chains_deployments_chainlets_logs(*, chain_id, chain_deployment_id, chainlet_id)¶
Gets the logs for a chainlet within a chain deployment.
- Parameters:
- Return type:
- async get_chains_environments(*, chain_id)¶
Get all chain environments
- Parameters:
chain_id (str)
- Return type:
- async get_chains_environments_env_name(*, chain_id, env_name)¶
Get a chain environment’s details
- Parameters:
- Return type:
- async get_gateway_groups()¶
List groups
- Return type:
- async get_gateway_groups_api_keys(*, group_id)¶
List API keys for a group
- Parameters:
group_id (str)
- Return type:
- async get_gateway_groups_api_keys_api_key_prefix(*, group_id, api_key_prefix)¶
Get an API key for a group
- Parameters:
- Return type:
- async get_gateway_groups_group_id(*, group_id)¶
Get a group
- async get_instance_type_prices()¶
Gets prices for available instance types.
- Return type:
- async get_instance_types()¶
Gets all available instance types
- Return type:
- async get_library_listings()¶
Gets all library listings
- Return type:
- async get_library_listings_user_defined_listing_id(*, user_defined_listing_id)¶
Gets a library listing
- Parameters:
user_defined_listing_id (str)
- Return type:
- async get_library_listings_versions(*, user_defined_listing_id)¶
Gets all versions for a library listing
- Parameters:
user_defined_listing_id (str)
- Return type:
- async get_library_listings_versions_version_tag(*, user_defined_listing_id, version_tag)¶
Gets a library listing version
- Parameters:
- Return type:
- async get_loops_capabilities()¶
Get Loops server capabilities.
- Return type:
- async get_loops_checkpoints()¶
List Loops checkpoints.
- Return type:
- async get_loops_checkpoints_files(*, checkpoint_id)¶
Get Loops checkpoint files.
- Parameters:
checkpoint_id (str)
- Return type:
- async get_loops_deployments()¶
List Loops deployments.
- Return type:
- async get_loops_deployments_deployment_id(*, deployment_id)¶
Get a Loops deployment.
- Parameters:
deployment_id (str)
- Return type:
- async get_loops_deployments_logs(*, deployment_id)¶
Get logs for a Loops trainer deployment.
- Parameters:
deployment_id (str)
- Return type:
- async get_loops_runs()¶
List Loops runs.
- Return type:
- async get_loops_samplers()¶
List Loops samplers.
- Return type:
- async get_loops_samplers_sampler_id(*, sampler_id)¶
Get a Loops sampler.
- Parameters:
sampler_id (str)
- Return type:
- async get_loops_sessions(*, session_id)¶
Get a Loops session.
- Parameters:
session_id (str)
- Return type:
- async get_model_apis_snapshots()¶
Get the latest model weight snapshot
- Return type:
- async get_model_apis_snapshots_model_id(*, model_id)¶
Get the latest model weight snapshot
- Parameters:
model_id (str)
- Return type:
- async get_models_deployments(*, model_id)¶
Gets all deployments of a model
- Parameters:
model_id (str)
- Return type:
- async get_models_deployments_config(*, model_id, deployment_id)¶
Gets a deployment’s config
- Parameters:
- Return type:
- async get_models_deployments_deployment_id(*, model_id, deployment_id)¶
Gets a model’s deployment by ID
- Parameters:
- Return type:
- async get_models_deployments_development(*, model_id)¶
Gets a model’s development deployment
- Parameters:
model_id (str)
- Return type:
- async get_models_deployments_download(*, model_id, deployment_id)¶
Gets a presigned download URL for a deployment’s truss
- Parameters:
- Return type:
- async get_models_deployments_logs(*, model_id, deployment_id)¶
Gets the logs for a model deployment.
- Parameters:
- Return type:
- async get_models_deployments_production(*, model_id)¶
Gets a model’s production deployment
- Parameters:
model_id (str)
- Return type:
- async get_models_environments(*, model_id)¶
Get all environments
- Parameters:
model_id (str)
- Return type:
- async get_models_environments_env_name(*, model_id, env_name)¶
Get an environment’s details
- Parameters:
- Return type:
- async get_models_model_id(*, model_id)¶
Gets a model by ID
- async get_teams_secrets(*, team_id)¶
Gets all secrets for a team (metadata only, no plain text keys)
- async get_trainer_sessions_trainers_checkpoints(*, session_id, trainer_id)¶
List trainer server checkpoints.
- Parameters:
- Return type:
- async get_trainer_sessions_trainers_checkpoints_files(*, session_id, trainer_id, checkpoint_id)¶
Get trainer server checkpoint files.
- Parameters:
- Return type:
- async get_training_capacity()¶
Get training GPU capacity.
- Return type:
- async get_training_projects()¶
List training projects.
- Return type:
- async get_training_projects_cache_summary(*, training_project_id)¶
Get training project cache summary.
- Parameters:
training_project_id (str)
- Return type:
- async get_training_projects_jobs(*, training_project_id)¶
List training jobs.
- Parameters:
training_project_id (str)
- Return type:
- async get_training_projects_jobs_auth_codes(*, training_project_id, training_job_id)¶
Get auth codes for a training job.
- Parameters:
- Return type:
- async get_training_projects_jobs_checkpoint_files(*, training_project_id, training_job_id)¶
Get training job checkpoint files.
- Parameters:
- Return type:
- async get_training_projects_jobs_checkpoints(*, training_project_id, training_job_id)¶
Get training job checkpoints.
- Parameters:
- Return type:
- async get_training_projects_jobs_download(*, training_project_id, training_job_id)¶
Get the uploaded training job as a S3 Artifact
- Parameters:
- Return type:
- async get_training_projects_jobs_logs(*, training_project_id, training_job_id)¶
Get the logs for a training job.
- Parameters:
- Return type:
- async get_training_projects_jobs_metrics(*, training_project_id, training_job_id)¶
Get the metrics for a training job.
- Parameters:
- Return type:
- async get_training_projects_jobs_training_job_id(*, training_project_id, training_job_id)¶
Get a training job.
- Parameters:
- Return type:
- async get_training_projects_training_project_id(*, training_project_id)¶
Get a training project.
- Parameters:
training_project_id (str)
- Return type:
- async patch_chains_environments(*, chain_id, env_name, body)¶
Update a chain environment’s settings
- async patch_chains_environments_chainlet_settings_autoscaling_settings(*, chain_id, env_name, body)¶
Update a chainlet environment’s autoscaling settings
- async patch_gateway_groups(*, group_id, body)¶
Update a group
- Parameters:
group_id (str)
body (UpdateGroupRequest)
- Return type:
- async patch_library_listings(*, user_defined_listing_id, body)¶
Updates a library listing
- Parameters:
user_defined_listing_id (str)
body (UpdateLibraryListingRequest)
- Return type:
- async patch_library_listings_versions(*, user_defined_listing_id, version_tag, body)¶
Updates a library listing version
- async patch_models_deployments_autoscaling_settings(*, model_id, deployment_id, body)¶
Updates a deployment’s autoscaling settings
- Parameters:
model_id (str)
deployment_id (str)
body (UpdateAutoscalingSettings)
- Return type:
- async patch_models_deployments_development_autoscaling_settings(*, model_id, body)¶
Updates a development deployment’s autoscaling settings
- Parameters:
model_id (str)
body (UpdateAutoscalingSettings)
- Return type:
- async patch_models_deployments_production_autoscaling_settings(*, model_id, body)¶
Updates a production deployment’s autoscaling settings
- Parameters:
model_id (str)
body (UpdateAutoscalingSettings)
- Return type:
- async patch_models_environments(*, model_id, env_name, body)¶
Update an environment’s settings
- Parameters:
model_id (str)
env_name (str)
body (UpdateEnvironmentRequest)
- Return type:
- async patch_training_projects_jobs_interactive_sessions(*, training_project_id, training_job_id, session_id, body)¶
Patch an interactive session.
- async post_api_keys(*, body)¶
Creates an API key
- Parameters:
body (CreateAPIKeyRequest)
- Return type:
- async post_chains_deployments_deactivate(*, chain_id, chain_deployment_id)¶
Deactivates a chain deployment
- Parameters:
- Return type:
- async post_chains_environments(*, chain_id, body)¶
Create a chain environment
- Parameters:
chain_id (str)
- Return type:
- async post_chains_environments_chainlet_settings_instance_types_update(*, chain_id, env_name, body)¶
Update a chainlet environment’s instance type settings.
- async post_chains_environments_promote(*, chain_id, env_name, body)¶
Promotes a chain deployment to an environment
- async post_gateway_groups(*, body)¶
Create a group
- Parameters:
body (CreateGroupRequest)
- Return type:
- async post_gateway_groups_api_keys(*, group_id, body)¶
Create an API key for a group
- Parameters:
group_id (str)
body (CreateApiKeyForGroupRequest)
- Return type:
- async post_gateway_groups_api_keys_register(*, group_id, body)¶
Register an API key for a group
- Parameters:
group_id (str)
body (RegisterAPIKeyRequest)
- Return type:
- async post_library_listings(*, body)¶
Creates a new library listing
- Parameters:
body (CreateLibraryListingRequest)
- Return type:
- async post_library_listings_versions(*, user_defined_listing_id, body)¶
Creates a new library listing version
- Parameters:
user_defined_listing_id (str)
- Return type:
- async post_llm_models(*, body)¶
Creates a new BIS LLM deployment
- Parameters:
body (CreateLLMModelRequest)
- Return type:
- async post_llm_models_deployments(*, model_id, body)¶
Creates a new BIS LLM deployment version
- Parameters:
model_id (str)
body (CreateLLMModelVersionRequest)
- Return type:
- async post_loops_checkpoints_validate(*, body)¶
Validate a Loops checkpoint bt:// URI.
- Parameters:
- Return type:
- async post_loops_deployments_deactivate(*, deployment_id)¶
Deactivate a Loops deployment.
- Parameters:
deployment_id (str)
- Return type:
- async post_loops_deployments_metrics(*, deployment_id, body)¶
Get metrics for a Loops trainer deployment.
- Parameters:
deployment_id (str)
- Return type:
- async post_loops_runs(*, body)¶
Create a Loops run.
- Parameters:
body (CreateLoopsRunRequest)
- Return type:
- async post_loops_samplers(*, body)¶
Create a Loops sampler.
- Parameters:
body (CreateLoopsSamplerRequest)
- Return type:
- async post_loops_sessions(*, body)¶
Create a Loops session.
- Parameters:
body (CreateLoopsSessionRequest)
- Return type:
- async post_model_apis_snapshots(*, body)¶
Create a model weight snapshot
- Parameters:
- Return type:
- async post_model_apis_snapshots_model_id(*, model_id, body)¶
Create a model weight snapshot
- Parameters:
model_id (str)
- Return type:
- async post_models(*, body)¶
Creates a new model from a source
- Parameters:
body (CreateModelRequest)
- Return type:
- async post_models_deployments(*, model_id, body)¶
Adds a new deployment to a model
- Parameters:
model_id (str)
body (CreateModelDeploymentRequest)
- Return type:
- async post_models_deployments_activate(*, model_id, deployment_id)¶
Activates a deployment
- Parameters:
- Return type:
- async post_models_deployments_deactivate(*, model_id, deployment_id)¶
Deactivates a deployment
- Parameters:
- Return type:
- async post_models_deployments_development_activate(*, model_id)¶
Activates a development deployment
- Parameters:
model_id (str)
- Return type:
- async post_models_deployments_development_deactivate(*, model_id)¶
Deactivates a development deployment
- Parameters:
model_id (str)
- Return type:
- async post_models_deployments_development_promote(*, model_id, body)¶
Promotes a development deployment to production
- Parameters:
model_id (str)
body (PromoteRequest)
- Return type:
- async post_models_deployments_development_retry(*, model_id)¶
Retries a failed development deployment
- Parameters:
model_id (str)
- Return type:
- async post_models_deployments_logs(*, model_id, deployment_id, body)¶
Gets the logs for a model deployment (deprecated; use GET).
- Parameters:
model_id (str)
deployment_id (str)
body (GetDeploymentLogsRequest)
- Return type:
- async post_models_deployments_production_activate(*, model_id)¶
Activates a production deployment
- Parameters:
model_id (str)
- Return type:
- async post_models_deployments_production_deactivate(*, model_id)¶
Deactivates a production deployment
- Parameters:
model_id (str)
- Return type:
- async post_models_deployments_production_retry(*, model_id)¶
Retries a failed production deployment
- Parameters:
model_id (str)
- Return type:
- async post_models_deployments_promote(*, model_id, deployment_id, body)¶
Promotes a deployment to production
- Parameters:
model_id (str)
deployment_id (str)
body (PromoteRequest)
- Return type:
- async post_models_deployments_retry(*, model_id, deployment_id)¶
Retries a failed deployment
- Parameters:
- Return type:
- async post_models_deployments_ssh_sign(*, model_id, deployment_id, body)¶
Sign an SSH certificate for an inference model.
- Parameters:
model_id (str)
deployment_id (str)
body (SignSSHCertificateRequest)
- Return type:
- async post_models_environments(*, model_id, body)¶
Create an environment
- Parameters:
model_id (str)
body (CreateEnvironmentRequest)
- Return type:
- async post_models_environments_activate(*, model_id, env_name)¶
Activates a deployment associated with an environment
- Parameters:
- Return type:
- async post_models_environments_cancel_promotion(*, model_id, env_name)¶
Cancels a promotion to an environment
- Parameters:
- Return type:
- async post_models_environments_deactivate(*, model_id, env_name)¶
Deactivates a deployment associated with an environment
- Parameters:
- Return type:
- async post_models_environments_force_cancel_promotion(*, model_id, env_name)¶
Force cancels a rolling promotion
- Parameters:
- Return type:
- async post_models_environments_force_roll_forward_promotion(*, model_id, env_name)¶
Force rolls forward a rolling promotion
- Parameters:
- Return type:
- async post_models_environments_pause_promotion(*, model_id, env_name)¶
Pauses a rolling promotion
- Parameters:
- Return type:
- async post_models_environments_promote(*, model_id, env_name, body)¶
Promotes a deployment to an environment
- Parameters:
model_id (str)
env_name (str)
body (PromoteToEnvironmentRequest)
- Return type:
- async post_models_environments_resume_promotion(*, model_id, env_name)¶
Resumes a paused rolling promotion
- Parameters:
- Return type:
- async post_prepare_model_upload(*, body)¶
Validates a model push payload and issues upload credentials
- Parameters:
body (PrepareModelUploadRequest)
- Return type:
- async post_secrets(*, body)¶
Upserts a secret
- Parameters:
body (UpsertSecretRequest)
- Return type:
- async post_teams_api_keys(*, team_id, body)¶
Creates a team API key
- Parameters:
team_id (str)
body (CreateAPIKeyRequest)
- Return type:
- async post_teams_llm_models(*, team_id, body)¶
Creates a new BIS LLM deployment
- Parameters:
team_id (str)
body (CreateLLMModelRequest)
- Return type:
- async post_teams_models(*, team_id, body)¶
Creates a new model from a source
- Parameters:
team_id (str)
body (CreateModelRequest)
- Return type:
- async post_teams_secrets(*, team_id, body)¶
Upserts a secret in a team
- Parameters:
team_id (str)
body (UpsertSecretRequest)
- Return type:
- async post_teams_training_projects(*, team_id, body)¶
Upsert a training project in a specific team.
- Parameters:
team_id (str)
body (UpsertTrainingProjectRequest)
- Return type:
- async post_trainer_sessions(*, body)¶
Create a trainer session.
- Parameters:
body (CreateTrainerSessionRequest)
- Return type:
- async post_trainer_sessions_samplers(*, session_id, body)¶
Create a sampling server.
- Parameters:
session_id (str)
body (CreateSamplingServerRequest)
- Return type:
- async post_trainer_sessions_trainers(*, session_id, body)¶
Create a trainer server.
- Parameters:
session_id (str)
body (CreateTrainerServerRequest)
- Return type:
- async post_trainers_checkpoints_search(*, body)¶
Look up trainer checkpoint info by bt:// URI.
- Parameters:
body (CheckpointSearchRequest)
- Return type:
- async post_trainers_search(*, body)¶
Search trainers.
- Parameters:
body (SearchTrainersRequest)
- Return type:
- async post_training_jobs_search(*, body)¶
Search training jobs.
- Parameters:
body (SearchTrainingJobsRequest)
- Return type:
- async post_training_projects(*, body)¶
Upsert a training project.
- Parameters:
body (UpsertTrainingProjectRequest)
- Return type:
- async post_training_projects_jobs(*, training_project_id, body)¶
Create a training job.
- Parameters:
training_project_id (str)
body (CreateTrainingJobRequest)
- Return type:
- async post_training_projects_jobs_logs(*, training_project_id, training_job_id, body)¶
Get the logs for a training job (deprecated; use GET).
- Parameters:
training_project_id (str)
training_job_id (str)
body (GetTrainingJobLogsRequest)
- Return type:
- async post_training_projects_jobs_metrics(*, training_project_id, training_job_id, body)¶
Get the metrics for a training job (deprecated; use GET).
- Parameters:
training_project_id (str)
training_job_id (str)
body (GetTrainingJobMetricsRequest)
- Return type:
- async post_training_projects_jobs_recreate(*, training_project_id, training_job_id)¶
Recreate a training job
- Parameters:
- Return type:
- async post_training_projects_jobs_ssh_sign(*, training_project_id, training_job_id, body)¶
Sign an SSH certificate for a training job.
- Parameters:
training_project_id (str)
training_job_id (str)
body (SignSSHCertificateRequest)
- Return type:
- async post_training_projects_jobs_stop(*, training_project_id, training_job_id, body)¶
Stop a training job.
- Parameters:
training_project_id (str)
training_job_id (str)
body (StopTrainingJobRequest)
- Return type: