AI endpoints
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.
Write captions
Turns a short brief into one caption per platform, in that platform's style and within its limits.
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
}'const res = await fetch("https://postkea.com/api/v1/ai/write", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
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,
}),
});
const { data: out } = await res.json();
console.log(out);import os, requests
r = requests.post(
"https://postkea.com/api/v1/ai/write",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"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,
},
)
out = r.json()["data"]
print(out)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.
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"
}'const res = await fetch("https://postkea.com/api/v1/ai/rewrite", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
text: "Our new glaze collection is now available in the online shop for everyone.",
action: "punchier",
platform: "x",
}),
});
const { data: out } = await res.json();
console.log(out);import os, requests
r = requests.post(
"https://postkea.com/api/v1/ai/rewrite",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"text": "Our new glaze collection is now available in the online shop for everyone.",
"action": "punchier",
"platform": "x",
},
)
out = r.json()["data"]
print(out)Adapt for each platform
Turns one long text, such as a blog post or a transcript, into a version for each platform.
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"
]
}'const res = await fetch("https://postkea.com/api/v1/ai/repurpose", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
text: "Long blog post text...",
platforms: ["linkedin", "threads", "bluesky"],
}),
});
const { data: out } = await res.json();
console.log(out);import os, requests
r = requests.post(
"https://postkea.com/api/v1/ai/repurpose",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"text": "Long blog post text...",
"platforms": ["linkedin", "threads", "bluesky"],
},
)
out = r.json()["data"]
print(out)Translate
Translates into up to 20 languages at once and keeps hashtags, mentions, links and emojis intact.
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"
]
}'const res = await fetch("https://postkea.com/api/v1/ai/translate", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
text: "Doors open at 6. Bring a friend. #openstudio",
languages: ["de", "pt-BR", "ja"],
}),
});
const { data: out } = await res.json();
console.log(out);import os, requests
r = requests.post(
"https://postkea.com/api/v1/ai/translate",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"text": "Doors open at 6. Bring a friend. #openstudio",
"languages": ["de", "pt-BR", "ja"],
},
)
out = r.json()["data"]
print(out)Suggest hashtags
Relevant hashtags for a text, tuned to the platform.
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"
}'const res = await fetch("https://postkea.com/api/v1/ai/hashtags", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
text: "Handmade stoneware mugs, fired in a wood kiln",
count: 8,
platform: "instagram",
}),
});
const { data: out } = await res.json();
console.log(out);import os, requests
r = requests.post(
"https://postkea.com/api/v1/ai/hashtags",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"text": "Handmade stoneware mugs, fired in a wood kiln",
"count": 8,
"platform": "instagram",
},
)
out = r.json()["data"]
print(out)Suggest replies
Reply suggestions for a comment, in your brand voice. The inbox uses this.
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"
}'const res = await fetch("https://postkea.com/api/v1/ai/replies", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
comment: "Do you ship to Canada?",
post: "New mugs are in the shop",
tone: "friendly",
}),
});
const { data: out } = await res.json();
console.log(out);import os, requests
r = requests.post(
"https://postkea.com/api/v1/ai/replies",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"comment": "Do you ship to Canada?",
"post": "New mugs are in the shop",
"tone": "friendly",
},
)
out = r.json()["data"]
print(out)Brainstorm ideas
Post ideas for a topic, which you can save to the ideas board.
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"
}'const res = await fetch("https://postkea.com/api/v1/ai/ideas", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
topic: "behind the scenes of a pottery studio",
platform: "tiktok",
audience: "beginners",
}),
});
const { data: out } = await res.json();
console.log(out);import os, requests
r = requests.post(
"https://postkea.com/api/v1/ai/ideas",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"topic": "behind the scenes of a pottery studio",
"platform": "tiktok",
"audience": "beginners",
},
)
out = r.json()["data"]
print(out)Summarize text
Summary, key points, topics, takeaways and sentiment of any text, up to 400,000 characters.
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"
}'const res = await fetch("https://postkea.com/api/v1/ai/summarize", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
text: "Full text of an article or transcript...",
prompt: "Focus on pricing",
}),
});
const { data: out } = await res.json();
console.log(out);import os, requests
r = requests.post(
"https://postkea.com/api/v1/ai/summarize",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"text": "Full text of an article or transcript...",
"prompt": "Focus on pricing",
},
)
out = r.json()["data"]
print(out)Describe an image
Alt text for an image, for screen readers and for networks that support alt text.
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"
}'const res = await fetch("https://postkea.com/api/v1/ai/alt-text", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
imageUrl: "https://cdn.example.com/kiln-1.jpg",
}),
});
const { data: out } = await res.json();
console.log(out);import os, requests
r = requests.post(
"https://postkea.com/api/v1/ai/alt-text",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"imageUrl": "https://cdn.example.com/kiln-1.jpg",
},
)
out = r.json()["data"]
print(out)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.
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"
}'const res = await fetch("https://postkea.com/api/v1/ai/image", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "A flat illustration of a kea parrot holding a small ceramic cup, soft morning light",
size: "1024x1536",
}),
});
const { data: out } = await res.json();
console.log(out);import os, requests
r = requests.post(
"https://postkea.com/api/v1/ai/image",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"prompt": "A flat illustration of a kea parrot holding a small ceramic cup, soft morning light",
"size": "1024x1536",
},
)
out = r.json()["data"]
print(out)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.
{
"success": true,
"data": {
"text": "claude",
"images": true,
"speechToText": true
}
}credits is 0 whenever engine is basic.