Build on AI Kraft
The public API gives third-party tools — Zapier, n8n, custom scripts, your own backend — programmatic access to AI Kraft's content generation, history, repurpose engine, and brand profiles. Every endpoint speaks JSON, authenticates with a bearer token, and returns standard HTTP status codes.
Base URL
https://aikraft.app/api/v1Authentication
Every request must include an Authorization header with your API key as a bearer token.
bashAuthorization: Bearer kraft_sk_aBcDeFgHiJk...
Create and manage keys in Settings → Developer. The plain key is shown once on creation — store it in a password manager or your app's env vars.
Each key has a list of permissions that gate which endpoints it can call:
generate— call POST /generateread:history— call GET /historyrepurpose— call POST /repurposeread:brand— call GET /brandpublish— reserved for future direct-publish endpoints
Rate limits
Limits are per-workspace, not per-key. Multiple keys for the same workspace share the same bucket.
| Plan | Requests / minute |
|---|---|
| Starter | 60 |
| Growth | 300 |
| Agency | 1,000 |
Hitting the limit returns 429 Too Many Requests with Retry-After, X-RateLimit-Limit, and X-RateLimit-Remaining headers.
Endpoints
/generateperm: generate1 creditGenerate a new piece of content. Returns the persisted Post.
Request
json{ "topic": "Launch our new jollof rice delivery service", "platform": "Instagram", "toneLevel": 3, "brandProfileId": "clx..." // optional — defaults to your default brand }
Response
json{ "post": { "id": "clx...", "topic": "Launch our new jollof rice delivery service", "platform": "Instagram", "content": "Lagos, your weeknight just got SAVED...", "status": "DRAFT", "createdAt": "2026-06-05T01:23:45.000Z" } }
/history?limit=20&cursor=<postId>perm: read:history—Paginated post history. limit 1–100 (default 20). Use nextCursor for incremental sync.
Response
json{ "posts": [ { "id": "clx...", "topic": "...", "platform": "...", "content": "...", "status": "DRAFT", "createdAt": "..." } ], "nextCursor": "clx..." }
/repurposeperm: repurpose1 creditRepurpose a piece of source content into a different platform's native format.
Request
json{ "sourceContent": "Long-form blog post text here...", "platform": "LinkedIn", "toneLevel": 4, "brandProfileId": "clx..." }
Response
json{ "content": "After 18 months of building...", "platform": "LinkedIn" }
/brandperm: read:brand—List all brand profiles in your workspace. Useful for resolving brandProfileId before /generate or /repurpose.
Response
json{ "brands": [ { "id": "clx...", "brandName": "Mama Cass Cuisine", "industry": "Food & Beverage", "market": "nigeria", "isDefault": true, "voiceAnalysedAt": "2026-06-01T...", ... } ] }
Code samples
The simplest possible call — generating an Instagram post — in three languages:
JavaScript / Node
javascriptconst res = await fetch("https://aikraft.app/api/v1/generate", { method: "POST", headers: { "authorization": `Bearer ${process.env.KRAFT_API_KEY}`, "content-type": "application/json", }, body: JSON.stringify({ topic: "Friday night specials are live", platform: "Instagram", }), }); const { post } = await res.json(); console.log(post.content);
Python
pythonimport os, requests res = requests.post( "https://aikraft.app/api/v1/generate", headers={ "Authorization": f"Bearer {os.environ['KRAFT_API_KEY']}", "Content-Type": "application/json", }, json={ "topic": "Friday night specials are live", "platform": "Instagram", }, ) post = res.json()["post"] print(post["content"])
cURL
bashcurl -X POST https://aikraft.app/api/v1/generate \ -H "Authorization: Bearer $KRAFT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "topic": "Friday night specials are live", "platform": "Instagram" }'
Webhooks
Subscribe a URL to receive events from AI Kraft. Useful for piping new posts into Slack, your CMS, or any tool that can receive an HTTPS POST.
Available events:
post.created— fires when a new Post is saved (API or dashboard)credits.low— fires when wallet credits drop below 5
Payload shape
json{ "event": "post.created", "workspaceId": "clx...", "occurredAt": "2026-06-05T01:23:45.000Z", "data": { "post": { "id": "clx...", "topic": "...", "platform": "Instagram", "content": "...", "status": "DRAFT", "createdAt": "..." } } }
Verifying signatures
Every POST includes an x-kraft-signatureheader — HMAC-SHA256 of the raw body, keyed with your webhook's secret. Reject any request whose signature doesn't match.
javascriptimport crypto from "crypto"; // In your webhook handler: const signature = req.headers["x-kraft-signature"]?.replace(/^sha256=/, ""); const expected = crypto .createHmac("sha256", process.env.KRAFT_WEBHOOK_SECRET) .update(rawBody) .digest("hex"); if (signature !== expected) { return res.status(401).send("bad signature"); }
Register webhook URLs in Settings → Developer → Outbound webhooks. The signing secret is shown once on creation.
Zapier setup walkthrough
AI Kraft works with Zapier via two patterns — incoming webhooks for triggers, and the public API for actions. No dedicated Zapier app yet; both patterns work today with Zapier's generic "Webhooks by Zapier" and "Custom Request" steps.
Trigger: "When a post is created in AI Kraft"
- In Zapier, create a new Zap with the Webhooks by Zapier trigger.
- Choose the Catch Hook event. Zapier gives you a URL like
https://hooks.zapier.com/hooks/catch/123/abc/— copy it. - In AI Kraft, go to Settings → Developer → Outbound webhooks. Click New webhook.
- Paste the Zapier URL, name it (e.g. "Zap — Slack notify"), tick the
post.createdevent, click Create. - Save and copy the signing secret if your Zap needs to verify it (most simple flows skip verification).
- Back in Zapier, click Test trigger. Generate a post in AI Kraft — Zapier should pick it up within seconds.
Action: "Generate content from a row in Sheets"
- Trigger on a new row in Google Sheets (or whatever source you prefer).
- Add a Webhooks by Zapier → Custom Request action step.
- Method:
POST· URL:https://aikraft.app/api/v1/generate - Headers:
Authorization: Bearer YOUR_KRAFT_API_KEY·Content-Type: application/json - Body (JSON):
{ "topic": "{{topic from sheet}}", "platform": "Instagram" } - Test the step — Zapier shows the generated post in the response.
- Pipe the response into any downstream action: post to Slack, save back to Sheets, send via email, etc.
Each /generate call costs 1 credit. Build your Zap with conservative triggers (e.g. only on rows where a "publish" column is set to TRUE) so you don't burn credits on every row creation.