AI endpoints

Writing tools that know each network's style and limits: captions per platform, rewrites, translations, hashtags, reply suggestions, ideas, summaries, alt text and images. Every endpoint needs the ai scope.

Overview

All AI endpoints take JSON and answer with the result plus engine (which engine answered) and credits (what it cost). Summaries of videos and posts live in Scraping, for example youtube.summarize.

EndpointDescriptionCredits
POST /v1/ai/writeWrite captions1
POST /v1/ai/rewriteRewrite text1
POST /v1/ai/repurposeAdapt for each platform1
POST /v1/ai/translateTranslate1
POST /v1/ai/hashtagsSuggest hashtags1
POST /v1/ai/repliesSuggest replies1
POST /v1/ai/ideasBrainstorm ideas1
POST /v1/ai/summarizeSummarize text2
POST /v1/ai/alt-textDescribe an image1
POST /v1/ai/imageGenerate an image5

Write captions

Turns a short brief into one caption per platform, in that platform's style and within its limits.

NameTypeDescription
briefrequiredstringWhat the post is about, in your own words. Up to 20,000 characters.
platformsstring[]Platform ids to write for.Default: ["x"]
tonestringFor example warm, formal, playful.
languagestringLanguage to write in, for example es.
hashtagsbooleanInclude hashtags where the platform uses them.Default: true
emojisbooleanAllow emojis.Default: true
lengthshort | medium | longHow long the captions should be.Default: medium
variantsinteger, 1 to 5Versions to write per platform.Default: 1
curl -X POST "https://postkea.com/api/v1/ai/write" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "brief": "We open a second studio in Lisbon on 1 December. Free wheel classes the first week.",
  "platforms": [
    "instagram",
    "linkedin",
    "x"
  ],
  "tone": "warm",
  "variants": 2
}'

Rewrite text

Changes existing text: make it shorter or longer, more casual or formal, fix grammar, make it punchier, add a hook, simplify, add emojis, or follow your own instruction.

NameTypeDescription
textrequiredstringThe text to rewrite.
actionrequiredshorten | expand | casual | formal | fix | punchier | hook | simplify | emoji | customWhat to do. custom follows instruction.
instructionstringYour own instruction, for example rewrite for a younger audience.
platformstringKeep the result within this platform's limits.
curl -X POST "https://postkea.com/api/v1/ai/rewrite" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "text": "Our new glaze collection is now available in the online shop for everyone.",
  "action": "punchier",
  "platform": "x"
}'

Adapt for each platform

Turns one long text, such as a blog post or a transcript, into a version for each platform.

NameTypeDescription
textrequiredstringThe source text.
platformsrequiredstring[]Platform ids, up to 20.
tonestringTone for every version.
curl -X POST "https://postkea.com/api/v1/ai/repurpose" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "text": "Long blog post text...",
  "platforms": [
    "linkedin",
    "threads",
    "bluesky"
  ]
}'

Translate

Translates into up to 20 languages at once and keeps hashtags, mentions, links and emojis intact.

NameTypeDescription
textrequiredstringThe text to translate.
languagesrequiredstring[]Target languages as BCP 47 codes, for example de, pt-BR, zh-Hans.
platformstringKeep each translation within this platform's limits.
curl -X POST "https://postkea.com/api/v1/ai/translate" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "text": "Doors open at 6. Bring a friend. #openstudio",
  "languages": [
    "de",
    "pt-BR",
    "ja"
  ]
}'

Suggest hashtags

Relevant hashtags for a text, tuned to the platform.

NameTypeDescription
textrequiredstringThe post or topic.
countinteger, 1 to 30How many hashtags.Default: 10
platformstringPlatform the hashtags are for.
curl -X POST "https://postkea.com/api/v1/ai/hashtags" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "text": "Handmade stoneware mugs, fired in a wood kiln",
  "count": 8,
  "platform": "instagram"
}'

Suggest replies

Reply suggestions for a comment, in your brand voice. The inbox uses this.

NameTypeDescription
commentrequiredstringThe comment to answer.
poststringThe post it was left on, for context.
tonestringTone of the replies.
brandVoicestringA short description of how your brand talks.
countinteger, 1 to 5How many suggestions.Default: 3
curl -X POST "https://postkea.com/api/v1/ai/replies" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "comment": "Do you ship to Canada?",
  "post": "New mugs are in the shop",
  "tone": "friendly"
}'

Brainstorm ideas

Post ideas for a topic, which you can save to the ideas board.

NameTypeDescription
topicrequiredstringWhat to brainstorm about.
countinteger, 1 to 20How many ideas.Default: 8
platformstringPlatform the ideas are for.
audiencestringWho the posts are for.
curl -X POST "https://postkea.com/api/v1/ai/ideas" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "topic": "behind the scenes of a pottery studio",
  "platform": "tiktok",
  "audience": "beginners"
}'

Summarize text

Summary, key points, topics, takeaways and sentiment of any text, up to 400,000 characters.

NameTypeDescription
textrequiredstringThe text, at least 20 characters.
titlestringTitle, for context.
promptstringExtra instructions, for example focus on pricing.
languagestringLanguage of the summary.
curl -X POST "https://postkea.com/api/v1/ai/summarize" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "text": "Full text of an article or transcript...",
  "prompt": "Focus on pricing"
}'

Describe an image

Alt text for an image, for screen readers and for networks that support alt text.

NameTypeDescription
imageUrlrequiredurlPublic URL of the image.
curl -X POST "https://postkea.com/api/v1/ai/alt-text" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "imageUrl": "https://cdn.example.com/kiln-1.jpg"
}'

Generate an image

Creates an image from a description and saves it to the media library. The response has the library item, ready to post.

NameTypeDescription
promptrequiredstringWhat the image should show.
size1024x1024 | 1024x1536 | 1536x1024Square, portrait or landscape.Default: 1024x1024
curl -X POST "https://postkea.com/api/v1/ai/image" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "A flat illustration of a kea parrot holding a small ceramic cup, soft morning light",
  "size": "1024x1536"
}'

Engines and availability

Text features are written by the AI engine. GET /v1/ai/status tells you which features this server can run: text is ai or basic, and images and speechToText say whether image generation and audio transcription are available.

GET /v1/ai/status
{
  "success": true,
  "data": {
    "text": "claude",
    "images": true,
    "speechToText": true
  }
}
When a server has no AI service configured, text endpoints fall back to a simple built in engine. Its answers are plainer, and they cost nothing: credits is 0 whenever engine is basic.