# Providers & Auth

Model providers and the credentials behind them: list providers and their auth state, set or remove an API key, and run the OAuth authorize/callback pair.

Playground

Send these requests to your own running server. Values stay in this browser.

Not connected

Base URL  Directory _optional_  Bearer token _optional_ 

 

How this works

Start a server with `nikcli serve --hostname 127.0.0.1 --port 4096`. Requests go straight from this page to that address — the browser allows it because loopback counts as a secure origin, and the server allows it because `nikcli-ai.dev` is in its CORS allowlist.

To try things without touching your real sessions or config, start the server with `NIKCLI_TEST_HOME` pointed at a throwaway directory — see [the guided tour](/docs/guides/api-tour).

## Operations

8 endpoints, generated from the server's own [OpenAPI document](/docs/api). Every path also accepts the `directory` and `workspace` query parameters that select which instance handles the request.

<table class="api-index not-prose"><tbody><tr><td class="api-index-method"><span class="api-method api-method-get">get</span></td><td><a href="#op-get-provider">/provider</a></td><td class="api-index-id">provider.list</td></tr><tr><td class="api-index-method"><span class="api-method api-method-get">get</span></td><td><a href="#op-get-provider-auth">/provider/auth</a></td><td class="api-index-id">provider.auth</td></tr><tr><td class="api-index-method"><span class="api-method api-method-post">post</span></td><td><a href="#op-post-provider-providerID-api">/provider/{providerID}/api</a></td><td class="api-index-id">provider.api.set</td></tr><tr><td class="api-index-method"><span class="api-method api-method-delete">delete</span></td><td><a href="#op-delete-provider-providerID-auth">/provider/{providerID}/auth</a></td><td class="api-index-id">provider.auth.remove</td></tr><tr><td class="api-index-method"><span class="api-method api-method-post">post</span></td><td><a href="#op-post-provider-providerID-oauth-authorize">/provider/{providerID}/oauth/authorize</a></td><td class="api-index-id">provider.oauth.authorize</td></tr><tr><td class="api-index-method"><span class="api-method api-method-post">post</span></td><td><a href="#op-post-provider-providerID-oauth-callback">/provider/{providerID}/oauth/callback</a></td><td class="api-index-id">provider.oauth.callback</td></tr><tr><td class="api-index-method"><span class="api-method api-method-put">put</span></td><td><a href="#op-put-auth-providerID">/auth/{providerID}</a></td><td class="api-index-id">auth.set</td></tr><tr><td class="api-index-method"><span class="api-method api-method-delete">delete</span></td><td><a href="#op-delete-auth-providerID">/auth/{providerID}</a></td><td class="api-index-id">auth.remove</td></tr></tbody></table>

get /provider [#](#op-get-provider) `provider.list`

Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| directory | query | string | optional |
| workspace | query | string | optional |

Responses

200 ProviderList application/json

{
  all: [Provider](#schema-Provider)\[\]
  default: {
    \[key: string\]: string
  }
  connected: string\[\]
}

Example response from schema

{
  "all": \[
    {
      "id": "",
      "name": "",
      "source": "env",
      "env": \[\],
      "key": "",
      "options": {},
      "models": {}
    }
  \],
  "default": {},
  "connected": \[
    ""
  \]
}

Generated from the response schema — field values are placeholders, the shape is real.

SDK example

provider.list

ts 

1

2

3

4

5

6

```
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.provider.list({
  ...
})
```

Try it

directory _query_  workspace _query_

---

Source: https://nikcli-ai.dev/docs/api/provider
