Instagram caption generator API
Describe your post, pick a tone and length, and get three caption drafts to edit, or start from the caption formula and ten templates below.
- Endpoint:
POST https://postboost.co/app/api/tools/instagram-caption-generator(operationIdgenerateCaption) - Web tool: postboost.co/tools/instagram-caption-generator
- Also on the web: TikTok caption generator (
network: "tiktok"), LinkedIn post generator (network: "linkedin",format: "post") - Token: required. A new generation spends 1 AI credit of the workspace you name (or your active workspace); a repeated identical request is answered from the cache for free. A scoped API key needs the
aiability and pays with its own workspace - MCP: tool
generate-captiononhttps://postboost.co/mcp/tools(listed only with a token)
Request
| Field | Type | Default | Description |
|---|---|---|---|
text | string | What the post is about. | |
tone | string: friendly, professional, playful, inspirational, bold | "friendly" | |
length | string: short, medium, long | "medium" | short: 10-20 words, medium: 25-40, long: 45-60. |
emoji | boolean | true | Use a few fitting emoji. |
hashtags | boolean | false | End each caption with 3-5 relevant hashtags. |
network | string: instagram, tiktok, linkedin, x, threads, facebook | "instagram" | The network the text is written for. |
workspace | string | UUID of the workspace whose AI credits pay for the call. Default: your active workspace (a scoped API key: its own workspace). | |
format | string: caption, post | "caption" | caption: short captions (default). post: long-form posts of 300-600, 600-1,300 or 1,300-2,000 characters by length, with at most 3 hashtags; network linkedin only. |
Call it
- curl
- Python
- Node.js
- PHP
- Go
- Ruby
- Java
- C#
- Rust
- CLI
curl -X POST https://postboost.co/app/api/tools/instagram-caption-generator \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"text":"Weekend sale on all candles","network":"instagram","tone":"playful","hashtags":true}'
from postboost import ApiClient, Configuration
from postboost.api.free_tools_api import FreeToolsApi
from postboost.models import FreeToolGenerateCaptionRequest
with ApiClient(Configuration()) as client:
api = FreeToolsApi(client)
result = api.generate_caption(FreeToolGenerateCaptionRequest.from_dict({"text": "Weekend sale on all candles", "network": "instagram", "tone": "playful", "hashtags": True}))
print(result.to_dict())
import { FreeToolsApi } from 'postboost';
const api = new FreeToolsApi();
const { body } = await api.generateCaption({ text: "Weekend sale on all candles", network: "instagram", tone: "playful", hashtags: true });
console.log(body);
use PostBoostClient\Api\FreeToolsApi;
use PostBoostClient\Model\FreeToolGenerateCaptionRequest;
$api = new FreeToolsApi(new GuzzleHttp\Client());
$result = $api->generateCaption(new FreeToolGenerateCaptionRequest(['text' => "Weekend sale on all candles", 'network' => "instagram", 'tone' => "playful", 'hashtags' => true]));
echo $result;
import (
"context"
"encoding/json"
"fmt"
postboost "github.com/postboost-co/postboost-go"
)
var request postboost.FreeToolGenerateCaptionRequest
if err := json.Unmarshal([]byte(`{"text":"Weekend sale on all candles","network":"instagram","tone":"playful","hashtags":true}`), &request); err != nil {
panic(err)
}
client := postboost.NewAPIClient(postboost.NewConfiguration())
result, _, err := client.FreeToolsAPI.GenerateCaption(context.Background()).FreeToolGenerateCaptionRequest(request).Execute()
fmt.Println(result, err)
require 'postboost'
api = PostBoost::FreeToolsApi.new
result = api.generate_caption(PostBoost::FreeToolGenerateCaptionRequest.new({ text: "Weekend sale on all candles", network: "instagram", tone: "playful", hashtags: true }))
puts result.to_hash
import com.postboost.ApiClient;
import com.postboost.api.FreeToolsApi;
import com.postboost.model.FreeToolGenerateCaptionRequest;
import com.postboost.model.FreeToolGenerateCaptionResponse;
FreeToolsApi api = new FreeToolsApi(new ApiClient());
FreeToolGenerateCaptionRequest request = FreeToolGenerateCaptionRequest.fromJson("{\"text\":\"Weekend sale on all candles\",\"network\":\"instagram\",\"tone\":\"playful\",\"hashtags\":true}");
FreeToolGenerateCaptionResponse result = api.generateCaption(request);
System.out.println(result.toJson());
using Newtonsoft.Json;
using PostBoost.Client.Api;
using PostBoost.Client.Client;
using PostBoost.Client.Model;
var api = new FreeToolsApi(new Configuration());
var request = JsonConvert.DeserializeObject<FreeToolGenerateCaptionRequest>(@"{""text"":""Weekend sale on all candles"",""network"":""instagram"",""tone"":""playful"",""hashtags"":true}");
var result = await api.GenerateCaptionAsync(request);
Console.WriteLine(result.ToJson());
use postboost::apis::configuration::Configuration;
use postboost::apis::free_tools_api;
use postboost::models::FreeToolGenerateCaptionRequest;
let config = Configuration::new();
let request: FreeToolGenerateCaptionRequest = serde_json::from_str(r##"{"text":"Weekend sale on all candles","network":"instagram","tone":"playful","hashtags":true}"##)?;
let result = free_tools_api::generate_caption(&config, request).await?;
println!("{:?}", result);
echo '{"text":"Weekend sale on all candles","network":"instagram","tone":"playful","hashtags":true}' | ./postboost-cli --content-type application/json generateCaption -
This tool needs a token: send Authorization: Bearer YOUR_API_TOKEN as a default header (how, per SDK).
Response
{
"captions": [
"Candle season just got brighter 🕯️\nEverything is on sale this weekend only. #candles #weekendsale #shopsmall",
"Light up your weekend ✨ All our candles are on sale until Sunday. #candlelover #sale #homedecor",
"Your shelf called. It wants more candles 😄 Weekend sale starts now. #candles #giftideas #weekendvibes"
],
"credits_spent": 1,
"cached": false
}
With MCP
Connect https://postboost.co/mcp/tools (setup) and ask, for example: Write three post captions for a topic with AI (needs a token, spends AI credits) with the PostBoost generate-caption tool.
Errors
| Status | When |
|---|---|
401 | No token, or an invalid one. The body has register_url to create a free account. |
403 | workspace is not a workspace you belong to, or your account has no workspace, or a scoped API key lacks the ai ability or is bound to another workspace (code: insufficient_scope). |
413 | The JSON body is larger than 128 KB. |
422 | A field is invalid; the body lists the errors per field. |
429 | The workspace has no AI credits left this billing cycle (code: ai_credits_exhausted, upgrade_url), or the per-minute limit is reached. |
502 | The AI provider failed or timed out. No credit was spent. |
503 | AI tools are switched off right now. |