Skip to content

The ai resource uses Gemini to generate platform-specific captions and hashtag suggestions. AI features are available on Pro and Business tiers.

Methods

MethodWhat it does
status()Check whether AI is enabled and which model is in use
generateContent(params)Generate a caption per platform
suggestHashtags(params)Suggest hashtags per platform

Check availability

typescript
const { available, model } = await socifyr.ai.status()
//  { available: true, model: 'gemini-2.0-flash' }

Generate captions

typescript
const { content } = await socifyr.ai.generateContent({
  uploadType: 'video',
  platforms: ['instagram', 'linkedin', 'x'],
  title: 'Product launch video',
  description: 'We\'re shipping our new SDK',
  tone: 'professional',
  brandVoice: 'We speak with authority but stay approachable',
})

// content is a map: platform → caption
console.log(content.instagram)
console.log(content.linkedin)
console.log(content.x)

The response shape is { content: Record<string, string> } — one entry per platform you asked for.

Tone options

'professional' | 'casual' | 'humorous' | 'inspirational' | 'informative'

Length constraints

Captions are auto-trimmed to each platform's character limit (e.g. 280 for X, 2200 for Instagram, 3000 for LinkedIn).

Suggest hashtags

typescript
const suggestions = await socifyr.ai.suggestHashtags({
  text: 'Launching our new social media automation SDK',
  platforms: ['instagram', 'x'],
  count: 15,
  existingHashtags: ['#devtools'], // avoid suggesting these
})

//  [
//    { platform: 'instagram', hashtags: ['#socialmedia', '#automation', ...] },
//    { platform: 'x',         hashtags: ['#dev', '#api', ...] },
//  ]

Combining with uploads

typescript
const { content } = await socifyr.ai.generateContent({
  uploadType: 'photo',
  platforms: ['instagram', 'linkedin'],
  description: 'Behind-the-scenes from our team retreat',
})

await socifyr.uploads.photos({
  connections: ['instagram-mybrand', 'linkedin-myhandle'],
  medias: [readFileSync('retreat.jpg')],
  text: content.linkedin, // default caption — Instagram gets its own via platformOptions
  platformOptions: {
    'instagram-mybrand': { text: content.instagram },
  },
})