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

# Create Llm Configuration

> Create a new LLM configuration for the authenticated user's space.

This endpoint:
- Requires API key or session authentication
- Validates that the secret_id belongs to the user's space
- Creates a new LLM configuration with the provided settings

Args:
    service: Injected LLM configuration service
    payload: Request containing url, display_name, model_name, and secret_id

Returns:
    Response with created LLM configuration

Raises:
    400 Bad Request: If user doesn't have an associated space or secret is invalid



## OpenAPI

````yaml /openapi.json post /v1/llm-configurations
openapi: 3.1.0
info:
  title: Live avatar API
  version: 0.1.0
servers:
  - url: https://api.liveavatar.com
security: []
paths:
  /v1/llm-configurations:
    post:
      tags:
        - LLM Configurations
      summary: Create Llm Configuration
      description: |-
        Create a new LLM configuration for the authenticated user's space.

        This endpoint:
        - Requires API key or session authentication
        - Validates that the secret_id belongs to the user's space
        - Creates a new LLM configuration with the provided settings

        Args:
            service: Injected LLM configuration service
            payload: Request containing url, display_name, model_name, and secret_id

        Returns:
            Response with created LLM configuration

        Raises:
            400 Bad Request: If user doesn't have an associated space or secret is invalid
      operationId: create_llm_configuration_v1_llm_configurations_post
      parameters:
        - name: la_session
          in: cookie
          required: false
          schema:
            title: La Session
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLLMConfigurationSchema'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response_LLMConfigurationResponseSchema_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    CreateLLMConfigurationSchema:
      properties:
        base_url:
          title: Base Url
          description: The LLM API endpoint URL
          type: string
        display_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Display Name
          description: Display name for the configuration
        model_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Model Name
          description: The model name to use
        secret_id:
          type: string
          maxLength: 36
          minLength: 1
          title: Secret Id
          description: ID of the secret containing the API key
      type: object
      required:
        - display_name
        - model_name
        - secret_id
      title: CreateLLMConfigurationSchema
      description: Request schema for creating a new LLM configuration
    Response_LLMConfigurationResponseSchema_:
      properties:
        code:
          type: integer
          title: Code
          default: 100
        data:
          anyOf:
            - $ref: '#/components/schemas/LLMConfigurationResponseSchema'
            - type: 'null'
        message:
          title: Message
          type: string
      type: object
      title: Response[LLMConfigurationResponseSchema]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LLMConfigurationResponseSchema:
      properties:
        id:
          type: string
          title: Id
        base_url:
          title: Base Url
          type: string
        display_name:
          type: string
          title: Display Name
        model_name:
          type: string
          title: Model Name
        secret_id:
          type: string
          title: Secret Id
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - base_url
        - display_name
        - model_name
        - secret_id
        - created_at
        - updated_at
      title: LLMConfigurationResponseSchema
      description: Response schema for an LLM configuration
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          title: Message
          type: string
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-KEY

````