Page cover

API Code Examples

This page provides code examples for running the APIs in Python.

Before running any of the scripts, run export ARCEE_API_TOKEN=$YOUR_TOKEN.

List Available Workflows

import requests
import os

# Setup
API_BASE_URL = "https://orchestra.arcee.ai/api/v1/workflow"
API_KEY = os.environ.get("ARCEE_API_TOKEN")
headers = {"Authorization": f"Bearer {API_KEY}"}

# List workflows
response = requests.get(f"{API_BASE_URL}/workflows", headers=headers)
print(response.json())

Workflow Execution

import requests
import os

# Setup
API_BASE_URL = "https://orchestra.arcee.ai/api/v1/workflow"
API_KEY = os.environ.get("ARCEE_API_TOKEN")
headers = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
workflow_id = "YOUR_WORKFLOW_ID"

# Execute a workflow
payload = {"prompt": "Tell me a joke about the weather"}
response = requests.post(f"{API_BASE_URL}/workflows/{workflow_id}/execute", 
                        headers=headers, 
                        json=payload)

print(response.json())

Workflow Execution Steps

Execution History

Workflow Diagram

Last updated