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

# Validate Custom Model

> Validate a custom PyBaMM model JSON file and return variable information.

Validates that the JSON can be successfully loaded as a PyBaMM model and
returns the variable names from model.rhs and model.algebraic.

Parameters
----------
file : UploadFile
    The PyBaMM serialized model JSON file

Returns
-------
CustomModelValidationResult
    Validation result with success status, error message, and variable info



## OpenAPI

````yaml https://api.ionworks.com/openapi.json post /models/validate-custom-model
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /models/validate-custom-model:
    post:
      summary: Validate Custom Model
      description: >-
        Validate a custom PyBaMM model JSON file and return variable
        information.


        Validates that the JSON can be successfully loaded as a PyBaMM model and

        returns the variable names from model.rhs and model.algebraic.


        Parameters

        ----------

        file : UploadFile
            The PyBaMM serialized model JSON file

        Returns

        -------

        CustomModelValidationResult
            Validation result with success status, error message, and variable info
      operationId: validate_custom_model_models_validate_custom_model_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_validate_custom_model_models_validate_custom_model_post
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomModelValidationResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Body_validate_custom_model_models_validate_custom_model_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
          description: PyBaMM serialized model JSON file
      type: object
      required:
        - file
      title: Body_validate_custom_model_models_validate_custom_model_post
    CustomModelValidationResult:
      properties:
        success:
          type: boolean
          title: Success
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        rhs_variables:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Rhs Variables
        algebraic_variables:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Algebraic Variables
      type: object
      required:
        - success
      title: CustomModelValidationResult
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````