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

# Create a new chat deployment



## OpenAPI

````yaml /openapi-specs/brainbase-openapi.documented.json post /api/workers/{workerId}/deployments/chat
openapi: 3.0.0
info:
  title: Brainbase REST API
  version: 1.0.3
  description: API documentation for Brainbase REST API
servers:
  - url: https://brainbase-monorepo-api.onrender.com
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Team
    description: Endpoints related to team functionalities
  - name: Integrations
    description: Endpoints for integrations
  - name: Assets
    description: Endpoints for asset management
  - name: Workers
    description: Endpoints for worker operations
  - name: Flows
    description: Endpoints for flow management
  - name: Voice Deployments
    description: Endpoints for voice deployments
  - name: Voice V1 Deployments
    description: Endpoints for voice v1 deployments
  - name: Voice Deployment Logs
    description: Endpoints for voice deployment logs
  - name: Voice Deployment Outbound Data
    description: Endpoints for voice deployment outbound data
  - name: Chat Deployments
    description: Endpoints for chat deployments
  - name: Chat Deployment Logs
    description: Endpoints for chat deployment logs
  - name: Tags
    description: Endpoints for tag management and worker tag assignment
  - name: Echo
    description: Endpoints for Echo test suites, agents, and scorecards
  - name: Flow Versions
    description: Endpoints for flow version control
  - name: Deployment History
    description: Endpoints for deployment change history
  - name: Deployment Parameters
    description: Endpoints for deployment parameters
  - name: Log Exports
    description: Endpoints for async log export to CSV/JSON
  - name: Logs
    description: >-
      Universal log lookup — fetch any deployment log by ID without needing
      worker or deployment context
  - name: Deployments
    description: >-
      Universal deployment lookup — fetch any deployment by ID without needing
      worker context
paths:
  /api/workers/{workerId}/deployments/chat:
    post:
      tags:
        - Chat Deployments
      summary: Create a new chat deployment
      parameters:
        - name: workerId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateChatDeploymentRequest'
      responses:
        '201':
          description: Chat deployment created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatDeployment'
        '400':
          description: Invalid request body
        '401':
          description: Unauthorized
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import BrainbaseLabs from 'brainbase-labs';


            const client = new BrainbaseLabs({
              apiKey: process.env['BRAINBASE_LABS_API_KEY'], // This is the default and can be omitted
            });


            const chat = await
            client.workers.deployments.chat.create('workerId', {
              flowId: 'flowId',
              name: 'name',
            });


            console.log(chat.id);
        - lang: Python
          source: |-
            import os
            from brainbase_labs import BrainbaseLabs

            client = BrainbaseLabs(
                api_key=os.environ.get("BRAINBASE_LABS_API_KEY"),  # This is the default and can be omitted
            )
            chat = client.workers.deployments.chat.create(
                worker_id="workerId",
                flow_id="flowId",
                name="name",
            )
            print(chat.id)
components:
  schemas:
    CreateChatDeploymentRequest:
      type: object
      properties:
        name:
          type: string
          nullable: false
        flowId:
          type: string
          nullable: false
        flowVersionId:
          type: string
        allowedUsers:
          type: array
          items:
            type: string
        welcomeMessage:
          type: string
        llmModel:
          type: string
        modelConfig:
          type: object
          additionalProperties:
            type: string
        extractions:
          type: object
          additionalProperties:
            type: object
            properties:
              type:
                type: string
                enum:
                  - string
                  - number
                  - boolean
                nullable: false
              description:
                type: string
                nullable: false
              required:
                type: boolean
            required:
              - type
              - description
        successCriteria:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
                nullable: false
              description:
                type: string
              items:
                type: array
                items:
                  type: object
                  properties:
                    title:
                      type: string
                      nullable: false
                    description:
                      type: string
                      nullable: false
                    type:
                      type: string
                      enum:
                        - BINARY
                        - SCORE
                      nullable: false
                    threshold:
                      type: number
                      nullable: false
                  required:
                    - title
                    - description
                    - type
                    - threshold
                nullable: false
            required:
              - title
              - items
      required:
        - name
        - flowId
    ChatDeployment:
      type: object
      properties:
        id:
          type: string
          nullable: false
        allowedUsers:
          type: string
          nullable: false
        welcomeMessage:
          type: string
          nullable: true
        llmModel:
          type: string
          nullable: true
        modelConfig:
          type: object
          nullable: false
        chatAgentId:
          type: string
          nullable: false
      required:
        - id
        - allowedUsers
        - modelConfig
        - chatAgentId
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key authentication

````