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

# Create Agent

> Create a new agent and define its configurations.



## OpenAPI

````yaml POST /agent
openapi: 3.0.1
info:
  title: Machina Sports SDK
  description: >-
    Machina Sports API for seamless AI integration in sports, offering real-time
    insights, personalized content, and fan sentiment analysis.
  version: '1.0'
  termsOfService: http://machina.gg/tos/
  contact:
    email: support@machina.gg
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://{api-address}.org.machina.gg
    description: Production server
    variables:
      api-address:
        default: https://api.machina.gg
        description: Your api-address
  - url: http://local.machina:5001
    description: Local development server
security:
  - ApiToken: []
paths:
  /agent:
    post:
      tags:
        - agents
      summary: Create Agent
      description: Create a new agent and define its configurations.
      operationId: createAgent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - title
                - description
              properties:
                name:
                  type: string
                  description: Unique identifier for the agent
                title:
                  type: string
                  description: Display title of the agent
                description:
                  type: string
                  description: Detailed description of the agent's purpose
                context:
                  type: object
                  description: Configuration settings for the agent
                workflows:
                  type: array
                  description: Array of workflow definitions
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: Name of the workflow
                      description:
                        type: string
                        description: Description of the workflow
                      condition:
                        type: string
                        description: Condition for workflow execution
                      outputs:
                        type: object
                        description: Output mappings for the workflow
                status:
                  type: string
                  enum:
                    - active
                    - inactive
                  default: active
                  description: Current status of the agent
              example:
                name: my-new-agent
                title: My New Agent
                description: Your agent description
                context:
                  config-frequency: 0.04
                workflows:
                  - name: sync-nba-embeds
                    description: sync-nba-embeds
                    inputs:
                      event_code: $.get('event_code') or None
                    outputs:
                      sync-nba-embeds-status: $.get('workflow-status', False)
                status: inactive
      responses:
        '200':
          description: Agent created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Unique identifier of the created agent
                        example: 67db52c32ae92018b93310a1
                  meta:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 200
                  status:
                    type: string
                    enum:
                      - success
                    example: success
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized
components:
  securitySchemes:
    ApiToken:
      type: apiKey
      name: x-api-token
      in: header
      description: API key authentication

````