Every build of a toolset is a numbered version. Requests go to whichever version the live alias points at, so a new build never interrupts traffic: the old version answers until the new one is ready.
Build a new version
Send the complete new tool list:
curl https://api.bluwing.si/v1/bricks/brk_7m2q9xk4hd3vfc8r/versions \
-H "Authorization: Bearer $BLUWING_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "tools": [ ... ], "base_version": 3, "options": { "auto_activate": true } }'base_version is the version you started from. If someone built another version in the meantime, the answer is 409 VERSION_CONFLICT instead of quietly overwriting their change.
Only tools that are new or changed are charged, one credit each. Sending the same list again costs nothing and returns the existing version with reused: true.
Patch instead of resending
For a large toolset, send only the differences with PATCH /v1/bricks/{id}/tools:
{
"base_version": 3,
"add": [ { "type": "function", "function": { "name": "issue_voucher", "description": "...", "parameters": { "type": "object", "properties": {} } } } ],
"update": [ { "type": "function", "function": { "name": "refund_order", "description": "...", "parameters": { "type": "object", "properties": {} } } } ],
"remove": ["legacy_refund"]
}The result is a new version, charged the same way.
Point live somewhere else
To roll back, or to release a version you built without auto_activate:
curl -X PUT https://api.bluwing.si/v1/bricks/brk_7m2q9xk4hd3vfc8r/aliases/live \
-H "Authorization: Bearer $BLUWING_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "version": 2 }'Only a ready version can be live. The change takes effect for the next request. Pass expected_row_version (from GET /v1/bricks/{id}) to make the move conditional; a mismatch answers 409 ALIAS_CONFLICT.
Call a specific version
live is the default. To test a version before it goes live, name it in the request:
{ "input": "Refund order 4412", "version": 4 }In the console, each toolset's page lists its versions with a Make live or Roll back button.