POST
/public/enhanceEnhance a prompt using AI-powered optimization.
Required permission:
enhanceRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | The prompt to enhance (1-100,000 chars) |
modality | string | No | Target modality: text, image, video, audio, code, 3d. Default: text |
tone | string | No | Desired tone: professional, casual, academic, creative, technical, friendly |
length | string | No | Detail level: concise, standard, detailed |
maxTokens | integer | No | Maximum tokens for response (1-8192) |
customInstructions | string | No | Additional instructions (max 2000 chars) |
stream | boolean | No | Enable streaming response. Default: false |
Example Request
curl -X POST https://api.promptomize.app/api/v1/public/enhance \
-H "X-API-Key: pk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Write a professional email to schedule a meeting",
"modality": "text",
"tone": "professional",
"length": "standard"
}'Response
Success (200)
{
"enhancedPrompt": "Compose a professional business email...",
"usage": {
"inputTokens": 42,
"outputTokens": 156,
"totalTokens": 198,
"processingMs": 1234
},
"quota": {
"used": 15,
"limit": 100,
"remaining": 85
}
}Error Responses
400 - Validation Error
{
"error": "Validation error",
"code": "VALIDATION_ERROR",
"details": [
{ "field": "prompt", "message": "Required" }
]
}401 - Authentication Error
{
"error": "Invalid API key",
"code": "INVALID_API_KEY",
"message": "The provided API key is invalid, expired, or revoked"
}429 - Rate Limit Exceeded
{
"error": "Rate limit exceeded",
"code": "RATE_LIMIT_EXCEEDED",
"message": "You have exceeded 60 requests per minute",
"retryAfter": 45
}Streaming
Set stream: true to receive the response as Server-Sent Events (SSE).
Stream Events
Token event
data: {"type": "token", "content": "Compose"}Complete event
data: {"type": "complete", "enhancedPrompt": "...", "usage": {...}}Done marker
data: [DONE]