Task AI Execution
Execute any task through an AI model for analysis, expansion, decomposition, or brainstorming. Supports file attachments, agent invocation, and automatic propagation to connected tasks.
Endpoints
| Method | Path | Description | Auth | Entitlement |
|---|---|---|---|---|
| POST | /bits/:id/execute | Execute a task through AI | JWT | ai.bits.execute |
| POST | /chainies/:id/execute | Execute a project through AI | JWT | ai.bits.execute |
| GET | /ai/models/available | List available models for a feature | JWT | -- |
| PATCH | /ai/runs/:runId/share | Share an execution result | JWT | -- |
| GET | /community/executions | List public execution shares | None | -- |
Who can execute
An execution always runs, and is billed, in the account and workspace selected for the request.
- You can execute only tasks and projects that you created in that workspace. Tasks and projects that a team or a collaborator shares with you are readable but not executable.
agentInstanceIdmust name an active agent available in the same workspace: an agent of that workspace or one shared with the whole account.- A task, project, or agent that you cannot execute returns
404, the same response as one that does not exist. Nothing is run or charged. - Automatic propagation only reaches your own tasks in the same account and workspace.
Execute a Task
Description
Use the id of the task you're executing (e.g. from a task lookup or create-task response) -- not the literal value shown in the examples below.
Request
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | No | chat, analyze, expand, decompose, brainstorm (default: analyze) |
prompt | string | No | Optional instruction to guide the AI (max 4000 chars) |
modelId | string | No | Override model UUID (must be entitled) |
agentInstanceId | string | No | Agent instance UUID for specialized execution |
attachmentFileIds | string[] | No | File UUIDs from media library (max 20) |
Execution Modes
| Mode | Description |
|---|---|
chat | Conversational - responds naturally to user instructions |
analyze | Structured insights: observations, issues, key points |
expand | Adds context, resources, and depth to the task |
decompose | Breaks the task into up to 10 action items |
brainstorm | Generates creative and practical approaches |
Response
{
"data": {
"runId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"sessionId": "c9a7d1e2-4b3f-4e8a-9012-3d4e5f6a7b8c",
"text": "1. Research the topic and gather key references\n2. Draft an outline with main sections\n3. Write the first section focusing on introduction"
}
}Code Examples
curl -X POST https://api.chainabit.com/api/v1/bits/$BIT_ID/execute \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"mode": "decompose",
"prompt": "Break this into daily sub-tasks for a beginner."
}'Execute a Project
Description
Same execution pipeline as tasks, but the context includes the project's title, description, vision statement, and its recent tasks. Use the id of the project you're executing -- not the literal value shown in the examples below.
Request
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | No | Execution mode (default: analyze) |
prompt | string | No | Optional instruction (max 4000 chars) |
modelId | string | No | Override model UUID |
agentInstanceId | string | No | Agent instance UUID |
Response
Same response shape as Execute a Task (runId, sessionId, text).
Code Examples
curl -X POST https://api.chainabit.com/api/v1/chainies/$CHAINY_ID/execute \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"mode": "brainstorm",
"prompt": "Suggest new approaches for this project."
}'List Available Models
Description
Returns models the authenticated user is entitled to use for a given feature key.
Request
Query params: see the featureKey query parameter used in the example below.
Response
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "GPT-4o",
"modelKey": "gpt-4o",
"provider": "openai",
"providerName": "OpenAI",
"capabilities": ["chat", "tools", "vision"],
"contextWindowTokens": 128000
}
]
}Code Examples
curl "https://api.chainabit.com/api/v1/ai/models/available?featureKey=ai.bits.execute" \
-H "Authorization: Bearer $TOKEN"Share an Execution
Description
Share execution results publicly or revoke sharing.
Only the member who started a run can share it or change its sharing. Anyone else, including account owners and admins, receives 403. A run with no recorded starter can be shared by a member working in the run's account and workspace. A run from a temporary conversation cannot be shared.
Request
| Field | Type | Required | Description |
|---|---|---|---|
visibility | string | No | private or public |
title | string | No | Share title (max 200 chars) |
description | string | No | Share description (max 1000 chars) |
allowComments | boolean | No | Allow community comments |
allowClone | boolean | No | Allow cloning |
Response
{
"data": {
"shareId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"accessToken": "<share-access-token>",
"visibility": "public"
}
}Code Examples
const response = await fetch(`https://api.chainabit.com/api/v1/ai/runs/${runId}/share`, {
method: "PATCH",
headers: {
Authorization: `Bearer ${TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ visibility: "public", title: "My AI Analysis" }),
});
const { data } = await response.json();response = requests.patch(
f"{os.environ['BASE_URL']}/ai/runs/{run_id}/share",
headers={"Authorization": f"Bearer {os.environ['TOKEN']}"},
json={"visibility": "public", "title": "My AI Analysis"},
)
data = response.json()["data"]Community Executions
Description
List publicly shared execution results. No authentication required.
Request
Query params: see the limit and offset query parameters used in the example below.
Response
{
"data": [
{
"id": "share-uuid",
"entity_id": "run-uuid",
"visibility": "public",
"allow_comments": true,
"created_at": "2026-04-11T12:00:00.000Z"
}
],
"meta": {
"total": 42,
"limit": 10,
"offset": 0,
"hasNextPage": true
}
}Code Examples
curl "https://api.chainabit.com/api/v1/community/executions?limit=10&offset=0"Entitlements
Execution requires the ai.bits.execute entitlement. Execution allowances, available model providers, attachment limits, and agent invocation depend on your plan. Use GET /ai/models/available to list the models you can use, and see the pricing page for current plan details.