Skip to main content
Here’s how to use the /invoke/stdout endpoint with Python to stream responses from the Cloud Coding API. We’ll use the requests library to make the HTTP POST request and handle the Server-Sent Events (SSE) stream.

Installation

First, make sure you have the requests library installed in your environment:

Single Task Invocation

This example demonstrates how to invoke a single task and process the streaming response. The script prints each event received from the API.

Parallel Task Invocation

This example runs two tasks in parallel. The output from custom events includes a task_name field, allowing you to distinguish between outputs from different concurrent tasks.