Authentication
All prompt management endpoints require authentication using one of the following methods:- API Key: Include your API key in the
Authorizationheader asBearer <your-api-key> - Supabase Session: Include your Supabase session token in the
Authorizationheader
Base URL
Create Prompt
Create a new prompt in the marketplace.Endpoint
Input schema (Add Prompt)
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name (min 2 characters) |
prompt | string | Yes | Prompt content (min 5 characters) |
description | string | No | Optional description |
useCases | array | Yes | At least one use case; each { "title": string, "description": string } |
tags | string | Yes | Comma-separated tags (min 2 characters) |
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 |
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)
The name of the prompt (minimum 2 characters)
The prompt content (minimum 5 characters)
A detailed description of what the prompt does and when to use it
An array of use cases demonstrating the prompt’s applications
Comma-separated tags (minimum 2 characters)
Whether the prompt is free or paid
Price in USD (required if
is_free is false, minimum: 0.01)The category of the prompt (e.g., “content”, “code”, “analysis”)
The status of the prompt (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
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 prompts: 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.
Success response (200)
tokenized is true and token_address and pool_address are set.
Output schema (Add Prompt — success)
| Field | Type | Description |
|---|---|---|
success | boolean | true on success |
id | string | UUID of the created prompt |
listing_url | string | URL to the prompt listing (e.g. https://swarms.world/prompt/{id}) |
tokenized | boolean | Whether the prompt was tokenized |
token_address | string | null | Solana token address (when tokenized) |
pool_address | string | null | Liquidity pool address (when tokenized) |
Error responses (Add Prompt)
- 400 – Validation:
error,message,details,errors,status_code. Content validation: alsotrustworthiness,contentQuality. Duplicate:existingId. Tokenization failed: standard 400 shape. - 401 –
error,message,details,how_to_get_key,status_code(e.g. API key missing, invalid/expired, user not found). - 429 –
error,message,details,currentUsage,limits,resetTime,status_code. - 500 – Server/database/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 prompt 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
Update Prompt
Update an existing prompt in the marketplace.Endpoint
Request Body
All fields from the create prompt endpoint are available, plus:The unique identifier of the prompt to update
Response
Example Request
Query Prompts
Search and filter prompts in the marketplace.Endpoint
Request Body
Search query to match against prompt names and descriptions (max 100 characters)
Filter by category (case-insensitive, max 50 characters)
Filter by price type: “all”, “free”, or “paid”
Filter by specific user ID
Sort order: “newest”, “oldest”, “popular”, or “rating”
Number of results to return (min: 1, max: 100)
Number of results to skip for pagination (min: 0)
Response
Example Request
Query Parameters Explained
- search: Searches in both the prompt name and description fields
- category: Filters results to only show prompts in the specified category
- priceFilter:
'all': Shows both free and paid prompts'free': Shows only prompts whereis_freeis true'paid': Shows only prompts whereis_freeis false
- sortBy:
'newest': Sorts by creation date, newest first'oldest': Sorts by creation date, oldest first'popular': Sorts by popularity metrics'rating': Sorts by average user rating
Rate Limiting
All prompt management endpoints are subject to rate limiting:- Daily Limit: 500 prompts per user per day
- Reset Time: Midnight UTC
- Free Content Limit: 500 free prompts per day
- Paid Content Limit: 500 paid prompts per day
429 error response:
Error Responses
The API returns standard HTTP status codes:200: Success400: Bad Request (validation errors)401: Unauthorized (authentication required)403: Forbidden (content validation failed)404: Not Found429: Too Many Requests (rate limit exceeded)500: Internal Server Error
Example Error Response
All endpoints return consistent error responses:details, errors, and status_code. Duplicate content responses include existingId. Rate limit (429) responses include currentUsage, limits, and resetTime. Authentication (401) responses may include how_to_get_key.
Common Validation Errors
- Prompt name less than 2 characters
- Prompt content less than 5 characters
- Invalid URL format for
image_urlor links - Missing
price_usdwhenis_freeis false - Invalid use case format (missing title or description)
- Duplicate content: response includes
existingIdwith the existing prompt ID - Tokenization: when
tokenized_onis true, missing or invalidticker,creator_wallet, orprivate_key
Content Validation
All prompts undergo automatic validation for:- Duplicate Detection: Same prompt content for the same user returns 400 with
existingId - Quality Assessment: Evaluates prompt clarity and completeness (responses may include
trustworthiness,contentQuality) - Content Safety: Ensures prompts don’t contain harmful or inappropriate content
- Trustworthiness Scoring: Assigns a score based on various quality factors
403 Forbidden or 400 Bad Request response with details about the validation failure.
Validation Response Example (duplicate)
Price Conversion
When you submit a prompt withprice_usd, the system automatically converts it to SOL (Solana) based on the current market price. The converted price is stored in the price field.
Example:
- You set
price_usd: 10.00 - Current SOL price: $200
- Calculated
price: 0.05 SOL
Database Schema
Prompts are stored with the following key fields:Using Marketplace Prompts with Agents
Once you have a prompt in the marketplace, you can use it with any agent by specifying themarketplace_prompt_id in the agent configuration. The Swarms API will automatically retrieve the prompt from the marketplace and apply it to your agent.
How It Works
- Query the marketplace to find a suitable prompt using the Query Prompts endpoint
- Copy the prompt’s
idfrom the response - Use the
marketplace_prompt_idfield in your agent configuration - The system automatically retrieves and applies the prompt to your agent
Example: Using a Marketplace Prompt
Direct Usage with Known Prompt ID
If you already know the prompt ID, you can use it directly:Important Notes
- When
marketplace_prompt_idis provided, it takes precedence over thesystem_promptfield - The prompt is automatically retrieved from the marketplace and applied to the agent
- You don’t need to manually fetch or pass the prompt content
- Both free and paid marketplace prompts can be used with agents
- For more details on agent configuration, see the Agent Completions Reference