AI Gateway Admin
post/ai/providers/test

Request

  • Base URL: /api (relative, and the document was published on a file host, not at the API’s origin)
  • URL: /api/ai/providers/test
  • Auth: HTTP bearer

Request body

api_keystring

The raw API key to test (may be empty for a self-hosted provider)

base_urlstring nullable

Optional custom base URL (required for "openai_compatible")

default_modelstring nullable

Model to send the test completion to. Required for "openai_compatible"; defaults to a small vendor model otherwise.

providerstring required

Provider ID: "openai", "anthropic", "xai", "gemini", "openrouter", "openai_compatible"

trust_private_addressboolean

Test as if the base URL's exact private address were trusted on the key. Requires settings:write.

Response

Test result

errorstring nullable

Error message if the test failed

latency_msinteger required

Response time in milliseconds

providerstring required
successboolean required

Changes

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      the request property became optional

    • breaking

      the request property became required

    • warning

      removed the request property

    • warning

      removed the request property