---
updatedAt: 2025-08-11T17:51:01.000Z
agentTools:
  projectIndex: https://netra-apex.readme.io/llms.txt
---

# Run Agent

Starts the agent to analyze the user's request.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Netra AI Optimization Platform API",
    "version": "1.0.0",
    "description": "Enterprise-grade system for optimizing AI workloads. This API provides endpoints for agent orchestration, workflow management, and AI optimization tools.",
    "contact": {
      "name": "Netra Support",
      "email": "support@netra.ai",
      "url": "https://netra.ai/support"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://netra.ai/license"
    }
  },
  "paths": {
    "/api/agent/run_agent": {
      "post": {
        "tags": [
          "agent"
        ],
        "summary": "Run Agent",
        "description": "Starts the agent to analyze the user's request.",
        "operationId": "run_agent_api_agent_run_agent_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestModel"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "Response Run Agent Api Agent Run Agent Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DataSource": {
        "properties": {
          "source_table": {
            "type": "string",
            "title": "Source Table"
          },
          "filters": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filters"
          }
        },
        "type": "object",
        "required": [
          "source_table"
        ],
        "title": "DataSource"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "RequestModel": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "query": {
            "type": "string",
            "title": "Query"
          },
          "workloads": {
            "items": {
              "$ref": "#/components/schemas/Workload"
            },
            "type": "array",
            "title": "Workloads"
          },
          "constraints": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "title": "Constraints"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "query",
          "workloads"
        ],
        "title": "RequestModel"
      },
      "TimeRange": {
        "properties": {
          "start_time": {
            "type": "string",
            "title": "Start Time"
          },
          "end_time": {
            "type": "string",
            "title": "End Time"
          }
        },
        "type": "object",
        "required": [
          "start_time",
          "end_time"
        ],
        "title": "TimeRange"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "Workload": {
        "properties": {
          "run_id": {
            "type": "string",
            "title": "Run Id"
          },
          "query": {
            "type": "string",
            "title": "Query"
          },
          "data_source": {
            "$ref": "#/components/schemas/DataSource"
          },
          "time_range": {
            "$ref": "#/components/schemas/TimeRange"
          }
        },
        "type": "object",
        "required": [
          "run_id",
          "query",
          "data_source",
          "time_range"
        ],
        "title": "Workload"
      }
    }
  },
  "servers": [
    {
      "url": "http://localhost:8000",
      "description": "Local development server"
    },
    {
      "url": "https://api.netra.ai",
      "description": "Production server"
    },
    {
      "url": "https://staging-api.netra.ai",
      "description": "Staging server"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "apiKey": []
    }
  ]
}
```