> ## Documentation Index
> Fetch the complete documentation index at: https://developer.opus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Generate Opus workflows from a natural-language prompt entirely through the API

## Overview

The Workflow Generation API lets you create a workflow from a natural-language prompt entirely through the API — no browser session required. Opus AI agents design and build the workflow for you; you poll the run until it completes.

## Base URL

All API requests should be made to the following base URL:

```text theme={null}
https://operator.opus.com/api/v1/workflow/
```

## Authentication

All API endpoints require authentication with your Opus API key, sent as a Bearer token.

```text theme={null}
Authorization: Bearer <your_api_key>
```

Your key determines your identity: the acting user, your organization, and the workspaces you can target. Each endpoint additionally requires the listed workflow permission in the target workspace.

A request with a missing, invalid, or expired key returns `401`. Keys are also rate limited — sustained bursts return `429`, independent of the active-run limits described below.

<Note>
  Your API key is a unique, secret credential. Store it securely and never expose it in client-side code.
</Note>

## Generation Flow

The typical flow for generating a workflow through the API follows these steps:

<Steps>
  <Step title="Start Generation">
    Kick off a new generation run using `POST /generate`. Opus AI agents begin designing and building your workflow.
  </Step>

  <Step title="Poll the Run">
    Check progress by polling `GET /{workflowId}/run` until the run reaches a terminal status.
  </Step>

  <Step title="Open the Workflow">
    Once complete, open the generated workflow in the Opus builder (or via the workflow APIs) using the returned `workflowId`.
  </Step>
</Steps>

## Usage Notes

<Note>
  **One run at a time** per workflow. Starting a second run while one is active returns `409`. [Cancel the current run](/api-reference/workflow-generation/cancel-run) or wait for it to finish.
</Note>

* **Polling**: Progress updates continuously; polling every 3–10 seconds is plenty.
* **Time limit**: Runs that exceed **25 minutes** are cancelled automatically.
* **Files**: Attach only files your user can access. A file that can't be read is skipped with a note in the run's task results rather than failing the run.

## Available Endpoints

<CardGroup cols={2}>
  <Card title="Generate Workflow" icon="wand-magic-sparkles" href="/api-reference/workflow-generation/generate-headless">
    Start a new workflow generation run from a prompt
  </Card>

  <Card title="Get Run Status" icon="spinner" href="/api-reference/workflow-generation/get-run-status">
    Poll a generation run until it completes
  </Card>

  <Card title="Cancel a Run" icon="circle-stop" href="/api-reference/workflow-generation/cancel-run">
    Stop an in-progress generation run
  </Card>
</CardGroup>
