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

# Create agent

> Create a new agent with a model, instructions, and optional tools.

Create an agent configuration that defines the model, instructions, reasoning effort, and tools the agent can use.

The `tool_ids` parameter accepts IDs for any tool type, including agent-as-tools. When including agent-as-tools, the sub-agents and their tool wrappers must already exist before creating the supervisor agent.

For details on building multi-agent workflows, see [Agent as tool](/flow/sdk/agents/agent-as-tool).


## OpenAPI

````yaml post /v1/flow/agents/create
openapi: 3.1.0
info:
  title: SeekrFlow API
  description: SeekrFlow API Documentation
  termsOfService: http://www.seekr.com/support
  contact:
    name: Seekr API Support
    url: http://www.seekr.com/contact
    email: contact@seekr.com
  version: 5.87.1
servers:
  - url: https://flow.seekr.com
    description: SeekrBuild server base URL
security: []
paths:
  /v1/flow/agents/create:
    post:
      tags:
        - Agents
      summary: Create agent
      description: Create a new agent with a model, instructions, and optional tools.
      operationId: create_v1_flow_agents_create_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAgentRequest'
            examples:
              preferred_tool_ids:
                summary: Preferred usage using tool_ids
                value:
                  name: My Agent
                  instructions: >-
                    You are a helpful assistant that can search files, browse
                    the web, and run Python code.
                  model_id: deployment-123
                  temperature: 0.4
                  reasoning_effort: medium
                  tool_ids:
                    - tool-123
                    - tool-456
              legacy_tools_deprecated:
                summary: Legacy usage using tools (deprecated)
                description: 'DEPRECATED: Use tool_ids instead.'
                value:
                  name: My Agent
                  instructions: >-
                    You are a helpful assistant that can search files, browse
                    the web, and run Python code.
                  model_id: deployment-123
                  temperature: 0.4
                  reasoning_effort: medium
                  tools:
                    - name: file_search
                      tool_env:
                        file_search_index: my-index
                        document_tool_desc: Search through documents
                        top_k: 10
                        score_threshold: 0.7
                    - name: web_search
                      tool_env:
                        web_search_tool_description: Search the web for current information
                    - name: run_python
                      tool_env:
                        run_python_tool_desc: Execute Python code
                        function_ids:
                          - func-123
                          - func-456
                    - name: agent_as_tool
                      agent_id: ag-123...
                      description: Description of subagent tool.
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    CreateAgentRequest:
      properties:
        name:
          type: string
          title: Name
        instructions:
          type: string
          title: Instructions
        tools:
          anyOf:
            - items:
                oneOf:
                  - $ref: >-
                      #/components/schemas/llm_training__agents__tools__schemas__file_search__CreateFileSearch
                  - $ref: >-
                      #/components/schemas/llm_training__agents__tools__schemas__web_search__CreateWebSearch
                  - $ref: >-
                      #/components/schemas/llm_training__agents__tools__schemas__run_python__CreateRunPython
                discriminator:
                  propertyName: name
                  mapping:
                    file_search:
                      $ref: >-
                        #/components/schemas/llm_training__agents__tools__schemas__file_search__CreateFileSearch
                    run_python:
                      $ref: >-
                        #/components/schemas/llm_training__agents__tools__schemas__run_python__CreateRunPython
                    web_search:
                      $ref: >-
                        #/components/schemas/llm_training__agents__tools__schemas__web_search__CreateWebSearch
              type: array
            - type: 'null'
          title: Tools
          description: 'DEPRECATED: Use `tool_ids` instead.'
          deprecated: true
        tool_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tool Ids
          description: Preferred way to associate tools with an agent.
        model_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Id
        output:
          anyOf:
            - $ref: '#/components/schemas/AgentOutputConfig'
            - type: 'null'
        temperature:
          anyOf:
            - type: number
              maximum: 2
              minimum: 0
            - type: 'null'
          title: Temperature
        reasoning_effort:
          anyOf:
            - $ref: '#/components/schemas/ReasoningEffort'
            - type: 'null'
          default: medium
      additionalProperties: false
      type: object
      required:
        - name
        - instructions
      title: CreateAgentRequest
    AgentSchema:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        instructions:
          type: string
          title: Instructions
        status:
          $ref: '#/components/schemas/AgentStatus'
        model_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Id
        output:
          anyOf:
            - $ref: '#/components/schemas/AgentOutputConfig'
            - type: 'null'
        temperature:
          anyOf:
            - type: number
              maximum: 2
              minimum: 0
            - type: 'null'
          title: Temperature
        reasoning_effort:
          $ref: '#/components/schemas/ReasoningEffort'
        planner_temperature:
          anyOf:
            - type: number
              maximum: 2
              minimum: 0
            - type: 'null'
          title: Planner Temperature
        user_id:
          type: string
          title: User Id
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Id
        tools:
          items:
            oneOf:
              - $ref: >-
                  #/components/schemas/llm_training__agents__tools__schemas__file_search__FileSearch
              - $ref: >-
                  #/components/schemas/llm_training__agents__tools__schemas__web_search__WebSearch
              - $ref: >-
                  #/components/schemas/llm_training__agents__tools__schemas__run_python__RunPython
              - $ref: >-
                  #/components/schemas/llm_training__agents__tools__schemas__agent_as_tool__AgentAsTool
              - $ref: >-
                  #/components/schemas/llm_training__agents__tools__schemas__mcp_connector__MCPConnectorTool
            discriminator:
              propertyName: name
              mapping:
                agent_as_tool:
                  $ref: >-
                    #/components/schemas/llm_training__agents__tools__schemas__agent_as_tool__AgentAsTool
                file_search:
                  $ref: >-
                    #/components/schemas/llm_training__agents__tools__schemas__file_search__FileSearch
                mcp_connector:
                  $ref: >-
                    #/components/schemas/llm_training__agents__tools__schemas__mcp_connector__MCPConnectorTool
                run_python:
                  $ref: >-
                    #/components/schemas/llm_training__agents__tools__schemas__run_python__RunPython
                web_search:
                  $ref: >-
                    #/components/schemas/llm_training__agents__tools__schemas__web_search__WebSearch
          type: array
          title: Tools
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        last_deployed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Deployed At
        active_duration:
          type: integer
          minimum: 0
          title: Active Duration
          default: 0
      type: object
      required:
        - id
        - name
        - instructions
        - status
        - reasoning_effort
        - user_id
        - team_id
        - created_at
        - updated_at
      title: AgentSchema
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    llm_training__agents__tools__schemas__file_search__CreateFileSearch:
      properties:
        name:
          type: string
          const: file_search
          title: Name
        tool_env:
          $ref: '#/components/schemas/FileSearchEnv'
      type: object
      required:
        - name
        - tool_env
      title: CreateFileSearch
      examples:
        - name: file_search
          tool_env:
            document_tool_desc: Search through uploaded documents
            file_search_index: my-document-index
            score_threshold: 0.7
            top_k: 10
    llm_training__agents__tools__schemas__web_search__CreateWebSearch:
      properties:
        name:
          type: string
          const: web_search
          title: Name
        tool_env:
          $ref: '#/components/schemas/WebSearchEnv'
      type: object
      required:
        - name
        - tool_env
      title: CreateWebSearch
      examples:
        - name: web_search
          tool_env:
            web_search_tool_description: Search the web for current information and news
    llm_training__agents__tools__schemas__run_python__CreateRunPython:
      properties:
        name:
          type: string
          const: run_python
          title: Name
        tool_env:
          $ref: '#/components/schemas/RunPythonEnv'
      type: object
      required:
        - name
        - tool_env
      title: CreateRunPython
      examples:
        - name: run_python
          tool_env:
            function_ids:
              - func-123
              - func-456
            run_python_tool_desc: Execute Python code for data analysis and calculations
    AgentOutputConfig:
      properties:
        frequency:
          anyOf:
            - $ref: '#/components/schemas/AgentOutputFrequency'
            - type: 'null'
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
        model_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Id
        temperature:
          anyOf:
            - type: number
              maximum: 2
              minimum: 0
            - type: 'null'
          title: Temperature
      type: object
      title: AgentOutputConfig
    ReasoningEffort:
      type: string
      enum:
        - low
        - medium
        - high
        - speed_optimized
        - performance_optimized
      title: ReasoningEffort
    AgentStatus:
      type: string
      enum:
        - Inactive
        - Pending
        - Active
        - Updating
        - Failed
      title: AgentStatus
    llm_training__agents__tools__schemas__file_search__FileSearch:
      properties:
        name:
          type: string
          const: file_search
          title: Name
        tool_env:
          $ref: '#/components/schemas/FileSearchEnv'
        id:
          type: string
          title: Id
      type: object
      required:
        - name
        - tool_env
      title: FileSearch
    llm_training__agents__tools__schemas__web_search__WebSearch:
      properties:
        name:
          type: string
          const: web_search
          title: Name
        tool_env:
          $ref: '#/components/schemas/WebSearchEnv'
        id:
          type: string
          title: Id
      type: object
      required:
        - name
        - tool_env
      title: WebSearch
    llm_training__agents__tools__schemas__run_python__RunPython:
      properties:
        name:
          type: string
          const: run_python
          title: Name
          default: run_python
        tool_env:
          $ref: '#/components/schemas/RunPythonEnv'
        id:
          type: string
          title: Id
      type: object
      required:
        - tool_env
      title: RunPython
    llm_training__agents__tools__schemas__agent_as_tool__AgentAsTool:
      properties:
        name:
          type: string
          const: agent_as_tool
          title: Name
          default: agent_as_tool
        tool_env:
          $ref: '#/components/schemas/ToolEnv'
          default: {}
        id:
          type: string
          title: Id
        agent_id:
          type: string
          title: Agent Id
        description:
          type: string
          title: Description
      type: object
      required:
        - agent_id
        - description
      title: AgentAsTool
    llm_training__agents__tools__schemas__mcp_connector__MCPConnectorTool:
      properties:
        name:
          type: string
          const: mcp_connector
          title: Name
        tool_env:
          $ref: '#/components/schemas/MCPConnectorToolEnv'
        id:
          type: string
          title: Id
      type: object
      required:
        - name
        - tool_env
      title: MCPConnectorTool
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    FileSearchEnv:
      properties:
        FILE_SEARCH_INDEX:
          type: string
          minLength: 1
          title: File Search Index
        EMBEDDING_MODEL:
          anyOf:
            - type: string
            - type: 'null'
          title: Embedding Model
        DOCUMENT_TOOL_DESC:
          type: string
          minLength: 1
          title: Document Tool Desc
        TOP_K:
          type: integer
          maximum: 100
          minimum: 1
          title: Top K
          description: Top K must be >= 1 and <= 100
          default: 10
        SCORE_THRESHOLD:
          type: number
          exclusiveMaximum: 1
          minimum: 0
          title: Score Threshold
          description: Score must be ≥ 0.0 and < 1.0
          default: 0
      type: object
      required:
        - FILE_SEARCH_INDEX
        - DOCUMENT_TOOL_DESC
      title: FileSearchEnv
    WebSearchEnv:
      properties:
        WEB_SEARCH_TOOL_DESCRIPTION:
          anyOf:
            - type: string
            - type: 'null'
          title: Web Search Tool Description
      type: object
      title: WebSearchEnv
    RunPythonEnv:
      properties:
        RUN_PYTHON_TOOL_DESC:
          anyOf:
            - type: string
            - type: 'null'
          title: Run Python Tool Desc
        FUNCTION_IDS:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Function Ids
      type: object
      title: RunPythonEnv
    AgentOutputFrequency:
      type: string
      enum:
        - always
        - never
        - automatic
      title: AgentOutputFrequency
    ToolEnv:
      properties: {}
      type: object
      title: ToolEnv
      description: Base class for tool environments.
    MCPConnectorToolEnv:
      properties:
        URL:
          type: string
          minLength: 1
          title: Url
        TRANSPORT:
          type: string
          enum:
            - sse
            - streamable-http
          title: Transport
          default: streamable-http
        AUTHORIZATION_URL:
          anyOf:
            - type: string
            - type: 'null'
          title: Authorization Url
      type: object
      required:
        - URL
      title: MCPConnectorToolEnv
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: Seekr API Key without 'Bearer' Prefix
      in: header
      name: Authorization

````