> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://stelltec.com/rhebok/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://stelltec.com/rhebok/docs/_mcp/server.

# Set the remote embedding endpoint

POST http://127.0.0.1:7331/api/config/embed
Content-Type: application/json

Writes `RHEBOK_EMBED_URL`, `RHEBOK_EMBED_MODEL` and `RHEBOK_EMBED_TOKEN`
to the `env` file beside `config.toml` and returns the new config
state. A field you leave out is not changed; `null` or a blank string
removes it. While a URL is in effect, a model and a token must also be
in effect. A value set in the process environment wins over the file.


Reference: https://stelltec.com/rhebok/docs/api/config/set-embed-endpoint

## Request

### Body (application/json)

This endpoint expects an EmbedEndpointRequest.

- `url` (string, optional, nullable) — The endpoint's base URL (`RHEBOK_EMBED_URL`).
- `model` (string, optional, nullable) — The model name to send (`RHEBOK_EMBED_MODEL`).
- `token` (string, optional, nullable) — The Bearer token (`RHEBOK_EMBED_TOKEN`). It is write-only.

## Response

### 200

Saved. The body is the new config state, as `GET /api/config` returns it.

- `path` (string, required) — The path of `config.toml`.
- `exists` (boolean, required)
- `etag` (string, required) — sha256 of the file's bytes as hex, or `""` when there is no file. Send it back on save.
- `effective` (map from string to any, required) — The whole config rhebok runs with, every default filled in. Keys that look like secrets are removed. Dotted paths into this object are the keys of a save's `set`.
- `surface_weights` (ConfigViewSurfaceWeights, required) — The ranking weights the hook and MCP each use after per-surface overrides.
- `file` (map from string to any, required, nullable) — Only what `config.toml` itself sets. `{}` when there is no file, null when it does not parse.
- `defaults` (map from string to any, required) — The config with nothing set, in the same shape as `effective`.
- `errors` (list of FieldError, required) — Every problem in the file as it is now.
- `secrets` (ConfigViewSecrets, required) — Whether each secret is set. The values are never returned.
- `env_overrides` (list of EnvOverride, required) — Endpoint settings that come from the process environment, which the dashboard cannot change.
- `embed_models` (list of EmbedModelChoice, required)
- `endpoint` (EmbedEndpointState, required)

## Errors

### 400 Bad Request Error

The body is not the JSON this route expects (it does not parse, or a required field is missing or has the wrong type).

- `error` (string, required) — What went wrong, in plain words.

### 409 Conflict Error

The request `Origin` is not this dashboard.

- `error` (string, required) — What went wrong, in plain words.

### 413 Content Too Large Error

The declared `Content-Length` is over 65,536 bytes.

- `error` (string, required) — What went wrong, in plain words.

### 421 Misdirected Request Error

The `Host` header does not name this dashboard (see the rules at the top of this page).

- `error` (string, required) — What went wrong, in plain words.

### 422 Unprocessable Entity Error

The change was not saved because it would leave the config with a new problem. `errors` lists each problem.

- `error` (string, required) — "not saved: " followed by every problem, separated by "; ".
- `errors` (list of FieldError, required)

### 500 Internal Server Error

An unexpected server-side failure, such as failing to find the running binary, spawn a process, or read or write a file.

- `error` (string, required) — What went wrong, in plain words.

## Types

### ConfigViewSurfaceWeights

The ranking weights the hook and MCP each use after per-surface overrides.

- `hook` (map from string to any, required)
- `mcp` (map from string to any, required)

### FieldError

One problem with `config.toml` or with a requested change.

- `path` (string, required) — The dotted key (`hook.threshold`), or `""` for a syntax error.
- `message` (string, required)
- `line` (integer, required, nullable) — The 1-based line in `config.toml`, or null when the problem has no single line.

### ConfigViewSecrets

Whether each secret is set. The values are never returned.

- `embed.token` (enum, required)
  - Allowed values: `set`, `unset`
- `pdf.ocr_token` (enum, required)
  - Allowed values: `set`, `unset`
- `backup.key` (enum, required)
  - Allowed values: `set`, `unset`
- `backup.drive_token` (enum, required)
  - Allowed values: `set`, `unset`

### EnvOverride

- `variable` (enum, required)
  - Allowed values: `RHEBOK_EMBED_URL`, `RHEBOK_EMBED_MODEL`, `RHEBOK_EMBED_TOKEN`
- `setting` (enum, required)
  - Allowed values: `endpoint.url`, `endpoint.model`, `embed.token`

### EmbedModelChoice

- `id` (string, required)
- `label` (string, required)
- `model` (string, required)
- `dimensions` (integer, required)
- `hook_threshold` (double, required)
- `mcp_threshold` (double, required)
- `size` (string, required)
- `min_ollama` (string, required, nullable)
- `summary` (string, required)

### EmbedEndpointState

- `backend` (enum, required)
  - Allowed values: `ollama`, `remote`
- `url` (string, required, nullable)
- `model` (string, required, nullable)
- `error` (string, required, nullable) — Why the remote endpoint settings could not be used, or null.

## Examples

### set

**Request**

```json
{
  "url": "http://192.168.1.20:1234",
  "model": "text-embedding-qwen3-embedding-0.6b",
  "token": "lm-studio-token"
}
```

**Response**

```json
{
  "path": "string",
  "exists": true,
  "etag": "string",
  "effective": {},
  "surface_weights": {
    "hook": {},
    "mcp": {}
  },
  "file": {},
  "defaults": {},
  "errors": [
    {
      "path": "string",
      "message": "string",
      "line": 1
    }
  ],
  "secrets": {
    "embed.token": "set",
    "pdf.ocr_token": "set",
    "backup.key": "set",
    "backup.drive_token": "set"
  },
  "env_overrides": [
    {
      "variable": "RHEBOK_EMBED_URL",
      "setting": "endpoint.url"
    }
  ],
  "embed_models": [
    {
      "id": "string",
      "label": "string",
      "model": "string",
      "dimensions": 1,
      "hook_threshold": 1.1,
      "mcp_threshold": 1.1,
      "size": "string",
      "min_ollama": "string",
      "summary": "string"
    }
  ],
  "endpoint": {
    "backend": "ollama",
    "url": "string",
    "model": "string",
    "error": "string"
  }
}
```

**SDK Code**

```python set
import requests

url = "http://127.0.0.1:7331/api/config/embed"

payload = {
    "url": "http://192.168.1.20:1234",
    "model": "text-embedding-qwen3-embedding-0.6b",
    "token": "lm-studio-token"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript set
const url = 'http://127.0.0.1:7331/api/config/embed';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"url":"http://192.168.1.20:1234","model":"text-embedding-qwen3-embedding-0.6b","token":"lm-studio-token"}'
};

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

```go set
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://127.0.0.1:7331/api/config/embed"

	payload := strings.NewReader("{\n  \"url\": \"http://192.168.1.20:1234\",\n  \"model\": \"text-embedding-qwen3-embedding-0.6b\",\n  \"token\": \"lm-studio-token\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby set
require 'uri'
require 'net/http'

url = URI("http://127.0.0.1:7331/api/config/embed")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"url\": \"http://192.168.1.20:1234\",\n  \"model\": \"text-embedding-qwen3-embedding-0.6b\",\n  \"token\": \"lm-studio-token\"\n}"

response = http.request(request)
puts response.read_body
```

```java set
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://127.0.0.1:7331/api/config/embed")
  .header("Content-Type", "application/json")
  .body("{\n  \"url\": \"http://192.168.1.20:1234\",\n  \"model\": \"text-embedding-qwen3-embedding-0.6b\",\n  \"token\": \"lm-studio-token\"\n}")
  .asString();
```

```php set
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://127.0.0.1:7331/api/config/embed', [
  'body' => '{
  "url": "http://192.168.1.20:1234",
  "model": "text-embedding-qwen3-embedding-0.6b",
  "token": "lm-studio-token"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp set
using RestSharp;

var client = new RestClient("http://127.0.0.1:7331/api/config/embed");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"url\": \"http://192.168.1.20:1234\",\n  \"model\": \"text-embedding-qwen3-embedding-0.6b\",\n  \"token\": \"lm-studio-token\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift set
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "url": "http://192.168.1.20:1234",
  "model": "text-embedding-qwen3-embedding-0.6b",
  "token": "lm-studio-token"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://127.0.0.1:7331/api/config/embed")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### clear

**Request**

```json
{
  "url": null,
  "model": null,
  "token": null
}
```

**Response**

```json
{
  "path": "string",
  "exists": true,
  "etag": "string",
  "effective": {},
  "surface_weights": {
    "hook": {},
    "mcp": {}
  },
  "file": {},
  "defaults": {},
  "errors": [
    {
      "path": "string",
      "message": "string",
      "line": 1
    }
  ],
  "secrets": {
    "embed.token": "set",
    "pdf.ocr_token": "set",
    "backup.key": "set",
    "backup.drive_token": "set"
  },
  "env_overrides": [
    {
      "variable": "RHEBOK_EMBED_URL",
      "setting": "endpoint.url"
    }
  ],
  "embed_models": [
    {
      "id": "string",
      "label": "string",
      "model": "string",
      "dimensions": 1,
      "hook_threshold": 1.1,
      "mcp_threshold": 1.1,
      "size": "string",
      "min_ollama": "string",
      "summary": "string"
    }
  ],
  "endpoint": {
    "backend": "ollama",
    "url": "string",
    "model": "string",
    "error": "string"
  }
}
```

**SDK Code**

```python clear
import requests

url = "http://127.0.0.1:7331/api/config/embed"

payload = {
    "url": None,
    "model": None,
    "token": None
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript clear
const url = 'http://127.0.0.1:7331/api/config/embed';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"url":null,"model":null,"token":null}'
};

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

```go clear
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://127.0.0.1:7331/api/config/embed"

	payload := strings.NewReader("{\n  \"url\": null,\n  \"model\": null,\n  \"token\": null\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby clear
require 'uri'
require 'net/http'

url = URI("http://127.0.0.1:7331/api/config/embed")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"url\": null,\n  \"model\": null,\n  \"token\": null\n}"

response = http.request(request)
puts response.read_body
```

```java clear
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://127.0.0.1:7331/api/config/embed")
  .header("Content-Type", "application/json")
  .body("{\n  \"url\": null,\n  \"model\": null,\n  \"token\": null\n}")
  .asString();
```

```php clear
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://127.0.0.1:7331/api/config/embed', [
  'body' => '{
  "url": null,
  "model": null,
  "token": null
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp clear
using RestSharp;

var client = new RestClient("http://127.0.0.1:7331/api/config/embed");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"url\": null,\n  \"model\": null,\n  \"token\": null\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift clear
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "url": ,
  "model": ,
  "token": 
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://127.0.0.1:7331/api/config/embed")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```