API Endpoint
POST Content Generation API
/api/v1/ai/content/generate
Generate marketing copy, blogs, social captions, and product content from a short prompt.
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
prompt |
string | Required | Instruction or writing prompt |
type |
string | Optional | Content type such as blog_post, social_caption, email |
tone |
string | Optional | Tone style such as professional, friendly, persuasive |
length |
string | Optional | Output size: short, medium, or long |
Example Request
JSON Request
{
"prompt": "Write a launch announcement for our new AI API platform",
"type": "social_caption",
"tone": "professional",
"length": "medium"
}
cURL
curl -X POST https://rsflowhub.com/api/v1/ai/content/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Write a launch announcement for our new AI API platform",
"type": "social_caption",
"tone": "professional",
"length": "medium"
}'
Example Response
JSON Response
{
"success": true,
"data": {
"result": {
"content": "We just launched RS FlowHub APIs to help teams ship AI features faster...",
"word_count": 54
}
},
"meta": {
"credits_used": 3,
"credits_remaining": 996
}
}
SDK Examples
Use the same endpoint with JavaScript, Python, or PHP.
cURL
curl -X POST 'https://rsflowhub.com/api/v1/ai/content/generate' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"prompt": "Write a launch announcement for our new AI API platform",
"type": "social_caption",
"tone": "professional",
"length": "medium"
}'
JavaScript (fetch)
const payload = {
"prompt": "Write a launch announcement for our new AI API platform",
"type": "social_caption",
"tone": "professional",
"length": "medium"
};
const response = await fetch('https://rsflowhub.com/api/v1/ai/content/generate', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify(payload),
});
const data = await response.json();
console.log(data);
Python (requests)
import requests
url = "https://rsflowhub.com/api/v1/ai/content/generate"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"prompt": "Write a launch announcement for our new AI API platform",
"type": "social_caption",
"tone": "professional",
"length": "medium"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
PHP (Laravel HTTP)
use Illuminate\Support\Facades\Http;
$response = Http::withToken('YOUR_API_KEY')
->acceptJson()
->post('https://rsflowhub.com/api/v1/ai/content/generate', array (
'prompt' => 'Write a launch announcement for our new AI API platform',
'type' => 'social_caption',
'tone' => 'professional',
'length' => 'medium',
));
$data = $response->json();
print_r($data);
Production usage
Store both your original prompt and generated output for auditing and quality iteration.
Store both your original prompt and generated output for auditing and quality iteration.