Getting Started with the BlogFlux API
Learn how to integrate BlogFlux into your applications using our REST API.
🔑 Step 1: Get Your API Key
- Log in to your BlogFlux dashboard
- Go to Settings > API Keys
- Click "Generate New API Key"
- Copy and save your key securely
⚠️ Security Warning
Never expose your API key in client-side code or public repositories!
📡 Base URL
https://blogflux.ai/api/v1
🔐 Authentication
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
📝 Example: Generate a Post
cURL
curl -X POST https://blogflux.ai/api/v1/posts/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"topic": "How to train a golden retriever",
"ai_model": "gpt-5-mini",
"language": "en"
}'
Python
import requests
url = "https://blogflux.ai/api/v1/posts/generate"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"topic": "How to train a golden retriever",
"ai_model": "gpt-5-mini",
"language": "en"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
JavaScript (Node.js)
const fetch = require('node-fetch');
const url = 'https://blogflux.ai/api/v1/posts/generate';
const options = {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
topic: 'How to train a golden retriever',
ai_model: 'gpt-5-mini',
language: 'en'
})
};
fetch(url, options)
.then(res => res.json())
.then(data => console.log(data));
✅ Response Format
{
"status": "success",
"data": {
"post_id": "abc123",
"title": "How to Train a Golden Retriever: Complete Guide",
"content": "...",
"status": "completed"
}
}
🔍 Error Codes
| Code | Meaning | Solution |
|---|---|---|
| 400 | Bad Request | Check your request parameters |
| 401 | Unauthorized | Verify your API key |
| 429 | Rate Limit | Wait before retrying |
| 500 | Server Error | Contact support |
📚 Next Steps
For complete API reference with all available endpoints, parameters, and examples, visit our interactive API documentation: