Perplexity · Schema

Contextualized Embeddings Request

Request body for creating contextualized embeddings

Properties

Name Type Description
input array Nested array structure where each inner array contains chunks from a single document. Chunks within the same document are encoded with document-level context awareness. Maximum 512 documents. Total ch
model string The contextualized embedding model to use
dimensions integer Number of dimensions for output embeddings (Matryoshka). Range: 128-1024 for pplx-embed-context-v1-0.6b, 128-2560 for pplx-embed-context-v1-4b. Defaults to full dimensions (1024 or 2560).
encoding_format string Output encoding format for embeddings. base64_int8 returns base64-encoded signed int8 values. base64_binary returns base64-encoded packed binary (1 bit per dimension).
View JSON Schema on GitHub

JSON Schema

perplexity-contextualizedembeddingsrequest-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/ContextualizedEmbeddingsRequest",
  "title": "Contextualized Embeddings Request",
  "type": "object",
  "description": "Request body for creating contextualized embeddings",
  "required": [
    "input",
    "model"
  ],
  "properties": {
    "input": {
      "type": "array",
      "title": "Input",
      "description": "Nested array structure where each inner array contains chunks from a single document. Chunks within the same document are encoded with document-level context awareness. Maximum 512 documents. Total chunks across all documents must not exceed 16,000. Total tokens per document must not exceed 32K. All chunks in a single request must not exceed 120,000 tokens combined. Empty strings are not allowed.",
      "items": {
        "type": "array",
        "items": {
          "type": "string",
          "minLength": 1
        },
        "minItems": 1
      },
      "minItems": 1,
      "maxItems": 512
    },
    "model": {
      "type": "string",
      "title": "Model",
      "description": "The contextualized embedding model to use",
      "enum": [
        "pplx-embed-context-v1-0.6b",
        "pplx-embed-context-v1-4b"
      ]
    },
    "dimensions": {
      "type": "integer",
      "title": "Dimensions",
      "description": "Number of dimensions for output embeddings (Matryoshka). Range: 128-1024 for pplx-embed-context-v1-0.6b, 128-2560 for pplx-embed-context-v1-4b. Defaults to full dimensions (1024 or 2560).",
      "minimum": 128,
      "maximum": 2560
    },
    "encoding_format": {
      "type": "string",
      "title": "Encoding Format",
      "description": "Output encoding format for embeddings. base64_int8 returns base64-encoded signed int8 values. base64_binary returns base64-encoded packed binary (1 bit per dimension).",
      "enum": [
        "base64_int8",
        "base64_binary"
      ],
      "default": "base64_int8"
    }
  }
}