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

# Run Agent

> Execute an agent with provided inputs and return results immediately.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url "https://api.roe-ai.com/v1/agents/run/YOUR_AGENT_ID/" \
    --header "Authorization: Bearer YOUR_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
      "inputs": {
        "key": "value"
      }
    }'
  ```
</RequestExample>


## OpenAPI

````yaml POST /v1/agents/run/{agent_id}/
openapi: 3.1.0
info:
  title: Roe AI API
  version: 1.0.0
  description: Complete API documentation for Roe AI platform
servers:
  - url: https://api.roe-ai.com
    description: Production API
security: []
paths:
  /v1/agents/run/{agent_id}/:
    post:
      tags:
        - v1
      summary: Run agent synchronously
      description: Execute an agent with provided inputs and return results immediately.
      operationId: agents_run_2
      parameters:
        - in: path
          name: agent_id
          schema:
            type: string
            format: uuid
          required: true
        - name: organization_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
          description: >-
            Organization ID. This is required for access control. It can be
            provided via query or request body depending on the endpoint.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentExecutionRequestRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AgentDatum'
          description: Agent job result
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad request - invalid input data
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Insufficient credits
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Access to the Agents feature is forbidden or permission to access
            this agent denied
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Agent not found
components:
  schemas:
    AgentExecutionRequestRequest:
      type: object
      description: Serializer for agent execution requests with dynamic input fields.
      properties:
        metadata:
          description: Optional metadata as JSON object or JSON string
        agent_input_key_example:
          type: string
          minLength: 1
          description: >-
            Agent input keys are dynamic based on agent configuration. Can be
            text or file.
    AgentDatum:
      type: object
      properties:
        key:
          type: string
          description: The key of the output
        description:
          type: string
          description: The description of the output
        data_type:
          type: string
          description: The MIME data type of the output
        value:
          type: string
          description: The value of the output, serialized as a string
        cost:
          type: number
          format: double
          description: The cost of the agent job execution
      required:
        - data_type
        - key
        - value
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message
      required:
        - message

````