https://swarms.world/api/token/launch/batch
Creates multiple tokenized agents in a single request. Each item in the batch is launched the same way as the single Token Launch endpoint: minimal agent listing plus token creation on Solana via Jupiter. You can use one private key for all tokens (top-level private_key) or a different key per token (or a mix of both).
Use cases: Launch many agents from one wallet, or from multiple wallets in one call; bulk tokenization with consistent or per-item metadata.
Content type: This endpoint accepts JSON only (application/json). For multipart or file uploads, use the single Token Launch endpoint per token.
Batch size: Minimum 1 token, maximum 50 tokens per request.
Execution: All tokens are processed in parallel. If some items fail (e.g. downstream Add Agent errors), the response uses HTTP 207 Multi-Status and includes both successes and failures in results.
Request
Headers
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token. Use your API key: Bearer YOUR_API_KEY. |
Content-Type | string | Yes | Must be application/json. |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
private_key | string | Conditional | Default private key for all tokens. Required if any token does not provide its own private_key. |
tokens | array | Yes | Array of token definitions (1–50 items). See Token item below. |
tokens):
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name of the agent. Minimum 2 characters. |
description | string | Yes | Description of the agent. Cannot be empty. |
ticker | string | Yes | Token symbol (e.g. MAG, SWARM). 1–10 characters; only letters and numbers. Automatically uppercased. |
private_key | string | No | Overrides the top-level private_key for this token only. Use when different wallets create different tokens. |
image | string | No | Agent/token image. URL (https://... or http://...): used as-is. Base64 (data URL or raw): uploaded to Supabase Storage, then the Supabase URL is sent to Jupiter. Omit for no image. |
private_key at the top level (applies to all tokens that don’t set their own) or set private_key on each token, or mix: some tokens use the default, others override with their own.
Code examples by language
The following table lists the same batch launch request implemented in each language. Use the tabs below to view or copy the code.| Language | Description |
|---|---|
| cURL | Raw HTTP request with curl. |
| Python | Using requests (sync). |
| TypeScript | Using fetch (Node or browser). |
| Rust | Using reqwest (blocking). |
| Go | Using net/http and encoding/json. |
Response
Success – All tokens launched (HTTP 200)
| Field | Type | Description |
|---|---|---|
success | boolean | true when all tokens were launched. |
total | number | Total number of tokens in the batch. |
succeeded | number | Number of tokens that were created successfully. |
failed | number | Number of tokens that failed (0 when status is 200). |
results | array | One entry per token, in index order. Each success entry has the shape below. |
results when that token succeeded):
| Field | Type | Description |
|---|---|---|
success | boolean | Always true. |
index | number | Zero-based index of the token in the request tokens array. |
id | string | UUID of the created agent in the database. |
listing_url | string | Full URL to the agent page, e.g. https://swarms.world/agent/{id}. |
token_address | string | null | Solana mint address of the created token. |
pool_address | string | null | Jupiter pool/config address for the token, when available. |
Partial success – Some tokens failed (HTTP 207)
When at least one token fails (e.g. Add Agent returns an error), the response status is 207 Multi-Status. The body has the same structure as above, with:success:falsesucceeded+failed: counts of successful and failed itemsresults: array of both successful and failed items, sorted byindexfailures: optional array of only the failed items (for convenience)
results when that token failed):
| Field | Type | Description |
|---|---|---|
success | boolean | Always false. |
index | number | Zero-based index of the token in the request tokens array. |
error | string | Error message (e.g. from Add Agent or tokenization). |
Error response body (4xx / 5xx)
Request-level errors (validation, invalid key, insufficient SOL, wrong content type, etc.) return a single error object, not a batch result.| Field | Type | Description |
|---|---|---|
error | string | Short error category (e.g. Validation error, Invalid private key). |
message | string | Human-readable error description. |
details | string | object | Optional; validation details or other context. |
status_code | number | HTTP status code. |
token_index | number | Optional; present for per-token errors (e.g. invalid private key or insufficient SOL) to indicate which token in tokens caused the error. |
results (HTTP 207), not as a single 401 response. The error message in the failed result will indicate authentication failure.
Validation errors (400) for the whole request (e.g. missing private key for all tokens, invalid JSON, or validation failure) include:
| Field | Type | Description |
|---|---|---|
details | object | Often Zod-style fieldErrors for tokens or top-level fields. |
| Field | Type | Description |
|---|---|---|
token_index | number | Index of the token whose creator wallet has insufficient SOL. |
required_sol | number | Minimum required SOL (0.04). |
current_balance_sol | number | Creator wallet balance at time of check. |
HTTP Status Codes
| Code | Meaning |
|---|---|
200 | All tokens launched successfully. |
207 | Multi-Status: at least one token succeeded and at least one failed. Check results (or failures) for per-item outcome. |
400 | Bad request: invalid JSON, validation failed, invalid private key, insufficient SOL for a token, or unsupported content type (e.g. not application/json). Use token_index when present to identify the failing token. |
401 | Unauthorized: missing or invalid API key. (If Add Agent returns 401 for some items, those appear as failed entries in a 207 response.) |
405 | Method not allowed; only POST is accepted. |
429 | Too many requests; daily agent limit exceeded. |
500 | Internal server error. |
Examples
Minimal request – one private key for all tokens
Response examples by status
Output JSON for each HTTP status. Use the tabs to switch between response types.Mixed private keys – default plus overrides
Request with image URL and base64
Notes
-
Private key formats
Same as the single Token Launch API:- JSON array: 64 integers, e.g.
[1,2,3,...,64] - Base64: 64-byte key encoded as base64
- Base58: 64-byte key encoded as base58 (e.g. Phantom export format)
- JSON array: 64 integers, e.g.
-
Ticker
Per token: 1–10 characters, letters and numbers only. Stored and returned in uppercase. -
Image
- URL:
https://...orhttp://...is used as-is. - Base64:
data:image/...;base64,...or raw base64 is uploaded to Supabase Storage; the resulting URL is sent to Jupiter. - Batch endpoint does not support multipart file upload; use the single Token Launch endpoint for file uploads.
- URL:
-
Authentication
Same API key as the rest of the Swarms Platform API. Create and manage keys at https://swarms.world/platform/api-keys. If Add Agent returns 401 for some items, those appear as failed entries in a 207 response with an authentication-related error message. -
Rate limits
Subject to the same daily agent creation limits as Add Agent. Each token in the batch counts toward your limit. See the API Reference for limits and reset behavior. -
Batch size
Minimum 1, maximum 50 tokens per request. For larger batches, send multiple requests. -
Order and indexing
resultsare sorted byindex(the position in the requesttokensarray). Useindexto correlate successes and failures with your input. -
Pre-validation and early exit
Before launching any token, the endpoint validates all private keys and (when RPC is available) checks SOL balance for each creator wallet. If any of these checks fail, the entire request returns 400 withtoken_indexso you can fix that item and retry. -
Downstream behavior
Each token is created via the same Add Agent flow as the single Token Launch endpoint (placeholder agent, default metadata,tokenized_on: true). Failures (e.g. duplicate agent, tokenization error) are reported per item inresultswith HTTP 207.
See also
- Token Launch (single) – Create one token per request; supports JSON and multipart.
- Agents API – Full agent creation API used internally by both launch endpoints.
- API Reference – Overview, authentication, and other endpoints.