{
  "openapi": "3.1.0",
  "info": {
    "title": "Chatsax API",
    "version": "1.1.0",
    "description": "Agent search infrastructure. Core model request schemas follow Jina AI OpenAPI 2026.07.27.1603. Chatsax authentication, quotas, ownership and gateway routes are independent. Source: https://api.jina.ai/openapi.json"
  },
  "paths": {
    "/v1/embeddings": {
      "post": {
        "tags": [
          "Search Foundation Models"
        ],
        "summary": "Embeddings",
        "description": "Generate embeddings for text, images, or documents.\n\nWorld-class multimodal multilingual embeddings for semantic search,\nsimilarity matching, clustering, and classification tasks.",
        "operationId": "embeddings_v1_embeddings_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/EmbeddingsV2Request"
                  },
                  {
                    "$ref": "#/components/schemas/EmbeddingsV3Request"
                  },
                  {
                    "$ref": "#/components/schemas/EmbeddingsV5Request"
                  },
                  {
                    "$ref": "#/components/schemas/EmbeddingsV4Request"
                  },
                  {
                    "$ref": "#/components/schemas/CodeEmbeddings500MRequest"
                  },
                  {
                    "$ref": "#/components/schemas/CodeEmbeddings1500MRequest"
                  },
                  {
                    "$ref": "#/components/schemas/ClipV1Request"
                  },
                  {
                    "$ref": "#/components/schemas/ClipV2Request"
                  },
                  {
                    "$ref": "#/components/schemas/ColbertV1Request"
                  },
                  {
                    "$ref": "#/components/schemas/ColbertV2Request"
                  },
                  {
                    "$ref": "#/components/schemas/ELSERV2Request"
                  }
                ],
                "title": "Embedding Request",
                "discriminator": {
                  "propertyName": "model",
                  "mapping": {
                    "jina-embeddings-v2-base-en": "#/components/schemas/EmbeddingsV2Request",
                    "jina-embeddings-v2-base-zh": "#/components/schemas/EmbeddingsV2Request",
                    "jina-embeddings-v2-base-de": "#/components/schemas/EmbeddingsV2Request",
                    "jina-embeddings-v2-base-es": "#/components/schemas/EmbeddingsV2Request",
                    "jina-embeddings-v2-base-code": "#/components/schemas/EmbeddingsV2Request",
                    "jina-embeddings-v3": "#/components/schemas/EmbeddingsV3Request",
                    "jina-embeddings-v5-text-nano": "#/components/schemas/EmbeddingsV5Request",
                    "jina-embeddings-v5-text-small": "#/components/schemas/EmbeddingsV5Request",
                    "jina-embeddings-v5-omni-small": "#/components/schemas/EmbeddingsV5Request",
                    "jina-embeddings-v5-omni-nano": "#/components/schemas/EmbeddingsV5Request",
                    "jina-embeddings-v4": "#/components/schemas/EmbeddingsV4Request",
                    "jina-code-embeddings-0.5b": "#/components/schemas/CodeEmbeddings500MRequest",
                    "jina-code-embeddings-1.5b": "#/components/schemas/CodeEmbeddings1500MRequest",
                    "jina-clip-v1": "#/components/schemas/ClipV1Request",
                    "jina-clip-v2": "#/components/schemas/ClipV2Request",
                    "jina-colbert-v1-en": "#/components/schemas/ColbertV1Request",
                    "jina-colbert-v2": "#/components/schemas/ColbertV2Request",
                    "elser-v2": "#/components/schemas/ELSERV2Request"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "ChatsaxKey": []
          }
        ]
      }
    },
    "/v1/rerank": {
      "post": {
        "tags": [
          "Search Foundation Models"
        ],
        "summary": "Rerank",
        "description": "Rerank documents by relevance to a query.\n\nWorld-class reranker for maximizing search relevancy and RAG accuracy.",
        "operationId": "rerank_v1_rerank_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/TextRerankerRequest"
                  },
                  {
                    "$ref": "#/components/schemas/RerankerM0Request"
                  },
                  {
                    "$ref": "#/components/schemas/RerankerV3Request"
                  }
                ],
                "title": "Reranking Request",
                "discriminator": {
                  "propertyName": "model",
                  "mapping": {
                    "jina-reranker-v2-base-multilingual": "#/components/schemas/TextRerankerRequest",
                    "jina-reranker-v1-tiny-en": "#/components/schemas/TextRerankerRequest",
                    "jina-reranker-v1-turbo-en": "#/components/schemas/TextRerankerRequest",
                    "jina-reranker-v1-base-en": "#/components/schemas/TextRerankerRequest",
                    "jina-colbert-v1-en": "#/components/schemas/TextRerankerRequest",
                    "jina-colbert-v2": "#/components/schemas/TextRerankerRequest",
                    "jina-reranker-m0": "#/components/schemas/RerankerM0Request",
                    "jina-reranker-v3": "#/components/schemas/RerankerV3Request",
                    "jina-reranker-v3.5": "#/components/schemas/RerankerV3Request"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RerankingResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "ChatsaxKey": []
          }
        ]
      }
    },
    "/v1/classify": {
      "post": {
        "tags": [
          "Zero/Few-shot Classification"
        ],
        "summary": "Classify",
        "description": "Classify text or images into categories.\n\nZero-shot and few-shot classification. Zero-shot uses embedding similarity,\nfew-shot uses a trained classifier.",
        "operationId": "classify_v1_classify_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/EmbeddingsV2ZeroShotClassificationRequest"
                      },
                      {
                        "$ref": "#/components/schemas/EmbeddingsV3ZeroShotClassificationRequest"
                      },
                      {
                        "$ref": "#/components/schemas/EmbeddingsV4ZeroShotClassificationRequest"
                      },
                      {
                        "$ref": "#/components/schemas/EmbeddingsV5ZeroShotClassificationRequest"
                      },
                      {
                        "$ref": "#/components/schemas/ClipZeroShotClassificationRequest"
                      },
                      {
                        "$ref": "#/components/schemas/CodeEmbeddingsZeroShotClassificationRequest"
                      }
                    ],
                    "discriminator": {
                      "propertyName": "model",
                      "mapping": {
                        "jina-embeddings-v2-base-en": "#/components/schemas/EmbeddingsV2ZeroShotClassificationRequest",
                        "jina-embeddings-v2-base-zh": "#/components/schemas/EmbeddingsV2ZeroShotClassificationRequest",
                        "jina-embeddings-v2-base-de": "#/components/schemas/EmbeddingsV2ZeroShotClassificationRequest",
                        "jina-embeddings-v2-base-es": "#/components/schemas/EmbeddingsV2ZeroShotClassificationRequest",
                        "jina-embeddings-v2-base-code": "#/components/schemas/EmbeddingsV2ZeroShotClassificationRequest",
                        "jina-embeddings-v3": "#/components/schemas/EmbeddingsV3ZeroShotClassificationRequest",
                        "jina-embeddings-v4": "#/components/schemas/EmbeddingsV4ZeroShotClassificationRequest",
                        "jina-embeddings-v5-text-nano": "#/components/schemas/EmbeddingsV5ZeroShotClassificationRequest",
                        "jina-embeddings-v5-text-small": "#/components/schemas/EmbeddingsV5ZeroShotClassificationRequest",
                        "jina-clip-v1": "#/components/schemas/ClipZeroShotClassificationRequest",
                        "jina-clip-v2": "#/components/schemas/ClipZeroShotClassificationRequest",
                        "jina-code-embeddings-0.5b": "#/components/schemas/CodeEmbeddingsZeroShotClassificationRequest",
                        "jina-code-embeddings-1.5b": "#/components/schemas/CodeEmbeddingsZeroShotClassificationRequest"
                      }
                    }
                  },
                  {
                    "$ref": "#/components/schemas/FewShotClassificationRequest"
                  }
                ],
                "title": "Classification Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClassificationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "ChatsaxKey": []
          }
        ]
      }
    },
    "/v1/train": {
      "post": {
        "tags": [
          "Zero/Few-shot Classification"
        ],
        "summary": "Train",
        "description": "Train or update a few-shot classifier.\n\nCreate a new classifier with labeled examples, or update an existing one\nwith additional training data.",
        "operationId": "train_v1_train_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/EmbeddingsV2CreateTrainingRequest"
                      },
                      {
                        "$ref": "#/components/schemas/EmbeddingsV3CreateTrainingRequest"
                      },
                      {
                        "$ref": "#/components/schemas/EmbeddingsV4CreateTrainingRequest"
                      },
                      {
                        "$ref": "#/components/schemas/EmbeddingsV5CreateTrainingRequest"
                      },
                      {
                        "$ref": "#/components/schemas/ClipCreateTrainingRequest"
                      }
                    ],
                    "discriminator": {
                      "propertyName": "model",
                      "mapping": {
                        "jina-embeddings-v2-base-en": "#/components/schemas/EmbeddingsV2CreateTrainingRequest",
                        "jina-embeddings-v2-base-zh": "#/components/schemas/EmbeddingsV2CreateTrainingRequest",
                        "jina-embeddings-v2-base-de": "#/components/schemas/EmbeddingsV2CreateTrainingRequest",
                        "jina-embeddings-v2-base-es": "#/components/schemas/EmbeddingsV2CreateTrainingRequest",
                        "jina-embeddings-v2-base-code": "#/components/schemas/EmbeddingsV2CreateTrainingRequest",
                        "jina-embeddings-v3": "#/components/schemas/EmbeddingsV3CreateTrainingRequest",
                        "jina-embeddings-v4": "#/components/schemas/EmbeddingsV4CreateTrainingRequest",
                        "jina-embeddings-v5-text-nano": "#/components/schemas/EmbeddingsV5CreateTrainingRequest",
                        "jina-embeddings-v5-text-small": "#/components/schemas/EmbeddingsV5CreateTrainingRequest",
                        "jina-clip-v1": "#/components/schemas/ClipCreateTrainingRequest",
                        "jina-clip-v2": "#/components/schemas/ClipCreateTrainingRequest"
                      }
                    }
                  },
                  {
                    "$ref": "#/components/schemas/UpdateTrainingRequest"
                  }
                ],
                "title": "Training Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "ChatsaxKey": []
          }
        ]
      }
    },
    "/v1/classifiers": {
      "get": {
        "tags": [
          "Zero/Few-shot Classification"
        ],
        "summary": "List Classifiers",
        "description": "List all classifiers owned by the authenticated user.",
        "operationId": "list_classifiers_v1_classifiers_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ClassifierSummary"
                  },
                  "type": "array",
                  "title": "Response List Classifiers V1 Classifiers Post"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "ChatsaxKey": []
          }
        ]
      },
      "post": {
        "tags": [
          "Zero/Few-shot Classification"
        ],
        "summary": "List Classifiers",
        "description": "List all classifiers owned by the authenticated user.",
        "operationId": "list_classifiers_v1_classifiers_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ClassifierSummary"
                  },
                  "type": "array",
                  "title": "Response List Classifiers V1 Classifiers Post"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "ChatsaxKey": []
          }
        ]
      }
    },
    "/v1/classifiers/{classifier_id}": {
      "delete": {
        "tags": [
          "Zero/Few-shot Classification"
        ],
        "summary": "Delete Classifier",
        "description": "Delete a classifier by ID.",
        "operationId": "delete_classifier_v1_classifiers__classifier_id__delete",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "parameters": [
          {
            "name": "classifier_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Classifier Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Delete Classifier V1 Classifiers  Classifier Id  Delete"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/models": {
      "get": {
        "tags": [
          "Model List"
        ],
        "summary": "List Models",
        "description": "List all available Jina AI models.\n\nReturns model metadata in OpenRouter-compatible format including\nmodel IDs, input/output modalities, context lengths, and pricing.",
        "operationId": "list_models_v1_models_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelListResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": []
      }
    },
    "/v1/models/{model_id}": {
      "get": {
        "tags": [
          "Model List"
        ],
        "summary": "Get Model",
        "description": "Get details for a specific model.\n\nAccepts both full form (`jina-ai/jina-embeddings-v3`) and\nshort form (`jina-embeddings-v3`).",
        "operationId": "get_model_v1_models__model_id__get",
        "parameters": [
          {
            "name": "model_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Model Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelInfo"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": []
      }
    },
    "/v1/chat/completions": {
      "post": {
        "summary": "Chat: jina-vlm or jina-deepsearch-v1, selected by model",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success; response follows the provider contract."
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Missing or invalid Chatsax key"
          },
          "403": {
            "description": "Insufficient scope"
          },
          "429": {
            "description": "Request limit exceeded; see Retry-After"
          },
          "502": {
            "description": "Provider failure"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "reasoning_effort": {
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  "budget_tokens": {
                    "type": "integer"
                  },
                  "max_tokens": {
                    "type": "integer"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/v1/batch/embeddings": {
      "post": {
        "tags": [
          "Batch Embeddings"
        ],
        "summary": "Create a batch embedding job",
        "description": "Submit a batch of texts for asynchronous embedding processing.",
        "operationId": "create_batch_job_v1_batch_embeddings_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchEmbeddingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "security": [
          {
            "ChatsaxKey": []
          }
        ]
      }
    },
    "/v1/batch/{batch_id}": {
      "get": {
        "tags": [
          "Batch Embeddings"
        ],
        "summary": "Get batch job status",
        "description": "Retrieve the status of a batch embedding job.",
        "operationId": "get_batch_status_v1_batch__batch_id__get",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Batch Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "delete": {
        "tags": [
          "Batch Embeddings"
        ],
        "summary": "Cancel a batch job",
        "description": "Cancel a pending or processing batch job.",
        "operationId": "cancel_batch_job_v1_batch__batch_id__delete",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Batch Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchStatus"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/batches": {
      "get": {
        "tags": [
          "Batch Embeddings"
        ],
        "summary": "List batch jobs",
        "description": "List recent batch jobs for the authenticated user.",
        "operationId": "list_batch_jobs_v1_batches_get",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 20,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BatchStatus"
                  },
                  "title": "Response List Batch Jobs V1 Batches Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/batch/{batch_id}/output": {
      "get": {
        "tags": [
          "Batch Embeddings"
        ],
        "summary": "Download batch job output",
        "description": "Stream the output JSONL file for a completed batch job.",
        "operationId": "download_batch_output_v1_batch__batch_id__output_get",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Batch Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/batch/{batch_id}/errors": {
      "get": {
        "tags": [
          "Batch Embeddings"
        ],
        "summary": "Download batch job error file",
        "description": "Stream the error JSONL file for a completed batch job.",
        "operationId": "download_batch_errors_v1_batch__batch_id__errors_get",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Batch Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/read": {
      "post": {
        "summary": "Read a web page",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success; response follows the provider contract."
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Missing or invalid Chatsax key"
          },
          "403": {
            "description": "Insufficient scope"
          },
          "429": {
            "description": "Request limit exceeded; see Retry-After"
          },
          "502": {
            "description": "Provider failure"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "html": {
                    "type": "string"
                  },
                  "pdf": {
                    "type": "string"
                  },
                  "viewport": {
                    "type": "object"
                  },
                  "injectPageScript": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "instruction": {
                    "type": "string"
                  },
                  "jsonSchema": {
                    "type": "object"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        }
      },
      "get": {
        "summary": "Query-parameter convenience endpoint",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success; response follows the provider contract."
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Missing or invalid Chatsax key"
          },
          "403": {
            "description": "Insufficient scope"
          },
          "429": {
            "description": "Request limit exceeded; see Retry-After"
          },
          "502": {
            "description": "Provider failure"
          }
        },
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          }
        ]
      }
    },
    "/v1/search": {
      "post": {
        "summary": "Search the web",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success; response follows the provider contract."
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Missing or invalid Chatsax key"
          },
          "403": {
            "description": "Insufficient scope"
          },
          "429": {
            "description": "Request limit exceeded; see Retry-After"
          },
          "502": {
            "description": "Provider failure"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "q": {
                    "type": "string"
                  },
                  "num": {
                    "type": "integer"
                  },
                  "gl": {
                    "type": "string"
                  },
                  "hl": {
                    "type": "string"
                  },
                  "location": {
                    "type": "string"
                  },
                  "page": {
                    "type": "integer"
                  }
                },
                "additionalProperties": true,
                "required": [
                  "q"
                ]
              }
            }
          }
        }
      },
      "get": {
        "summary": "Query-parameter convenience endpoint",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success; response follows the provider contract."
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Missing or invalid Chatsax key"
          },
          "403": {
            "description": "Insufficient scope"
          },
          "429": {
            "description": "Request limit exceeded; see Retry-After"
          },
          "502": {
            "description": "Provider failure"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/segment": {
      "post": {
        "summary": "Tokenize and segment text",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success; response follows the provider contract."
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Missing or invalid Chatsax key"
          },
          "403": {
            "description": "Insufficient scope"
          },
          "429": {
            "description": "Request limit exceeded; see Retry-After"
          },
          "502": {
            "description": "Provider failure"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "content"
                ],
                "properties": {
                  "content": {
                    "type": "string"
                  },
                  "tokenizer": {
                    "type": "string",
                    "default": "cl100k_base"
                  },
                  "return_tokens": {
                    "type": "boolean"
                  },
                  "return_chunks": {
                    "type": "boolean"
                  },
                  "max_chunk_length": {
                    "type": "integer",
                    "description": "Maximum characters per chunk"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/deepsearch": {
      "post": {
        "summary": "Research with jina-deepsearch-v1; supports SSE",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success; response follows the provider contract."
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Missing or invalid Chatsax key"
          },
          "403": {
            "description": "Insufficient scope"
          },
          "429": {
            "description": "Request limit exceeded; see Retry-After"
          },
          "502": {
            "description": "Provider failure"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "reasoning_effort": {
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  "budget_tokens": {
                    "type": "integer"
                  },
                  "max_tokens": {
                    "type": "integer"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "summary": "Gateway health and configuration",
        "security": [],
        "responses": {
          "200": {
            "description": "Success; response follows the provider contract."
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Missing or invalid Chatsax key"
          },
          "403": {
            "description": "Insufficient scope"
          },
          "429": {
            "description": "Request limit exceeded; see Retry-After"
          },
          "502": {
            "description": "Provider failure"
          }
        }
      }
    },
    "/api/capabilities": {
      "get": {
        "summary": "API capability discovery",
        "security": [],
        "responses": {
          "200": {
            "description": "Success; response follows the provider contract."
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Missing or invalid Chatsax key"
          },
          "403": {
            "description": "Insufficient scope"
          },
          "429": {
            "description": "Request limit exceeded; see Retry-After"
          },
          "502": {
            "description": "Provider failure"
          }
        }
      }
    },
    "/api/me": {
      "get": {
        "summary": "Current key metadata and 30-day usage",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success; response follows the provider contract."
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Missing or invalid Chatsax key"
          },
          "403": {
            "description": "Insufficient scope"
          },
          "429": {
            "description": "Request limit exceeded; see Retry-After"
          },
          "502": {
            "description": "Provider failure"
          }
        }
      }
    },
    "/api/admin/keys": {
      "get": {
        "summary": "List managed API keys (administrator only)",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success; response follows the provider contract."
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Missing or invalid Chatsax key"
          },
          "403": {
            "description": "Insufficient scope"
          },
          "429": {
            "description": "Request limit exceeded; see Retry-After"
          },
          "502": {
            "description": "Provider failure"
          }
        }
      },
      "post": {
        "summary": "Create a scoped API key (administrator only)",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success; response follows the provider contract."
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Missing or invalid Chatsax key"
          },
          "403": {
            "description": "Insufficient scope"
          },
          "429": {
            "description": "Request limit exceeded; see Retry-After"
          },
          "502": {
            "description": "Provider failure"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "rate_limit_per_minute": {
                    "type": "integer",
                    "default": 60
                  },
                  "daily_request_limit": {
                    "type": "integer",
                    "default": 10000
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/keys/{id}": {
      "delete": {
        "summary": "Revoke a managed API key (administrator only)",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success; response follows the provider contract."
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Missing or invalid Chatsax key"
          },
          "403": {
            "description": "Insufficient scope"
          },
          "429": {
            "description": "Request limit exceeded; see Retry-After"
          },
          "502": {
            "description": "Provider failure"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/admin/upstream": {
      "get": {
        "summary": "Verified provider token balance (administrator only)",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success; response follows the provider contract."
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Missing or invalid Chatsax key"
          },
          "403": {
            "description": "Insufficient scope"
          },
          "429": {
            "description": "Request limit exceeded; see Retry-After"
          },
          "502": {
            "description": "Provider failure"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "summary": "Stateless MCP Streamable HTTP JSON-RPC",
        "security": [
          {
            "ChatsaxKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success; response follows the provider contract."
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Missing or invalid Chatsax key"
          },
          "403": {
            "description": "Insufficient scope"
          },
          "429": {
            "description": "Request limit exceeded; see Retry-After"
          },
          "502": {
            "description": "Provider failure"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/api/auth/config": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Available sign-in providers",
        "operationId": "chatsax_get_api_auth_config",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          }
        }
      }
    },
    "/api/auth/session": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Current session",
        "operationId": "chatsax_get_api_auth_session",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          }
        }
      }
    },
    "/api/auth/register": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Register and send a verification email",
        "operationId": "chatsax_post_api_auth_register",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          }
        },
        "description": "Email links expire after 30 minutes. Successful login/reset sets a secure HttpOnly session cookie. Registration does not grant tokens before verification.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "password": {
                    "type": "string",
                    "format": "password",
                    "minLength": 8
                  },
                  "consent": {
                    "const": true
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "required": [
                  "email",
                  "password",
                  "consent"
                ]
              }
            }
          }
        }
      }
    },
    "/api/auth/login": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Sign in with email and password",
        "operationId": "chatsax_post_api_auth_login",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          }
        },
        "description": "Email links expire after 30 minutes. Successful login/reset sets a secure HttpOnly session cookie. Registration does not grant tokens before verification.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "password": {
                    "type": "string",
                    "format": "password",
                    "minLength": 8
                  }
                },
                "required": [
                  "email",
                  "password"
                ]
              }
            }
          }
        }
      }
    },
    "/api/auth/forgot": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Send a password reset link",
        "operationId": "chatsax_post_api_auth_forgot",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          }
        },
        "description": "Email links expire after 30 minutes. Successful login/reset sets a secure HttpOnly session cookie. Registration does not grant tokens before verification.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        }
      }
    },
    "/api/auth/resend-verification": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Resend an email verification link",
        "operationId": "chatsax_post_api_auth_resend-verification",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          }
        },
        "description": "Email links expire after 30 minutes. Successful login/reset sets a secure HttpOnly session cookie. Registration does not grant tokens before verification.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        }
      }
    },
    "/api/auth/reset": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Set a new password",
        "operationId": "chatsax_post_api_auth_reset",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          }
        },
        "description": "Email links expire after 30 minutes. Successful login/reset sets a secure HttpOnly session cookie. Registration does not grant tokens before verification.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64
                  },
                  "password": {
                    "type": "string",
                    "format": "password",
                    "minLength": 8
                  }
                },
                "required": [
                  "token",
                  "password"
                ]
              }
            }
          }
        }
      }
    },
    "/api/auth/logout": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Sign out and revoke the current session",
        "operationId": "chatsax_post_api_auth_logout",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/auth/profile": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Update your profile",
        "operationId": "chatsax_post_api_auth_profile",
        "security": [
          {
            "AccountSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          },
          "401": {
            "description": "Sign in with a verified account"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/api/auth/verify": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Verify an email link",
        "operationId": "chatsax_get_api_auth_verify",
        "security": [],
        "responses": {
          "303": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          }
        },
        "description": "Browser redirect endpoint. Consumes the verification link once, grants a 10M trial once per verified account, sets a session cookie and redirects to Key Manager.",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64
            }
          }
        ]
      }
    },
    "/api/auth/oauth/google": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Start Google sign-in",
        "operationId": "chatsax_get_api_auth_oauth_google",
        "security": [],
        "responses": {
          "303": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          }
        },
        "description": "Browser navigation endpoint. Redirects to the provider and stores a short-lived state cookie. The callback completes sign-in and redirects to Key Manager."
      }
    },
    "/api/auth/oauth/github": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Start Github sign-in",
        "operationId": "chatsax_get_api_auth_oauth_github",
        "security": [],
        "responses": {
          "303": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          }
        },
        "description": "Browser navigation endpoint. Redirects to the provider and stores a short-lived state cookie. The callback completes sign-in and redirects to Key Manager."
      }
    },
    "/api/account/overview": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Account balance, recent ledger and purchases",
        "operationId": "chatsax_get_api_account_overview",
        "security": [
          {
            "AccountSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          },
          "401": {
            "description": "Sign in with a verified account"
          }
        },
        "description": "wallet contains balance_tokens, reserved_tokens and available_tokens. Recent purchases and ledger are limited to 50 rows each."
      }
    },
    "/api/account/keys": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "List your API keys",
        "operationId": "chatsax_get_api_account_keys",
        "security": [
          {
            "AccountSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          },
          "401": {
            "description": "Sign in with a verified account"
          }
        },
        "description": "Only prefixes and metadata are returned. At most 20 active keys per account."
      },
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Create an API key",
        "operationId": "chatsax_post_api_account_keys",
        "security": [
          {
            "AccountSession": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          },
          "401": {
            "description": "Sign in with a verified account"
          }
        },
        "description": "Full plaintext key is returned only once. Keys share the account token balance, with individual input and request budgets.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "max_input_bytes": {
                    "type": "integer",
                    "minimum": 1024,
                    "maximum": 8388608,
                    "default": 2097152
                  },
                  "max_request_tokens": {
                    "type": "integer",
                    "minimum": 10000,
                    "maximum": 10000000,
                    "default": 10000000
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/api/account/keys/{id}": {
      "patch": {
        "tags": [
          "Account"
        ],
        "summary": "Rename a key or change request budgets",
        "operationId": "chatsax_patch_api_account_keys_id",
        "security": [
          {
            "AccountSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          },
          "401": {
            "description": "Sign in with a verified account"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "max_input_bytes": {
                    "type": "integer",
                    "minimum": 1024,
                    "maximum": 8388608,
                    "default": 2097152
                  },
                  "max_request_tokens": {
                    "type": "integer",
                    "minimum": 10000,
                    "maximum": 10000000,
                    "default": 10000000
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "delete": {
        "tags": [
          "Account"
        ],
        "summary": "Revoke an API key",
        "operationId": "chatsax_delete_api_account_keys_id",
        "security": [
          {
            "AccountSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          },
          "401": {
            "description": "Sign in with a verified account"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/billing/plans": {
      "get": {
        "tags": [
          "Billing"
        ],
        "summary": "Token packages and available payment methods",
        "operationId": "chatsax_get_api_billing_plans",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          }
        }
      }
    },
    "/api/billing/checkout": {
      "post": {
        "tags": [
          "Billing"
        ],
        "summary": "Create a token purchase checkout",
        "operationId": "chatsax_post_api_billing_checkout",
        "security": [
          {
            "AccountSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          },
          "401": {
            "description": "Sign in with a verified account"
          }
        },
        "description": "Creates a payable checkout; does not itself charge. Card prices are USD/EUR. Alipay and WeChat settle in CNY using the disclosed fixed merchant rate. Returned fields include order_id, currency and amount_minor, plus a redirect URL and/or QR data. Tokens are credited only after verified payment.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "plan": {
                    "type": "string",
                    "enum": [
                      "standard",
                      "scale"
                    ]
                  },
                  "currency": {
                    "type": "string",
                    "enum": [
                      "usd",
                      "eur"
                    ],
                    "default": "usd"
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "card",
                      "alipay",
                      "wxpay"
                    ],
                    "default": "card"
                  }
                },
                "required": [
                  "plan"
                ]
              }
            }
          }
        }
      }
    },
    "/api/billing/order": {
      "get": {
        "tags": [
          "Billing"
        ],
        "summary": "Check one of your payment orders",
        "operationId": "chatsax_get_api_billing_order",
        "security": [
          {
            "AccountSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          },
          "401": {
            "description": "Sign in with a verified account"
          }
        },
        "description": "Retrieves the order and wallet; reconciles Stripe state when necessary. A success return URL alone never credits tokens.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/billing/portal": {
      "post": {
        "tags": [
          "Billing"
        ],
        "summary": "Open your Stripe billing portal",
        "operationId": "chatsax_post_api_billing_portal",
        "security": [
          {
            "AccountSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          },
          "401": {
            "description": "Sign in with a verified account"
          }
        },
        "description": "Requires a Stripe customer from a prior card purchase or card setup. Returns a short-lived provider URL for billing and invoice management.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        }
      }
    },
    "/api/billing/auto-recharge": {
      "get": {
        "tags": [
          "Billing"
        ],
        "summary": "Automatic recharge settings and saved card summary",
        "operationId": "chatsax_get_api_billing_auto-recharge",
        "security": [
          {
            "AccountSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          },
          "401": {
            "description": "Sign in with a verified account"
          }
        }
      },
      "post": {
        "tags": [
          "Billing"
        ],
        "summary": "Enable or disable automatic recharge",
        "operationId": "chatsax_post_api_billing_auto-recharge",
        "security": [
          {
            "AccountSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          },
          "401": {
            "description": "Sign in with a verified account"
          }
        },
        "description": "Enable requires a consented saved card, consent=true and all settings. Threshold must not exceed the package size. To stop new automatic charges, send only {\"enabled\":false}. A decline or required card authentication pauses automatic recharge.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "consent": {
                    "type": "boolean"
                  },
                  "threshold_tokens": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "plan": {
                    "type": "string",
                    "enum": [
                      "standard",
                      "scale"
                    ]
                  },
                  "currency": {
                    "type": "string",
                    "enum": [
                      "usd",
                      "eur"
                    ]
                  },
                  "max_daily_charges": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        }
      }
    },
    "/api/billing/payment-method/setup": {
      "post": {
        "tags": [
          "Billing"
        ],
        "summary": "Start consented card setup",
        "operationId": "chatsax_post_api_billing_payment-method_setup",
        "security": [
          {
            "AccountSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          },
          "401": {
            "description": "Sign in with a verified account"
          }
        },
        "description": "Returns a Stripe setup checkout URL. Saving a card does not purchase tokens or enable automatic recharge.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "consent": {
                    "const": true
                  }
                },
                "required": [
                  "consent"
                ]
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Billing"
        ],
        "summary": "Reconcile your card setup",
        "operationId": "chatsax_get_api_billing_payment-method_setup",
        "security": [
          {
            "AccountSession": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          },
          "401": {
            "description": "Sign in with a verified account"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/contact": {
      "post": {
        "tags": [
          "Support"
        ],
        "summary": "Submit a private support request",
        "operationId": "chatsax_post_api_contact",
        "security": [],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "429": {
            "description": "Request limit reached"
          }
        },
        "description": "Stored privately with a ticket reference. Limited to 5 requests per IP and 3 per email per hour. Do not include payment card details or API secrets.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "integration",
                      "billing",
                      "account",
                      "privacy",
                      "security"
                    ]
                  },
                  "subject": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 200
                  },
                  "message": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 6000
                  }
                },
                "required": [
                  "email",
                  "subject",
                  "message"
                ]
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AudioDoc": {
        "properties": {
          "audio": {
            "type": "string",
            "title": "Audio",
            "description": "Audio as a URL or base64-encoded string."
          }
        },
        "type": "object",
        "required": [
          "audio"
        ],
        "title": "AudioDoc"
      },
      "BaseUsage": {
        "properties": {
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens",
            "description": "Total number of tokens processed."
          }
        },
        "type": "object",
        "required": [
          "total_tokens"
        ],
        "title": "BaseUsage"
      },
      "BatchEmbeddingRequest": {
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "jina-embeddings-v5-text-nano",
              "jina-embeddings-v5-text-small"
            ],
            "title": "Model",
            "description": "The embedding model to use for batch processing."
          },
          "input_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Url",
            "description": "URL to input JSONL file (GCS, S3, or HTTP). Either input_url or input must be provided."
          },
          "input": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input",
            "description": "Inline JSONL lines for small batches. Either input_url or input must be provided."
          },
          "task": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task",
            "description": "Task optimization: retrieval, text-matching, clustering, or classification.",
            "default": "text-matching"
          },
          "dimensions": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1024.0,
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimensions",
            "description": "Number of dimensions for output embeddings (1-1024)."
          },
          "normalized": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Normalized",
            "description": "If true (default), embeddings are L2-normalized to unit length.",
            "default": true
          },
          "webhook_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Url",
            "description": "URL to POST notification when job completes."
          }
        },
        "type": "object",
        "required": [
          "model"
        ],
        "title": "BatchEmbeddingRequest",
        "description": "Request to create a batch embedding job.",
        "examples": [
          {
            "dimensions": 512,
            "input_url": "gs://my-bucket/inputs.jsonl",
            "model": "jina-embeddings-v5-text-small",
            "task": "retrieval"
          },
          {
            "input": [
              {
                "body": {
                  "input": "Hello world"
                },
                "custom_id": "req-1"
              },
              {
                "body": {
                  "input": "Batch embeddings"
                },
                "custom_id": "req-2"
              }
            ],
            "model": "jina-embeddings-v5-text-nano",
            "task": "text-matching"
          }
        ]
      },
      "BatchStats": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "Total number of input lines."
          },
          "completed": {
            "type": "integer",
            "title": "Completed",
            "description": "Number of successfully processed lines.",
            "default": 0
          },
          "failed": {
            "type": "integer",
            "title": "Failed",
            "description": "Number of failed lines.",
            "default": 0
          },
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens",
            "description": "Total tokens consumed across all processed lines.",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "total"
        ],
        "title": "BatchStats",
        "description": "Statistics for a batch job."
      },
      "BatchStatus": {
        "properties": {
          "batch_id": {
            "type": "string",
            "title": "Batch Id",
            "description": "Unique identifier for the batch job."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "completed",
              "failed",
              "expired",
              "cancelled"
            ],
            "title": "Status",
            "description": "Current status of the batch job."
          },
          "model": {
            "type": "string",
            "title": "Model",
            "description": "The model used for embedding."
          },
          "created_at": {
            "type": "string",
            "title": "Created At",
            "description": "ISO 8601 timestamp when job was created."
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At",
            "description": "ISO 8601 timestamp when job completed (if finished)."
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At",
            "description": "ISO 8601 timestamp when output URL expires (created_at + 24h)."
          },
          "output_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Url",
            "description": "Signed URL to download output JSONL (24h expiry)."
          },
          "error_file_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error File Url",
            "description": "URL to download error JSONL for failed lines."
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error",
            "description": "Error message if job failed."
          },
          "stats": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BatchStats"
              },
              {
                "type": "null"
              }
            ],
            "description": "Processing statistics."
          }
        },
        "type": "object",
        "required": [
          "batch_id",
          "status",
          "model",
          "created_at"
        ],
        "title": "BatchStatus",
        "description": "Status of a batch embedding job.",
        "examples": [
          {
            "batch_id": "batch_abc123",
            "completed_at": "2024-01-15T10:35:00Z",
            "created_at": "2024-01-15T10:30:00Z",
            "expires_at": "2024-01-16T10:30:00Z",
            "model": "jina-embeddings-v5-text-small",
            "output_url": "https://storage.googleapis.com/...",
            "stats": {
              "completed": 998,
              "failed": 2,
              "total": 1000
            },
            "status": "completed"
          }
        ]
      },
      "ClassificationPrediction": {
        "properties": {
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Object type, always `classification`.",
            "default": "classification"
          },
          "index": {
            "type": "integer",
            "title": "Index",
            "description": "Position of this result in the input list."
          },
          "prediction": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              }
            ],
            "title": "Prediction",
            "description": "Predicted label, or a dict of labels per group."
          },
          "score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "additionalProperties": {
                  "type": "number"
                },
                "type": "object"
              }
            ],
            "title": "Score",
            "description": "Confidence score, or a dict of scores per group."
          },
          "predictions": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ClassificationPredictionLabel"
                },
                "type": "array"
              },
              {
                "additionalProperties": {
                  "items": {
                    "$ref": "#/components/schemas/ClassificationPredictionLabel"
                  },
                  "type": "array"
                },
                "type": "object"
              }
            ],
            "title": "Predictions",
            "description": "All candidate labels with scores, or a dict per group."
          }
        },
        "type": "object",
        "required": [
          "index",
          "prediction",
          "score",
          "predictions"
        ],
        "title": "ClassificationPrediction",
        "description": "Classification result for one input item."
      },
      "ClassificationPredictionLabel": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label",
            "description": "The candidate label."
          },
          "score": {
            "type": "number",
            "title": "Score",
            "description": "Confidence score for this label."
          }
        },
        "type": "object",
        "required": [
          "label",
          "score"
        ],
        "title": "ClassificationPredictionLabel",
        "description": "A label with its confidence score."
      },
      "ClassificationResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ClassificationPrediction"
            },
            "type": "array",
            "title": "Data",
            "description": "Classification results, one per input item."
          },
          "usage": {
            "$ref": "#/components/schemas/BaseUsage",
            "description": "Token usage statistics."
          }
        },
        "type": "object",
        "required": [
          "data",
          "usage"
        ],
        "title": "ClassificationResponse",
        "description": "Response containing classification results."
      },
      "ClassifierSummary": {
        "properties": {
          "classifier_id": {
            "type": "string",
            "format": "uuid",
            "title": "Classifier Id",
            "description": "Unique identifier for the classifier"
          },
          "user_id": {
            "type": "string",
            "format": "uuid",
            "title": "User Id",
            "description": "User ID who owns the classifier"
          },
          "model": {
            "type": "string",
            "title": "Model",
            "description": "Name of the model used"
          },
          "labels": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Labels",
            "description": "List of classification labels"
          },
          "access": {
            "type": "string",
            "title": "Access",
            "description": "Access level (e.g., private, public)"
          },
          "updated_number": {
            "type": "integer",
            "title": "Updated Number",
            "description": "Number of times updated"
          },
          "used_number": {
            "type": "integer",
            "title": "Used Number",
            "description": "Number of times used"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Creation timestamp"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "description": "Last update timestamp"
          },
          "used_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Used At",
            "description": "Last used timestamp"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "description": "Whether the classifier is currently active",
            "default": true
          },
          "is_latest": {
            "type": "boolean",
            "title": "Is Latest",
            "description": "Whether this is the latest version of the classifier",
            "default": true
          },
          "metadata_": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata",
            "description": "Additional metadata"
          }
        },
        "type": "object",
        "required": [
          "classifier_id",
          "user_id",
          "model",
          "labels",
          "access",
          "updated_number",
          "used_number",
          "created_at",
          "updated_at"
        ],
        "title": "ClassifierSummary"
      },
      "ClipCreateTrainingRequest": {
        "properties": {
          "access": {
            "type": "string",
            "title": "Access",
            "description": "Access level for the training data. Can be 'public' or 'private'.",
            "default": "public"
          },
          "num_iters": {
            "type": "integer",
            "title": "Num Iters",
            "description": "Number of iterations for the training process.",
            "default": 10
          },
          "model": {
            "type": "string",
            "enum": [
              "jina-clip-v1",
              "jina-clip-v2"
            ],
            "title": "Model",
            "description": "CLIP model for zero-shot classification of images and text."
          },
          "input": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TextTrainingItem"
                },
                {
                  "$ref": "#/components/schemas/ImageTrainingItem"
                }
              ]
            },
            "type": "array",
            "maxItems": 512,
            "minItems": 2,
            "title": "Input",
            "description": "Must be a list of text-label or image-label training items with at least two unique labels. For batch training, provide a list with up to 512 items. Each image can be up to 8MB."
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "ClipCreateTrainingRequest",
        "example": {
          "access": "public",
          "input": [
            {
              "image": "https://images.unsplash.com/photo-1518717758536-85ae29035b6d",
              "label": "Cat"
            },
            {
              "label": "Art",
              "text": "A painting of a sunset over the mountains."
            }
          ],
          "model": "jina-clip-v2",
          "num_iters": 12
        }
      },
      "ClipV1Request": {
        "properties": {
          "embedding_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "float",
                  "base64",
                  "binary",
                  "ubinary"
                ]
              },
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "float",
                    "base64",
                    "binary",
                    "ubinary"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Type",
            "description": "Output encoding format: `float`, `base64`, `binary`, `ubinary`, or a list of these."
          },
          "normalized": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Normalized",
            "description": "If true (default), embeddings are L2-normalized to unit length.",
            "default": true
          },
          "truncate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Truncate",
            "description": "If true, truncates input exceeding the model's max token limit instead of returning an error.",
            "default": false
          },
          "model": {
            "type": "string",
            "const": "jina-clip-v1",
            "title": "Model",
            "description": "The CLIP model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "$ref": "#/components/schemas/ImageDoc"
              },
              {
                "$ref": "#/components/schemas/PDFDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    },
                    {
                      "$ref": "#/components/schemas/ImageDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Content to embed: a string, `TextDoc`, `ImageDoc`, `PDFDoc`, or a list of items. PDFs must be sent individually. Images up to 8MB."
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "ClipV1Request",
        "description": "CLIP v1 multimodal model for images and text in a shared vector space.",
        "example": {
          "embedding_type": "float",
          "input": [
            {
              "image": "https://i.ibb.co/nQNGqL0/beach1.jpg"
            },
            "A beautiful sunset over the beach"
          ],
          "model": "jina-clip-v1",
          "normalized": true
        }
      },
      "ClipV2Request": {
        "properties": {
          "embedding_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "float",
                  "base64",
                  "binary",
                  "ubinary"
                ]
              },
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "float",
                    "base64",
                    "binary",
                    "ubinary"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Type",
            "description": "Output encoding format: `float`, `base64`, `binary`, `ubinary`, or a list of these."
          },
          "normalized": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Normalized",
            "description": "If true (default), embeddings are L2-normalized to unit length.",
            "default": true
          },
          "truncate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Truncate",
            "description": "If true, truncates input exceeding the model's max token limit instead of returning an error.",
            "default": false
          },
          "model": {
            "type": "string",
            "const": "jina-clip-v2",
            "title": "Model",
            "description": "The CLIP model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "$ref": "#/components/schemas/ImageDoc"
              },
              {
                "$ref": "#/components/schemas/PDFDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    },
                    {
                      "$ref": "#/components/schemas/ImageDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Content to embed: a string, `TextDoc`, `ImageDoc`, `PDFDoc`, or a list of items. PDFs must be sent individually. Images up to 8MB."
          },
          "task": {
            "anyOf": [
              {
                "type": "string",
                "const": "retrieval.query"
              },
              {
                "type": "null"
              }
            ],
            "title": "Task",
            "description": "Set to `retrieval.query` to optimize for search queries. Leave unset for documents."
          },
          "dimensions": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1024.0,
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimensions",
            "description": "Number of dimensions for the output embedding. Range: 1-1024."
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "ClipV2Request",
        "description": "CLIP v2 with Matryoshka representation learning for flexible dimensions.",
        "example": {
          "dimensions": 512,
          "embedding_type": "float",
          "input": [
            {
              "image": "https://i.ibb.co/nQNGqL0/beach1.jpg"
            },
            "Jina AI - Your Search Foundation - Supercharged"
          ],
          "model": "jina-clip-v2",
          "normalized": true,
          "task": "retrieval.query"
        }
      },
      "ClipZeroShotClassificationRequest": {
        "properties": {
          "labels": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "additionalProperties": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "type": "object"
              }
            ],
            "title": "Labels",
            "description": "Candidate labels: a list of up to 512 labels, or a dict of up to 8 groups with max 64 labels each."
          },
          "model": {
            "type": "string",
            "enum": [
              "jina-clip-v1",
              "jina-clip-v2"
            ],
            "title": "Model",
            "description": "The CLIP model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "$ref": "#/components/schemas/ImageDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    },
                    {
                      "$ref": "#/components/schemas/ImageDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Content to classify: a string, `TextDoc`, `ImageDoc`, or list of up to 512 items. Images up to 8MB."
          }
        },
        "type": "object",
        "required": [
          "labels",
          "model",
          "input"
        ],
        "title": "ClipZeroShotClassificationRequest",
        "description": "Zero-shot classification using CLIP for text and images.",
        "example": {
          "input": [
            "A photo of a cat sitting on a windowsill.",
            {
              "image": "https://images.unsplash.com/photo-1518717758536-85ae29035b6d"
            }
          ],
          "labels": [
            "Animal",
            "Object",
            "Scene"
          ],
          "model": "jina-clip-v2"
        }
      },
      "CodeEmbeddings1500MRequest": {
        "properties": {
          "embedding_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "float",
                  "base64",
                  "binary",
                  "ubinary"
                ]
              },
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "float",
                    "base64",
                    "binary",
                    "ubinary"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Type",
            "description": "Output encoding format: `float`, `base64`, `binary`, `ubinary`, or a list of these."
          },
          "model": {
            "type": "string",
            "const": "jina-code-embeddings-1.5b",
            "title": "Model",
            "description": "The code embedding model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Code or text to embed: a string, `TextDoc`, or a list of items."
          },
          "truncate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Truncate",
            "description": "If true, truncates input exceeding the model's max token limit instead of returning an error.",
            "default": false
          },
          "dimensions": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1536.0,
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimensions",
            "description": "Number of dimensions for the output embedding. Range: 1-1536."
          },
          "task": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "nl2code.query",
                  "nl2code.passage",
                  "qa.query",
                  "qa.passage",
                  "code2code.query",
                  "code2code.passage",
                  "code2nl.query",
                  "code2nl.passage",
                  "code2completion.query",
                  "code2completion.passage"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Task",
            "description": "Task type: `nl2code`, `qa`, `code2code`, `code2nl`, or `code2completion`. Use `.query` for queries, `.passage` for documents.",
            "default": "nl2code.query"
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "CodeEmbeddings1500MRequest",
        "description": "Code embedding model (1.5B) for code search and understanding.",
        "examples": [
          {
            "dimensions": 512,
            "input": [
              "import * as ElementPlusIconsVue from '@element-plus/icons-vue'\nconst app = createApp(App)\nfor (const [key, component] of Object.entries(ElementPlusIconsVue)) {\n  app.component(key, component)\n}"
            ],
            "model": "jina-code-embeddings-1.5b",
            "task": "nl2code.passage"
          }
        ]
      },
      "CodeEmbeddings500MRequest": {
        "properties": {
          "embedding_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "float",
                  "base64",
                  "binary",
                  "ubinary"
                ]
              },
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "float",
                    "base64",
                    "binary",
                    "ubinary"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Type",
            "description": "Output encoding format: `float`, `base64`, `binary`, `ubinary`, or a list of these."
          },
          "model": {
            "type": "string",
            "const": "jina-code-embeddings-0.5b",
            "title": "Model",
            "description": "The code embedding model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Code or text to embed: a string, `TextDoc`, or a list of items."
          },
          "truncate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Truncate",
            "description": "If true, truncates input exceeding the model's max token limit instead of returning an error.",
            "default": false
          },
          "dimensions": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 896.0,
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimensions",
            "description": "Number of dimensions for the output embedding. Range: 1-896."
          },
          "task": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "nl2code.query",
                  "nl2code.passage",
                  "qa.query",
                  "qa.passage",
                  "code2code.query",
                  "code2code.passage",
                  "code2nl.query",
                  "code2nl.passage",
                  "code2completion.query",
                  "code2completion.passage"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Task",
            "description": "Task type: `nl2code`, `qa`, `code2code`, `code2nl`, or `code2completion`. Use `.query` for queries, `.passage` for documents.",
            "default": "nl2code.query"
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "CodeEmbeddings500MRequest",
        "description": "Code embedding model (500M) for code search and understanding.",
        "examples": [
          {
            "dimensions": 512,
            "embedding_type": "float",
            "input": [
              "import * as ElementPlusIconsVue from '@element-plus/icons-vue'\nconst app = createApp(App)\nfor (const [key, component] of Object.entries(ElementPlusIconsVue)) {\n  app.component(key, component)\n}"
            ],
            "model": "jina-code-embeddings-0.5b",
            "task": "nl2code.passage"
          }
        ]
      },
      "CodeEmbeddingsZeroShotClassificationRequest": {
        "properties": {
          "labels": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "additionalProperties": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "type": "object"
              }
            ],
            "title": "Labels",
            "description": "Candidate labels: a list of up to 512 labels, or a dict of up to 8 groups with max 64 labels each."
          },
          "model": {
            "type": "string",
            "enum": [
              "jina-code-embeddings-0.5b",
              "jina-code-embeddings-1.5b"
            ],
            "title": "Model",
            "description": "The code embedding model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Code to classify: a string, `TextDoc`, or list of up to 512 items."
          }
        },
        "type": "object",
        "required": [
          "labels",
          "model",
          "input"
        ],
        "title": "CodeEmbeddingsZeroShotClassificationRequest",
        "description": "Zero-shot classification using code embedding models.",
        "example": {
          "input": [
            "def hello_world():\n    print('Hello, World!')",
            "SELECT * FROM users WHERE id = 1;"
          ],
          "labels": [
            "Python",
            "JavaScript",
            "SQL",
            "Rust"
          ],
          "model": "jina-code-embeddings-0.5b"
        }
      },
      "ColbertV1Request": {
        "properties": {
          "embedding_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "float",
                  "base64",
                  "binary",
                  "ubinary"
                ]
              },
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "float",
                    "base64",
                    "binary",
                    "ubinary"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Type",
            "description": "Output encoding format: `float`, `base64`, `binary`, `ubinary`, or a list of these."
          },
          "model": {
            "type": "string",
            "const": "jina-colbert-v1-en",
            "title": "Model",
            "description": "The ColBERT model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Text to embed: a string, `TextDoc`, or a list of items."
          },
          "input_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "query",
                  "document"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Type",
            "description": "Role of the input: `query` for search queries, `document` for passages.",
            "default": "document"
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "ColbertV1Request",
        "description": "ColBERT v1 for token-level late interaction retrieval.",
        "example": {
          "embedding_type": "float",
          "input": [
            "A beautiful sunset over the beach",
            "Jina AI - Your Search Foundation - Supercharged"
          ],
          "input_type": "document",
          "model": "jina-colbert-v1-en"
        }
      },
      "ColbertV2Request": {
        "properties": {
          "embedding_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "float",
                  "base64",
                  "binary",
                  "ubinary"
                ]
              },
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "float",
                    "base64",
                    "binary",
                    "ubinary"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Type",
            "description": "Output encoding format: `float`, `base64`, `binary`, `ubinary`, or a list of these."
          },
          "model": {
            "type": "string",
            "const": "jina-colbert-v2",
            "title": "Model",
            "description": "The ColBERT model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Text to embed: a string, `TextDoc`, or a list of items."
          },
          "input_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "query",
                  "document"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Type",
            "description": "Role of the input: `query` for search queries, `document` for passages.",
            "default": "document"
          },
          "dimensions": {
            "anyOf": [
              {
                "type": "integer",
                "enum": [
                  64,
                  96,
                  128
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimensions",
            "description": "Dimensions per token: `64`, `96`, or `128`. Defaults to 128."
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "ColbertV2Request",
        "description": "ColBERT v2 with Matryoshka representation learning for flexible dimensions.",
        "example": {
          "dimensions": 128,
          "embedding_type": "float",
          "input": [
            "A beautiful sunset over the beach"
          ],
          "input_type": "query",
          "model": "jina-colbert-v2"
        }
      },
      "ELSERV2EmbeddingUsage": {
        "properties": {
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens",
            "description": "Total number of tokens processed."
          },
          "input_tokens": {
            "type": "integer",
            "title": "Input Tokens",
            "description": "Number of tokens in the input."
          },
          "output_tokens": {
            "type": "integer",
            "title": "Output Tokens",
            "description": "Number of tokens in the output."
          }
        },
        "type": "object",
        "required": [
          "total_tokens",
          "input_tokens",
          "output_tokens"
        ],
        "title": "ELSERV2EmbeddingUsage",
        "description": "Token usage statistics for Elser v2 embedding requests."
      },
      "ELSERV2Request": {
        "properties": {
          "embedding_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "float",
                  "base64",
                  "binary",
                  "ubinary"
                ]
              },
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "float",
                    "base64",
                    "binary",
                    "ubinary"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Type",
            "description": "Output encoding format: `float`, `base64`, `binary`, `ubinary`, or a list of these."
          },
          "model": {
            "type": "string",
            "const": "elser-v2",
            "title": "Model",
            "description": "The sparse embedding model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Text to embed: a string, `TextDoc`, or a list of items."
          },
          "task": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "retrieval.query",
                  "retrieval.passage"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Task",
            "description": "Task optimization: `retrieval.query` for queries, `retrieval.passage` for documents."
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "ELSERV2Request",
        "description": "ELSER v2 request schema.",
        "example": {
          "input": [
            "What is machine learning?",
            "How does AI work?"
          ],
          "model": "elser-v2",
          "task": "retrieval.query"
        }
      },
      "EmbeddingResponse": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model",
            "description": "The model used to generate the embeddings."
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Object type, always `list`.",
            "default": "list"
          },
          "usage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EmbeddingUsage"
              },
              {
                "$ref": "#/components/schemas/ELSERV2EmbeddingUsage"
              },
              {
                "$ref": "#/components/schemas/BaseUsage"
              }
            ],
            "title": "Usage",
            "description": "Token usage statistics."
          },
          "data": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/SingleEmbeddingData"
                },
                "type": "array"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/MultiEmbeddingData"
                },
                "type": "array"
              },
              {
                "items": {
                  "additionalProperties": {
                    "type": "number"
                  },
                  "type": "object"
                },
                "type": "array"
              }
            ],
            "title": "Data",
            "description": "List of embeddings, one per input item. For sparse embeddings (elser-v2), this is a list of dicts mapping tokens to scores."
          }
        },
        "type": "object",
        "required": [
          "model",
          "usage",
          "data"
        ],
        "title": "EmbeddingResponse",
        "description": "Response containing embeddings for all input items."
      },
      "EmbeddingUsage": {
        "properties": {
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens",
            "description": "Total number of tokens processed."
          },
          "prompt_tokens": {
            "type": "integer",
            "title": "Prompt Tokens",
            "description": "Number of text input tokens. For multimodal responses the per-modality fields below account for non-text tokens; for text-only responses this equals `total_tokens`."
          },
          "image_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Tokens",
            "description": "Number of tokens from image inputs."
          },
          "audio_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audio Tokens",
            "description": "Number of tokens from audio inputs."
          },
          "video_tokens": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Tokens",
            "description": "Number of tokens from video inputs."
          }
        },
        "type": "object",
        "required": [
          "total_tokens",
          "prompt_tokens"
        ],
        "title": "EmbeddingUsage",
        "description": "Token usage statistics for embedding requests.\n\n`prompt_tokens` counts text input tokens (including the task prefix and\nany structural/special framing). For text-only models \u2014 and any response\nthat doesn't populate a per-modality breakdown \u2014 it equals `total_tokens`.\nFor multimodal v5-omni responses, `total_tokens` is the aggregate across\nall modalities and the per-modality fields (`image_tokens` /\n`audio_tokens` / `video_tokens`) are sub-counts, so the invariant holds\nexactly (absent per-modality fields count as 0):\n\n    total_tokens == prompt_tokens + image_tokens + audio_tokens + video_tokens\n\nPDF pages are rendered to images and counted in `image_tokens`.\n\nAll MM fields are Optional so text-only responses don't have to populate\nthem, and serializers should drop unset fields (`exclude_none=True`)."
      },
      "EmbeddingsV2CreateTrainingRequest": {
        "properties": {
          "access": {
            "type": "string",
            "title": "Access",
            "description": "Access level for the training data. Can be 'public' or 'private'.",
            "default": "public"
          },
          "num_iters": {
            "type": "integer",
            "title": "Num Iters",
            "description": "Number of iterations for the training process.",
            "default": 10
          },
          "model": {
            "type": "string",
            "enum": [
              "jina-embeddings-v2-base-en",
              "jina-embeddings-v2-base-zh",
              "jina-embeddings-v2-base-de",
              "jina-embeddings-v2-base-es",
              "jina-embeddings-v2-base-code"
            ],
            "title": "Model",
            "description": "Text embedding model for zero-shot classification."
          },
          "input": {
            "items": {
              "$ref": "#/components/schemas/TextTrainingItem"
            },
            "type": "array",
            "maxItems": 512,
            "minItems": 2,
            "title": "Input",
            "description": "Must be a list of text-label training items with at least two unique labels. For batch training, provide a list with up to 512 items."
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "EmbeddingsV2CreateTrainingRequest",
        "example": {
          "access": "private",
          "input": [
            {
              "label": "Biology",
              "text": "Explain the process of photosynthesis."
            },
            {
              "label": "Geography",
              "text": "What is the capital of France?"
            }
          ],
          "model": "jina-embeddings-v2-base-en",
          "num_iters": 15
        }
      },
      "EmbeddingsV2Request": {
        "properties": {
          "embedding_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "float",
                  "base64",
                  "binary",
                  "ubinary"
                ]
              },
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "float",
                    "base64",
                    "binary",
                    "ubinary"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Type",
            "description": "Output encoding format: `float`, `base64`, `binary`, `ubinary`, or a list of these."
          },
          "normalized": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Normalized",
            "description": "If true (default), embeddings are L2-normalized to unit length.",
            "default": true
          },
          "truncate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Truncate",
            "description": "If true, truncates input exceeding the model's max token limit instead of returning an error.",
            "default": false
          },
          "model": {
            "type": "string",
            "enum": [
              "jina-embeddings-v2-base-en",
              "jina-embeddings-v2-base-zh",
              "jina-embeddings-v2-base-de",
              "jina-embeddings-v2-base-es",
              "jina-embeddings-v2-base-code"
            ],
            "title": "Model",
            "description": "The embedding model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Text to embed: a string, `TextDoc`, or a list of items."
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "EmbeddingsV2Request",
        "description": "Jina Embeddings v2 text embedding models.",
        "example": {
          "embedding_type": "float",
          "input": [
            "A beautiful sunset over the beach",
            "Jina AI - Your Search Foundation - Supercharged"
          ],
          "model": "jina-embeddings-v2-base-en",
          "normalized": true,
          "truncate": false
        }
      },
      "EmbeddingsV2ZeroShotClassificationRequest": {
        "properties": {
          "labels": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "additionalProperties": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "type": "object"
              }
            ],
            "title": "Labels",
            "description": "Candidate labels: a list of up to 512 labels, or a dict of up to 8 groups with max 64 labels each."
          },
          "model": {
            "type": "string",
            "enum": [
              "jina-embeddings-v2-base-en",
              "jina-embeddings-v2-base-zh",
              "jina-embeddings-v2-base-de",
              "jina-embeddings-v2-base-es",
              "jina-embeddings-v2-base-code"
            ],
            "title": "Model",
            "description": "The embedding model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Text to classify: a string, `TextDoc`, or list of up to 512 items."
          }
        },
        "type": "object",
        "required": [
          "labels",
          "model",
          "input"
        ],
        "title": "EmbeddingsV2ZeroShotClassificationRequest",
        "description": "Zero-shot classification using Embeddings v2.",
        "example": {
          "input": [
            "Write a Python function to reverse a string.",
            "Summarize the main findings of the research paper."
          ],
          "labels": [
            "Simple task",
            "Complex reasoning",
            "Creative writing"
          ],
          "model": "jina-embeddings-v2-base-en"
        }
      },
      "EmbeddingsV3CreateTrainingRequest": {
        "properties": {
          "access": {
            "type": "string",
            "title": "Access",
            "description": "Access level for the training data. Can be 'public' or 'private'.",
            "default": "public"
          },
          "num_iters": {
            "type": "integer",
            "title": "Num Iters",
            "description": "Number of iterations for the training process.",
            "default": 10
          },
          "model": {
            "type": "string",
            "const": "jina-embeddings-v3",
            "title": "Model",
            "description": "Text embedding model for zero-shot classification."
          },
          "input": {
            "items": {
              "$ref": "#/components/schemas/TextTrainingItem"
            },
            "type": "array",
            "maxItems": 512,
            "minItems": 2,
            "title": "Input",
            "description": "Must be a list of text-label training items with at least two unique labels. For batch training, provide a list with up to 512 items."
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "EmbeddingsV3CreateTrainingRequest",
        "example": {
          "access": "public",
          "input": [
            {
              "label": "Biology",
              "text": "Describe the structure of a plant cell."
            },
            {
              "label": "Creative writing",
              "text": "Write a poem about the ocean."
            }
          ],
          "model": "jina-embeddings-v3",
          "num_iters": 20
        }
      },
      "EmbeddingsV3Request": {
        "properties": {
          "embedding_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "float",
                  "base64",
                  "binary",
                  "ubinary"
                ]
              },
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "float",
                    "base64",
                    "binary",
                    "ubinary"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Type",
            "description": "Output encoding format: `float`, `base64`, `binary`, `ubinary`, or a list of these."
          },
          "normalized": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Normalized",
            "description": "If true (default), embeddings are L2-normalized to unit length.",
            "default": true
          },
          "truncate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Truncate",
            "description": "If true, truncates input exceeding the model's max token limit instead of returning an error.",
            "default": false
          },
          "model": {
            "type": "string",
            "const": "jina-embeddings-v3",
            "title": "Model",
            "description": "The embedding model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Text to embed: a string, `TextDoc`, or a list of items."
          },
          "task": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "retrieval.query",
                  "retrieval.passage",
                  "text-matching",
                  "classification",
                  "separation"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Task",
            "description": "Task optimization: `retrieval.query` for queries, `retrieval.passage` for documents, `text-matching` for similarity, `classification`, or `separation` for clustering."
          },
          "late_chunking": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Late Chunking",
            "description": "If true, concatenates all inputs and processes as one sequence before splitting. Useful for context across chunks."
          },
          "dimensions": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1024.0,
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimensions",
            "description": "Number of dimensions for the output embedding. Range: 1-1024."
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "EmbeddingsV3Request",
        "description": "Jina Embeddings v3 with task-specific optimization and flexible dimensions.",
        "example": {
          "dimensions": 512,
          "embedding_type": "float",
          "input": [
            "A beautiful sunset over the beach"
          ],
          "late_chunking": false,
          "model": "jina-embeddings-v3",
          "normalized": true,
          "task": "retrieval.query"
        }
      },
      "EmbeddingsV3ZeroShotClassificationRequest": {
        "properties": {
          "labels": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "additionalProperties": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "type": "object"
              }
            ],
            "title": "Labels",
            "description": "Candidate labels: a list of up to 512 labels, or a dict of up to 8 groups with max 64 labels each."
          },
          "model": {
            "type": "string",
            "const": "jina-embeddings-v3",
            "title": "Model",
            "description": "The embedding model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Text to classify: a string, `TextDoc`, or list of up to 512 items."
          }
        },
        "type": "object",
        "required": [
          "labels",
          "model",
          "input"
        ],
        "title": "EmbeddingsV3ZeroShotClassificationRequest",
        "description": "Zero-shot classification using Embeddings v3.",
        "example": {
          "input": [
            "Explain the theory of relativity in simple terms.",
            "Design a database schema for an e-commerce platform."
          ],
          "labels": [
            "Technical explanation",
            "Creative writing",
            "Business solution"
          ],
          "model": "jina-embeddings-v3"
        }
      },
      "EmbeddingsV4CreateTrainingRequest": {
        "properties": {
          "access": {
            "type": "string",
            "title": "Access",
            "description": "Access level for the training data. Can be 'public' or 'private'.",
            "default": "public"
          },
          "num_iters": {
            "type": "integer",
            "title": "Num Iters",
            "description": "Number of iterations for the training process.",
            "default": 10
          },
          "model": {
            "type": "string",
            "const": "jina-embeddings-v4",
            "title": "Model",
            "description": "Multimodal embedding model for zero-shot classification."
          },
          "input": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TextTrainingItem"
                },
                {
                  "$ref": "#/components/schemas/ImageTrainingItem"
                }
              ]
            },
            "type": "array",
            "maxItems": 512,
            "minItems": 2,
            "title": "Input",
            "description": "Must be a list of text-label or image-label training items with at least two unique labels. For batch training, provide a list with up to 512 items."
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "EmbeddingsV4CreateTrainingRequest",
        "example": {
          "access": "private",
          "input": [
            {
              "label": "Dog",
              "text": "A dog playing in the park."
            },
            {
              "image": "https://images.unsplash.com/photo-1465101046530-73398c7f28ca",
              "label": "Rocket"
            }
          ],
          "model": "jina-embeddings-v4",
          "num_iters": 25
        }
      },
      "EmbeddingsV4Request": {
        "properties": {
          "embedding_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "float",
                  "base64",
                  "binary",
                  "ubinary"
                ]
              },
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "float",
                    "base64",
                    "binary",
                    "ubinary"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Type",
            "description": "Output encoding format: `float`, `base64`, `binary`, `ubinary`, or a list of these."
          },
          "model": {
            "type": "string",
            "const": "jina-embeddings-v4",
            "title": "Model",
            "description": "The embedding model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "$ref": "#/components/schemas/ImageDoc"
              },
              {
                "$ref": "#/components/schemas/PDFDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    },
                    {
                      "$ref": "#/components/schemas/ImageDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Content to embed: a string, `TextDoc`, `ImageDoc`, `PDFDoc`, or a list of items. PDFs must be sent individually. Images up to 8MB; PDFs up to 8MB."
          },
          "truncate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Truncate",
            "description": "If true, truncates input exceeding the model's max token limit instead of returning an error.",
            "default": false
          },
          "late_chunking": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Late Chunking",
            "description": "If true, concatenates all text inputs and processes as one sequence before splitting. Only works with text."
          },
          "dimensions": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 2048.0,
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimensions",
            "description": "Number of dimensions for the output embedding. Range: 1-2048."
          },
          "task": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "text-matching",
                  "retrieval.query",
                  "retrieval.passage",
                  "code.query",
                  "code.passage"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Task",
            "description": "Task optimization: `text-matching` (default), `retrieval.query`, `retrieval.passage`, `code.query`, or `code.passage`.",
            "default": "text-matching"
          },
          "return_multivector": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Return Multivector",
            "description": "If true, returns one embedding per token. Cannot be used with `dimensions`.",
            "default": false
          },
          "return_tokenized_input": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Return Tokenized Input",
            "description": "If true, returns tokens alongside multi-vector embeddings. Requires `return_multivector=true`.",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "EmbeddingsV4Request",
        "description": "Jina Embeddings v4 multimodal model for text, images, and PDFs.",
        "examples": [
          {
            "dimensions": 512,
            "embedding_type": "float",
            "input": [
              {
                "image": "https://i.ibb.co/nQNGqL0/beach1.jpg"
              },
              {
                "text": "A beautiful sunset over the beach"
              }
            ],
            "model": "jina-embeddings-v4"
          },
          {
            "embedding_type": "float",
            "input": [
              "Jina AI - Your Search Foundation - Supercharged"
            ],
            "late_chunking": true,
            "model": "jina-embeddings-v4",
            "task": "retrieval.passage"
          },
          {
            "dimensions": 512,
            "embedding_type": "float",
            "input": {
              "pdf": "https://example.com/sample.pdf"
            },
            "model": "jina-embeddings-v4"
          }
        ]
      },
      "EmbeddingsV4ZeroShotClassificationRequest": {
        "properties": {
          "labels": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "additionalProperties": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "type": "object"
              }
            ],
            "title": "Labels",
            "description": "Candidate labels: a list of up to 512 labels, or a dict of up to 8 groups with max 64 labels each."
          },
          "model": {
            "type": "string",
            "const": "jina-embeddings-v4",
            "title": "Model",
            "description": "The embedding model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Text to classify: a string, `TextDoc`, or list of up to 512 items."
          }
        },
        "type": "object",
        "required": [
          "labels",
          "model",
          "input"
        ],
        "title": "EmbeddingsV4ZeroShotClassificationRequest",
        "description": "Zero-shot classification using Embeddings v4.",
        "example": {
          "input": [
            "Describe the process of photosynthesis.",
            "Analyze the sentiment of the following review: 'The product exceeded my expectations.'"
          ],
          "labels": [
            "Factual answer",
            "Sentiment analysis",
            "Marketing content"
          ],
          "model": "jina-embeddings-v4"
        }
      },
      "EmbeddingsV5CreateTrainingRequest": {
        "properties": {
          "access": {
            "type": "string",
            "title": "Access",
            "description": "Access level for the training data. Can be 'public' or 'private'.",
            "default": "public"
          },
          "num_iters": {
            "type": "integer",
            "title": "Num Iters",
            "description": "Number of iterations for the training process.",
            "default": 10
          },
          "model": {
            "type": "string",
            "enum": [
              "jina-embeddings-v5-text-nano",
              "jina-embeddings-v5-text-small"
            ],
            "title": "Model",
            "description": "Text embedding model for zero-shot classification."
          },
          "input": {
            "items": {
              "$ref": "#/components/schemas/TextTrainingItem"
            },
            "type": "array",
            "maxItems": 512,
            "minItems": 2,
            "title": "Input",
            "description": "Must be a list of text-label training items with at least two unique labels. For batch training, provide a list with up to 512 items."
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "EmbeddingsV5CreateTrainingRequest",
        "example": {
          "access": "public",
          "input": [
            {
              "label": "Biology",
              "text": "Describe the structure of a plant cell."
            },
            {
              "label": "Creative writing",
              "text": "Write a poem about the ocean."
            }
          ],
          "model": "jina-embeddings-v5-text-small",
          "num_iters": 20
        }
      },
      "EmbeddingsV5Request": {
        "properties": {
          "embedding_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "float",
                  "base64",
                  "binary",
                  "ubinary"
                ]
              },
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "float",
                    "base64",
                    "binary",
                    "ubinary"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding Type",
            "description": "Output encoding format: `float`, `base64`, `binary`, `ubinary`, or a list of these."
          },
          "normalized": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Normalized",
            "description": "If true (default), embeddings are L2-normalized to unit length.",
            "default": true
          },
          "truncate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Truncate",
            "description": "If true, truncates input exceeding the model's max token limit instead of returning an error.",
            "default": false
          },
          "model": {
            "type": "string",
            "enum": [
              "jina-embeddings-v5-text-nano",
              "jina-embeddings-v5-text-small",
              "jina-embeddings-v5-omni-small",
              "jina-embeddings-v5-omni-nano"
            ],
            "title": "Model",
            "description": "The embedding model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "$ref": "#/components/schemas/ImageDoc"
              },
              {
                "$ref": "#/components/schemas/VideoDoc"
              },
              {
                "$ref": "#/components/schemas/AudioDoc"
              },
              {
                "$ref": "#/components/schemas/PDFDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    },
                    {
                      "$ref": "#/components/schemas/ImageDoc"
                    },
                    {
                      "$ref": "#/components/schemas/VideoDoc"
                    },
                    {
                      "$ref": "#/components/schemas/AudioDoc"
                    },
                    {
                      "$ref": "#/components/schemas/MergedContentGroup"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Content to embed: a string, `TextDoc`, `ImageDoc`, `VideoDoc`, `AudioDoc`, `PDFDoc`, or a list of items. List items may also be `{content: [...]}` groups \u2014 mixed-modality chunks fused into ONE embedding per group. PDFs must be sent as single inputs, not in a list. Text-only model variants reject non-text items."
          },
          "task": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "retrieval.query",
                  "retrieval.passage",
                  "text-matching",
                  "clustering",
                  "classification"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Task",
            "description": "Task optimization: `retrieval.query` for queries, `retrieval.passage` for documents, `text-matching` for similarity, `clustering`, or `classification`.",
            "default": "text-matching"
          },
          "dimensions": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1024.0,
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimensions",
            "description": "Number of dimensions for the output embedding. Range: 1-1024."
          }
        },
        "type": "object",
        "required": [
          "model",
          "input"
        ],
        "title": "EmbeddingsV5Request",
        "description": "Jina Embeddings v5 model with task-specific LoRA adapters and flexible\ndimensions. Small/nano sizes support text-only; the omni variant also\naccepts images, videos, audio, and PDFs in a single shared vector space.\nEach top-level list item is a single modality (one Doc class), with one\nexception: a `MergedContentGroup` (`{\"content\": [...]}`) fuses multiple\nchunks (text + image/video/audio) into a single embedding via one model\nforward pass.",
        "examples": [
          {
            "dimensions": 512,
            "embedding_type": "float",
            "input": [
              "A beautiful sunset over the beach"
            ],
            "model": "jina-embeddings-v5-text-small",
            "normalized": true,
            "task": "retrieval.query"
          },
          {
            "embedding_type": "float",
            "input": [
              {
                "image": "https://i.ibb.co/nQNGqL0/beach1.jpg"
              },
              {
                "text": "A beautiful sunset over the beach"
              }
            ],
            "model": "jina-embeddings-v5-text-small",
            "task": "retrieval.passage"
          }
        ]
      },
      "EmbeddingsV5ZeroShotClassificationRequest": {
        "properties": {
          "labels": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "additionalProperties": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "type": "object"
              }
            ],
            "title": "Labels",
            "description": "Candidate labels: a list of up to 512 labels, or a dict of up to 8 groups with max 64 labels each."
          },
          "model": {
            "type": "string",
            "enum": [
              "jina-embeddings-v5-text-nano",
              "jina-embeddings-v5-text-small"
            ],
            "title": "Model",
            "description": "The embedding model to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Text to classify: a string, `TextDoc`, or list of up to 512 items."
          }
        },
        "type": "object",
        "required": [
          "labels",
          "model",
          "input"
        ],
        "title": "EmbeddingsV5ZeroShotClassificationRequest",
        "description": "Zero-shot classification using Embeddings v5 text models.",
        "example": {
          "input": [
            "Explain the theory of relativity in simple terms.",
            "Design a database schema for an e-commerce platform."
          ],
          "labels": [
            "Technical explanation",
            "Creative writing",
            "Business solution"
          ],
          "model": "jina-embeddings-v5-text-small"
        }
      },
      "FewShotClassificationRequest": {
        "properties": {
          "classifier_id": {
            "type": "string",
            "title": "Classifier Id",
            "description": "ID of the trained classifier to use."
          },
          "input": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "$ref": "#/components/schemas/TextDoc"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Text to classify: a string, `TextDoc`, or list of up to 512 items."
          }
        },
        "type": "object",
        "required": [
          "classifier_id",
          "input"
        ],
        "title": "FewShotClassificationRequest",
        "description": "Few-shot classification using a trained classifier.",
        "example": {
          "classifier_id": "cls-2024-07-14-xyz",
          "input": [
            "Summarize the main points of the article.",
            "Classify the following statement: 'The service was prompt and friendly.'"
          ]
        }
      },
      "HTTPValidationError": {
        "title": "HTTPValidationError",
        "type": "object",
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "string"
          },
          "errors": {
            "title": "Errors",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "title": "Field",
                  "type": "string"
                },
                "message": {
                  "title": "Message",
                  "type": "string"
                },
                "type": {
                  "title": "Type",
                  "type": "string"
                },
                "input": {
                  "title": "Input"
                }
              }
            }
          }
        }
      },
      "ImageDoc": {
        "properties": {
          "image": {
            "type": "string",
            "title": "Image",
            "description": "Image as a URL or base64-encoded string."
          }
        },
        "type": "object",
        "required": [
          "image"
        ],
        "title": "ImageDoc"
      },
      "ImageTrainingItem": {
        "properties": {
          "image": {
            "type": "string",
            "title": "Image",
            "description": "Input image URL or base64 for training."
          },
          "label": {
            "type": "string",
            "title": "Label",
            "description": "Label for the input image."
          }
        },
        "type": "object",
        "required": [
          "image",
          "label"
        ],
        "title": "ImageTrainingItem"
      },
      "MergedContentGroup": {
        "properties": {
          "content": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TextDoc"
                },
                {
                  "$ref": "#/components/schemas/ImageDoc"
                },
                {
                  "$ref": "#/components/schemas/VideoDoc"
                },
                {
                  "$ref": "#/components/schemas/AudioDoc"
                }
              ]
            },
            "type": "array",
            "minItems": 1,
            "title": "Content",
            "description": "Ordered list of modality chunks (text / image / video / audio). Must contain at least one chunk."
          }
        },
        "type": "object",
        "required": [
          "content"
        ],
        "title": "MergedContentGroup",
        "description": "Mixed-modality chunks fused into ONE embedding per group.\n\nThe executor sends every chunk to the model in a single forward pass\n(interleaved per the model's special-token convention) and returns one\nvector per `MergedContentGroup`. Order within `content` is semantically\nmeaningful \u2014 re-ordering may change the resulting embedding.\n\nPDFs are intentionally not allowed inside `content`: they're rasterized\nto N per-page image prompts, which doesn't compose with single-pass\nfusion. Send PDFs as standalone single-input requests instead."
      },
      "ModelDatacenter": {
        "properties": {
          "country_code": {
            "type": "string",
            "title": "Country Code",
            "description": "ISO country code of the datacenter."
          }
        },
        "type": "object",
        "required": [
          "country_code"
        ],
        "title": "ModelDatacenter",
        "description": "Datacenter location for a model."
      },
      "ModelInfo": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique model identifier (e.g., `jina-ai/jina-embeddings-v3`)."
          },
          "hugging_face_id": {
            "type": "string",
            "title": "Hugging Face Id",
            "description": "HuggingFace model ID."
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Human-readable model name."
          },
          "created": {
            "type": "integer",
            "title": "Created",
            "description": "Unix timestamp when the model was released."
          },
          "input_modalities": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Input Modalities",
            "description": "Supported input modalities: `text`, `image`, `video`, `audio`."
          },
          "output_modalities": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Output Modalities",
            "description": "Output types: `embeddings`, `text`."
          },
          "quantization": {
            "type": "string",
            "title": "Quantization",
            "description": "Quantization level, if any."
          },
          "context_length": {
            "type": "integer",
            "title": "Context Length",
            "description": "Maximum context length in tokens."
          },
          "max_output_length": {
            "type": "integer",
            "title": "Max Output Length",
            "description": "Maximum output dimensions."
          },
          "pricing": {
            "$ref": "#/components/schemas/ModelPricing",
            "description": "Pricing information."
          },
          "supported_sampling_parameters": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Supported Sampling Parameters",
            "description": "Supported sampling parameters."
          },
          "supported_features": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Supported Features",
            "description": "Supported features."
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "Model description."
          },
          "datacenters": {
            "items": {
              "$ref": "#/components/schemas/ModelDatacenter"
            },
            "type": "array",
            "title": "Datacenters",
            "description": "Available datacenter locations."
          }
        },
        "type": "object",
        "required": [
          "id",
          "hugging_face_id",
          "name",
          "created",
          "input_modalities",
          "output_modalities",
          "quantization",
          "context_length",
          "max_output_length",
          "pricing",
          "supported_sampling_parameters",
          "supported_features",
          "description",
          "datacenters"
        ],
        "title": "ModelInfo",
        "description": "Information about a single model."
      },
      "ModelListResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ModelInfo"
            },
            "type": "array",
            "title": "Data",
            "description": "List of available models."
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "ModelListResponse",
        "description": "Response containing list of available models.",
        "example": {
          "data": [
            {
              "context_length": 8192,
              "created": 1725840000,
              "datacenters": [
                {
                  "country_code": "US"
                }
              ],
              "description": "jina-embeddings-v3 is a multilingual embedding model...",
              "hugging_face_id": "jinaai/jina-embeddings-v3",
              "id": "jina-ai/jina-embeddings-v3",
              "input_modalities": [
                "text"
              ],
              "max_output_length": 1024,
              "name": "Jina AI: Jina Embeddings v3",
              "output_modalities": [
                "embeddings"
              ],
              "pricing": {
                "completion": "0",
                "image": "0",
                "input_cache_read": "0",
                "input_cache_write": "0",
                "prompt": "0.00000005",
                "request": "0"
              },
              "quantization": "",
              "supported_features": [],
              "supported_sampling_parameters": []
            }
          ]
        }
      },
      "ModelPricing": {
        "properties": {
          "prompt": {
            "type": "string",
            "title": "Prompt",
            "description": "Price per prompt token."
          },
          "completion": {
            "type": "string",
            "title": "Completion",
            "description": "Price per completion token."
          },
          "image": {
            "type": "string",
            "title": "Image",
            "description": "Price per image."
          },
          "request": {
            "type": "string",
            "title": "Request",
            "description": "Price per request."
          },
          "input_cache_read": {
            "type": "string",
            "title": "Input Cache Read",
            "description": "Price for input cache read."
          },
          "input_cache_write": {
            "type": "string",
            "title": "Input Cache Write",
            "description": "Price for input cache write."
          }
        },
        "type": "object",
        "required": [
          "prompt",
          "completion",
          "image",
          "request",
          "input_cache_read",
          "input_cache_write"
        ],
        "title": "ModelPricing",
        "description": "Pricing information for a model."
      },
      "MultiEmbeddingData": {
        "properties": {
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Object type, always `embeddings` for multi-vector output.",
            "default": "embeddings"
          },
          "index": {
            "type": "integer",
            "title": "Index",
            "description": "Position of this result in the input list."
          },
          "embeddings": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "items": {
                  "items": {
                    "type": "number"
                  },
                  "type": "array"
                },
                "type": "array"
              }
            ],
            "title": "Embeddings",
            "description": "Per-token embedding vectors. Each is a list of floats or base64 string."
          },
          "tokenized_input": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tokenized Input",
            "description": "Tokens corresponding to each embedding, if `return_tokenized_input=true`."
          }
        },
        "type": "object",
        "required": [
          "index",
          "embeddings"
        ],
        "title": "MultiEmbeddingData",
        "description": "Multi-vector embedding result (one vector per token)."
      },
      "PDFDoc": {
        "properties": {
          "pdf": {
            "type": "string",
            "title": "Pdf",
            "description": "PDF as a URL or base64-encoded string."
          }
        },
        "type": "object",
        "required": [
          "pdf"
        ],
        "title": "PDFDoc"
      },
      "RerankerM0Request": {
        "properties": {
          "query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/ImageDoc"
              }
            ],
            "title": "Query",
            "description": "The query to rank documents against: a text string, or an image object (`{\"image\": <url|base64>}`) for a visual query."
          },
          "top_n": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Top N",
            "description": "Number of top results to return. If not set, returns all documents."
          },
          "return_documents": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Return Documents",
            "description": "If true (default), includes document content in each result.",
            "default": true
          },
          "model": {
            "type": "string",
            "const": "jina-reranker-m0",
            "title": "Model",
            "description": "The multimodal reranking model to use."
          },
          "documents": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "$ref": "#/components/schemas/TextDoc"
                },
                {
                  "$ref": "#/components/schemas/ImageDoc"
                }
              ]
            },
            "type": "array",
            "minItems": 1,
            "title": "Documents",
            "description": "Documents to rank: strings, `TextDoc`, or `ImageDoc` objects."
          }
        },
        "type": "object",
        "required": [
          "query",
          "model",
          "documents"
        ],
        "title": "RerankerM0Request",
        "description": "Multimodal reranking for text and images.",
        "example": {
          "documents": [
            {
              "image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png"
            },
            {
              "text": "Attention Is All You Need: This groundbreaking paper introduced the Transformer architecture, revolutionizing natural language processing and becoming the foundation for modern large language models like GPT and BERT."
            },
            "Recent advances in computer vision have led to the development of vision transformers (ViTs) that achieve state-of-the-art performance on image classification tasks by treating images as sequences of patches.",
            {
              "image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/wired-preview.png"
            },
            {
              "text": "Graph Neural Networks: A Review of Methods and Applications. This comprehensive survey covers the latest developments in graph-based machine learning, including graph convolutional networks and graph attention mechanisms."
            },
            "Traditional database systems struggle with the volume and variety of modern data workloads, leading to the adoption of distributed computing frameworks like Apache Spark and Hadoop for big data processing."
          ],
          "model": "jina-reranker-m0",
          "query": "innovative artificial intelligence research papers and visual data analysis",
          "return_documents": false,
          "top_n": 4
        }
      },
      "RerankerV3Request": {
        "properties": {
          "query": {
            "type": "string",
            "title": "Query",
            "description": "The search query to rank documents against."
          },
          "top_n": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Top N",
            "description": "Number of top results to return. If not set, returns all documents."
          },
          "return_documents": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Return Documents",
            "description": "If true (default), includes document content in each result.",
            "default": true
          },
          "model": {
            "type": "string",
            "enum": [
              "jina-reranker-v3",
              "jina-reranker-v3.5"
            ],
            "title": "Model",
            "description": "The reranking model to use."
          },
          "documents": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "$ref": "#/components/schemas/TextDoc"
                }
              ]
            },
            "type": "array",
            "minItems": 1,
            "title": "Documents",
            "description": "Documents to rank: strings or `TextDoc` objects."
          },
          "max_doc_length": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 8192.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Doc Length",
            "description": "Maximum tokens per document (1-8192). Omit to use the model's default (2048 for jina-reranker-v3, 8192 for jina-reranker-v3.5)."
          },
          "return_embeddings": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Return Embeddings",
            "description": "If true, returns the document embedding alongside the relevance score."
          }
        },
        "type": "object",
        "required": [
          "query",
          "model",
          "documents"
        ],
        "title": "RerankerV3Request",
        "description": "Listwise reranker for high-quality multilingual retrieval. `max_doc_length`\nis an optional override; when omitted it stays `None` and the serving executor\napplies its configured per-model default, keeping that default in one place.",
        "example": {
          "documents": [
            "Climate Change and Renewable Energy: A Global Perspective. Rising temperatures and extreme weather events are accelerating the transition to solar and wind power worldwide.",
            "Le changement climatique et l'\u00e9nergie renouvelable : une perspective europ\u00e9enne. L'Union europ\u00e9enne investit massivement dans les technologies vertes pour atteindre la neutralit\u00e9 carbone d'ici 2050.",
            "Klimawandel und erneuerbare Energien: Deutsche Energiewende. Deutschland f\u00fchrt die Transformation des Energiesektors durch innovative Technologien und politische Ma\u00dfnahmen an.",
            "\u6c14\u5019\u53d8\u5316\u5bf9\u53ef\u518d\u751f\u80fd\u6e90\u7684\u5f71\u54cd\uff1a\u4e2d\u56fd\u7684\u7eff\u8272\u53d1\u5c55\u6218\u7565\u3002\u4e2d\u56fd\u6b63\u5728\u5927\u529b\u63a8\u8fdb\u592a\u9633\u80fd\u548c\u98ce\u80fd\u9879\u76ee\uff0c\u4ee5\u5b9e\u73b0\u78b3\u4e2d\u548c\u76ee\u6807\u3002",
            "Artificial Intelligence in Healthcare: Revolutionizing Medical Diagnosis. AI-powered systems are improving accuracy in disease detection and treatment recommendations.",
            "Blockchain Technology: Transforming Financial Services. Decentralized finance applications are reshaping traditional banking and payment systems."
          ],
          "model": "jina-reranker-v3",
          "query": "Climate change impact on renewable energy adoption",
          "return_documents": false,
          "return_embeddings": false,
          "top_n": 4
        }
      },
      "RerankingResponse": {
        "properties": {
          "model": {
            "type": "string",
            "title": "Model",
            "description": "The model used for reranking."
          },
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Object type, always `list`.",
            "default": "list"
          },
          "usage": {
            "$ref": "#/components/schemas/BaseUsage",
            "description": "Token usage statistics."
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/RerankingResult"
            },
            "type": "array",
            "title": "Results",
            "description": "Ranked documents, sorted by relevance score descending."
          }
        },
        "type": "object",
        "required": [
          "model",
          "usage",
          "results"
        ],
        "title": "RerankingResponse",
        "description": "Response containing ranked documents."
      },
      "RerankingResult": {
        "properties": {
          "index": {
            "type": "integer",
            "title": "Index",
            "description": "Position of this document in the original input list."
          },
          "relevance_score": {
            "type": "number",
            "title": "Relevance Score",
            "description": "Relevance score. Higher is more relevant."
          },
          "document": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/components/schemas/TextDoc"
              },
              {
                "$ref": "#/components/schemas/ImageDoc"
              },
              {
                "type": "null"
              }
            ],
            "title": "Document",
            "description": "Document content, if `return_documents=true`."
          },
          "embedding": {
            "anyOf": [
              {
                "items": {
                  "type": "number"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Embedding",
            "description": "Document embedding, if `return_embeddings=true`."
          }
        },
        "type": "object",
        "required": [
          "index",
          "relevance_score"
        ],
        "title": "RerankingResult",
        "description": "A single reranking result."
      },
      "SingleEmbeddingData": {
        "properties": {
          "object": {
            "type": "string",
            "title": "Object",
            "description": "Object type, always `embedding`.",
            "default": "embedding"
          },
          "index": {
            "type": "integer",
            "title": "Index",
            "description": "Position of this embedding in the input list."
          },
          "embedding": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "type": "number"
                },
                "type": "array"
              },
              {
                "additionalProperties": {
                  "type": "number"
                },
                "type": "object"
              }
            ],
            "title": "Embedding",
            "description": "The embedding vector: a list of floats for dense embeddings, a dict of token->score for sparse embeddings, or a base64 string for other encodings."
          }
        },
        "type": "object",
        "required": [
          "index",
          "embedding"
        ],
        "title": "SingleEmbeddingData",
        "description": "Single embedding result for one input item."
      },
      "TextDoc": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Text content to process."
          }
        },
        "type": "object",
        "required": [
          "text"
        ],
        "title": "TextDoc"
      },
      "TextRerankerRequest": {
        "properties": {
          "query": {
            "type": "string",
            "title": "Query",
            "description": "The search query to rank documents against."
          },
          "top_n": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Top N",
            "description": "Number of top results to return. If not set, returns all documents."
          },
          "return_documents": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Return Documents",
            "description": "If true (default), includes document content in each result.",
            "default": true
          },
          "model": {
            "type": "string",
            "enum": [
              "jina-reranker-v2-base-multilingual",
              "jina-reranker-v1-tiny-en",
              "jina-reranker-v1-turbo-en",
              "jina-reranker-v1-base-en",
              "jina-colbert-v1-en",
              "jina-colbert-v2"
            ],
            "title": "Model",
            "description": "The reranking model to use."
          },
          "documents": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "$ref": "#/components/schemas/TextDoc"
                }
              ]
            },
            "type": "array",
            "minItems": 1,
            "title": "Documents",
            "description": "Documents to rank: strings or `TextDoc` objects."
          }
        },
        "type": "object",
        "required": [
          "query",
          "model",
          "documents"
        ],
        "title": "TextRerankerRequest",
        "description": "Text reranking request for v1/v2 models.",
        "example": {
          "documents": [
            "Climate Change and Renewable Energy: A Global Perspective. Rising temperatures and extreme weather events are accelerating the transition to solar and wind power worldwide.",
            "Le changement climatique et l'\u00e9nergie renouvelable : une perspective europ\u00e9enne. L'Union europ\u00e9enne investit massivement dans les technologies vertes pour atteindre la neutralit\u00e9 carbone d'ici 2050.",
            "Klimawandel und erneuerbare Energien: Deutsche Energiewende. Deutschland f\u00fchrt die Transformation des Energiesektors durch innovative Technologien und politische Ma\u00dfnahmen an.",
            "\u6c14\u5019\u53d8\u5316\u5bf9\u53ef\u518d\u751f\u80fd\u6e90\u7684\u5f71\u54cd\uff1a\u4e2d\u56fd\u7684\u7eff\u8272\u53d1\u5c55\u6218\u7565\u3002\u4e2d\u56fd\u6b63\u5728\u5927\u529b\u63a8\u8fdb\u592a\u9633\u80fd\u548c\u98ce\u80fd\u9879\u76ee\uff0c\u4ee5\u5b9e\u73b0\u78b3\u4e2d\u548c\u76ee\u6807\u3002",
            "Artificial Intelligence in Healthcare: Revolutionizing Medical Diagnosis. AI-powered systems are improving accuracy in disease detection and treatment recommendations.",
            "Blockchain Technology: Transforming Financial Services. Decentralized finance applications are reshaping traditional banking and payment systems."
          ],
          "model": "jina-reranker-v2-base-multilingual",
          "query": "Climate change impact on renewable energy adoption",
          "return_documents": false,
          "top_n": 4
        }
      },
      "TextTrainingItem": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Input text for training."
          },
          "label": {
            "type": "string",
            "title": "Label",
            "description": "Label for the input text."
          }
        },
        "type": "object",
        "required": [
          "text",
          "label"
        ],
        "title": "TextTrainingItem"
      },
      "TrainingResponse": {
        "properties": {
          "classifier_id": {
            "type": "string",
            "title": "Classifier Id",
            "description": "ID of the classifier that was trained or updated."
          },
          "num_samples": {
            "type": "integer",
            "title": "Num Samples",
            "description": "Number of training samples processed in this request."
          },
          "usage": {
            "$ref": "#/components/schemas/BaseUsage",
            "description": "Token usage statistics for the training request."
          }
        },
        "type": "object",
        "required": [
          "classifier_id",
          "num_samples"
        ],
        "title": "TrainingResponse",
        "example": {
          "classifier_id": "00000000-0000-0000-0000-000000000000",
          "num_samples": 6,
          "usage": {
            "total_tokens": 1830
          }
        }
      },
      "UpdateTrainingRequest": {
        "properties": {
          "classifier_id": {
            "type": "string",
            "title": "Classifier Id",
            "description": "ID of the classifier to use for few-shot classification."
          },
          "input": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TextTrainingItem"
              },
              {
                "$ref": "#/components/schemas/ImageTrainingItem"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/TextTrainingItem"
                    },
                    {
                      "$ref": "#/components/schemas/ImageTrainingItem"
                    }
                  ]
                },
                "type": "array"
              }
            ],
            "title": "Input",
            "description": "Input(s) for updating training. Accepts a `TextTrainingItem`, `ImageTrainingItem`, or a list of them. For batch update, provide a list with up to 512 items."
          },
          "num_iters": {
            "type": "integer",
            "title": "Num Iters",
            "description": "Number of iterations for the training process.",
            "default": 10
          }
        },
        "type": "object",
        "required": [
          "classifier_id",
          "input"
        ],
        "title": "UpdateTrainingRequest",
        "example": {
          "classifier_id": "cls-2025-07-15-xyz",
          "input": [
            {
              "label": "Physics",
              "text": "Summarize the theory of relativity."
            },
            {
              "image": "https://images.unsplash.com/photo-1506744038136-46273834b3fb",
              "label": "Landscape"
            },
            {
              "label": "Biology",
              "text": "Explain the process of photosynthesis."
            },
            {
              "image": "https://images.unsplash.com/photo-1465101046530-73398c7f28ca",
              "label": "Rocket"
            }
          ],
          "num_iters": 20
        }
      },
      "VideoDoc": {
        "properties": {
          "video": {
            "type": "string",
            "title": "Video",
            "description": "Video as a URL or base64-encoded string."
          }
        },
        "type": "object",
        "required": [
          "video"
        ],
        "title": "VideoDoc"
      },
      "ErrorResponse": {
        "title": "ErrorResponse",
        "type": "object",
        "required": [
          "detail"
        ],
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "string",
            "description": "Human-readable error message",
            "example": "Invalid API key. Verify your API key at https://chatsax.com/api-dashboard/key-manager or generate a new one."
          },
          "code": {
            "title": "Code",
            "type": "string",
            "description": "Machine-readable error code for programmatic handling",
            "example": "AUTH_INVALID_API_KEY"
          },
          "request_id": {
            "title": "Request ID",
            "type": "string",
            "description": "Unique request identifier for tracing and support",
            "example": "03f58cd9da22fabf"
          }
        }
      }
    },
    "securitySchemes": {
      "ChatsaxKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Chatsax API key"
      },
      "AccountSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-chatsax_session",
        "description": "HttpOnly login session. Register and sign in on chatsax.com; browser requests include the cookie. API keys do not authorize account administration or purchases."
      }
    },
    "responses": {
      "BadRequest": {
        "description": "- **INPUT_MODEL_NOT_FOUND**: Model 'model_name' not found. Available models: ....\n- **INPUT_INVALID_LABELS**: Invalid training labels. At least {min_labels} unique labels are required for training.\n- **INPUT_LABEL_LIMIT_EXCEEDED**: Label limit exceeded: {current} labels provided, maximum N allowed for your plan. Reduce the number of labels or upgrade your plan at https://chatsax.com/api-dashboard/key-manager.\n- **INPUT_TOKEN_LIMIT_EXCEEDED**: Input text exceeds the model's maximum of {max_tokens} tokens. Use 'truncate: true' to automatically truncate, or split into smaller chunks.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "- **AUTH_MISSING_API_KEY**: Authentication required. Provide your API key via the Authorization header: 'Authorization: Bearer <api-key>'. Get your API key at https://chatsax.com/api-dashboard/key-manager.\n- **AUTH_INVALID_API_KEY**: Invalid API key. Verify your API key at https://chatsax.com/api-dashboard/key-manager or generate a new one.\n- **AUTH_INVALID_FORMAT**: Invalid authorization format. Use 'Authorization: Bearer <api-key>' with a valid Chatsax API key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Forbidden": {
        "description": "- **AUTHZ_INSUFFICIENT_BALANCE**: Insufficient account balance. Top up your account at https://chatsax.com/api-dashboard/key-manager.\n- **AUTHZ_RESOURCE_LIMIT_EXCEEDED**: Resource limit exceeded for your plan. Current: {current}, limit: N. Delete existing resources or upgrade your plan at https://chatsax.com/api-dashboard/key-manager.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "NotFound": {
        "description": "- **RESOURCE_NOT_FOUND**: {resource_type} '{resource_id}' not found or access denied. Verify the ID and your permissions.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Conflict": {
        "description": "- **CONFLICT_RESOURCE_BUSY**: {resource_type} '{resource_id}' is currently being modified. Please retry after a few moments.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "- **RATE_REQUEST_LIMIT_EXCEEDED**: Request rate limit exceeded: {current}/N requests per minute. Reduce request frequency or upgrade your plan at https://chatsax.com/api-dashboard/key-manager.\n- **RATE_TOKEN_LIMIT_EXCEEDED**: Token rate limit exceeded: {current:,}/{limit:,} tokens per minute. Reduce batch sizes or upgrade your plan at https://chatsax.com/api-dashboard/key-manager.\n- **RATE_CONCURRENCY_LIMIT_EXCEEDED**: Concurrency limit exceeded: {current}/N concurrent requests. Wait for pending requests to complete before sending new ones.\n- **RATE_IP_LIMIT_EXCEEDED**: IP rate limit exceeded. Too many requests from this IP address. Reduce request frequency.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "- **INTERNAL_ERROR**: An unexpected error occurred. If this persists, contact support with the request_id from this response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "- **SERVICE_UNAVAILABLE**: Service temporarily unavailable. Please retry with exponential backoff.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "GatewayTimeout": {
        "description": "- **SERVICE_TIMEOUT**: Service request timed out. Try with smaller inputs or retry later.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Model List",
      "description": "List available Jina AI models and their capabilities.\n\nReturns model metadata in OpenRouter-compatible format including model IDs, input/output modalities, context lengths, and pricing information. Use this endpoint to discover available models before making API calls.\n"
    },
    {
      "name": "Search Foundation Models",
      "description": "Generate embeddings and rerank documents using state-of-the-art models.\n\n**Embeddings** convert text, images, and documents into dense vector representations for semantic search, RAG, and similarity matching. Available models include `jina-embeddings-v3` (multilingual, 8K context), `jina-embeddings-v4` (multimodal, 32K context), `jina-embeddings-v5-text-small` (multilingual, 32K context, 1024-dim), `jina-embeddings-v5-text-nano` (multilingual, 8K context, 768-dim), `jina-embeddings-v5-omni-small` (multilingual multimodal, 32K context, 1024-dim), `jina-embeddings-v5-omni-nano` (multilingual multimodal, 8K context, 768-dim), and `jina-clip-v2` (text-image, 89 languages).\n\n**Reranking** refines search results by scoring query-document relevance. Models include `jina-reranker-v3.5` and `jina-reranker-v3` (0.6B, 131K context, listwise reranking), `jina-reranker-m0` (multimodal, 29 languages), `jina-reranker-v2-base-multilingual` (100+ languages, function calling support), and `jina-colbert-v2` (late interaction for high precision).\n"
    },
    {
      "name": "Zero/Few-shot Classification",
      "description": "Categorize text and images using embedding-based classification.\n\n**Zero-shot**: Classify inputs into semantic labels without training data. Supports up to 512 labels, or 8 label groups of up to 64 labels each. Best for flexible, immediate classification with descriptive labels.\n\n**Few-shot**: Train custom classifiers with labeled examples (200-400 samples recommended). Supports incremental updates and handles domain-specific or time-sensitive data. Limited to 16 classes and 16 classifiers per API key.\n\nSupports multilingual text via `jina-embeddings-v3`, `jina-embeddings-v5-text-small`, `jina-embeddings-v5-text-nano`, and multimodal (text/image) via `jina-clip-v2` or `jina-embeddings-v4`.\n"
    },
    {
      "name": "Batch Embeddings",
      "description": "Asynchronous batch embedding processing for large-scale workloads.\n\nSubmit embedding jobs with up to 50,000 inputs via GCS file URL or up to 10,000 inputs inline. Jobs are processed asynchronously - poll for status, then download output as JSONL when complete.\n\n**Workflow**: 1) Submit job via `POST /v1/batch/embeddings` with input data and model selection. 2) Poll `GET /v1/batch/{batch_id}` until status is `completed`. 3) Download results from `GET /v1/batch/{batch_id}/output`.\n\n**Input format**: OpenAI-compatible JSONL with `custom_id` and `body.input` fields. Supports both inline JSON arrays and GCS-hosted JSONL files for larger batches.\n\n**Supported models**: `jina-embeddings-v5-text-small` (1024-dim, 32K context) and `jina-embeddings-v5-text-nano` (768-dim, 8K context). All task types supported: retrieval, text-matching, clustering, classification.\n\nOutput files expire after 24 hours. Optional webhook notifications on job completion.\n"
    },
    {
      "name": "Health Check",
      "description": "Liveness and readiness probes for service health monitoring. For internal use only."
    },
    {
      "name": "Account"
    },
    {
      "name": "Billing"
    },
    {
      "name": "Support"
    }
  ],
  "servers": [
    {
      "url": "https://chatsax.com"
    },
    {
      "url": "https://api.chatsax.com"
    }
  ],
  "security": [
    {
      "ChatsaxKey": []
    }
  ]
}
