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

# Create a workspace

> Creates a new AI workspace. Only one free (base) workspace is allowed per user.
The workspace name must be unique.



## OpenAPI

````yaml /spec/ai-workspaces.yaml post /v1/workspaces
openapi: 3.0.1
info:
  title: AI - Workspaces
  description: >-
    Manage AI workspaces. Workspaces are the primary organizational unit for AI
    resources.

    Each workspace has a plan (base, standard, pro), a state (ACTIVE, FROZEN),
    and provider preferences.


    Parameters:

    - `teamID`: To access services in a team (query param or `x-teamid` header)


    Authentication: JWT Bearer token sent via the `Authorization` header.
  termsOfService: '#'
  contact:
    email: info@liara.ir
  version: 1.0.0
servers:
  - url: https://ai.liara.ir
security:
  - jwt: []
tags:
  - name: Workspaces
    description: Workspace CRUD operations
  - name: Workspace Actions
    description: Workspace actions (resize, unfreeze, provider preferences)
  - name: Workspace Activity
    description: Usage activity and free token tracking
  - name: Model Limits
    description: Model-specific limits within a workspace
externalDocs:
  description: Find out more about Liara AI
  url: https://liara.ir
paths:
  /v1/workspaces:
    post:
      tags:
        - Workspaces
      summary: Create a workspace
      description: >-
        Creates a new AI workspace. Only one free (base) workspace is allowed
        per user.

        The workspace name must be unique.
      operationId: createWorkspace
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWorkspaceRequest'
      responses:
        '200':
          description: Workspace created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateWorkspaceResponse'
        '400':
          description: Bad request
          content: {}
        '401':
          description: Missing authentication
          content: {}
        '402':
          description: Payment required - insufficient balance
          content: {}
        '403':
          description: Forbidden - already have a free workspace
          content: {}
        '409':
          description: Conflict - workspace name already exists
          content: {}
        '410':
          description: Gone - plan not available
          content: {}
components:
  schemas:
    CreateWorkspaceRequest:
      type: object
      required:
        - name
        - plan
      properties:
        name:
          type: string
          minLength: 3
          maxLength: 50
          pattern: ^[a-z0-9][a-z0-9-]+[a-z0-9]$
          description: |-
            Unique workspace name (lowercase, 3-50 chars).
            Cannot be "liara".
        plan:
          type: string
          enum:
            - base
            - standard
            - pro
          description: Workspace plan tier
    CreateWorkspaceResponse:
      type: object
      properties:
        workspace:
          type: object
          properties:
            _id:
              type: string
              description: Workspace ID
  securitySchemes:
    jwt:
      type: apiKey
      description: 'Enter the token with the `Bearer: ` prefix, e.g. "Bearer abcde12345"'
      name: Authorization
      in: header

````