JieGou has always been a visual platform — you build recipes and workflows in the browser, run them with a click, and see results in real time. But what if you want to trigger a workflow from a GitHub Action? Or run a recipe from a Slack bot? Or embed JieGou execution into your existing CI/CD pipeline?
Today we’re launching the SDK API — a headless execution layer that lets you run anything in JieGou programmatically.
One endpoint, four actions
The SDK API is a single unified endpoint at POST /api/sdk. Authenticate with a bearer token, specify an action, and get results:
# Run a recipe synchronously
curl -X POST https://console.jiegou.ai/api/sdk \
-H "Authorization: Bearer jg_a7f2b1c3e9d4..." \
-H "Content-Type: application/json" \
-d '{
"action": "run_recipe",
"recipeId": "abc123",
"input": { "topic": "AI trends in 2026" }
}'
Four actions are available:
| Action | What it does | Response |
|---|---|---|
run_recipe | Execute a single recipe | Synchronous — returns result immediately |
run_workflow | Execute a multi-step workflow | Async — returns runId for polling |
run_coding_agent | Run a coding agent task | Async — returns runId with streaming |
send_message | Send a message to a conversation | Synchronous — returns assistant response |
API keys with granular permissions
SDK API keys are separate from your LLM provider keys (BYOK). Create them from the account settings page with scoped permissions:
recipes:read/recipes:executeworkflows:read/workflows:executeruns:readconversations:read/conversations:writecoding-agent:executeskills:read
Keys use the jg_ prefix for easy identification in logs and secret scanners. The plaintext token is shown once at creation — after that, only the first 8 characters are visible. Keys are stored as SHA-256 hashes, never in plaintext.
Each key can have an optional expiration date. Rotate keys instantly — the old token is revoked and a new one is generated with the same configuration.
Async execution with polling and streaming
Workflows and coding agent tasks run asynchronously. The initial response gives you a runId and a pollUrl:
{
"status": "queued",
"runId": "run_xyz789",
"pollUrl": "/api/sdk/runs/run_xyz789"
}
Poll for status:
curl https://console.jiegou.ai/api/sdk/runs/run_xyz789 \
-H "Authorization: Bearer jg_a7f2b1c3..."
Or stream real-time events via SSE:
curl -N https://console.jiegou.ai/api/sdk/runs/run_xyz789/stream \
-H "Authorization: Bearer jg_a7f2b1c3..." \
-H "Accept: text/event-stream"
Events include step starts, step completions, coding agent tool calls, and the final result.
Rate limiting and usage tracking
Each API key has its own rate limits:
- 60 requests per minute per key
- 1,000 requests per hour per key
- 10 concurrent requests per key
SDK usage is tracked separately from web UI usage in the billing dashboard, broken down by API key and action type. Token consumption feeds into the same BYOK billing as web usage.
Integration examples
GitHub Actions
- name: Generate changelog
run: |
curl -X POST $JIEGOU_URL/api/sdk \
-H "Authorization: Bearer ${{ secrets.JIEGOU_SDK_KEY }}" \
-d '{"action": "run_recipe", "recipeId": "changelog-gen", "input": {"diff": "${{ steps.diff.outputs.content }}"}}'
Slack bot
app.message('summarize', async ({ message, say }) => {
const result = await fetch(`${JIEGOU_URL}/api/sdk`, {
method: 'POST',
headers: { 'Authorization': `Bearer ${JIEGOU_KEY}` },
body: JSON.stringify({
action: 'run_recipe',
recipeId: 'thread-summarizer',
input: { thread: message.text },
}),
});
const data = await result.json();
await say(data.result.output);
});
Scheduled batch processing
#!/bin/bash
# Run nightly data processing workflow
RESPONSE=$(curl -s -X POST "$JIEGOU_URL/api/sdk" \
-H "Authorization: Bearer $JIEGOU_KEY" \
-d '{"action": "run_workflow", "workflowId": "nightly-etl", "input": {"date": "'$(date -I)'"}}')
RUN_ID=$(echo $RESPONSE | jq -r '.runId')
# Poll until complete
while true; do
STATUS=$(curl -s "$JIEGOU_URL/api/sdk/runs/$RUN_ID" \
-H "Authorization: Bearer $JIEGOU_KEY" | jq -r '.status')
[ "$STATUS" = "completed" ] && break
[ "$STATUS" = "failed" ] && exit 1
sleep 10
done
Available now
The SDK API is available on Pro plans and above. Create your first API key in Account Settings > SDK API Keys.
We’re also working on an npm package (@jiegou/sdk) that wraps the REST API with TypeScript types, streaming helpers, and automatic retry logic. Stay tuned.
Create an API key and start automating your automations.