curl --request POST \
--url https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: '<string>', input: '<string>'})
};
fetch('https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/embeddings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/embeddings"
payload = {
"model": "<string>",
"input": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "list",
"model": "<string>",
"data": [
{
"object": "embedding",
"index": 123,
"embedding": [
123
]
}
],
"usage": {
"prompt_tokens": 123,
"total_tokens": 123
},
"embedding": [
123
]
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"status": 123,
"retryAfter": 123,
"provider": "<string>",
"model": "<string>",
"provider_error_type": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"status": 123,
"retryAfter": 123,
"provider": "<string>",
"model": "<string>",
"provider_error_type": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"status": 123,
"retryAfter": 123,
"provider": "<string>",
"model": "<string>",
"provider_error_type": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"status": 123,
"retryAfter": 123,
"provider": "<string>",
"model": "<string>",
"provider_error_type": "<string>"
}Create text embeddings
OpenAI-compatible embeddings endpoint. Accepts a single string or an
array of strings as input and routes through the gateway’s provider
layer. Returns the standard OpenAI EmbeddingResponse. When the input
is a single string, the response also exposes a flat embedding field
(Prisme.ai convenience extension) in addition to data[0].embedding.
analytics_context is a Prisme.ai extension used to enrich analytics
events.
Governance overlays may reject the call (forwarded as 403 / 429 with
the upstream result.status, e.g. MODEL_NOT_ALLOWED,
HEADER_POLICY_VIOLATION, INVALID_DIMENSIONS).
curl --request POST \
--url https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/embeddings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: '<string>', input: '<string>'})
};
fetch('https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/embeddings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/embeddings"
payload = {
"model": "<string>",
"input": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "list",
"model": "<string>",
"data": [
{
"object": "embedding",
"index": 123,
"embedding": [
123
]
}
],
"usage": {
"prompt_tokens": 123,
"total_tokens": 123
},
"embedding": [
123
]
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"status": 123,
"retryAfter": 123,
"provider": "<string>",
"model": "<string>",
"provider_error_type": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"status": 123,
"retryAfter": 123,
"provider": "<string>",
"model": "<string>",
"provider_error_type": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"status": 123,
"retryAfter": 123,
"provider": "<string>",
"model": "<string>",
"provider_error_type": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {},
"status": 123,
"retryAfter": 123,
"provider": "<string>",
"model": "<string>",
"provider_error_type": "<string>"
}Authorizations
User-bound credential carrying an identity: either a session JWT
or a user access token (at:*) generated from the user settings UI.
Send as Authorization: Bearer <token>.
Org API keys (iak_*) are not accepted here - they carry
no user identity. Use the x-prismeai-api-key header instead
(see OrgApiKeyAuth).
Body
Embedding model id from the catalogue.
256Either a single string or an array of strings to embed.
Requested output dimensionality. Must be one of the model's
supported_dimensions when set; otherwise rejected with
INVALID_DIMENSIONS.
Prisme.ai extension. Caller-supplied analytics context.
Response
Successful embedding response.
OpenAI-compatible embeddings response. When input was a single
string, the response also exposes a flat root-level embedding field
(Prisme.ai convenience extension) in addition to data[0].embedding.
list Prisme.ai extension. Convenience copy of data[0].embedding
present only when the request input was a single string.
Was this page helpful?