> ## Documentation Index
> Fetch the complete documentation index at: https://omniflow-vpn.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Post v1panelsettingsaiproviders test

> Requires settings.write. Makes one small completion against the stored credential and records the outcome on the provider, so "is this configured correctly?" is answerable without spending a real request later. The prompt is Omniflow's own text; no customer content is involved.

A test that ran and failed answers 200 with `lastCheckOk` false, because the outcome is what was asked for. A test that could not be attempted — no key stored, no model to test with, an unregistered provider — answers 4xx and stores nothing, because recording a failure would claim something was tried.

It sits behind settings.write rather than settings.read: it opens a sealed credential and spends the installation's money. It is rate limited per operator.



## OpenAPI

````yaml https://raw.githubusercontent.com/kewldan/omniflow/main/api/openapi.yaml post /v1/panel/settings/ai/providers/{slug}/test
openapi: 3.0.3
info:
  title: Omniflow API
  version: 1.0.0
  description: >-
    Customer, commerce, payment, wallet, fulfillment, and operations API for
    Omniflow.
servers: []
security: []
paths:
  /v1/panel/settings/ai/providers/{slug}/test:
    post:
      tags:
        - panel
      description: >-
        Requires settings.write. Makes one small completion against the stored
        credential and records the outcome on the provider, so "is this
        configured correctly?" is answerable without spending a real request
        later. The prompt is Omniflow's own text; no customer content is
        involved.


        A test that ran and failed answers 200 with `lastCheckOk` false, because
        the outcome is what was asked for. A test that could not be attempted —
        no key stored, no model to test with, an unregistered provider — answers
        4xx and stores nothing, because recording a failure would claim
        something was tried.


        It sits behind settings.write rather than settings.read: it opens a
        sealed credential and spends the installation's money. It is rate
        limited per operator.
      operationId: testPanelAIProvider
      parameters:
        - $ref: '#/components/parameters/AIProviderSlug'
        - $ref: '#/components/parameters/CSRFToken'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PanelAIProviderTestInput'
      responses:
        '200':
          description: The test ran; the provider carries its outcome
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PanelAIProvider'
        '403':
          $ref: '#/components/responses/Problem'
        '404':
          $ref: '#/components/responses/Problem'
        '422':
          $ref: '#/components/responses/Problem'
        '429':
          $ref: '#/components/responses/Problem'
components:
  parameters:
    AIProviderSlug:
      in: path
      name: slug
      required: true
      schema:
        type: string
        pattern: ^[a-z0-9][a-z0-9_-]{1,40}$
    CSRFToken:
      in: header
      name: X-CSRF-Token
      required: true
      description: >-
        Echoes the token from the current session. Required on every unsafe
        method.
      schema:
        type: string
  schemas:
    PanelAIProviderTestInput:
      type: object
      properties:
        model:
          type: string
          maxLength: 120
          description: >-
            Which model to test with. Omit it to use whatever model a feature
            already points at this provider — that is the configuration worth
            proving. A provider nothing points at yet has none to infer, and the
            request is refused rather than guessed.
    PanelAIProvider:
      type: object
      required:
        - slug
        - kind
        - displayName
        - enabled
        - zeroRetention
        - trainsOnData
        - keyConfigured
        - lastCheckOk
        - updatedAt
      properties:
        slug:
          type: string
          pattern: ^[a-z0-9][a-z0-9_-]{1,40}$
        kind:
          type: string
          enum:
            - openai_compatible
            - anthropic
            - gemini
        displayName:
          type: string
          minLength: 1
          maxLength: 120
        baseUrl:
          type: string
          description: >-
            Where the provider is reached. Required for the OpenAI-compatible
            adapter, which is how an owner points at a model they host
            themselves. It is an address rather than a secret and is returned.
        enabled:
          type: boolean
        zeroRetention:
          type: boolean
          description: >-
            The owner's answer from the provider's own terms. Omniflow cannot
            verify it and does not pretend to; it is recorded so the panel can
            warn before a feature is switched on rather than after data left.
        trainsOnData:
          type: boolean
        retentionNote:
          type: string
          maxLength: 2000
        dataRegion:
          type: string
          maxLength: 60
        keyConfigured:
          type: boolean
          description: >-
            Whether a credential is stored. The credential itself is never
            returned.
        lastCheckedAt:
          type: string
          format: date-time
        lastCheckOk:
          type: boolean
        lastCheckError:
          type: string
          maxLength: 500
          description: >-
            Why the last test failed, or how the last one passed. It never
            carries the provider's own message, which can echo the prompt, and
            never a transport error, which can carry a key held in a query
            string.
        updatedAt:
          type: string
          format: date-time
    Problem:
      type: object
      required:
        - type
        - title
        - status
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        request_id:
          type: string
  responses:
    Problem:
      description: Request failed
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.