Skip to main content

Overview of Calling Modes

BizyAir offers three calling modes, switched via HTTP headers. No request body changes are needed:

Synchronous Blocking

The default mode. The HTTP connection stays open until the task completes. No special header is required.
The response contains the task result, including outputs[].object_url.
Synchronous mode requires a long-lived connection. Make sure your HTTP client’s read timeout is at least 60 seconds to prevent the client from disconnecting while the task is still running.

Async Polling

Enable by adding the X-BizyAir-Task-Async: enable header to your request.

Step 1: Submit an async task and get therequest_id

Returns 202 Accepted immediately:

Step 2: Poll the task status

Step 3: Retrieve results once the status is Success

Complete Python Example

Webhook Callback

Enable by adding the X-BizyAir-Task-WebHook-Url header to your request.

Step 1: Submit a task with a webhook

Returns 202 Accepted + request_id immediately.

Step 2: Receive results at your callback endpoint

When the task completes, BizyAir sends a POST request to the URL you specified:
  • Method: POST
  • Headers: Content-Type: application/json, User-Agent: Go-http-client/1.1, along with your X-BizyAir-Task-Authorization and any other X-BizyAir-Task-* headers you set
  • Body: Contains the complete task result

Node.js Callback Server Example

Your callback endpoint must return HTTP 200 OK. If it returns a non-200 status, times out, or is unreachable, the platform will retry on a schedule (approximately every 6 seconds, up to 10 attempts). The per-request timeout is approximately 10 seconds.

Choosing a Calling Mode

Query Task Status

Get the current status and metadata of a task (queue info, runtime, etc.).
Response fields (inside data): Status enum:

Query Task Results

Retrieve the outputs (object_url, etc.) of a completed task.
Response example:
outputs[] field reference:

Cancel Task

Only works for tasks in the Queuing state; removes the task from the queue.
Cancellation is idempotent — repeated calls have no side effects. If the task is already running, use Interrupt instead.

Interrupt Task

Only works for tasks in the Running state; forces a stop.
Interrupting a running task still incurs charges for the portion already executed. Only tasks in the Queuing state can be cancelled at no charge.

Get AI App Information

You can retrieve metadata for any AI app (WebApp) you have permission to access via web_app_id, including the app name, author info, cover image, and all input node definitions (input_nodes) required to call the app. Developers can use this to dynamically discover an app’s input parameters: the variable_name in input_nodes corresponds one-to-one with the keys of input_values in the “Invoke AI Apps” request body, making it ideal for building DIY plugins. A plugin can first call this endpoint to fetch the input fields, then auto-render a form and construct the call request.

Endpoint

{web_app_id} is the app ID, the same as the numeric ID in the app detail page URL and the web_app_id in the Invoke AI Apps request body. Public apps can be accessed without additional authentication; a 404 is returned if the app does not exist or you lack access.

Request Example

Response Example

input_nodes contains all input nodes for the app; the actual response may include multiple nodes. Some field values are omitted in this example.

Response Field Reference

Fields inside data: Fields inside input_nodes[]:

Error Response

Returns HTTP 404 when the app does not exist or you lack access: