> ## Documentation Index
> Fetch the complete documentation index at: https://docs.boat.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Fail fast

> Get an answer in about 1.5 seconds when no machine of your type is ready, and fall back right away.

These four calls put the sandbox on a machine that is already running and waiting:

* Create a sandbox.
* Deploy from a named snapshot.
* Fork.
* Resume.

They usually get a machine in less than one second. A burst can use all the ready machines of one type. Then the next calls wait while Boat builds new machines.

## Use fail fast

If you prefer to fall back to something else instead of waiting, pass `failFast` to any of these calls. The call then answers in about 1.5 seconds with one of two results:

| Result | What it means |
| - | - |
| `202` | The usual answer. The sandbox is on a machine that was ready. |
| `503` `no_ready_machine` | Nothing started. See below. |

When you get `503` `no_ready_machine`:

* Boat does not create a sandbox or a fork. A resumed sandbox stays stopped.
* You pay nothing.
* The attempt does not count against your [start limits](/pricing).
* Retry, or fall back, immediately.

<CodeGroup>
  ```bash CLI theme={null}
  boat new --fail-fast --type large
  boat new --fail-fast --from ci-runner
  boat fork --fail-fast bx_23456789
  boat resume --fail-fast bx_23456789
  ```

  ```bash curl theme={null}
  curl -sS -X POST "https://boat.dev/api/v1/sandboxes" \
    -H "Authorization: Bearer $BOAT_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"failFast":true,"from":"ci-runner"}'
  # same field on POST /sandboxes/{id}/fork and /sandboxes/{id}/resume
  ```

  ```ts TypeScript theme={null}
  try {
    const created = await sandbox.create({ failFast: true, from: "ci-runner" });
    // also: sandbox.fork({ sandboxId, failFast: true }), sandbox.resume({ sandboxId, failFast: true })
  } catch (error) {
    // 503 no_ready_machine: nothing was started; fall back or retry.
  }
  ```

  ```python Python theme={null}
  try:
      created = sandbox.create(CreateSandboxRequest(fail_fast=True, var_from="ci-runner"))
  except ApiException as error:
      # 503 no_ready_machine: nothing was started; fall back or retry.
      pass
  ```
</CodeGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.