Change the embedding model
const url = 'http://localhost:11044/api/v1/embeddings';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"model":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:11044/api/v1/embeddings \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "model": "example" }'RE-EMBEDS EVERYTHING. Vector indexes are created at a model’s own dimensions, so a different model means every stored vector is wrong until it is recomputed — this drops the indexes, walks each store, re-embeds, and rebuilds them at the new width, restoring the previous model if any of that fails. Setting the first model on an appliance that has none is the cheap case: there is nothing to re-embed yet.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”model names the embedding model to switch to, or a role that resolves to one such as hosted; trimmed, and 400 when blank or when nothing here resolves it. Naming the model already in use changes nothing and answers unchanged; any other model drops and rebuilds every vector index and re-embeds every store
The embedding model to switch to, taken by POST /embeddings. Switching re-embeds every stored vector
object
Name of an embedding model available on this appliance, or a role that resolves to one (e.g. hosted). Trimmed; blank is refused with 400
Example generated
{ "model": "example"}Responses
Section titled “Responses”Changed
object
No model named, or no such model here — just the reason; or the change failed and was rolled back — the reason and the state now in force
An embedding model change that was refused before anything was touched
object
Why: no model named, no such model here, or a reindex already running
An embedding model change that failed part-way and was rolled back
object
What failed
The embedding state after the rollback, so the caller sees which model is in use now
object
False when nothing can be embedded — no local model, no provider key — so document features are off
The model’s vector width, or null when there is no model
The model in use, or null when there is none
Why document features are off, written to be shown and naming the command that fixes it. Null when they are on
A reindex is already running
An embedding model change that was refused before anything was touched
object
Why: no model named, no such model here, or a reindex already running

