Go from zero to your first API-generated content in 10 minutes.
This guide walks you through creating an API key, checking your token balance, starting a content build, and downloading the result.
Before you start, you need:
Go to Settings → API → Create Key in the J77.ai web app. Give it a name (e.g. "Development") and select scopes:
read — fetch targets, builds, deliverables, balancewrite — create/update targets and library itemsbuilds — create builds, generate images, use suggest/chatFor this quickstart, select all three scopes. Copy the key — it starts with j77_live_ and is only shown once.
export J77_API_KEY="j77_live_YOUR_40_HEX_CHARS_HERE"Verify your setup is working by checking your token balance.
curl -s -H "Authorization: Bearer $J77_API_KEY" \
https://api.j77.ai/api/v1/tokens/balance | jq .{
"balance": 47,
"lifetimePurchased": 100,
"lifetimeUsed": 53
}If you see your balance, authentication is working. If you get a 401, check that your key starts with j77_live_ and is copied correctly. If you get a 403, make sure your API subscription is active.
A target represents a brand or website. Every build belongs to a target. If you already have one, skip this step and use its ID.
curl -s -X POST https://api.j77.ai/api/v1/targets \
-H "Authorization: Bearer $J77_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My Blog",
"slug": "my-blog",
"description": "Personal tech blog",
"brandKit": {
"voice": "Clear and conversational",
"tone": "Helpful"
}
}' | jq .{
"id": "a1b2c3d4-5678-9abc-def0-1234567890ab",
"name": "My Blog",
"slug": "my-blog",
...
}export TARGET_ID="a1b2c3d4-5678-9abc-def0-1234567890ab"Create a content build. This starts the multi-model pipeline: research, draft, critique, verification. A single blog post costs 1 token and takes 3-8 minutes.
curl -s -X POST https://api.j77.ai/api/v1/builds \
-H "Authorization: Bearer $J77_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: quickstart-first-build" \
-d '{
"targetId": "'$TARGET_ID'",
"buildType": "single",
"kind": "blog",
"objective": "Write a practical guide to implementing health scores for SaaS customer success teams",
"researchPolicy": "required"
}' | jq .{
"buildId": "c3d4e5f6-7890-abcd-ef01-345678901234",
"correlationId": "corr_abc123"
}export BUILD_ID="c3d4e5f6-7890-abcd-ef01-345678901234"The Idempotency-Key header ensures that retrying this exact request won't create a duplicate build or waste tokens.
The build runs asynchronously. Poll the build endpoint until the status is completed.
while true; do
STATUS=$(curl -s -H "Authorization: Bearer $J77_API_KEY" \
"https://api.j77.ai/api/v1/builds/$BUILD_ID" | jq -r '.build.status')
echo "Status: $STATUS"
[ "$STATUS" = "completed" ] || [ "$STATUS" = "failed" ] && break
sleep 30
doneBuild statuses progress through: pending → researching → drafting → critiquing → merging → completed
Once completed, get the deliverable ID from the build response and download the content.
DELIVERABLE_ID=$(curl -s -H "Authorization: Bearer $J77_API_KEY" \
"https://api.j77.ai/api/v1/builds/$BUILD_ID" | jq -r '.deliverables[0].id')
echo "Deliverable: $DELIVERABLE_ID"curl -H "Authorization: Bearer $J77_API_KEY" \
"https://api.j77.ai/api/v1/deliverables/$DELIVERABLE_ID/download?format=md" \
-o article.md
echo "Saved: article.md ($(wc -w < article.md) words)"You now have a researched, verified, publish-ready article on disk. You can also download as HTML with format=html, or get the full deliverable with sources and claim verification via GET /deliverables/:id.