# exec()

Canonical URL: https://developers.iagenify.com/fr/sdk/ref/compute/exec/
Language: fr

`api.compute.exec({ storageId, command, timeoutMs? }) → Promise<ComputeResult>`

Run one command in a temporary isolated container and return its output and execution usage.

Status: billed compute · temporary container

```javascript
const result = await api.compute.exec({
  storageId: "YOUR_OBJECT_STORAGE_ID",
  command: "npm run build",
  timeoutMs: 120_000,
});
console.log(result.stdout, result.stderr, result.exitCode);
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `storageId` | string | required | ID of an Object Storage owned by the signed-in account; it is mounted as `/workspace`. |
| `command` | string | required | Command to execute in the isolated container. |
| `timeoutMs` | integer |  | Optional execution timeout in milliseconds, subject to service limits. |

## Result {#result}

The response includes `ok`, `stdout`, `stderr`, `exitCode`, `cpuSeconds` and quota information. A non-zero exit code is a completed command result; runner, storage, quota and timeout failures are returned as API errors.

> **This does not keep a process alive**
>
> The container is for this command. Use [terminals.create()](/fr/sdk/ref/compute/terminals/create) when you need a process to survive the initial request.

```python
result = api.compute.exec(
    storage_id="YOUR_OBJECT_STORAGE_ID",
    command="npm run build",
    timeout_ms=120_000,
)
print(result["stdout"], result["stderr"], result["exitCode"])
```
