Skip to main content
POST
/
v1
/
graph-workflow
/
completions
Execute Graph Workflow
curl --request POST \
  --url https://api.example.com/v1/graph-workflow/completions \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "agents": [
    {
      "agent_name": "<string>",
      "description": "<string>",
      "system_prompt": "<string>",
      "model_name": "gpt-4.1",
      "auto_generate_prompt": false,
      "max_tokens": 8192,
      "temperature": 0.5,
      "role": "worker",
      "max_loops": 1,
      "tools_list_dictionary": [
        {}
      ],
      "mcp_url": "<string>",
      "streaming_on": false,
      "llm_args": {},
      "dynamic_temperature_enabled": true,
      "mcp_config": {
        "type": "mcp",
        "url": "http://localhost:8000/mcp",
        "tool_configurations": {},
        "authorization_token": "<string>",
        "transport": "streamable_http",
        "headers": {},
        "timeout": 10
      },
      "mcp_configs": {
        "connections": [
          {
            "type": "mcp",
            "url": "http://localhost:8000/mcp",
            "tool_configurations": {},
            "authorization_token": "<string>",
            "transport": "streamable_http",
            "headers": {},
            "timeout": 10
          }
        ]
      },
      "tool_call_summary": true,
      "reasoning_effort": "<string>",
      "thinking_tokens": 123,
      "reasoning_enabled": false
    }
  ],
  "edges": [
    {
      "source": "<string>",
      "target": "<string>",
      "metadata": {}
    }
  ],
  "entry_points": [
    "<string>"
  ],
  "end_points": [
    "<string>"
  ],
  "max_loops": 1,
  "task": "<string>",
  "img": "<string>",
  "auto_compile": true,
  "verbose": false
}
'
{
  "job_id": "<string>",
  "status": "<string>",
  "outputs": "<unknown>",
  "usage": {
    "input_tokens": 123,
    "output_tokens": 123,
    "total_tokens": 123,
    "token_cost": 123,
    "cost_per_agent": 0.01
  },
  "timestamp": "<string>",
  "name": "<string>",
  "description": "<string>"
}

Headers

x-api-key
string
required

Body

application/json

Input schema for GraphWorkflow completion requests.

name
string | null

The name of the graph workflow.

description
string | null

The description of the graph workflow.

agents
AgentSpec · object[] | null

List of agent specifications to be used as nodes in the workflow graph.

edges
(EdgeSpec · object | object)[] | null

List of edges connecting nodes. Can be EdgeSpec objects or dictionaries with 'source' and 'target' keys.

Schema for defining an edge between nodes in the workflow graph.

entry_points
string[] | null

List of node IDs that serve as starting points for the workflow.

end_points
string[] | null

List of node IDs that serve as ending points for the workflow.

max_loops
integer | null
default:1

The maximum number of execution loops for the workflow.

task
string | null

The task to be executed by the workflow.

img
string | null

Optional image path for vision-enabled agents.

auto_compile
boolean | null
default:true

Whether to automatically compile the workflow for optimization.

verbose
boolean | null
default:false

Whether to enable detailed logging.

Response

Successful Response

Output schema for GraphWorkflow completion responses.

job_id
string
required

The job ID of the graph workflow.

status
string
required

The status of the graph workflow.

outputs
any
required

The outputs of the graph workflow.

usage
Usage · object
required

The usage statistics of the workflow.

timestamp
string
required

The timestamp of the graph workflow execution.

name
string | null

The name of the graph workflow.

description
string | null

The description of the graph workflow.