> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/NVIDIA/OpenShell/llms.txt
> Use this file to discover all available pages before exploring further.

# Providers

> Create and manage credential providers that inject API keys and tokens into OpenShell sandboxes as environment variables.

AI agents typically need credentials to access external services: an API key for the model provider, a token for GitHub or GitLab, and so on. OpenShell manages these credentials as first-class entities called *providers*.

A provider is a named credential bundle. When you attach a provider to a sandbox, the gateway injects its credentials into the sandbox as environment variables at startup. Credentials never touch the sandbox filesystem.

<Note>
  When the trailing command in `openshell sandbox create` is a recognized tool name (`claude`, `codex`, or `opencode`), the CLI auto-creates the required provider from your local environment if one does not already exist. You do not need to create the provider separately.
</Note>

## Create a provider

<Tabs>
  <Tab title="From local credentials">
    The fastest way to create a provider is to let the CLI discover credentials from your shell environment:

    ```bash theme={null}
    openshell provider create --name my-claude --type claude --from-existing
    ```

    This reads `ANTHROPIC_API_KEY` or `CLAUDE_API_KEY` from your current environment and stores them in the provider.
  </Tab>

  <Tab title="With explicit credentials">
    Supply a credential value directly:

    ```bash theme={null}
    openshell provider create --name my-api --type generic --credential API_KEY=sk-abc123
    ```
  </Tab>

  <Tab title="Bare key form">
    Pass a key name without a value to read it from the environment variable of that name:

    ```bash theme={null}
    openshell provider create --name my-api --type generic --credential API_KEY
    ```

    This looks up the current value of `$API_KEY` in your shell and stores it.
  </Tab>
</Tabs>

## Attach providers to sandboxes

Pass one or more `--provider` flags when creating a sandbox:

```bash theme={null}
openshell sandbox create --provider my-claude --provider my-github -- claude
```

Each `--provider` flag attaches one provider. The sandbox receives all credentials from every attached provider at runtime.

<Warning>
  Providers cannot be added to a running sandbox. If you need to attach an additional provider, delete the sandbox and recreate it with all required providers specified.
</Warning>

## Manage providers

<Steps>
  <Step title="List all providers">
    ```bash theme={null}
    openshell provider list
    ```
  </Step>

  <Step title="Inspect a provider">
    ```bash theme={null}
    openshell provider get my-claude
    ```
  </Step>

  <Step title="Update a provider's credentials">
    ```bash theme={null}
    openshell provider update my-claude --from-existing
    ```
  </Step>

  <Step title="Delete a provider">
    ```bash theme={null}
    openshell provider delete my-claude
    ```
  </Step>
</Steps>

## Supported provider types

The following provider types are supported. The `--from-existing` flag reads the listed environment variables from your current shell.

| Type       | Environment variables injected                             | Typical use                         |
| ---------- | ---------------------------------------------------------- | ----------------------------------- |
| `claude`   | `ANTHROPIC_API_KEY`, `CLAUDE_API_KEY`                      | Claude Code, Anthropic API          |
| `codex`    | `OPENAI_API_KEY`                                           | OpenAI Codex                        |
| `generic`  | User-defined                                               | Any service with custom credentials |
| `github`   | `GITHUB_TOKEN`, `GH_TOKEN`                                 | GitHub API, `gh` CLI                |
| `gitlab`   | `GITLAB_TOKEN`, `GLAB_TOKEN`, `CI_JOB_TOKEN`               | GitLab API, `glab` CLI              |
| `nvidia`   | `NVIDIA_API_KEY`                                           | NVIDIA API Catalog                  |
| `openai`   | `OPENAI_API_KEY`                                           | Any OpenAI-compatible endpoint      |
| `opencode` | `OPENCODE_API_KEY`, `OPENROUTER_API_KEY`, `OPENAI_API_KEY` | opencode tool                       |

<Tip>
  Use the `generic` type for any service not listed above. You define the environment variable names and values yourself with `--credential`.
</Tip>

## Security model

Credentials are stored in the gateway — not on disk in the sandbox. The gateway injects them as environment variables at sandbox startup. This means:

* A compromised sandbox process cannot read credentials by scanning the filesystem.
* Credentials are purged when the sandbox is deleted.
* Providers can only be attached at sandbox creation time, not after the fact.

## Supported inference providers

The following providers have been tested with `inference.local`. Any provider that exposes an OpenAI-compatible API works with the `openai` type. Set `--config OPENAI_BASE_URL` to the provider's base URL.

| Provider           | Name             | Type        | Base URL                                  |
| ------------------ | ---------------- | ----------- | ----------------------------------------- |
| NVIDIA API Catalog | `nvidia-prod`    | `nvidia`    | `https://integrate.api.nvidia.com/v1`     |
| Anthropic          | `anthropic-prod` | `anthropic` | `https://api.anthropic.com`               |
| Baseten            | `baseten`        | `openai`    | `https://inference.baseten.co/v1`         |
| Bitdeer AI         | `bitdeer`        | `openai`    | `https://api-inference.bitdeer.ai/v1`     |
| Deepinfra          | `deepinfra`      | `openai`    | `https://api.deepinfra.com/v1/openai`     |
| Groq               | `groq`           | `openai`    | `https://api.groq.com/openai/v1`          |
| Ollama (local)     | `ollama`         | `openai`    | `http://host.openshell.internal:11434/v1` |
| LM Studio (local)  | `lmstudio`       | `openai`    | `http://host.openshell.internal:1234/v1`  |

To configure inference routing, refer to [Configure Inference Routing](/inference/configure).

## Next steps

<CardGroup cols={2}>
  <Card title="Policies" icon="shield" href="/sandboxes/policies">
    Control what the agent can access on the network and filesystem.
  </Card>

  <Card title="Community sandboxes" icon="users" href="/sandboxes/community-sandboxes">
    Use a pre-built environment from the community catalog.
  </Card>

  <Card title="Policy schema reference" icon="file-text" href="/reference/policy-schema">
    Full field-by-field YAML definition for sandbox policies.
  </Card>

  <Card title="GitHub sandbox tutorial" icon="book" href="/tutorials/github-sandbox">
    End-to-end walkthrough combining a GitHub provider with a scoped policy.
  </Card>
</CardGroup>
