- Authenticate: Secure your requests with an API key or Supabase session token.
- Create, Update, or Query Agents: Use the endpoints below to add, modify, or search agents.
- Get Results or Listings: Instantly receive confirmation, your agent listing URL, or search results.
Step 1: Authentication
All agent management actions require authentication using one of these methods:- API Key: Send your API key in the
Authorizationheader asBearer <your-api-key>. - Supabase Session: Provide your Supabase session token in the
Authorizationheader.
Base URL
Step 2: Create an Agent
It’s quick and easy to create your own agent in the marketplace.Endpoint
Input schema (Add Agent)
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name (min 2 characters) |
agent | string | No | Agent code/content (min 5 characters if provided); can be null |
language | string | No | Programming or script language |
description | string | Yes | Description of the agent |
requirements | array | No | Dependencies; each { "package": string, "installation": string } |
useCases | array | Yes | Use cases; each { "title": string, "description": string } |
tags | string | No | Comma-separated tags (min 2 characters if provided) |
is_free | boolean | No | Default true |
price_usd | number | If paid | Required when is_free is false; must be > 0 |
category | string | No | Optional category |
status | string | No | 'pending' | 'approved' | 'rejected'; default 'pending' |
tokenized_on | boolean | No | Enable tokenization on Solana |
ticker | string | If tokenized | Required when tokenized_on is true; uppercase alphanumeric; max 10 characters |
image_url | string | No | Public image URL (valid URL or empty string) |
file_path | string | No | Storage path for image (alternative to image_url) |
image_base64 | string | No | Base64-encoded image (alternative to image_url; may include data:image/...;base64, prefix) |
links | array | No | Array of strings or { "name": string, "url": string } |
seller_wallet_address | string | No | Seller wallet address |
x402_url | string | No | x402 payment URL (valid URL or empty string) |
mcp_url | string | No | MCP server URL (valid URL or empty string) |
creator_wallet | string | If tokenized | Creator wallet public key; required when tokenized_on is true |
private_key | string | If tokenized | Private key for signing (JSON array or base64); required when tokenized_on is true |
Request Body (detailed)
Just provide the necessary agent details:The name of the agent (minimum 2 characters)
Agent code/content (minimum 5 characters if provided); can be null
A detailed description of what the agent does
Programming language used (e.g., “python”, “javascript”)
An array of package requirements
An array of use cases showing what your agent can do
Comma-separated tags (minimum 2 characters if provided)
Whether the agent is free or paid
Price in USD (required if
is_free is false, minimum: 0.01)The agent’s category (e.g., “data-science”, “automation”)
The status of the agent (pending, approved, rejected)
Public image URL (valid URL or empty string)
Storage path for image (alternative to
image_url)Base64-encoded image (alternative to
image_url; can include data:image/...;base64, prefix)Links: array of strings or
{ "name": string, "url": string } (e.g. website, twitter, telegram for token metadata)Seller wallet address
x402 payment URL (valid URL or empty string)
MCP server URL (valid URL or empty string)
Enable tokenization on Solana
Required when
tokenized_on is true; uppercase letters and numbers only; max 10 charactersCreator wallet public key; required when
tokenized_on is truePrivate key for signing (JSON array or base64); required when
tokenized_on is trueValidation rules
- Paid agents: When
is_freeisfalse,price_usdis required and must be > 0. - Tokenization: When
tokenized_onistrue,ticker,creator_wallet, andprivate_keyare required; ticker must be uppercase alphanumeric, max 10 characters. - Duplicate: Same name and same
agentcontent for the same user returns 400 withexistingId.
Success response (200)
On success, you’ll immediately get:tokenized is true and token_address and pool_address are set.
Output schema (Add Agent — success)
| Field | Type | Description |
|---|---|---|
success | boolean | true on success |
id | string | UUID of the created agent |
listing_url | string | URL to the agent listing (e.g. https://swarms.world/agent/{id}) |
tokenized | boolean | Whether the agent was tokenized |
token_address | string | null | Solana token address (when tokenized) |
pool_address | string | null | Liquidity pool address (when tokenized) |
Error responses (Add Agent)
- 400 – Validation:
error,message,details,errors,status_code. Content validation: alsotrustworthiness,contentQuality. Duplicate agent:existingId. Tokenization failed: standard 400 shape. - 401 –
error,message,details,how_to_get_key,status_code. - 429 –
error,message,details,currentUsage,limits,resetTime,status_code. - 500 – Server/database/price conversion/tokenization error:
error,message,details,status_code(may includehint,codefor DB errors).
Error output schema (common fields)
| HTTP | Field | Type | Description |
|---|---|---|---|
| All | error | string | Short error message |
| All | message | string | Detailed description |
| All | code | string | Error code (e.g. VALIDATION_ERROR) |
| All | details | string | Optional extra context |
| All | status_code | number | HTTP status code |
| 400 | errors | object | Validation errors by field |
| 400 | existingId | string | Existing agent ID (duplicate) |
| 400 | trustworthiness | number | Content trust score (content validation) |
| 400 | contentQuality | number | Content quality score (content validation) |
| 401 | how_to_get_key | string | Instructions to obtain API key |
| 429 | currentUsage | object | Current usage counts |
| 429 | limits | object | Rate limit values |
| 429 | resetTime | string | ISO timestamp when limit resets |
| 500 | hint | string | Optional DB/system hint (DB errors may also include a code field) |
Example Request
Step 3: Update or Query Agents
You can easily change agent info or search/filter agents—just as effortlessly as creating one!Update Agent
Endpoint
Request Body
All fields from the create agent endpoint are available, plus:The unique ID of the agent you want to update
Example Request
Success Response
Query Agents
Endpoint
Request Body
Keyword to match agent names/descriptions
Filter by category (case-insensitive)
Filter by price: “all”, “free”, or “paid”
Filter by user ID
Sort order: “newest”, “oldest”, “popular”, or “rating”
Number of agents to return (1-100)
Offset for pagination
Example Request
Example Response
Rate Limiting
All agent management endpoints are subject to rate limiting:- Daily Limit: 500 agents per user per day
- Reset Time: Midnight UTC
429 error response:
Error Responses
The API uses standard HTTP status codes to signal errors:200: Success400: Bad Request (validation errors)401: Unauthorized403: Forbidden (content validation failed)404: Not Found429: Too Many Requests500: Internal Server Error
Example Error Response
All endpoints return consistent error responses:details, errors, and status_code. Duplicate agent responses include existingId. Rate limit (429) responses include currentUsage, limits, and resetTime. Authentication (401) responses may include how_to_get_key.
Content Validation
Every agent undergoes automated checks, including:- Duplicate Detection: Same name and same
agentcontent for the same user returns 400 withexistingId - Quality Assessment: Checks code completeness and standards
- Security Scanning: Ensures code is safe
- Trustworthiness Scoring: Rates each agent on quality and trust (content validation responses may include
trustworthiness,contentQuality)
403 Forbidden or 400 Bad Request with detailed reasons.
In summary: you can create, edit, or search for agents in the Swarms marketplace in just 3 easy steps!