# Python & JavaScript

Small examples that call the implemented API without a fictional package.

Status: REST examples · Source Python MCP client available

## Python
The source package contains the HTTP client used by the MCP bridge:
```python
import os
from computeruse.mcp import Api

client = Api(
    os.environ["COMPUTERUSE_API_ORIGIN"],
    os.environ["COMPUTERUSE_API_TOKEN"],
)
rentals = client.call("account")["rentals"]
```
Install the source in your environment or run from its directory. No public PyPI package is claimed by this example.

## Server-side JavaScript
```javascript
const origin = process.env.COMPUTERUSE_API_ORIGIN;
const response = await fetch(`${origin}/api/v1/account`, {
  headers: {
    Authorization: `Bearer ${process.env.COMPUTERUSE_API_TOKEN}`,
  },
  redirect: 'error',
});
if (!response.ok) throw new Error(`ComputerUse: ${response.status}`);
const { rentals } = await response.json();
```
Run this on a trusted server. Never include account credentials in browser JavaScript, public environment variables or bundles. Configure a trusted HTTPS origin before calling it.

## Planned SDK surface
Typed computer actions, event streaming, upload/download helpers and connection leases will follow the runtime API. Versioned packages must be released and tested before an installation command is advertised. No Android APK is currently provided.
