> 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.

# Test the embedding connection

POST http://127.0.0.1:7331/api/embed/test

Embeds a short fixed text with the configured backend (local Ollama or
the remote endpoint) and reports whether it worked, how long it took,
and the vector's dimensions. A failure is a 200 with `ok: false`. Any
request body is ignored.


Reference: https://stelltec.com/rhebok/docs/api/install-and-health/test-embedding

## Response

### 200

The result of the test.

- `ok` (boolean, required)
- `latency_ms` (integer, required)
- `dimensions` (integer, required, nullable) — The length of the returned vector, or null on failure.
- `backend` (enum, required)
  - Allowed values: `ollama`, `remote`
- `url` (string, required, nullable)
- `model` (string, required, nullable)
- `error` (string, optional) — Present only when `ok` is false.

## Errors

### 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.

## Examples

### ok

**Response**

```json
{
  "ok": true,
  "latency_ms": 38,
  "dimensions": 512,
  "backend": "ollama",
  "url": "http://localhost:11434",
  "model": "qwen3-embedding:0.6b"
}
```

**SDK Code**

```python ok
import requests

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

response = requests.post(url)

print(response.json())
```

```javascript ok
const url = 'http://127.0.0.1:7331/api/embed/test';
const options = {method: 'POST'};

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

```go ok
package main

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

func main() {

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

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

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

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

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

}
```

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

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

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

request = Net::HTTP::Post.new(url)

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

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

HttpResponse<String> response = Unirest.post("http://127.0.0.1:7331/api/embed/test")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://127.0.0.1:7331/api/embed/test');

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

```csharp ok
using RestSharp;

var client = new RestClient("http://127.0.0.1:7331/api/embed/test");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift ok
import Foundation

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

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()
```

### failed

**Response**

```json
{
  "ok": false,
  "latency_ms": 2,
  "dimensions": null,
  "backend": "ollama",
  "url": "http://localhost:11434",
  "model": "qwen3-embedding:0.6b",
  "error": "error sending request for url (http://localhost:11434/api/embed): connection refused"
}
```

**SDK Code**

```python failed
import requests

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

response = requests.post(url)

print(response.json())
```

```javascript failed
const url = 'http://127.0.0.1:7331/api/embed/test';
const options = {method: 'POST'};

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

```go failed
package main

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

func main() {

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

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

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

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

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

}
```

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

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

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

request = Net::HTTP::Post.new(url)

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

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

HttpResponse<String> response = Unirest.post("http://127.0.0.1:7331/api/embed/test")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://127.0.0.1:7331/api/embed/test');

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

```csharp failed
using RestSharp;

var client = new RestClient("http://127.0.0.1:7331/api/embed/test");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift failed
import Foundation

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

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()
```