curl --request GET \
--url https://api.example.com/knowledge_bases/embedding_models \
--header 'x-user-id: <x-user-id>'import requests
url = "https://api.example.com/knowledge_bases/embedding_models"
headers = {"x-user-id": "<x-user-id>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-user-id': '<x-user-id>'}};
fetch('https://api.example.com/knowledge_bases/embedding_models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/knowledge_bases/embedding_models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-user-id: <x-user-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/knowledge_bases/embedding_models"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-user-id", "<x-user-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/knowledge_bases/embedding_models")
.header("x-user-id", "<x-user-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/knowledge_bases/embedding_models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-user-id"] = '<x-user-id>'
response = http.request(request)
puts response.read_body{
"providers": [
{
"credential": {
"data": {},
"id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"user_id": "<string>"
},
"models": [
{
"name": "<string>",
"label": "<string>",
"dimensions": 123,
"type": "embedding_model",
"status": "active",
"input_types": [
"text/plain"
],
"output_types": [
"application/x-embedding"
],
"supported_dimensions": [
123
],
"context_size": 1,
"parameter_schema": {},
"parameter_overrides": {}
}
]
}
],
"policy": {
"kind": "any",
"dimension": 123
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}List embedding models compatible with the KB dimension policy
List embedding models the user can pick at KB-creation time.
Walks the caller’s credentials, looks up each provider’s
embedding model class, gathers its model cards, and projects
each card through the manager’s :class:DimensionPolicy.
Incompatible cards are dropped; matryoshka cards under a
FIXED / LOCKED_BY_EXISTING policy are narrowed to the
locked dimension. Providers that end up with zero compatible
models are omitted from the response entirely.
Args:
user_id (str):
Injected authenticated user ID.
storage (StorageBase):
Injected storage backend used to enumerate credentials.
manager (KnowledgeBaseManagerBase):
Injected knowledge base manager.
Returns:
ListKbEmbeddingModelsResponse:
One entry per credential with at least one compatible
embedding model, plus the policy used for filtering.
curl --request GET \
--url https://api.example.com/knowledge_bases/embedding_models \
--header 'x-user-id: <x-user-id>'import requests
url = "https://api.example.com/knowledge_bases/embedding_models"
headers = {"x-user-id": "<x-user-id>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-user-id': '<x-user-id>'}};
fetch('https://api.example.com/knowledge_bases/embedding_models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/knowledge_bases/embedding_models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-user-id: <x-user-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/knowledge_bases/embedding_models"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-user-id", "<x-user-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/knowledge_bases/embedding_models")
.header("x-user-id", "<x-user-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/knowledge_bases/embedding_models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-user-id"] = '<x-user-id>'
response = http.request(request)
puts response.read_body{
"providers": [
{
"credential": {
"data": {},
"id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"user_id": "<string>"
},
"models": [
{
"name": "<string>",
"label": "<string>",
"dimensions": 123,
"type": "embedding_model",
"status": "active",
"input_types": [
"text/plain"
],
"output_types": [
"application/x-embedding"
],
"supported_dimensions": [
123
],
"context_size": 1,
"parameter_schema": {},
"parameter_overrides": {}
}
]
}
],
"policy": {
"kind": "any",
"dimension": 123
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.
Response
Successful Response
Response body listing KB-compatible embedding models.
The list is pre-filtered server-side against the manager's dimension policy. The policy itself is also returned so the front-end can render an explanatory banner and lock the dimension selector when applicable.
One entry per credential that has at least one compatible embedding model.
Show child attributes
Show child attributes
The dimension policy used to filter the cards; surfaced verbatim so the UI can explain why models were filtered.
Show child attributes
Show child attributes