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

# Agent Creation

> Create a Rei Agent using the user's secret token.



## OpenAPI

````yaml /openapi.json post /accounts/units
openapi: 3.0.3
info:
  title: Reigent API
  version: 1.0.0
  description: API for managing Rei Agents and chat completions.
servers:
  - url: https://api.reilabs.org/v1
  - url: https://rei-api.reilabs.org/v1
security: []
paths:
  /accounts/units:
    servers:
      - url: https://api.reilabs.org/v1
    post:
      tags:
        - Agent Management
      summary: Agent Creation
      description: Create a Rei Agent using the user's secret token.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - agentModel
                - tag
                - behaviourPrompt
              properties:
                agentModel:
                  type: string
                  enum:
                    - google/gemini-2.5-flash
                  description: The model to use for the agent
                tag:
                  type: string
                  description: Tag to identify your unit
                behaviourPrompt:
                  type: string
                  description: The behaviour prompt for the agent
                temperature:
                  type: integer
                  minimum: 0
                  maximum: 1
                maxTokens:
                  type: integer
                  minimum: 1
                  maximum: 2000000
                responseFormat:
                  type: string
                  enum:
                    - text
                    - json
                    - markdown
                    - html
                color:
                  type: string
                  description: Color code in Hex format
                  example: '#FFFFFF'
                  pattern: ^#[0-9A-Fa-f]{6}$
      responses:
        '200':
          description: Agent created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  secretToken:
                    type: string
        '400':
          description: Validation Error
        '401':
          description: Unauthorized
      security:
        - UserSecretToken: []
components:
  securitySchemes:
    UserSecretToken:
      type: http
      scheme: bearer
      description: Account API Key from Rei Portal

````