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

# Create an agent

> Creates a new agent in the requested workspace.



## OpenAPI

````yaml /openapi.yaml post /v1/public/workspaces/{workspace_id}/agents
openapi: 3.0.1
info:
  title: Fetch Hive Public API
  version: v1
  description: Customer-facing Fetch Hive API endpoints for public API keys.
servers:
  - url: https://api.fetchhive.com
security: []
paths:
  /v1/public/workspaces/{workspace_id}/agents:
    parameters:
      - name: workspace_id
        in: path
        required: true
        description: Workspace UUID
        schema:
          type: string
          format: uuid
    post:
      tags:
        - Agents
      summary: Create an agent
      description: Creates a new agent in the requested workspace.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                agent:
                  type: object
                  properties:
                    name:
                      type: string
                      example: My Agent
                    llm_model:
                      type: string
                      example: gpt-4.1-mini
                    model_type:
                      type: string
                      example: hosted
                    description:
                      type: string
                      example: A helpful assistant
                    instruction_prompt:
                      type: string
                      example: You are a helpful assistant
                    temperature:
                      type: number
                      example: 0.7
                    max_token:
                      type: string
                      format: uuid
                  required:
                    - name
                    - llm_model
                    - model_type
              required:
                - agent
        required: true
      responses:
        '200':
          description: agent created
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Successfully created an agent.
                  agent:
                    type: object
                required:
                  - message
                  - agent
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
        '422':
          description: invalid LLM model
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
      security:
        - bearer_auth: []
components:
  schemas:
    error_response:
      type: object
      properties:
        error:
          type: string
          example: Invalid access.
      required:
        - error
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: 'Workspace API key sent as `Authorization: Bearer <api_key>`.'

````