API Reference
The iSocialize AI API lets you generate platform-optimized social media content — captions, posts, hooks, and images — programmatically. One endpoint. Any platform. Any content type.
Authentication#
All API requests require an X-API-Key header. Generate your key at ai.isocialize.me/api-keys.
X-API-Key: isa_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxQuick Start#
Make your first request in under 60 seconds.
curl -X POST "https://ufsovdkahowhttxisneo.supabase.co/functions/v1/api-generate" \
-H "Content-Type: application/json" \
-H "X-API-Key: isa_your_key_here" \
-d '{
"prompt": "Create an engaging caption for a new coffee shop opening",
"platform": "instagram",
"mode": "marketing",
"type": "text"
}'{
"success": true,
"type": "text",
"data": {
"content": "☕ Your morning just got better! Grand opening this Saturday — come taste the difference. Fresh roasts, cozy vibes, and baristas who actually care. 📍 123 Main St\n\n#CoffeeShop #GrandOpening #LocalCoffee #MorningVibes",
"platform": "instagram",
"mode": "marketing"
},
"credits": {
"used": 1,
"remaining": 499
}
}API Reference#
/api-generateGenerate platform-optimized social media content. Either prompt or messages is required. All other fields are optional with sensible defaults.
Text Generation
Costs 1 credit per request. Returns polished text with platform-appropriate hashtags, emojis, and tone.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| prompt | string | required | — | Your content request. Max 5,000 characters. Omit if using messages. |
| platform | string | optional | Target platform — affects tone, length, hashtag strategy, and formatting. | |
| mode | string | optional | social | Content style: social, marketing, personal, or business. |
| type | string | optional | text | Set to "text" for this request type. |
Platform values
instagramtwitterfacebooklinkedintiktokyoutubepinterestthreadsMode values
socialEngagement-focused — hashtags, emojis, conversational hooksmarketingConversion-focused — urgency, call to action, product-forwardpersonalAuthentic, relatable, community-building voicebusinessProfessional, thought leadership, B2B toneImage Generation
Costs 2 credits per request. Returns a base64-encoded PNG data URI, sized appropriately for the target platform.
curl -X POST "https://ufsovdkahowhttxisneo.supabase.co/functions/v1/api-generate" \
-H "Content-Type: application/json" \
-H "X-API-Key: isa_your_key_here" \
-d '{
"prompt": "A vibrant flat lay of workout gear — dumbbells, protein shaker, and running shoes on a clean white surface",
"platform": "instagram",
"type": "image"
}'{
"success": true,
"type": "image",
"data": {
"image_url": "data:image/png;base64,iVBORw0KGgo...",
"prompt": "A vibrant flat lay of workout gear...",
"platform": "instagram"
},
"credits": {
"used": 2,
"remaining": 498
}
}The image_url value is a complete data URI — you can set it directly as an <img> src, or strip the prefix to get raw base64 for storage.
Multi-Turn Conversations
Use messages instead of prompt to iterate on content through conversation — the same way you'd refine a post in a chat interface. Supports up to 50 messages, 10,000 characters each.
{
"messages": [
{
"role": "user",
"content": "Create a caption for my bakery's new croissant flavor"
},
{
"role": "assistant",
"content": "🥐 Meet our newest obsession: Brown Butter Hazelnut Croissant. Layers of golden pastry, a nutty swirl inside, and a crunch that'll stop your scroll. Available starting Friday."
},
{
"role": "user",
"content": "Perfect — now make a shorter version for Twitter"
}
],
"platform": "twitter",
"mode": "social",
"type": "text"
}Response Schemas
All successful responses follow a consistent shape.
{
"success": true, // boolean — always true on 200
"type": "text", // echoes request type
"data": {
"content": "...", // ready-to-post text
"platform": "instagram", // echoed platform
"mode": "marketing" // echoed mode
},
"credits": {
"used": 1, // credits consumed by this request
"remaining": 499 // your balance after this request
}
}{
"success": true,
"type": "image",
"data": {
"image_url": "data:image/png;base64,...", // full data URI
"prompt": "...", // echoed prompt
"platform": "instagram" // echoed platform
},
"credits": {
"used": 2,
"remaining": 498
}
}Errors#
The API uses standard HTTP status codes. All error bodies include an error string.
| Code | Name | Description |
|---|---|---|
| 200 | OK | Request succeeded. |
| 400 | Bad Request | Missing required field, invalid platform value, or malformed JSON. |
| 401 | Unauthorized | Missing or invalid X-API-Key header. |
| 402 | Payment Required | Insufficient credits for this request. |
| 500 | Internal Server Error | Generation failed — retry with exponential backoff. |
{
"error": "Invalid platform",
"valid_platforms": ["instagram","twitter","facebook","linkedin","tiktok","youtube","pinterest","threads"],
"received": "snapchat"
}{ "error": "Invalid API key" }{
"error": "Insufficient credits",
"message": "This request requires 2 credits, you have 1",
"balance": 1,
"required": 2
}For 500 errors, wait at least 1 second and retry. If errors persist, check status.supabase.com or contact info@isocialize.me.
Guides#
n8n / Make.com
Use the HTTP Request node in n8n or Make.com to call the API and pipe the output into your publishing or scheduling workflow.
{
"method": "POST",
"url": "https://ufsovdkahowhttxisneo.supabase.co/functions/v1/api-generate",
"headers": {
"Content-Type": "application/json",
"X-API-Key": "{{ $env.ISOCIALIZE_API_KEY }}"
},
"body": {
"prompt": "{{ $json.prompt }}",
"platform": "{{ $json.platform }}",
"mode": "social",
"type": "text"
}
}Python
import os
import requests
API_KEY = os.environ["ISOCIALIZE_API_KEY"]
ENDPOINT = "https://ufsovdkahowhttxisneo.supabase.co/functions/v1/api-generate"
def generate(prompt: str, platform: str = "instagram", mode: str = "social", content_type: str = "text") -> dict:
response = requests.post(
ENDPOINT,
headers={
"Content-Type": "application/json",
"X-API-Key": API_KEY,
},
json={
"prompt": prompt,
"platform": platform,
"mode": mode,
"type": content_type,
},
timeout=30,
)
response.raise_for_status()
return response.json()
# Generate a caption
result = generate(
prompt="Coffee shop grand opening this Saturday",
platform="instagram",
mode="marketing",
)
print(result["data"]["content"])
print(f"Credits remaining: {result['credits']['remaining']}")Node.js / TypeScript
const ENDPOINT = "https://ufsovdkahowhttxisneo.supabase.co/functions/v1/api-generate";
interface GenerateOptions {
prompt: string;
platform?: "instagram" | "twitter" | "facebook" | "linkedin" | "tiktok" | "youtube" | "pinterest" | "threads";
mode?: "social" | "marketing" | "personal" | "business";
type?: "text" | "image";
}
async function generate(options: GenerateOptions) {
const res = await fetch(ENDPOINT, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": process.env.ISOCIALIZE_API_KEY!,
},
body: JSON.stringify(options),
});
if (!res.ok) {
const err = await res.json();
throw new Error(err.error || `HTTP ${res.status}`);
}
return res.json();
}
// Usage
const result = await generate({
prompt: "Write a thought leadership post about remote work trends",
platform: "linkedin",
mode: "business",
});
console.log(result.data.content);
console.log(`Credits remaining: ${result.credits.remaining}`);Rate Limits & Credits#
| Plan | Text / month | Images / month | Price |
|---|---|---|---|
| Free | ~150 (5/day) | ~60 (2/day) | $0 |
| iSocialize Ai Creator | 300 | 15 | $9.99/mo |
| iSocialize Ai Pro | 1,000 | 100 | $19.99/mo |
Each API call deducts credits from your account balance. Text generation costs 1 credit; image generation costs 2 credits. Credits are shared across the web app and API. Manage your API keys at ai.isocialize.me/api-keys.
OpenAPI Schema#
A complete OpenAPI 3.0 schema is available for use with Postman, Insomnia, code generators, or LLM tooling.
https://ai.isocialize.me/openapi.json