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

# Run Agent

> Initiates an agent run with specified parameters



## OpenAPI

````yaml POST /run_agent
openapi: 3.0.1
info:
  title: Kura API
  description: API specification for Kura's agent and session management endpoints
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://backend.trykura.com
security: []
paths:
  /run_agent:
    post:
      description: Initiates an agent run with specified parameters
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentRunRequest'
      responses:
        '200':
          description: Agent run initiated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AgentRunRequest:
      type: object
      required:
        - agent_id
        - api_key
      properties:
        agent_id:
          type: string
          description: Unique identifier for the agent
        parameters:
          type: object
          description: Key-value pairs of parameters for the agent run
          additionalProperties:
            type: string
        api_key:
          type: string
          description: API key for authentication
        auth_token:
          type: string
          description: >-
            Optional token obtained from the
            [/api/create_agent_auth_profile](/api-reference/endpoint/create_agent_auth_profile)
            endpoint that allows the agent to access encrypted authentication
            data. This token can only be used with the specific agent_id it was
            generated for.
          nullable: true
        run_async:
          type: boolean
          description: >-
            Controls whether the agent runs asynchronously. When set to false,
            the request will block until the agent completes execution.
          default: true
    AgentRunResponse:
      type: object
      description: Response schema for agent run
      required:
        - agent_run_url
        - session_id
      properties:
        agent_run_url:
          type: string
          description: URL to view the agent running in the web interface
          example: >-
            https://app.trykura.com/public-session-viewer/250ba43a-9597-486a-b718-aa61280fdd65
        session_id:
          type: string
          description: Unique identifier for the created session
          example: 250ba43a-9597-486a-b718-aa61280fdd65
        agent_output:
          description: >-
            Output from the agent execution. Only included when run_async is set
            to false.
          nullable: true
        error_message:
          type: string
          description: >-
            Error message if the agent execution failed. Only included when
            run_async is set to false.
          nullable: true
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string

````