# Check whether a provider accepts an API key, without storing it

Source: <https://everruns.com/docs/api/operations/check_credentials/>

POST

/v1/providers/check-credentials

Select code samplecURL (shell:curl)

```js
const url = 'https://app.everruns.com/api/v1/providers/check-credentials';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"api_key":"sk-proj-...","base_url":"https://api.openai.com/v1","credentials":"example","provider_type":"example"}'
};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```sh
curl --request POST \
  --url https://app.everruns.com/api/v1/providers/check-credentials \
  --header 'Content-Type: application/json' \
  --data '{ "api_key": "sk-proj-...", "base_url": "https://api.openai.com/v1", "credentials": "example", "provider_type": "example" }'
```

* Production APIapp.everruns.com/api/v1/providers/check-credentials

Used by org setup so a key the provider will reject is caught at entry instead of at the first agent run. Nothing is persisted.

## Request Bodyrequired

Media typeapplication/json

Request to check a provider credential without storing it.

object

**api\_key**

Single-field credential. Mutually exclusive with `credentials`.

string | null

##### Example

```plaintext
sk-proj-...
```

**base\_url**

Base URL for the provider’s API, when not the driver default.

string | null

##### Example

```plaintext
https://api.openai.com/v1
```

**credentials**

Typed multi-field credential, validated against the driver’s schema exactly as on create.

object | null

**provider\_type**

required

The type of LLM provider (e.g., openai, anthropic).

string

## Responses

### 200

Check completed

Media typeapplication/json

One of:

* object

  The provider accepted the credential.

  object

  **models**

  required

  Number of models the provider listed for this credential.

  integer

  **status**

  required

  string

  Allowed values: valid

* object

  The provider rejected the credential (401/403). Hard stop.

  object

  **message**

  required

  User-facing reason. Never carries the provider’s response body.

  string

  **status**

  required

  string

  Allowed values: rejected

* object

  This driver has no credential-checking endpoint (custom base URL, simulator, or a driver without model discovery).

  object

  **status**

  required

  string

  Allowed values: unsupported

* object

  The provider could not be reached, so the credential is unproven.

  object

  **message**

  required

  User-facing reason. Never carries the provider’s response body.

  string

  **status**

  required

  string

  Allowed values: unreachable

##### Example

```json
{
  "models": 42,
  "status": "valid"
}
```

### 400

Invalid request

### 500

Internal error