/v1/ai/generateGenerate content
Generate captions, hashtags, ideas, scripts, rewrites or image prompts. content_type (see GET /v1/reference/content_type) sets the caption length, hashtag count, structure and call to action; a template's category is used when it's omitted. Without persona_id the voice is picked automatically: the workspace's voice for the content type, else the platform voice for it, else the workspace default (see GET /v1/personas/voices); persona_id: null writes without a persona. Every generation uses the brand's saved details (brand kit, then the workspace profile: name, Instagram username, website, description, industry); campaign_id adds that campaign's objective, category, landing page and description. The response says which voice wrote it (persona.source) and whether a rule-fixing pass ran (repaired). Uses the workspace's BYOK key when set (no credits), otherwise AI credits per variation at the platform's current rates (credits_charged).
- kindrequired
- "caption" | "hashtags" | "ideas" | "script" | "rewrite" | "image_prompt"caption | hashtags | ideas | script | rewrite | image_prompt
- brief
- stringWhat you want, in a sentence or two
- content_type
- string | nullContent type key, e.g.
education,promo,ugc - persona_id
- anyPersona or platform voice ID. Omit for Auto (voice for the content type); null for no persona
- template_id
- anyStart from a template;
briefmay then be empty - format
- anyTarget format key, e.g.
ig_reel - campaign_id
- string | nullCampaign the copy is for: its objective, category, landing page and description are added to the prompt (404 when outside your workspace or team)
- variables
- objectTemplate variables. Only the ones the template names are used; a request with more than the platform allows is refused (422)
- variations
- integerHow many alternatives to write. Credits are charged for the ones returned
- provider
- stringForce a provider (see
GET /v1/ai/providers); your key for it when you have one, else the platform's - model
- string | objectA specific model:
"provider:model"(e.g."openrouter:anthropic/claude-haiku-5.5") or{ provider, model }. Must be listed byGET /v1/ai/models; credits use that model's multiplier
curl -X POST "https://sqa.coboost.ai/api/v1/ai/generate" \
-H "Authorization: Bearer $COBOOST_API_KEY" \
-H "Content-Type: application/json" \
-d '{"kind":"caption","brief":"Launch post for our vitamin C serum, 20% off this week","content_type":"product_launch","format":"ig_reel","variations":2,"model":"openrouter:anthropic/claude-haiku-5.5"}'{
"object": "ai_generation_result",
"id": "cmf0gen001",
"outputs": [
{
"text": "Glow season starts now. Our vitamin C serum is 20% off this week.",
"hashtags": [
"skincare",
"vitaminc"
],
"cta": "Shop now"
}
],
"provider": "anthropic",
"model": "claude-sonnet-5-5",
"used_byok": false,
"credits_charged": 2,
"persona": {
"id": "cmf0prs101",
"name": "Launch insider",
"source": "platform_type"
},
"content_type": "product_launch",
"repaired": false,
"fallback_used": false
}