Skip to main content

mistralai-blokhus

Typed async Python client for Blokhus, Mistral AI's microVM sandbox platform. Commands use HTTP/SSE, files use streamed HTTP, and terminals and port forwarding use WebSockets. Requires Python 3.12 or later.

Install

uv add mistralai-blokhus

The import package is blokhus.

Configure

Set MISTRAL_API_KEY, or pass a ClientConfig to override the key or the endpoint. The key is sent as Authorization: Bearer <key>.

Service accounts set MISTRAL_SA_TOKEN_PATH to the file that holds their token. The client reads the file on every request, so it follows token rotation. An explicit api_key takes priority over the token, and the token over MISTRAL_API_KEY.

from blokhus import ClientConfig, Sandbox

config = ClientConfig(base_url="https://example.com/v1/blokhus", api_key="...")
async with await Sandbox.create(image="python:3.12-slim", config=config) as sandbox:
    print((await sandbox.commands.exec("printf hello")).stdout)

Run a command

import asyncio

from blokhus import Sandbox


async def main() -> None:
    async with await Sandbox.create(image="python:3.12-slim") as sandbox:
        result = await sandbox.commands.exec("printf hello")
        print(result.stdout)
        await sandbox.files.write("/tmp/example.txt", "hello")
        print(await sandbox.files.read("/tmp/example.txt"))


asyncio.run(main())

Metadata

Release files for mistralai-blokhus 0.215.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mistralai-blokhus 0.215.0
File Size Uploaded Provenance Actions
mistralai_blokhus-0.215.0.tar.gz 87.6 kB With provenance Details for mistralai_blokhus-0.215.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mistralai-blokhus 0.215.0
File Interpreter ABI Platform Actions
mistralai_blokhus-0.215.0-py3-none-any.whl Python 3 none any Details for mistralai_blokhus-0.215.0-py3-none-any.whl

Total release size: 189.7 kB

Release files / mistralai_blokhus-0.215.0.tar.gz

Download URL mistralai_blokhus-0.215.0.tar.gz
Size 87.6 kB
Tags Source
SHA-256 checksum
How to use checksums
66b0d129c1894601934e77db615b8052f43f3e2c3332c831f7178aa325355c2f
BLAKE2b-256 checksum
How to use checksums
2874b9428196317a0f6813ea2e4497aaa0a4c6e398cda56ba4f439c5362e5f61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / mistralai_blokhus-0.215.0-py3-none-any.whl

Download URL mistralai_blokhus-0.215.0-py3-none-any.whl
Size 102.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d905b292ecc9c78dc1bd7f4b31401c9c1cc9841b74c0dd3c83736237ec3733a
BLAKE2b-256 checksum
How to use checksums
7e38a640a2af18b351ddc97acdedd824fa50bd0920459b5ce9da7c0dff0c9404
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for mistralai-blokhus 0.215.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mistralai_blokhus-0.215.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page