> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nemu.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Providers

> Manage upstream AI providers inside a workspace

A provider is an upstream endpoint that serves models. Providers belong to a workspace, so
pass `workspace_id` on reads and writes. Reads need `providers:read` and writes need
`providers:write`.

## List providers

```
GET /api/v1/providers?workspace_id=ws_1
```

<RequestExample>
  ```bash cURL theme={null}
  curl 'https://platform.nemu.cc/api/v1/providers?workspace_id=ws_1' \
    -H 'Authorization: Bearer <access_token>'
  ```

  ```ts SDK theme={null}
  const providers = await workspace.providers.list();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": [
      {
        "id": "prov_1",
        "user_id": "3f0e...",
        "workspace_id": "ws_1",
        "name": "primary",
        "base_url": "https://api.upstream.com/v1",
        "priority": 1,
        "api_key": null,
        "compatibility": "OPENAI_SDK",
        "model_options": [],
        "created_at": "2026-01-04T10:22:00.000Z",
        "updated_at": "2026-01-04T10:22:00.000Z"
      }
    ]
  }
  ```
</ResponseExample>

The `api_key` is write only. It is accepted on create and update, and never returned.

## Get a provider

```
GET /api/v1/providers/{id}?workspace_id=ws_1
```

## Create a provider

```
POST /api/v1/providers
```

<ParamField body="workspace_id" type="string" required>
  The workspace the provider belongs to.
</ParamField>

<ParamField body="name" type="string" required>
  A name for the provider.
</ParamField>

<ParamField body="base_url" type="string" required>
  The upstream base URL.
</ParamField>

<ParamField body="priority" type="integer" required>
  The order in which providers are tried. Lower runs first.
</ParamField>

<ParamField body="compatibility" type="string" required>
  One of `OPENAI_SDK`, `CEREBRAS`, `NVIDIA_NIM`, or `DEEPSEEK`.
</ParamField>

<ParamField body="api_key" type="string">
  The upstream key. Stored encrypted and never returned.
</ParamField>

<ParamField body="model_options" type="string[]">
  Extra model identifiers to expose from this provider.
</ParamField>

<RequestExample>
  ```ts SDK theme={null}
  const provider = await workspace.providers.create({
    name: "primary",
    base_url: "https://api.upstream.com/v1",
    priority: 1,
    compatibility: "OPENAI_SDK",
    api_key: "sk_upstream_key",
  });
  ```
</RequestExample>

## Update a provider

```
PATCH /api/v1/providers/{id}
```

Accepts any create field. Send `workspace_id` in the body.

## Delete a provider

```
DELETE /api/v1/providers/{id}
```
