---
title: "Test a custom OpenAI-compatible provider before saving it"
method: POST
path: "/v1/inference-providers/custom/test-connection"
tags: ["Inference Providers"]
---

# Test a custom OpenAI-compatible provider before saving it

`POST /v1/inference-providers/custom/test-connection`

## Request

- Base URL: `https://api.openworklabs.com`
- URL: `https://api.openworklabs.com/v1/inference-providers/custom/test-connection`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Sends one short test prompt through AI Gateway to {baseUrl}/chat/completions with the unsaved API key (or, with inferenceProviderId, the saved key of that custom provider, only for its saved address's origin) and the model settings on screen. Nothing is stored and no usage is recorded. ok=false carries a message for the admin that never contains the key, and step says which setup step the failure belongs to (connection: address or key; model: that model's id or settings; null: try again later). May consume a few tokens on the provider account. Requires the Manage Gateway providers permission and enabled Gateway management; a person must send it, never the agent or an API key. Shares the provider test limit of 20 tests per member and 60 per organization every ten minutes.

## Request body

- object
  - `baseUrl` string, required
  - `apiKey` string
  - `inferenceProviderId` string
  - `model` object, required
    - `id` string, required
    - `name` string
    - `attachment` boolean, required
    - `reasoning` boolean, required
    - `reasoning_options` union[]
      - union
        - object
          - `type` 'toggle', required
        - object
          - `type` 'effort', required
          - `values` string[], required
    - `tool_call` boolean, required
    - `structured_output` boolean, required
    - `temperature` boolean, required
    - `modalities` object, required
      - `input` string[], required
      - `output` string[], required
    - `limit` object, required
      - `context` integer, required
      - `output` integer, required
    - `cost` object
      - `input` number
      - `output` number
      - `cache_read` number
      - `cache_write` number

## Response `200`

Test a custom OpenAI-compatible provider before saving it

- union
  - object
    - `ok` true, required
    - `model` string, required
    - `status` integer, required
    - `code` unknown, required
    - `message` unknown, required
    - `step` unknown, required
  - object
    - `ok` false, required
    - `model` string, required
    - `status` integer, nullable, required
    - `code` string, required
    - `message` string, required
    - `step` 'connection' | 'model', nullable, required

## Other responses

- `400`: Invalid request or provider configuration.
- `401`: Sign-in required.
- `403`: Access denied or Gateway management disabled.
- `404`: Resource not found.
- `409`: Selection or resource conflict.
- `429`: Too many tests. Try again later.

## Changes

- **2026-11-12** `df9bc92e2753`: 1 breaking, 3 info
  - the response's body type changed from no type to `object` for status `404`
  - removed `#/components/schemas/NotFoundError, subschema #2` from the response body `anyOf` list for the response status `404`
  - added the optional property `message` to the response with the `404` status
  - added the required property `error` to the response with the `404` status
- **2026-11-06** `133d32d0939a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/inference-providers/custom/test-connection/post.md)

---

[API](https://skmtc.dev/openworklabs/apis/den-api.md) - [All operations](https://skmtc.dev/openworklabs/apis/den-api/llms.txt) - [OpenAPI document](https://skmtc.dev/openworklabs/apis/den-api/revisions/84fb0f99fb95?raw)
