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

# Add any model

> Add any model to Reason: a provider sign-in, bring your own API key, or a custom OpenAI- or Anthropic-compatible endpoint, from the app, the CLI or the API.

A Workspace can run Sessions on any model it connects. There are three ways to add one, and each works in the app, with the CLI and over the HTTP API.

| Way | Use it for |
| - | - |
| **Provider sign-in** | A subscription, such as ChatGPT, Claude or GitHub Copilot |
| **Provider API key** | Your own key for a provider Reason lists, such as OpenAI, Anthropic, Google, OpenRouter or Amazon Bedrock |
| **Custom endpoint** | Any other OpenAI- or Anthropic-compatible server: a hosted provider Reason does not list, a gateway, vLLM or Ollama |

[List available providers](https://docs.reasonmachines.com/api-reference/provider-credentials/list-available-providers.md) returns every provider, whether it takes a sign-in, an API key or both, and the fields it needs.

## In the app

Open **Settings → Models**. Choose a provider to sign in or enter its API key. For anything else choose **Custom** and enter the server's Base URL, its API key (any value for a keyless server) and its model IDs. For a server on your own computer or a private network, see [Use a model on your own machine](https://docs.reasonmachines.com/docs/local-models.md).

## With the CLI

`reason call` runs any API operation with JSON input from a file, so the key never appears on the command line. This connects a hosted OpenAI-compatible provider as a Custom endpoint:

```bash theme={null}
cat > in.json <<EOF
{
  "path": {"providerId": "custom-endpoint"},
  "body": {
    "key": "$VENICE_API_KEY",
    "config": {
      "CUSTOM_ENDPOINT_NAME": "Venice",
      "CUSTOM_ENDPOINT_BASE_URL": "https://api.venice.ai/api/v1",
      "CUSTOM_ENDPOINT_MODELS": "venice-uncensored,qwen3-coder-480b-a35b-instruct-turbo",
      "CUSTOM_ENDPOINT_CONTEXT_WINDOW_TOKENS": "128000"
    }
  }
}
EOF
reason call validateProviderCredential --input-file in.json    # tests the key, saves nothing
reason call configureProviderCredential --input-file in.json   # saves it
```

`reason tools describe configureProviderCredential` prints the exact fields. Install and sign in as [Reason CLI](https://docs.reasonmachines.com/docs/cli.md) describes.

## With the HTTP API

The same two calls take an API key from **Settings > API** with `org:write` ([Authentication and scopes](https://docs.reasonmachines.com/docs/build/auth-and-scopes.md)) and your Workspace id from `GET /v3/self`. This stores a provider API key:

```bash theme={null}
curl -s -X PUT https://api.reasonmachines.com/v3/organizations/$ORG/provider-credentials/openai \
  -H "Authorization: Bearer $REASON_API_KEY" \
  -H "content-type: application/json" \
  -d "{\"key\": \"$OPENAI_API_KEY\"}"
```

For a Custom endpoint, use `custom-endpoint` as the provider and send the `body` object from the CLI example. To test without saving, `POST` the same body to `.../provider-credentials/{providerId}/validate`. References: [Validate a provider API key](https://docs.reasonmachines.com/api-reference/provider-credentials/validate-a-provider-api-key.md), [Configure a provider credential](https://docs.reasonmachines.com/api-reference/provider-credentials/configure-a-provider-credential.md) and, for a sign-in, [Start provider sign-in](https://docs.reasonmachines.com/api-reference/provider-credentials/start-provider-sign-in.md).

## Custom endpoint fields

Only the Base URL is required.

| `config` name | Label in the app | What it sets |
| - | - | - |
| `CUSTOM_ENDPOINT_BASE_URL` | Base URL | The server's address, such as `https://vllm.example.com/v1` |
| `CUSTOM_ENDPOINT_NAME` | Endpoint name | The connection's name |
| `CUSTOM_ENDPOINT_API` | API format | `openai-completions`, `openai-responses` or `anthropic-messages` |
| `CUSTOM_ENDPOINT_EXECUTION` | Call the model from | `cloud`, the default, or `device` for your computer |
| `CUSTOM_ENDPOINT_MODELS` | Model IDs | Comma-separated IDs. Left out, Reason cloud discovers them from the server |
| `CUSTOM_ENDPOINT_CONTEXT_WINDOW_TOKENS` | Context window (tokens) | One context window for every model in the connection |
| `CUSTOM_ENDPOINT_MAX_OUTPUT_TOKENS` | Max output tokens per response | 16384 by default |
| `CUSTOM_ENDPOINT_REASONING_MODELS` | Reasoning model IDs | Which of the model IDs are reasoning models |
| `CUSTOM_ENDPOINT_REASONING_EFFORTS` | Supported reasoning effort values | Which of `minimal`, `low`, `medium`, `high`, `xhigh` and `max` they accept |
| `CUSTOM_ENDPOINT_IMAGE_MODELS` | Image input model IDs | Which of the model IDs accept images |

## Use the model

A connected model appears in the model picker and in [List models](https://docs.reasonmachines.com/api-reference/agent-auth/list-reason-models.md). A Custom endpoint's models are named `byok:custom-endpoint:<model id>`, and its account's `source_id` is `custom-endpoint:<account_key>`, with the `account_key` the save returned. To run a Session on exactly that connection, put that key in place of `ACCOUNT_KEY`:

```bash theme={null}
curl -s -X POST https://api.reasonmachines.com/v3/organizations/$ORG/sessions \
  -H "Authorization: Bearer $REASON_API_KEY" \
  -H "content-type: application/json" \
  -d '{"prompt": "Say hello", "model": "byok:custom-endpoint:venice-uncensored", "model_source_id": "custom-endpoint:ACCOUNT_KEY", "allow_model_rollover": false}'
```

[Create a session](https://docs.reasonmachines.com/api-reference/sessions/create-a-session.md) documents these fields. To list, rename or remove connected accounts, see [Provider accounts and Fast mode](https://docs.reasonmachines.com/docs/provider-accounts.md).

## Rules that surprise people

* A Custom connection has one context window. It applies to every model in that connection.
* A model not named in `CUSTOM_ENDPOINT_REASONING_MODELS` gets no effort setting in the model picker. Raise `CUSTOM_ENDPOINT_MAX_OUTPUT_TOKENS` for reasoning models.
* The endpoint must support tool calls. Agents cannot work without them.
* Reason cloud calls only a public HTTPS address. A server on `localhost`, a LAN or a tailnet needs **Your computer** and explicit model IDs: see [Use a model on your own machine](https://docs.reasonmachines.com/docs/local-models.md).
* Keys are encrypted and write-only. No call returns one; to change a connection, save it again.
* Any member adds a key or replaces one they connected. Replacing a key someone else connected takes an owner or admin.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.