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

# Verify Model Before Save

> Verify model credentials before creating the model



## OpenAPI

````yaml /openapi/em-runtime-assets-v2.yaml post /assets/models/verify
openapi: 3.1.0
info:
  title: em_runtime_assets
  version: 5.27.0
servers: []
security: []
paths:
  /assets/models/verify:
    post:
      tags:
        - models
      summary: Verify Model Before Save
      description: Verify model credentials before creating the model
      operationId: verify_model_before_save
      parameters:
        - name: X-Project-ID
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Project-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelVerifyRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelVerifyResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden
        '404':
          description: Model not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    ModelVerifyRequest:
      properties:
        litellm_model:
          type: string
          maxLength: 500
          minLength: 1
          title: Litellm Model
        credentials:
          additionalProperties:
            type: string
          type: object
          title: Credentials
          description: Credentials for the model provider (not stored).
        provider:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Provider
        api_base:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Api Base
        api_version:
          anyOf:
            - type: string
              maxLength: 50
            - type: 'null'
          title: Api Version
      type: object
      required:
        - litellm_model
        - credentials
      title: ModelVerifyRequest
      description: Request body for verifying model credentials before saving.
    ModelVerifyResponse:
      properties:
        verified:
          type: boolean
          title: Verified
        message:
          type: string
          title: Message
        latency_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Latency Ms
      type: object
      required:
        - verified
        - message
      title: ModelVerifyResponse
      description: Response for model verification.
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      type: object
      required:
        - error
      title: ErrorResponse
      description: Standard error response model.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ErrorBody:
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          title: Message
        details:
          additionalProperties: true
          type: object
          title: Details
        request_id:
          type: string
          title: Request Id
        timestamp:
          type: string
          format: date-time
          title: Timestamp
      type: object
      required:
        - code
        - message
        - request_id
        - timestamp
      title: ErrorBody
      description: Error body with structured details.
    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
    ErrorCode:
      type: string
      enum:
        - INVALID_REQUEST
        - INVALID_TOKEN
        - INSUFFICIENT_PERMISSIONS
        - RESOURCE_NOT_FOUND
        - RESOURCE_ALREADY_EXISTS
        - VALIDATION_ERROR
        - RATE_LIMIT_EXCEEDED
        - SERVICE_UNAVAILABLE
        - INTERNAL_ERROR
      title: ErrorCode
      description: Standard error codes for API responses.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````