POST
/
upload
/
upload_embeddings
cURL
curl --request POST \
  --url https://api.usecortex.ai/upload/upload_embeddings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: <content-type>' \
  --header 'accept: <accept>' \
  --data '{
  "embeddings": [
    [
      0.1,
      0.2,
      0.3,
      0.4,
      0.5
    ],
    [
      0.6,
      0.7,
      0.8,
      0.9,
      1
    ]
  ]
}'
{
  "success": true,
  "message": "Embeddings upload message pushed to SQS.",
  "chunk_ids": [
    "CortexEmbeddings123_0",
    "CortexEmbeddings123_1"
  ],
  "batch_id": "CortexEmbeddings123"
}

Requirements

  • Maximum dimensions: 2000 rows × 3024 columns; i.e, 2000 chunks with the dimensions, not more than 3024
  • Format: 2D array of numeric values (int or float)
  • Consistency: All embedding vectors must have the same dimension
  • Content: Embeddings array cannot be empty
  • Processing: Generates unique chunk IDs in format {batch_id}_{index} for each row.
    • Consider them as references of that particular embeddings vector. You will get back these chunk_ids, when you query something.
    • In the example on your right, the reference to [0.1, 0.2, 0.3, 0.4, 0.5] is CortexEmbeddings123_0
    • You can use these chunk IDs to link the original text which is being embedded
  • Dimensional consistency per tenant: All embedding vectors within a tenant must have identical dimensions. Different dimensional vectors require separate tenants

Sample Request

curl --location 'https://api.usecortex.ai/upload/upload_embeddings?tenant_id={TENANT_ID}&sub_tenant_id={SUB_TENANT_ID}' \
  --header 'Authorization: Bearer {API_KEY}' \
  --header 'accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "embeddings": [
      [0.1, 0.2, 0.3, 0.4, 0.5],
      [0.6, 0.7, 0.8, 0.9, 1.0],
      [0.2, 0.4, 0.6, 0.8, 1.0]
    ]
  }'

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Authorization
string
required

Bearer token (your API key)

Content-Type
string
default:application/json
required

Request content type

accept
string
default:application/json
required

Response content type

Query Parameters

tenant_id
string

Tenant identifier

sub_tenant_id
string

Sub-tenant identifier

Body

application/json

Response

200
application/json

Embeddings uploaded successfully

The response is of type object.