AsyncApiClient

class baseten.client.sandboxapi.AsyncApiClient(http_client, *, base_url=None, auth=None, headers=None, timeout=None)

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)

  • base_url (str | None)

  • auth (httpx.Auth | None)

  • headers (Mapping[str, str] | None)

  • timeout (httpx.Timeout | None)

async delete_drives_mount(*, mount_path)

Detach a drive from a local path

Parameters:

mount_path (str)

Return type:

DriveUnmountResponse

async delete_filesystem(*, path, params=None)

Delete file or directory

Parameters:
Return type:

SuccessResponse

async delete_filesystem_multipart_abort(*, upload_id)

Abort multipart upload

Parameters:

upload_id (str)

Return type:

SuccessResponse

async delete_filesystem_tree(*, path, params=None)

Delete directory tree

Parameters:
Return type:

SuccessResponse

async delete_network_process_monitor(*, pid)

Stop monitoring ports for a process

Parameters:

pid (str)

Return type:

DeleteNetworkProcessMonitorResponse

async delete_network_tunnel()

Disconnect tunnel

Return type:

SuccessResponse

async delete_process(*, identifier)

Stop a process

Parameters:

identifier (str)

Return type:

SuccessResponse

async delete_process_kill(*, identifier)

Kill a process

Parameters:

identifier (str)

Return type:

SuccessResponse

async delete_process_stdin(*, identifier)

Close a process’s stdin

Parameters:

identifier (str)

Return type:

SuccessResponse

async get_archive_status()

Get the archive status

Return type:

QuiesceStatus

async get_codegen_reranking(*, path, params)

Code reranking/semantic search

Parameters:
Return type:

RerankingResponse

async get_drives_mount()

List currently mounted drives

Return type:

DriveListResponse

async get_filesystem(*, path, params=None)

Get file or directory information

Parameters:
Return type:

GetFilesystemResponse

Search for text content in files

Parameters:
Return type:

ContentSearchResponse

async get_filesystem_find(*, path, params=None)

Find files and directories

Parameters:
Return type:

FindResponse

async get_filesystem_multipart()

List multipart uploads

Return type:

MultipartListUploadsResponse

async get_filesystem_multipart_parts(*, upload_id)

List parts

Parameters:

upload_id (str)

Return type:

MultipartListPartsResponse

async get_filesystem_raw(*, path, params=None, accept)

Get file or directory information. Returns the response unread, in the requested content type. The caller must close the response.

Parameters:
Return type:

Response

Fuzzy search for files and directories

Parameters:
Return type:

FuzzySearchResponse

async get_filesystem_tree(*, path, params=None)

Get directory tree

Parameters:
Return type:

Directory

async get_health()

Health check

Return type:

HealthResponse

async get_network_process_ports(*, pid)

Get open ports for a process

Parameters:

pid (str)

Return type:

GetNetworkProcessPortsResponse

async get_process()

List all processes

Return type:

GetProcessResponse

async get_process_identifier(*, identifier)

Get process by identifier

Parameters:

identifier (str)

Return type:

ProcessResponse

async get_process_logs(*, identifier)

Get process logs

Parameters:

identifier (str)

Return type:

ProcessLogs

async get_process_logs_stream(*, identifier, accept)

Stream process logs in real time. Returns the response unread, in the requested content type. The caller must close the response.

Parameters:
  • identifier (str)

  • accept (Literal['application/x-ndjson', 'text/plain'])

Return type:

Response

async get_watch_filesystem(*, path, params=None)

Stream file modification events in a directory. Returns the response unread. The caller must close the response.

Parameters:
Return type:

Response

async head_filesystem(*, path)

Stat a file or directory. Returns the response unread, since its headers are the result. The caller must close the response.

Parameters:

path (str)

Return type:

Response

async post_archive_export(*, request)

Export the filesystem changes to a presigned URL

Parameters:

request (ExportOptions)

Return type:

ExportResult | ExportProgress

async post_archive_resume()

Lift the archive freeze

Return type:

QuiesceStatus

async post_drives_mount(*, request)

Attach a drive to a local path

Parameters:

request (DriveMountRequest)

Return type:

DriveMountResponse

async post_environment_reload()

Reload environment from guest metadata

Return type:

HandlerReloadResponse

async post_filesystem_multipart_complete(*, upload_id, request)

Complete multipart upload

Parameters:
Return type:

SuccessResponse

async post_filesystem_multipart_initiate(*, path, request)

Initiate multipart upload

Parameters:
Return type:

MultipartInitiateResponse

async post_network_process_monitor(*, pid, request)

Start monitoring ports for a process

Parameters:
Return type:

PostNetworkProcessMonitorResponse

async post_process(*, request)

Execute a command

Parameters:

request (ProcessRequest)

Return type:

ProcessResponse

async post_process_raw(*, request, accept)

Execute a command. Returns the response unread, in the requested content type. The caller must close the response.

Parameters:
Return type:

Response

async post_process_stdin(*, identifier, content)

Write to a process’s stdin

Parameters:
Return type:

SuccessResponse

async post_upgrade(*, request)

Upgrade the sandbox-api

Parameters:

request (UpgradeRequest)

Return type:

SuccessResponse

async put_codegen_fastapply(*, path, request)

Apply code edit

Parameters:
Return type:

ApplyEditResponse

async put_filesystem(*, path, request)

Create or update a file or directory

Parameters:
Return type:

SuccessResponse

async put_filesystem_multipart_part(*, upload_id, params, files)

Upload part. files is sent as httpx files.

Parameters:
Return type:

MultipartUploadPartResponse

async put_filesystem_tree(*, path, request)

Create or update directory tree

Parameters:
Return type:

Directory

async put_network_tunnel_config(*, request)

Update tunnel configuration

Parameters:

request (TunnelConfigRequest)

Return type:

SuccessResponse