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

# Validate Model Instance

> Test a model instance configuration before creating it.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/model-instances/test
openapi: 3.1.0
info:
  description: >-
    Modular and extensible framework for building AI agents. This API requires
    JWT Bearer token authentication for most endpoints. Include your JWT token
    in the Authorization header. Public endpoints include /, /health, /docs,
    /redoc, and /openapi.json.
  title: AgentArea API
  version: 0.1.0
servers: []
security:
  - bearer: []
paths:
  /v1/model-instances/test:
    post:
      tags:
        - v1
        - protected
        - model-instances
      summary: Validate Model Instance
      description: Test a model instance configuration before creating it.
      operationId: validate_model_instance_v1_model_instances_test_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModelInstanceTestRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelInstanceTestResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    ModelInstanceTestRequest:
      properties:
        model_spec_id:
          format: uuid
          title: Model Spec Id
          type: string
        provider_config_id:
          format: uuid
          title: Provider Config Id
          type: string
        test_message:
          anyOf:
            - type: string
            - type: 'null'
          default: Hello, this is a test message.
          title: Test Message
      required:
        - provider_config_id
        - model_spec_id
      title: ModelInstanceTestRequest
      type: object
    ModelInstanceTestResponse:
      properties:
        cost:
          anyOf:
            - type: number
            - type: 'null'
          title: Cost
        error_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Type
        message:
          title: Message
          type: string
        model_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Name
        provider_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Type
        response_content:
          anyOf:
            - type: string
            - type: 'null'
          title: Response Content
        success:
          title: Success
          type: boolean
        tokens_used:
          anyOf:
            - type: integer
            - type: 'null'
          title: Tokens Used
      required:
        - success
        - message
      title: ModelInstanceTestResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearer:
      bearerFormat: JWT
      description: JWT Bearer token for authentication
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````