---
title: "Create Swarm"
method: POST
path: "/api/swarms"
tags: ["swarms"]
---

# Create Swarm

`POST /api/swarms`

## Request

- Base URL: `https://api.maritime.sh` (the document declares no server; this is the origin it was published from)
- URL: `https://api.maritime.sh/api/swarms`
- Auth: HTTP bearer

Starts a run of ``count`` sandboxes (or one per input), each running the command.

Swarms are invite-only: an account without access gets 403.

## Headers

- `Idempotency-Key` string, nullable

## Request body

- SwarmIn
  - `name` string, nullable
  - `template` string, nullable
  - `image` string, nullable
  - `size` SizeIn
    - `vcpus` integer
    - `memoryGb` integer
  - `count` integer, nullable
  - `command` union, required
    - string
    - string[]
  - `inputs` InputIn[], nullable
    - `args` string[]
    - `env` object
    - `files` object
  - `timeoutSeconds` integer
  - `concurrency` integer, nullable
  - `resultPath` string, nullable
  - `idempotencyKey` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/maritime/apis/maritime-api.md) - [All operations](https://skmtc.dev/maritime/apis/maritime-api/llms.txt) - [OpenAPI document](https://skmtc.dev/maritime/apis/maritime-api/revisions/acd712090ad6?raw)
