API ReferenceContent
Optimize Title
Generate AI-optimized title alternatives scored for click-through performance.
POST /api/v1/content/optimize-title
Generate AI-optimized title alternatives for your content. Each alternative is scored for click-through potential, keyword placement, and emotional appeal.
Credits: 3 per request
Authentication
X-Soke-Key: sk_live_your_api_keyAuthorization: Bearer your_jwt_tokenRequest Body
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
draftTitle | string | Yes | — | Your draft title to optimize |
platform | string | No | "youtube" | Target platform |
niche | string | No | — | Content niche for context |
keywords | string[] | No | — | Target keywords to incorporate |
keywordsWithScores | object[] | No | — | Keywords with competition data (from keyword research) |
keywordsWithScores[].keyword | string | — | — | The keyword |
keywordsWithScores[].competitionScore | number | — | — | Competition score (0-1) |
keywordsWithScores[].trendDirection | string | — | — | Trend direction |
Example Request
curl -X POST https://api.usesoke.ai/api/v1/content/optimize-title \
-H "Content-Type: application/json" \
-H "X-Soke-Key: sk_live_your_api_key" \
-d '{
"draftTitle": "How to be productive as a developer",
"platform": "youtube",
"niche": "tech",
"keywords": ["developer productivity", "coding tips"]
}'Response
{
"success": true,
"data": {
"originalTitle": "How to be productive as a developer",
"alternatives": [
{
"title": "10 Developer Productivity Hacks That Actually Work",
"score": 87.5,
"reasoning": "Strong number hook, includes target keyword, curiosity gap"
},
{
"title": "Why Most Developers Are Unproductive (And How to Fix It)",
"score": 82.0,
"reasoning": "Negative hook creates curiosity, promises solution"
}
]
},
"meta": {
"platform": "youtube",
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"processing_time_ms": 2100
}
}Error Codes
| Code | Status | Description |
|---|---|---|
BAD_REQUEST | 400 | Missing or invalid draftTitle |
RATE_LIMIT_EXCEEDED | 429 | Rate limit exceeded |
INSUFFICIENT_CREDITS | 402 | Not enough credits |
PLATFORM_NOT_IMPLEMENTED | 501 | Platform not yet supported |