{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sap-btp/json-schema/sap-btp-embeddings-post-response-schema.json",
  "title": "EmbeddingsPostResponse",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sap-btp-orchestration-openapi.yml#/components/schemas/EmbeddingsPostResponse",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "request_id",
    "final_result"
  ],
  "properties": {
    "request_id": {
      "type": "string"
    },
    "intermediate_results": {
      "$ref": "#/$defs/ModuleResultsBase"
    },
    "final_result": {
      "$ref": "#/$defs/EmbeddingsResponse"
    }
  },
  "$defs": {
    "AssistantChatMessage": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "role": {
          "type": "string",
          "enum": [
            "assistant"
          ]
        },
        "content": {
          "$ref": "#/$defs/ChatMessageContent"
        },
        "refusal": {
          "type": "string"
        },
        "tool_calls": {
          "$ref": "#/$defs/MessageToolCalls"
        },
        "reasoning_content": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ReasoningBlock"
          },
          "description": "Reasoning or thinking content from the model's previous turn.\n"
        }
      },
      "required": [
        "role"
      ]
    },
    "CacheControl": {
      "type": "object",
      "description": "Cache control directive for Anthropic prompt caching. Only applicable to Anthropic Claude models. When set, marks the content block as a cache breakpoint.\n",
      "additionalProperties": false,
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "ephemeral"
          ]
        },
        "ttl": {
          "type": "string",
          "description": "Time-to-live for the cache entry. Default is \"5m\" (5 minutes). \"1h\" (1 hour) is supported on select models (e.g. Claude Opus 4.5, Haiku 4.5, Sonnet 4.5).\n",
          "enum": [
            "5m",
            "1h"
          ]
        }
      }
    },
    "ChatMessage": {
      "oneOf": [
        {
          "$ref": "#/$defs/SystemChatMessage"
        },
        {
          "$ref": "#/$defs/UserChatMessage"
        },
        {
          "$ref": "#/$defs/AssistantChatMessage"
        },
        {
          "$ref": "#/$defs/ToolChatMessage"
        },
        {
          "$ref": "#/$defs/DeveloperChatMessage"
        }
      ]
    },
    "ChatMessageContent": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TextContent"
          },
          "minItems": 1
        }
      ]
    },
    "DeveloperChatMessage": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "role": {
          "type": "string",
          "enum": [
            "developer"
          ]
        },
        "content": {
          "$ref": "#/$defs/ChatMessageContent"
        }
      },
      "required": [
        "role",
        "content"
      ]
    },
    "Embedding": {
      "oneOf": [
        {
          "$ref": "#/$defs/EmbeddingFloatArray"
        },
        {
          "$ref": "#/$defs/EmbeddingBase64String"
        },
        {
          "$ref": "#/$defs/EmbeddingMultiFormat"
        }
      ]
    },
    "EmbeddingBase64String": {
      "type": "string",
      "description": "A single base64 string representing the embedding."
    },
    "EmbeddingFloatArray": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "description": "An array of floating point numbers representing the embedding. "
    },
    "EmbeddingMultiFormat": {
      "type": "object",
      "description": "A dictionary mapping encoding format names to their embeddings. Used when multiple encoding formats are requested (Cohere-specific).",
      "additionalProperties": false,
      "properties": {
        "float": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "description": "Float encoding format - array of floating point numbers"
        },
        "int8": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "Int8 encoding format - array of 8-bit integers"
        },
        "uint8": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "Uint8 encoding format - array of unsigned 8-bit integers"
        },
        "base64": {
          "type": "string",
          "description": "Base64 encoding format - base64 encoded string"
        },
        "binary": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "Binary encoding format - array of integers"
        },
        "ubinary": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "Ubinary encoding format - array of unsigned integers"
        }
      }
    },
    "EmbeddingResult": {
      "type": "object",
      "description": "Represents an embedding vector returned by embedding endpoint.\n",
      "additionalProperties": false,
      "required": [
        "object",
        "embedding",
        "index"
      ],
      "properties": {
        "object": {
          "type": "string",
          "description": "The object type, which is always \"embedding\".",
          "enum": [
            "embedding"
          ]
        },
        "embedding": {
          "$ref": "#/$defs/Embedding"
        },
        "index": {
          "type": "integer",
          "description": "The index of the embedding in the list of embeddings."
        }
      }
    },
    "EmbeddingsResponse": {
      "type": "object",
      "description": "The response from request to embedding model following OpenAI specification.",
      "additionalProperties": false,
      "required": [
        "object",
        "data",
        "model",
        "usage"
      ],
      "properties": {
        "object": {
          "type": "string",
          "description": "The object type, which is always \"list\".",
          "enum": [
            "list"
          ]
        },
        "data": {
          "type": "array",
          "description": "The list of embeddings generated by the model.",
          "items": {
            "$ref": "#/$defs/EmbeddingResult"
          }
        },
        "model": {
          "type": "string",
          "description": "The name of the model used to generate the embedding."
        },
        "usage": {
          "$ref": "#/$defs/EmbeddingsUsage"
        }
      }
    },
    "EmbeddingsUsage": {
      "type": "object",
      "description": "The usage information for the request.",
      "additionalProperties": false,
      "required": [
        "prompt_tokens",
        "total_tokens"
      ],
      "properties": {
        "prompt_tokens": {
          "type": "integer",
          "description": "The number of tokens used by the prompt."
        },
        "total_tokens": {
          "type": "integer",
          "description": "The total number of tokens used by the request."
        }
      }
    },
    "FileContent": {
      "type": "object",
      "required": [
        "file_data"
      ],
      "additionalProperties": false,
      "properties": {
        "file_data": {
          "type": "string",
          "description": "Base64 encoded file content or file URL"
        },
        "filename": {
          "type": "string",
          "description": "Name of the file"
        }
      }
    },
    "GenericModuleResult": {
      "type": "object",
      "description": "Generic module result",
      "required": [
        "message"
      ],
      "properties": {
        "message": {
          "type": "string",
          "description": "Some message created from the module"
        },
        "data": {
          "type": "object",
          "description": "Additional data object from the module"
        }
      }
    },
    "ImageContentUrl": {
      "type": "object",
      "required": [
        "url"
      ],
      "additionalProperties": false,
      "properties": {
        "url": {
          "type": "string"
        },
        "detail": {
          "type": "string",
          "default": "auto"
        }
      }
    },
    "InputTranslationModuleResult": {
      "type": "object",
      "description": "Input Translation module result",
      "required": [
        "message"
      ],
      "additionalProperties": false,
      "properties": {
        "message": {
          "type": "string",
          "description": "Status message describing the translation operation outcome."
        },
        "data": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "translated_template": {
              "type": "string",
              "deprecated": true
            },
            "translated_template_roles": {
              "type": "object",
              "additionalProperties": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "translated_placeholders": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "MessageToolCall": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The ID of the tool call."
        },
        "type": {
          "type": "string",
          "enum": [
            "function"
          ],
          "description": "The type of the tool. Currently, only `function` is supported."
        },
        "function": {
          "type": "object",
          "description": "The function that the model called.",
          "properties": {
            "name": {
              "type": "string",
              "description": "The name of the function to call."
            },
            "arguments": {
              "type": "string",
              "description": "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function."
            }
          },
          "required": [
            "name",
            "arguments"
          ]
        }
      },
      "required": [
        "id",
        "type",
        "function"
      ]
    },
    "MessageToolCalls": {
      "type": "array",
      "description": "The tool calls generated by the model, such as function calls.",
      "items": {
        "$ref": "#/$defs/MessageToolCall"
      }
    },
    "ModuleResultsBase": {
      "description": "Results of each module of /embeddings endpoint(e.g. input masking).",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "grounding": {
          "$ref": "#/$defs/GenericModuleResult"
        },
        "templating": {
          "$ref": "#/$defs/TemplatingChatMessage"
        },
        "input_translation": {
          "$ref": "#/$defs/InputTranslationModuleResult"
        },
        "input_masking": {
          "$ref": "#/$defs/GenericModuleResult"
        },
        "input_filtering": {
          "$ref": "#/$defs/GenericModuleResult"
        },
        "output_filtering": {
          "$ref": "#/$defs/GenericModuleResult"
        },
        "output_translation": {
          "$ref": "#/$defs/GenericModuleResult"
        }
      }
    },
    "ReasoningBlock": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "content": {
          "type": "string",
          "default": ""
        },
        "signature": {
          "type": "string",
          "default": ""
        }
      }
    },
    "SystemChatMessage": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "role": {
          "type": "string",
          "enum": [
            "system"
          ]
        },
        "content": {
          "$ref": "#/$defs/ChatMessageContent"
        }
      },
      "required": [
        "role",
        "content"
      ]
    },
    "TemplatingChatMessage": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/ChatMessage"
      }
    },
    "TextContent": {
      "type": "object",
      "required": [
        "type",
        "text"
      ],
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "text"
          ]
        },
        "text": {
          "type": "string"
        },
        "cache_control": {
          "$ref": "#/$defs/CacheControl"
        }
      }
    },
    "ToolChatMessage": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "role": {
          "type": "string",
          "enum": [
            "tool"
          ]
        },
        "tool_call_id": {
          "type": "string"
        },
        "content": {
          "$ref": "#/$defs/ChatMessageContent"
        }
      },
      "required": [
        "role",
        "content",
        "tool_call_id"
      ]
    },
    "UserChatMessage": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "content": {
          "$ref": "#/$defs/UserChatMessageContent"
        },
        "role": {
          "type": "string",
          "enum": [
            "user"
          ]
        }
      },
      "required": [
        "content",
        "role"
      ]
    },
    "UserChatMessageContent": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/UserChatMessageContentItem"
          },
          "minItems": 1
        }
      ]
    },
    "UserChatMessageContentItem": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "text",
            "image_url",
            "file"
          ]
        },
        "text": {
          "type": "string"
        },
        "image_url": {
          "$ref": "#/$defs/ImageContentUrl"
        },
        "file": {
          "$ref": "#/$defs/FileContent"
        },
        "cache_control": {
          "$ref": "#/$defs/CacheControl"
        }
      },
      "required": [
        "type"
      ]
    }
  }
}