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

# Test AI provider connection

> Validates the connection to an AI provider by sending a simple test prompt. Requires the provider type, model name, API key, and an optional base URL. Supported providers: OpenAI, Anthropic, Google Gemini, Ollama, OpenRouter, and Vercel AI Gateway. Requires authentication.



## OpenAPI

````yaml /spec.json post /ai/test-connection
openapi: 3.1.1
info:
  title: Reactive Resume
  version: 5.1.0
  description: Reactive Resume API
  license:
    name: MIT
    url: https://github.com/amruthpillai/reactive-resume/blob/main/LICENSE
  contact:
    name: Amruth Pillai
    email: hello@amruthpillai.com
    url: https://amruthpillai.com
servers:
  - url: http://localhost:3000/api/openapi
security:
  - apiKey: []
externalDocs:
  url: https://docs.rxresu.me
  description: Reactive Resume Documentation
paths:
  /ai/test-connection:
    post:
      tags:
        - AI
      summary: Test AI provider connection
      description: >-
        Validates the connection to an AI provider by sending a simple test
        prompt. Requires the provider type, model name, API key, and an optional
        base URL. Supported providers: OpenAI, Anthropic, Google Gemini, Ollama,
        OpenRouter, and Vercel AI Gateway. Requires authentication.
      operationId: testAiConnection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                provider:
                  enum:
                    - openai
                    - anthropic
                    - gemini
                    - vercel-ai-gateway
                    - openrouter
                    - ollama
                  type: string
                model:
                  type: string
                  minLength: 1
                apiKey:
                  type: string
                  minLength: 1
                baseURL:
                  type: string
                  default: ''
              required:
                - provider
                - model
                - apiKey
      responses:
        '200':
          description: The AI provider connection was successful.
          content:
            application/json:
              schema:
                anyOf:
                  - {}
                  - not: {}
        '400':
          description: '400'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: BAD_REQUEST
                      status:
                        const: 400
                      message:
                        type: string
                        default: Invalid AI provider configuration.
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '502':
          description: '502'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: BAD_GATEWAY
                      status:
                        const: 502
                      message:
                        type: string
                        default: The AI provider returned an error or is unreachable.
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
components:
  securitySchemes:
    apiKey:
      type: apiKey
      name: x-api-key
      in: header
      description: The API key to authenticate requests.

````