A valid request URL is required to generate request examples[
{
"source_id": "CortexDoc1234",
"embedding": {
"chunk_id": "<chunk_id>",
"embedding": []
},
"score": 1,
"distance": 1,
"metadata": {}
}
]{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}Filter Raw Embeddings
Retrieve embeddings for specific chunk IDs. Use this when you already know the chunk IDs and need their corresponding embeddings.
A valid request URL is required to generate request examples[
{
"source_id": "CortexDoc1234",
"embedding": {
"chunk_id": "<chunk_id>",
"embedding": []
},
"score": 1,
"distance": 1,
"metadata": {}
}
]{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": true,
"message": "Error occurred",
"error_code": "<string>"
}
}Try it button to try this API now in our playground. It’s the best way to check the full request and response in one place, customize your parameters, and generate ready-to-use code snippets.Examples
- API Request
- TypeScript
- Python (Sync)
curl -X 'POST' \
'https://api.usecortex.ai/embeddings/filter-raw-embeddings' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "string",
"sub_tenant_id": "string",
"source_id": "string",
"chunk_ids": [
"string"
],
"output_fields": [
"string"
],
"limit": 100
}'
const embeddings = await client.embeddings.getByChunkIds({
tenant_id: "tenant_1234",
sub_tenant_id: "sub_tenant_4567",
chunk_ids: ["chunk_001", "chunk_002", "chunk_003"]
});
# Async usage is similar, just use async_client and await
embeddings = client.embeddings.get_by_chunk_ids(
tenant_id="tenant_1234",
sub_tenant_id="sub_tenant_4567",
chunk_ids=["chunk_001", "chunk_002", "chunk_003"]
)
Requirements
- chunk_ids: Array of valid chunk ID strings (cannot be empty)
- tenant_id: Required for multi-tenancy support
- sub_tenant_id: Optional, defaults to tenant_id if not provided
Response Details
- embeddings: Dictionary mapping chunk IDs to their embedding vectors
- not_found_chunk_ids: Array of chunk IDs that were not found in the system
Sample Response
{
"embeddings": {
"CortexEmbeddings123_0": [
21.0,
22.0,
23.0,
24.0,
25.0,
26.0
],
"CortexEmbeddings123_1": [
20.100000381469727,
20.200000762939453,
20.299999237060547,
20.399999618530273,
20.5,
20.600000381469727
],
"CortexEmbeddings456_0": [
1.5,
2.5,
8.5,
8.5,
8.5,
6.5
]
},
"not_found_chunk_ids": [
"CortexEmbeddings789_2"
]
}
Error Responses
All endpoints return consistent error responses following the standard format. For detailed error information, see our Error Responses documentation.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Unique identifier for the tenant/organization
"tenant_1234"
Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
"sub_tenant_4567"
Optional source ID to filter by (mutually exclusive with chunk_ids)
"CortexDoc1234"
Optional list of chunk IDs to filter by (mutually exclusive with source_id)
[
"CortexEmbeddings123_0",
"CortexEmbeddings123_1"
]
Optional list of fields to return in results (default: chunk_id, source_id, metadata)
Maximum number of results to return
1 <= x <= 100001
Response
Successful Response
Source identifier
"CortexDoc1234"
Embedding payload with chunk id and vector (if set)
Show child attributes
Show child attributes
Similarity score
1
Vector distance
1
Metadata associated with the embedding