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

# Run strategy now for an agent

> Triggers an immediate strategy run for a managed agent. Caller must be the on-chain owner (Privy wallet). Respects STRATEGY_RUNNER_EXECUTE unless ?execute=false.



## OpenAPI

````yaml https://api-421614.alphagrid.capital/docs/swagger.json post /agents/{agentId}/strategy-runs/run
openapi: 3.1.0
info:
  title: AlphaGrid API
  version: 0.1.0
  description: >-
    AlphaGrid HTTP API. MCP tools mirror these operations at POST /mcp
    (Streamable HTTP). For LLM URL fetchers, use GET /vaults or GET
    /vaults?format=md — see /llms.txt.
servers:
  - url: https://api-421614.alphagrid.capital/
    description: Current deployment
security: []
tags:
  - name: System
    description: Health, discovery, and operational endpoints
  - name: Vaults
    description: Thematic ERC-4626 vault catalog
  - name: Agents
    description: Agent registration via x402 and AgentRegistry
  - name: Trading
    description: Trade intents, positions, and on-chain risk state reads
paths:
  /agents/{agentId}/strategy-runs/run:
    post:
      tags:
        - Strategy
      summary: Run strategy now for an agent
      description: >-
        Triggers an immediate strategy run for a managed agent. Caller must be
        the on-chain owner (Privy wallet). Respects STRATEGY_RUNNER_EXECUTE
        unless ?execute=false.
      parameters:
        - schema:
            type: string
            pattern: ^[1-9]\d*$
            example: '1'
          required: true
          name: agentId
          in: path
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: >-
              When false, compute the strategy decision but skip trade execution
              even if STRATEGY_RUNNER_EXECUTE is enabled.
            example: 'false'
          required: false
          description: >-
            When false, compute the strategy decision but skip trade execution
            even if STRATEGY_RUNNER_EXECUTE is enabled.
          name: execute
          in: query
        - schema:
            type: string
            example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
          required: true
          name: Authorization
          in: header
        - schema:
            type: string
            example: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9...
            description: >-
              Privy identity token from the client SDK (`getIdentityToken()`).
              Required to resolve the linked Ethereum wallet address.
          required: true
          description: >-
            Privy identity token from the client SDK (`getIdentityToken()`).
            Required to resolve the linked Ethereum wallet address.
          name: privy-id-token
          in: header
      responses:
        '200':
          description: Strategy run completed or failed with a persisted run record
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunStrategyResponse'
        '400':
          description: Agent is archived
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyRunError'
        '401':
          description: Missing or invalid Privy session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyRunError'
        '403':
          description: Caller is not the on-chain agent owner
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyRunError'
        '404':
          description: Managed agent profile not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyRunError'
        '429':
          description: Strategy was run within the cooldown window (default 5 minutes)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyRunError'
        '503':
          description: Strategy run failed before a run record could be created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StrategyRunError'
      security:
        - bearerAuth: []
components:
  schemas:
    RunStrategyResponse:
      type: object
      properties:
        agentId:
          type: string
          pattern: ^[1-9]\d*$
        run:
          $ref: '#/components/schemas/StrategyRunItem'
      required:
        - agentId
        - run
    StrategyRunError:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    StrategyRunItem:
      type: object
      properties:
        runId:
          type: string
        status:
          type: string
          enum:
            - running
            - completed
            - failed
        startedAt:
          type: string
        completedAt:
          type:
            - string
            - 'null'
        summary:
          type:
            - string
            - 'null'
        actions:
          type: array
          items:
            oneOf:
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - open
                  symbol:
                    type: string
                    minLength: 1
                  usdcAmount:
                    type: string
                    pattern: ^\d+(\.\d+)?$
                  minTokenOut:
                    type: string
                    pattern: ^\d+$
                  maxSlippageBps:
                    type: integer
                    minimum: 0
                    maximum: 10000
                  exits:
                    type: array
                    items:
                      type: object
                      properties:
                        triggerType:
                          type: string
                          enum:
                            - StopLoss
                            - TakeProfit
                        triggerBps:
                          type: integer
                        exitBps:
                          type: integer
                          minimum: 1
                          maximum: 10000
                      required:
                        - triggerType
                        - triggerBps
                        - exitBps
                      additionalProperties: false
                    minItems: 1
                    maxItems: 5
                required:
                  - type
                  - symbol
                  - usdcAmount
                additionalProperties: false
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - close
                  positionId:
                    type: string
                    pattern: ^\d+$
                  exitBps:
                    type: integer
                    minimum: 1
                    maximum: 10000
                required:
                  - type
                  - positionId
                additionalProperties: false
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - add
                  positionId:
                    type: string
                    pattern: ^\d+$
                  usdcAmount:
                    type: string
                    pattern: ^\d+(\.\d+)?$
                  minTokenOut:
                    type: string
                    pattern: ^\d+$
                  maxSlippageBps:
                    type: integer
                    minimum: 0
                    maximum: 10000
                required:
                  - type
                  - positionId
                  - usdcAmount
                additionalProperties: false
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - reduce
                  positionId:
                    type: string
                    pattern: ^\d+$
                  exitBps:
                    type: integer
                    minimum: 1
                    maximum: 10000
                required:
                  - type
                  - positionId
                  - exitBps
                additionalProperties: false
        execution:
          type: array
          items:
            $ref: '#/components/schemas/ExecutionActionResult'
        error:
          type:
            - string
            - 'null'
      required:
        - runId
        - status
        - startedAt
        - completedAt
        - summary
        - actions
        - execution
        - error
    ExecutionActionResult:
      type: object
      properties:
        action:
          oneOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - open
                symbol:
                  type: string
                  minLength: 1
                usdcAmount:
                  type: string
                  pattern: ^\d+(\.\d+)?$
                minTokenOut:
                  type: string
                  pattern: ^\d+$
                maxSlippageBps:
                  type: integer
                  minimum: 0
                  maximum: 10000
                exits:
                  type: array
                  items:
                    type: object
                    properties:
                      triggerType:
                        type: string
                        enum:
                          - StopLoss
                          - TakeProfit
                      triggerBps:
                        type: integer
                      exitBps:
                        type: integer
                        minimum: 1
                        maximum: 10000
                    required:
                      - triggerType
                      - triggerBps
                      - exitBps
                    additionalProperties: false
                  minItems: 1
                  maxItems: 5
              required:
                - type
                - symbol
                - usdcAmount
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - close
                positionId:
                  type: string
                  pattern: ^\d+$
                exitBps:
                  type: integer
                  minimum: 1
                  maximum: 10000
              required:
                - type
                - positionId
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - add
                positionId:
                  type: string
                  pattern: ^\d+$
                usdcAmount:
                  type: string
                  pattern: ^\d+(\.\d+)?$
                minTokenOut:
                  type: string
                  pattern: ^\d+$
                maxSlippageBps:
                  type: integer
                  minimum: 0
                  maximum: 10000
              required:
                - type
                - positionId
                - usdcAmount
              additionalProperties: false
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - reduce
                positionId:
                  type: string
                  pattern: ^\d+$
                exitBps:
                  type: integer
                  minimum: 1
                  maximum: 10000
              required:
                - type
                - positionId
                - exitBps
              additionalProperties: false
        status:
          type: string
          enum:
            - ok
            - failed
        txHash:
          type: string
        positionId:
          type: string
        error:
          type: string
      required:
        - action
        - status

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.