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

# Validate AI provider

> Test the API key for a provider



## OpenAPI

````yaml openapi.json post /api/v1/ai/providers/{id}/validate
openapi: 3.0.0
info:
  description: Dualship backend API for workflow automation and API management.
  title: Dualship API
  termsOfService: https://dualship.run/terms
  contact:
    name: Dualship Support
    url: https://dualship.run/support
    email: support@dualship.run
  version: '1.0'
servers:
  - url: https://api.dualship.run
security: []
paths:
  /api/v1/ai/providers/{id}/validate:
    post:
      tags:
        - ai
      summary: Validate AI provider
      description: Test the API key for a provider
      parameters:
        - description: Provider ID
          name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Validation result
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/internal_api_handler.ValidResponse'
        '400':
          description: Invalid provider ID
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/internal_api_handler.BadRequestError'
        '401':
          description: Unauthorized
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/internal_api_handler.UnauthorizedError'
        '404':
          description: Provider not found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/internal_api_handler.NotFoundError'
        '503':
          description: AI service not configured
          content:
            '*/*':
              schema:
                $ref: >-
                  #/components/schemas/internal_api_handler.ServiceUnavailableError
      security:
        - BearerAuth: []
components:
  schemas:
    internal_api_handler.ValidResponse:
      description: Validation result response
      type: object
      properties:
        error:
          type: string
          example: ''
        valid:
          type: boolean
          example: true
    internal_api_handler.BadRequestError:
      description: Bad request error
      type: object
      properties:
        code:
          type: string
          example: BAD_REQUEST
        error:
          type: string
          example: invalid request parameters
    internal_api_handler.UnauthorizedError:
      description: Unauthorized error
      type: object
      properties:
        code:
          type: string
          example: UNAUTHORIZED
        error:
          type: string
          example: unauthorized
    internal_api_handler.NotFoundError:
      description: Not found error
      type: object
      properties:
        code:
          type: string
          example: NOT_FOUND
        error:
          type: string
          example: resource not found
    internal_api_handler.ServiceUnavailableError:
      description: Service unavailable error
      type: object
      properties:
        code:
          type: string
          example: SERVICE_UNAVAILABLE
        error:
          type: string
          example: service unavailable
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT Bearer token authentication

````