> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aihubmix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integración con Jina AI

## Descripción

Hemos integrado las cinco interfaces principales de Jina AI, ayudándote a construir fácilmente potentes agentes inteligentes. Estas interfaces son adecuadas principalmente para los siguientes escenarios:

* **Embeddings vectoriales (Embeddings)**: Aplicable a escenarios multimodales de preguntas y respuestas RAG, como atención al cliente inteligente, contratación inteligente y preguntas y respuestas sobre bases de conocimiento.
* **Reordenamiento (Rerank)**: Mediante la optimización de los resultados candidatos de Embedding, los ordena según la relevancia temática, mejorando significativamente la calidad de las respuestas de los modelos de lenguaje grandes.
* **Búsqueda profunda (DeepSearch)**: Realiza búsqueda y razonamiento profundos hasta encontrar la respuesta óptima, especialmente adecuada para tareas complejas como proyectos de investigación y desarrollo de soluciones de producto.
* **Búsqueda web (Search)**: Pasa una consulta y obtén el cuerpo limpio de la página de resultados del buscador (SERP), listo para introducirlo directamente en un LLM para preguntas y respuestas con conexión web y RAG.
* **Lector web (Reader)**: Pasa cualquier URL y obtén el cuerpo Markdown limpio de esa página tras la conversión, ideal para extraer contenido web y alimentar un LLM.

<Tip>
  Hemos mejorado la API de Jina AI para admitir futuras extensiones, por lo que el uso puede diferir ligeramente de la implementación nativa oficial.
</Tip>

## Inicio rápido

Sustituye `API_KEY` por [AIHUBMIX\_API\_KEY](https://aihubmix.com/token) y el enlace del endpoint del modelo; los demás parámetros y el uso son totalmente coherentes con [la web oficial de Jina AI](https://jina.ai/).

**Sustitución de endpoints:**

* **Embeddings vectoriales (Embeddings)**: `https://jina.ai/embeddings` -> `https://aihubmix.com/v1/embeddings`
* **Reordenamiento (Rerank)**: `https://api.jina.ai/v1/rerank` -> `https://aihubmix.com/v1/rerank`
* **Búsqueda profunda (DeepSearch)**: `https://deepsearch.jina.ai/v1/chat/completions` -> `https://aihubmix.com/v1/chat/completions`
* **Búsqueda web (Search)**: `https://s.jina.ai/?q=` -> `https://aihubmix.com/v1/jina/search?q=`
* **Lector web (Reader)**: `https://r.jina.ai/<url>` -> `https://aihubmix.com/v1/jina/reader/<url>`

  <Note>
    Si la dirección principal actual de la API no está disponible, sustituye el dominio de esta configuración por la dirección de respaldo `https://api.inferera.com`; conserva la ruta sin cambios.
  </Note>

## Embeddings

El Embedding de Jina AI admite tanto texto plano como imágenes multimodales y funciona excelentemente en tareas multilingües.

### Parámetros de la solicitud

<ParamField body="model" type="string" required>
  Nombre del modelo, lista de modelos disponibles:

  * `jina-clip-v2`: Multimodal, multilingüe, 1024 dimensiones, ventana de contexto de 8K, 865M parámetros
  * `jina-embeddings-v3`: Modelo de texto, multilingüe, 1024 dimensiones, ventana de contexto de 8K, 570M parámetros
  * `jina-colbert-v2`: Modelo ColBERT multilingüe, contexto de 8K tokens, 560M parámetros, utilizado para embedding y reordenamiento
  * `jina-embeddings-v2-base-code`: Modelo optimizado para búsqueda de código y documentación, 768 dimensiones, ventana de contexto de 8K, 137M parámetros
</ParamField>

<ParamField body="input" type="array" required>
  Texto o imagen de entrada; los distintos modelos admiten diferentes formatos de entrada. Para texto, proporciona un array de cadenas; para modelos multimodales, proporciona un array de objetos que contengan los campos text o image.
</ParamField>

<ParamField body="embedding_format" type="string" default="float">
  Tipo de datos devueltos, valores opcionales:

  * `float`: Predeterminado, devuelve un array de floats. El formato más común y fácil de usar; devuelve una lista de floats
  * `binary_int8`: Devuelve un formato binario empaquetado int8. Almacenamiento, búsqueda y transmisión más eficientes
  * `binary_uint8`: Devuelve un formato binario empaquetado uint8. Almacenamiento, búsqueda y transmisión más eficientes
  * `base64`: Devuelve una cadena codificada en base64. Transmisión más eficiente
</ParamField>

<ParamField body="dimensions" default="1024" type="integer">
  El número de dimensiones utilizadas en el cómputo. Valores admitidos:

  * 1024
  * 768
</ParamField>

### 1. Uso multimodal

<CodeGroup>
  ```shell Curl theme={null}
  curl https://aihubmix.com/v1/embeddings \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-***" \
    -d @- <<EOFEOF
    {
      "model": "jina-clip-v2",
      "input": [
          {
              "text": "A beautiful sunset over the beach"
          },
          {
              "text": "Un beau coucher de soleil sur la plage"
          },
          {
              "text": "海滩上美丽的日落"
          },
          {
              "text": "浜辺に沈む美しい夕日"
          },
          {
              "image": "https://i.ibb.co/nQNGqL0/beach1.jpg"
          },
          {
              "image": "https://i.ibb.co/r5w8hG8/beach2.jpg"
          },
          {
              "image": "R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7"
          }
      ]
    }
  EOFEOF
  ```

  ```py Python theme={null}
  import requests
  import json

  url = 'https://aihubmix.com/v1/embeddings'
  headers = {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer sk-***' # Replace it by your AiHubMix Key
  }

  data = {
      "model": "jina-clip-v2",
      "input": [
          {
              "text": "A beautiful sunset over the beach"
          },
          {
              "text": "Un beau coucher de soleil sur la plage"
          },
          {
              "text": "海滩上美丽的日落"
          },
          {
              "text": "浜辺に沈む美しい夕日"
          },
          {
              "image": "https://i.ibb.co/nQNGqL0/beach1.jpg"
          },
          {
              "image": "https://i.ibb.co/r5w8hG8/beach2.jpg"
          },
          {
              "image": "R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7"
          }
      ]
  }

  response = requests.post(url, headers=headers, data=json.dumps(data))

  print(response.json())
  ```

  ```ts TypeScript theme={null}
  import fetch from 'node-fetch';

  const url = 'https://aihubmix.com/v1/embeddings';
  const headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer sk-***' // Replace it by your AiHubMix Key
  };
  const data = {
    "model": "jina-clip-v2",
    "input": [
      {
        "text": "A beautiful sunset over the beach"
      },
      {
        "text": "Un beau coucher de soleil sur la plage"
      },
      {
        "text": "海滩上美丽的日落"
      },
      {
        "text": "浜辺に沈む美しい夕日"
      },
      {
        "image": "https://i.ibb.co/nQNGqL0/beach1.jpg"
      },
      {
        "image": "https://i.ibb.co/r5w8hG8/beach2.jpg"
      },
      {
        "image": "R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7"
      }
    ]
  };

  fetch(url, {
    method: 'POST',
    headers: headers,
    body: JSON.stringify(data)
  })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(err => console.error(err));

  ```
</CodeGroup>

### 2. Uso con texto puro

Proporciona solo un array de cadenas de texto; no incluyas el campo `image`.

<CodeGroup>
  ```shell Curl theme={null}
  curl https://aihubmix.com/v1/rerank \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-***" \
    -d @- <<EOFEOF
    {
      "model": "jina-embeddings-v3",
      "input": [
          "A beautiful sunset over the beach",
          "Un beau coucher de soleil sur la plage",
          "海滩上美丽的日落",
          "浜辺に沈む美しい夕日"
      ]
    }
  EOFEOF
  ```

  ```py Python theme={null}
  import requests

  url = 'https://aihubmix.com/v1/embeddings'
  headers = {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer sk-***' # Replace it by your AiHubMix Key
  }
  data = {
      'model': 'jina-embeddings-v3',
      'input': [
          'A beautiful sunset over the beach',
          'Un beau coucher de soleil sur la plage',
          '海滩上美丽的日落',
          '浜辺に沈む美しい夕日'
      ]
  }

  response = requests.post(url, headers=headers, json=data)

  print(response.json())
  ```

  ```ts TypeScript theme={null}
  import * as https from 'https';

  const options = {
    hostname: 'aihubmix.com',
    path: '/v1/embeddings',   
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer sk-***' // Replace it by your AiHubMix Key
    }
  };

  const data = JSON.stringify({
    "model": "jina-embeddings-v3",
    "input": [
      "A beautiful sunset over the beach",
      "Un beau coucher de soleil sur la plage",
      "海滩上美丽的日落",
      "浜辺に沈む美しい夕日"
    ]
  });

  const req = https.request(options, res => {
    let responseData = '';
    res.on('data', chunk => {
      responseData += chunk;
    });
    res.on('end', () => {
      console.log(responseData);
    });
  });

  req.write(data);
  req.end();

  ```
</CodeGroup>

## Rerank

El Reranker tiene como objetivo mejorar la relevancia de la búsqueda y la precisión del RAG. Analiza en profundidad los resultados iniciales de la búsqueda, considera las interacciones sutiles entre la consulta y el contenido del documento, y reordena los resultados de la búsqueda para colocar los más relevantes en los primeros puestos.

### Parámetros de la solicitud

<ParamField body="model" type="string" required>
  Nombre del modelo, lista de modelos disponibles:

  * `jina-reranker-m0`: Reordenador multimodal y multilingüe de documentos, contexto de 10K, 2,4B parámetros, para la ordenación de documentos visuales
</ParamField>

<ParamField body="query" type="string" required>
  Texto de la consulta de búsqueda, utilizado para comparar con los documentos candidatos
</ParamField>

<ParamField body="top_n" type="integer">
  Número de documentos más relevantes a devolver. Por defecto devuelve todos los documentos
</ParamField>

<ParamField body="documents" type="array" required>
  Array de documentos candidatos; se reordenará según su relevancia respecto a la consulta
</ParamField>

<ParamField body="max_chunk_per_doc" default="4096" type="integer">
  Longitud máxima de fragmento por documento; aplicable **únicamente** a Cohere (no admitido por Jina). Predeterminado: 4096.\
  Los documentos largos se truncarán automáticamente al número de tokens especificado.
</ParamField>

### 1. Uso multimodal

<CodeGroup>
  ```shell Curl theme={null}
  curl https://aihubmix.com/v1/rerank \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-***" \
    -d @- <<EOFEOF
    {
      "model": "jina-reranker-m0",
      "query": "small language model data extraction",
      "documents": [
          {
              "image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/handelsblatt-preview.png"
          },
          {
              "image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png"
          },
          {
              "image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/wired-preview.png"
          },
          {
              "text": "We present ReaderLM-v2, a compact 1.5 billion parameter language model designed for efficient web content extraction. Our model processes documents up to 512K tokens, transforming messy HTML into clean Markdown or JSON formats with high accuracy -- making it an ideal tool for grounding large language models. The models effectiveness results from two key innovations: (1) a three-stage data synthesis pipeline that generates high quality, diverse training data by iteratively drafting, refining, and critiquing web content extraction; and (2) a unified training framework combining continuous pre-training with multi-objective optimization. Intensive evaluation demonstrates that ReaderLM-v2 outperforms GPT-4o-2024-08-06 and other larger models by 15-20% on carefully curated benchmarks, particularly excelling at documents exceeding 100K tokens, while maintaining significantly lower computational requirements."
          },
          {
              "image": "https://jina.ai/blog-banner/using-deepseek-r1-reasoning-model-in-deepsearch.webp"
          },
          {
              "text": "Data extraction? Why not just use regular expressions—wouldn't regex solve it all?"
          },
          {
              "text": "During the California Gold Rush, some merchants made more money selling supplies to miners than the miners made finding gold."
          },
          {
              "text": "Die wichtigsten Beiträge unserer Arbeit sind zweifach: Erstens führen wir eine neuartige dreistufige Datensynthese-Pipeline namens Draft-Refine-Critique ein, die durch iterative Verfeinerung hochwertige Trainingsdaten generiert; und zweitens schlagen wir eine umfassende Trainingsstrategie vor, die kontinuierliches Vortraining zur Längenerweiterung, überwachtes Feintuning mit spezialisierten Kontrollpunkten, direkte Präferenzoptimierung (DPO) und iteratives Self-Play-Tuning kombiniert. Um die weitere Forschung und Anwendung der strukturierten Inhaltsextraktion zu erleichtern, ist das Modell auf Hugging Face öffentlich verfügbar."
          },
          {
              "image": "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"
          }
      ]
    }
  EOFEOF
  ```

  ```py Python theme={null}
  import requests

  url = 'https://aihubmix.com/v1/rerank'
  headers = {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer sk-***' # Replace it by your AiHubMix Key 
  }
  data = {
      "model": "jina-reranker-m0",
      "query": "small language model data extraction",
      "documents": [
          {
              "image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/handelsblatt-preview.png"
          },
          {
              "image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png"
          },
          {
              "image": "https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/wired-preview.png"
          },
          {
              "text": "We present ReaderLM-v2, a compact 1.5 billion parameter language model designed for efficient web content extraction. Our model processes documents up to 512K tokens, transforming messy HTML into clean Markdown or JSON formats with high accuracy -- making it an ideal tool for grounding large language models. The models effectiveness results from two key innovations: (1) a three-stage data synthesis pipeline that generates high quality, diverse training data by iteratively drafting, refining, and critiquing web content extraction; and (2) a unified training framework combining continuous pre-training with multi-objective optimization. Intensive evaluation demonstrates that ReaderLM-v2 outperforms GPT-4o-2024-08-06 and other larger models by 15-20% on carefully curated benchmarks, particularly excelling at documents exceeding 100K tokens, while maintaining significantly lower computational requirements."
          },
          {
              "image": "https://jina.ai/blog-banner/using-deepseek-r1-reasoning-model-in-deepsearch.webp"
          },
          {
              "text": "Data extraction? Why not just use regular expressions—wouldn't regex solve it all?"
          },
          {
              "text": "During the California Gold Rush, some merchants made more money selling supplies to miners than the miners made finding gold."
          },
          {
              "text": "Die wichtigsten Beiträge unserer Arbeit sind zweifach: Erstens führen wir eine neuartige dreistufige Datensynthese-Pipeline namens Draft-Refine-Critique ein, die durch iterative Verfeinerung hochwertige Trainingsdaten generiert; und zweitens schlagen wir eine umfassende Trainingsstrategie vor, die kontinuierliches Vortraining zur Längenerweiterung, überwachtes Feintuning mit spezialisierten Kontrollpunkten, direkte Präferenzoptimierung (DPO) und iteratives Self-Play-Tuning kombiniert. Um die weitere Forschung und Anwendung der strukturierten Inhaltsextraktion zu erleichtern, ist das Modell auf Hugging Face öffentlich verfügbar."
          },
          {
              "image": "iVBORw0KGgoAAAANSUhEUgAAAMwAAADACAMAAAB/Pny7AAAA7VBMVEX///8AAABONC780K49Wv5gfYu8vLwiIiIAvNRHLypceJ5hfoc4Vf//1bL8/PxSbsCCgoLk5OQpKSlOQDXctpgZEA9AXv8SG0sGCRorHRocKnY4U+sKDQ7rwqISGBssOkE+Pj5fX19MY29ZdIF1YFGHcF68m4EjLTKSkpInOqIcJSndzbU9UFlcv87DyrvrzrF1wcpOTk6jo6OixsE7MCg4JSHLy8skNZLNqo4EBQ9kU0VZSj0uJh93d3cyMjKihnBvamZca3KoqbI8R5YaLI41R3omM1lNZ7EAAEEbIy46TGcwPk8jEQyIw8eZjobFTeMIAAAFHUlEQVR4nO3da0PaOhwG8CGOHqYwKqBjFKQ6sJt63Biy6Siw+/18/48zSP7FhqU5XNr04vP4igRCfmsX2jSFBw+2TTm0bN2V7ePkQooTt2SWvhGOxejHLZml3w4H0wYm5ACTWExIA0A8GNN+5c/YYn2pF7dNh7dX0YvpyP5hG8WdLdPgDdnAAANM6jD1dGMa10K2tXiYTp9HzxmBh9l6U8gxlI4JDDDAABNRyibLsFNnCRtzzZutc8x4yN8tqhG6cGDNQ4qwLV6KtGnYe1kHhagwRkif9StheAxggAEGmJRidmiyhj5vDjosoc+qa8JQ6sIWCn0CSiumCAwwwNxfzA5N+tQzgaE0gAEGGGBCU5hDFmfUYNFpCR/jjFkGWjdJVJgKb1DvJgEGGGCAiQXjzeEXpaVi6GJuUVrppRgrRnZ4cJ2TpeFhpLU5oaFYMEU5xgIGGGDuDybXEMMLB5Meyy11VKgcUSVlwkstek7oszPrYKS5bZVYurLKwduSPzVpCwnCvKuV8vMEYfJ3AQaYLGBc3uCvjTHVBGEKlXmcqWoBoxxT7bJMWry/va4kk5qIoeJRRBi6japg5IJXAMkx3RbLoqstWfJieGGtGhGGopwEDMDkS/mNUmolEbNpgAEmuxi+OoTmAKxB1Z8Jde2KR97vK1ktYSy6RUjTchNxaeWoV/OHht3z35fzvPxXannNKi/FSsIYfb5UM/Tlp3KMuOh1UBOO52lgPr/8h0WOeckrX0sxelc1/YWR9BcYYO43ZkeBGaUM482biHNB72hypZUujBcR86wlDMapx8h6CgwwwGQTQ3M12cCIVytSjskBAwww/4ORXqBMKWZo80hNSszVb9mchbIyaox3B+14bUz+6pxFPtd0LquMGkORf+2EGrN+gAEGmIRijANf2qnGlIcFf1wrVIx3gfbZSAtmKfRlbeFhhL1XN6YNDDDRY7L0f8ZZDM3B07MB/ZZmae2MXszQYStr/lNNnMstrZ4stKzRqPAMtWI8Ez8ukF/SCNihxLU+YjR9vZESI7/YFIAZAAMMMMuLGlRRYsZxYkyXzdxMxeUmyvSmdnCmcWJo6sZ0qyvHNVVJwJfRl23FrrMUOwH9Vcacro6JdU9aJcAkNaa9OsZOOqbssrvtO3T1oz4a+DKi5YJGhz3JTfoAQFM3Q9rbbsXDe7qzaUpPSjrGC52ydcXPfLqxIQk/AbJOPIx4OAZM/AEmqcniACAfmlOKkQeYGANMUgNMjFFORzjts8C0HeVLY8HYwkVnMcbJQ0VOVK/U+ysnC4xqT7pQYS5UrwQGGGASjaHfJbVz7XlokaPV9sdSj2ZLT/a3MMPo/N1Ts+KyS6fvT1iOeV/OToScqjCn4nPPuOWYP3rPGncrmn6yhdZoUn8vOOZY2X0l7ZhjaM885a1ruj7jrTeLFqP5x3SAASaS8CFzhrmZJToMa32GiXSENvk6xg8fP72Z5dNjns83rC9fvj7eMF+/sAZuPtNj3vrHD/zdotpABb4DfGsesuzuz7P7/Akrfdrkj9fObvMpa+DJc2qQt978xt8t4ltOjpq7vhzeYTbMAnMolB6x0qjvnwEGGGCAAQYYYIABJjmY74+E/ODnMz8fbZyfrAHrh1j6XQvmxemeP4uTs70Nszg5E0tfaMIIJ4phn2l6pcAAAwwwwAADDDBRYvYWfz6Mr3Bv6U9V4MP46jVhMnXUfCTMkN9NnG82b76/vzRx7rWLkzNggAEGmCxg/gAcTwKRD+vGjgAAAABJRU5ErkJggg=="
          }
      ]
  }

  response = requests.post(url, headers=headers, json=data)

  print(response.json())

  ```

  ```ts TypeScript theme={null}
  import fetch from 'node-fetch';

  const url = 'https://aihubmix.com/v1/rerank';

  const options = {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer sk-***' // Replace it by your AiHubMix Key
    },
    body: JSON.stringify({
      model: 'jina-reranker-m0',
      query: 'small language model data extraction',
      documents: [
        {
          image: 'https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/handelsblatt-preview.png'
        },
        {
          image: 'https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/paper-11.png'
        },
        {
          image: 'https://raw.githubusercontent.com/jina-ai/multimodal-reranker-test/main/wired-preview.png'
        },
        {
          text: 'We present ReaderLM-v2, a compact 1.5 billion parameter language model designed for efficient web content extraction. Our model processes documents up to 512K tokens, transforming messy HTML into clean Markdown or JSON formats with high accuracy -- making it an ideal tool for grounding large language models. The models effectiveness results from two key innovations: (1) a three-stage data synthesis pipeline that generates high quality, diverse training data by iteratively drafting, refining, and critiquing web content extraction; and (2) a unified training framework combining continuous pre-training with multi-objective optimization. Intensive evaluation demonstrates that ReaderLM-v2 outperforms GPT-4o-2024-08-06 and other larger models by 15-20% on carefully curated benchmarks, particularly excelling at documents exceeding 100K tokens, while maintaining significantly lower computational requirements.'
        },
        {
          image: 'https://jina.ai/blog-banner/using-deepseek-r1-reasoning-model-in-deepsearch.webp'
        },
        {
          text: 'Data extraction? Why not just use regular expressions—wouldn\'t regex solve it all?'
        },
        {
          text: 'During the California Gold Rush, some merchants made more money selling supplies to miners than the miners made finding gold.'
        },
        {
          text: 'Die wichtigsten Beiträge unserer Arbeit sind zweifach: Erstens führen wir eine neuartige dreistufige Datensynthese-Pipeline namens Draft-Refine-Critique ein, die durch iterative Verfeinerung hochwertige Trainingsdaten generiert; und zweitens schlagen wir eine umfassende Trainingsstrategie vor, die kontinuierliches Vortraining zur Längenerweiterung, überwachtes Feintuning mit spezialisierten Kontrollpunkten, direkte Präferenzoptimierung (DPO) und iteratives Self-Play-Tuning kombiniert. Um die weitere Forschung und Anwendung der strukturierten Inhaltsextraktion zu erleichtern, ist das Modell auf Hugging Face öffentlich verfügbar.'
        },
        {
          image: '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'
        }
      ]
    })
  };

  fetch(url, options)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
  ```
</CodeGroup>

### Descripción de la respuesta

```json theme={null}
{
  "model": "jina-reranker-m0",
  "results": [
    {
      "index": 1,
      "relevance_score": 0.8814517277012487
    },
    {
      "index": 3,
      "relevance_score": 0.7756727858283531
    },
    {
      "index": 7,
      "relevance_score": 0.6128658982982312
    }
  ],
  "usage": {
    "total_tokens": 2894
  }
}
```

**Respuesta exitosa:**

* `model`: El nombre del modelo utilizado
* `results`: Un array de resultados de reordenamiento ordenados por puntuación de relevancia en orden descendente; cada elemento contiene:
  * `index`: La posición del índice en el array de documentos original
  * `relevance_score`: Una puntuación de relevancia entre 0 y 1; las puntuaciones más altas indican mayor relevancia respecto a la consulta
* `usage`: Estadísticas de uso
  * `total_tokens`: Número total de tokens procesados en esta solicitud

### 2. Uso con texto

El reordenamiento de texto admite tanto tareas multilingües como regulares, de manera similar al uso de embeddings, pasando un array.

<CodeGroup>
  ```shell Curl theme={null}
  curl https://aihubmix.com/v1/rerank \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-***" \
    -d @- <<EOFEOF
    {
      "model": "jina-reranker-v2-base-multilingual",
      "query": "Organic skincare products for sensitive skin",
      "top_n": 3,
      "documents": [
          "Organic skincare for sensitive skin with aloe vera and chamomile: Imagine the soothing embrace of nature with our organic skincare range, crafted specifically for sensitive skin. Infused with the calming properties of aloe vera and chamomile, each product provides gentle nourishment and protection. Say goodbye to irritation and hello to a glowing, healthy complexion.",
          "New makeup trends focus on bold colors and innovative techniques: Step into the world of cutting-edge beauty with this seasons makeup trends. Bold, vibrant colors and groundbreaking techniques are redefining the art of makeup. From neon eyeliners to holographic highlighters, unleash your creativity and make a statement with every look.",
          "Bio-Hautpflege für empfindliche Haut mit Aloe Vera und Kamille: Erleben Sie die wohltuende Wirkung unserer Bio-Hautpflege, speziell für empfindliche Haut entwickelt. Mit den beruhigenden Eigenschaften von Aloe Vera und Kamille pflegen und schützen unsere Produkte Ihre Haut auf natürliche Weise. Verabschieden Sie sich von Hautirritationen und genießen Sie einen strahlenden Teint.",
          "Neue Make-up-Trends setzen auf kräftige Farben und innovative Techniken: Tauchen Sie ein in die Welt der modernen Schönheit mit den neuesten Make-up-Trends. Kräftige, lebendige Farben und innovative Techniken setzen neue Maßstäbe. Von auffälligen Eyelinern bis hin zu holografischen Highlightern – lassen Sie Ihrer Kreativität freien Lauf und setzen Sie jedes Mal ein Statement.",
          "Cuidado de la piel orgánico para piel sensible con aloe vera y manzanilla: Descubre el poder de la naturaleza con nuestra línea de cuidado de la piel orgánico, diseñada especialmente para pieles sensibles. Enriquecidos con aloe vera y manzanilla, estos productos ofrecen una hidratación y protección suave. Despídete de las irritaciones y saluda a una piel radiante y saludable.",
          "Las nuevas tendencias de maquillaje se centran en colores vivos y técnicas innovadoras: Entra en el fascinante mundo del maquillaje con las tendencias más actuales. Colores vivos y técnicas innovadoras están revolucionando el arte del maquillaje. Desde delineadores neón hasta iluminadores holográficos, desata tu creatividad y destaca en cada look.",
          "针对敏感肌专门设计的天然有机护肤产品：体验由芦荟和洋甘菊提取物带来的自然呵护。我们的护肤产品特别为敏感肌设计，温和滋润，保护您的肌肤不受刺激。让您的肌肤告别不适，迎来健康光彩。",
          "新的化妆趋势注重鲜艳的颜色和创新的技巧：进入化妆艺术的新纪元，本季的化妆趋势以大胆的颜色和创新的技巧为主。无论是霓虹眼线还是全息高光，每一款妆容都能让您脱颖而出，展现独特魅力。",
          "敏感肌のために特別に設計された天然有機スキンケア製品: アロエベラとカモミールのやさしい力で、自然の抱擁を感じてください。敏感肌用に特別に設計された私たちのスキンケア製品は、肌に優しく栄養を与え、保護します。肌トラブルにさようなら、輝く健康な肌にこんにちは。",
          "新しいメイクのトレンドは鮮やかな色と革新的な技術に焦点を当てています: 今シーズンのメイクアップトレンドは、大胆な色彩と革新的な技術に注目しています。ネオンアイライナーからホログラフィックハイライターまで、クリエイティビティを解き放ち、毎回ユニークなルックを演出しましょう。"
      ]
    }
  EOFEOF
  ```

  ```py Python theme={null}
  import requests

  url = 'https://aihubmix.com/v1/rerank'
  headers = {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer sk-***' # Replace it by your AiHubMix Key
  }
  data = {
      "model": "jina-reranker-v2-base-multilingual",
      "query": "Organic skincare products for sensitive skin",
      "top_n": 3,
      "documents": [
          "Organic skincare for sensitive skin with aloe vera and chamomile: Imagine the soothing embrace of nature with our organic skincare range, crafted specifically for sensitive skin. Infused with the calming properties of aloe vera and chamomile, each product provides gentle nourishment and protection. Say goodbye to irritation and hello to a glowing, healthy complexion.",
          "New makeup trends focus on bold colors and innovative techniques: Step into the world of cutting-edge beauty with this seasons makeup trends. Bold, vibrant colors and groundbreaking techniques are redefining the art of makeup. From neon eyeliners to holographic highlighters, unleash your creativity and make a statement with every look.",
          "Bio-Hautpflege für empfindliche Haut mit Aloe Vera und Kamille: Erleben Sie die wohltuende Wirkung unserer Bio-Hautpflege, speziell für empfindliche Haut entwickelt. Mit den beruhigenden Eigenschaften von Aloe Vera und Kamille pflegen und schützen unsere Produkte Ihre Haut auf natürliche Weise. Verabschieden Sie sich von Hautirritationen und genießen Sie einen strahlenden Teint.",
          "Neue Make-up-Trends setzen auf kräftige Farben und innovative Techniken: Tauchen Sie ein in die Welt der modernen Schönheit mit den neuesten Make-up-Trends. Kräftige, lebendige Farben und innovative Techniken setzen neue Maßstäbe. Von auffälligen Eyelinern bis hin zu holografischen Highlightern – lassen Sie Ihrer Kreativität freien Lauf und setzen Sie jedes Mal ein Statement.",
          "Cuidado de la piel orgánico para piel sensible con aloe vera y manzanilla: Descubre el poder de la naturaleza con nuestra línea de cuidado de la piel orgánico, diseñada especialmente para pieles sensibles. Enriquecidos con aloe vera y manzanilla, estos productos ofrecen una hidratación y protección suave. Despídete de las irritaciones y saluda a una piel radiante y saludable.",
          "Las nuevas tendencias de maquillaje se centran en colores vivos y técnicas innovadoras: Entra en el fascinante mundo del maquillaje con las tendencias más actuales. Colores vivos y técnicas innovadoras están revolucionando el arte del maquillaje. Desde delineadores neón hasta iluminadores holográficos, desata tu creatividad y destaca en cada look.",
          "针对敏感肌专门设计的天然有机护肤产品：体验由芦荟和洋甘菊提取物带来的自然呵护。我们的护肤产品特别为敏感肌设计，温和滋润，保护您的肌肤不受刺激。让您的肌肤告别不适，迎来健康光彩。",
          "新的化妆趋势注重鲜艳的颜色和创新的技巧：进入化妆艺术的新纪元，本季的化妆趋势以大胆的颜色和创新的技巧为主。无论是霓虹眼线还是全息高光，每一款妆容都能让您脱颖而出，展现独特魅力。",
          "敏感肌のために特別に設計された天然有機スキンケア製品: アロエベラとカモミールのやさしい力で、自然の抱擁を感じてください。敏感肌用に特別に設計された私たちのスキンケア製品は、肌に優しく栄養を与え、保護します。肌トラブルにさようなら、輝く健康な肌にこんにちは。",
          "新しいメイクのトレンドは鮮やかな色と革新的な技術に焦点を当てています: 今シーズンのメイクアップトレンドは、大胆な色彩と革新的な技術に注目しています。ネオンアイライナーからホログラフィックハイライターまで、クリエイティビティを解き放ち、毎回ユニークなルックを演出しましょう。"
      ]
  }

  response = requests.post(url, headers=headers, json=data)

  print(response.json())
  ```

  ```ts TypeScript theme={null}
  const https = require('https');

  const requestData = {
    model: "jina-reranker-v2-base-multilingual",
    query: "Organic skincare products for sensitive skin",
    top_n: 3,
    documents: [
      "Organic skincare for sensitive skin with aloe vera and chamomile: Imagine the soothing embrace of nature with our organic skincare range, crafted specifically for sensitive skin. Infused with the calming properties of aloe vera and chamomile, each product provides gentle nourishment and protection. Say goodbye to irritation and hello to a glowing, healthy complexion.",
      "New makeup trends focus on bold colors and innovative techniques: Step into the world of cutting-edge beauty with this seasons makeup trends. Bold, vibrant colors and groundbreaking techniques are redefining the art of makeup. From neon eyeliners to holographic highlighters, unleash your creativity and make a statement with every look.",
      "Bio-Hautpflege für empfindliche Haut mit Aloe Vera und Kamille: Erleben Sie die wohltuende Wirkung unserer Bio-Hautpflege, speziell für empfindliche Haut entwickelt. Mit den beruhigenden Eigenschaften von Aloe Vera und Kamille pflegen und schützen unsere Produkte Ihre Haut auf natürliche Weise. Verabschieden Sie sich von Hautirritationen und genießen Sie einen strahlenden Teint.",
      "Neue Make-up-Trends setzen auf kräftige Farben und innovative Techniken: Tauchen Sie ein in die Welt der modernen Schönheit mit den neuesten Make-up-Trends. Kräftige, lebendige Farben und innovative Techniken setzen neue Maßstäbe. Von auffälligen Eyelinern bis hin zu holografischen Highlightern – lassen Sie Ihrer Kreativität freien Lauf und setzen Sie jedes Mal ein Statement.",
      "Cuidado de la piel orgánico para piel sensible con aloe vera y manzanilla: Descubre el poder de la naturaleza con nuestra línea de cuidado de la piel orgánico, diseñada especialmente para pieles sensibles. Enriquecidos con aloe vera y manzanilla, estos productos ofrecen una hidratación y protección suave. Despídete de las irritaciones y saluda a una piel radiante y saludable.",
      "Las nuevas tendencias de maquillaje se centran en colores vivos y técnicas innovadoras: Entra en el fascinante mundo del maquillaje con las tendencias más actuales. Colores vivos y técnicas innovadoras están revolucionando el arte del maquillaje. Desde delineadores neón hasta iluminadores holográficos, desata tu creatividad y destaca en cada look.",
      "针对敏感肌专门设计的天然有机护肤产品：体验由芦荟和洋甘菊提取物带来的自然呵护。我们的护肤产品特别为敏感肌设计，温和滋润，保护您的肌肤不受刺激。让您的肌肤告别不适，迎来健康光彩。",
      "新的化妆趋势注重鲜艳的颜色和创新的技巧：进入化妆艺术的新纪元，本季的化妆趋势以大胆的颜色和创新的技巧为主。无论是霓虹眼线还是全息高光，每一款妆容都能让您脱颖而出，展现独特魅力。",
      "敏感肌のために特別に設計された天然有機スキンケア製品：アロエベラとカモミールのやさしい力で、自然の抱擁を感じてください。敏感肌用に特別に設計された私たちのスキンケア製品は、肌に優しく栄養を与え、保護します。肌トラブルにさようなら、輝く健康な肌にこんにちは。",
      "新しいメイクのトレンドは鮮やかな色と革新的な技術に焦点を当てています：今シーズンのメイクアップトレンドは、大胆な色彩と革新的な技術に注目しています。ネオンアイライナーからホログラフィックハイライターまで、クリエイティビティを解き放ち、毎回ユニークなルックを演出しましょう。"
    ]
  };

  const options = {
    hostname: 'aihubmix.com',
    port: 443,
    path: '/v1/rerank',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer sk-***' // Replace it by your AiHubMix Key
    }
  };

  const req = https.request(options, res => {
    let responseData = '';
    res.on('data', chunk => {
      responseData += chunk;
    });
    res.on('end', () => {
      console.log(responseData);
    });
  });

  req.write(JSON.stringify(requestData));
  req.end();
  ```
</CodeGroup>

## DeepSearch

DeepSearch combina capacidades de búsqueda, lectura y razonamiento para encontrar la mejor respuesta posible. Es totalmente compatible con el formato de la Chat API de OpenAI: simplemente sustituye api.openai.com por aihubmix.com para empezar.\
El stream devolverá el proceso de razonamiento.

### Parámetros de la solicitud

<ParamField body="model" type="string" required>
  Nombre del modelo, modelos disponibles:

  * `jina-deepsearch-v1`: Modelo predeterminado; busca, lee y razona hasta encontrar la mejor respuesta
</ParamField>

<ParamField body="stream" type="boolean" default="true">
  Si se habilita la respuesta en streaming. Se recomienda encarecidamente mantener esta opción activada; las solicitudes a DeepSearch pueden tardar mucho en completarse, y desactivar el streaming puede resultar en un error '524 Timeout'
</ParamField>

<ParamField body="messages" type="array" required>
  La lista de mensajes de conversación entre el usuario y el asistente. Admite múltiples tipos (modales) de mensajes, como texto (.txt, .pdf), imágenes (.png, .webp, .jpeg), etc. El tamaño máximo del archivo es de 10 MB
</ParamField>

### Formato de mensaje multimodal

DeepSearch admite múltiples tipos de formatos de mensaje, que pueden incluir texto puro (message), archivos (file) e imágenes (image). A continuación, ejemplos de distintos formatos:

#### 1. Mensaje de texto puro

```json theme={null}
{
  "role": "user",
  "content": "hi"
}
```

#### 2. Mensaje con archivo adjunto

```json theme={null}
{
  "role": "user",
  "content": [
    {
      "type": "text",
      "text": "what's in this file?"
    },
    {
      "type": "file",
      "data": "data:application/pdf;base64,JVBERi0xLjQKJfbk...", // PDF 文件的 base64 编码
      "mimeType": "application/pdf"
    }
  ]
}
```

#### 3. Mensaje con imagen

```json theme={null}
{
  "role": "user",
  "content": [
    {
      "type": "text",
      "text": "what's in the image?"
    },
    {
      "type": "image",
      "image": "data:image/webp;base64,UklGRoDOAAB...", // the base64 encoding of images
      "mimeType": "image/webp"
    }
  ]
}
```

Todos los archivos e imágenes deben estar previamente codificados en formato data URI, con un tamaño máximo de archivo de 10 MB.

### Ejemplo de llamada

Ten en cuenta que **la llamada en streaming con Python desde la web oficial de Jina AI no tendrá respuesta**; consulta nuestro ejemplo.

<CodeGroup>
  ```shell Curl theme={null}
  curl https://aihubmix.com/v1/chat/completions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer sk-***" \
    -d @- <<EOFEOF
    {
      "model": "jina-deepsearch-v1",
      "messages": [
          {
              "role": "user",
              "content": "Hi!"
          },
          {
              "role": "assistant",
              "content": "Hi, how can I help you?"
          },
          {
              "role": "user",
              "content": "what's the latest blog post from jina ai?"
          }
      ],
      "stream": true
    }
  EOFEOF
  ```

  ```py Python theme={null}
  import requests
  import json

  url = 'https://aihubmix.com/v1/chat/completions'
  headers = {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer sk-***' # Replace it by your AiHubMix Key
  }

  data = {
      "model": "jina-deepsearch-v1",
      "messages": [
          {
              "role": "user",
              "content": "Hi!"
          },
          {
              "role": "assistant",
              "content": "Hi, how can I help you?"
          },
          {
              "role": "user",
              "content": "what's the latest blog post from jina ai?"
          }
      ],
      "stream": True
  }

  # Use stream=True in the request to handle streaming responses
  response = requests.post(url, headers=headers, json=data, stream=True)

  # Check if the request was successful
  if response.status_code == 200:
      # Iterate over the response content line by line
      for line in response.iter_lines():
          if line:
              # Decode line and print (assuming SSE format: "data: {...}")
              decoded_line = line.decode('utf-8')
              if decoded_line.startswith('data: '):
                  # Handle potential end signal like "data: [DONE]"
                  if decoded_line[len('data: '):].strip() == '[DONE]':
                      print("\nStream finished.")
                      break
                  try:
                      # Extract the JSON part
                      json_data = json.loads(decoded_line[len('data: '):])
                      # Process the JSON data
                      if 'choices' in json_data and len(json_data['choices']) > 0:
                          delta = json_data['choices'][0].get('delta', {})
                          content_to_print = delta.get('content') or delta.get('reasoning_content') # Check both fields

                          if content_to_print:
                              print(content_to_print, end='', flush=True)
                  except json.JSONDecodeError:
                      # Ignore lines that are not valid JSON after "data: "
                      # print(f"\nCould not decode JSON from line: {decoded_line}")
                      pass # Optionally log or handle non-JSON data lines if needed
              # Handle lines that don't start with "data: " if necessary
              # else:
              #    print(f"Received non-data line: {decoded_line}")

      print() # Add a newline at the end
  elif response.status_code == 401:
       print(f"Error: {response.status_code} - Unauthorized. Please check your API key.")
       try:
           print(response.json())
       except json.JSONDecodeError:
           print(response.text)
  else:
      print(f"Error: {response.status_code}")
      try:
          print(response.json()) # Print error details if available
      except json.JSONDecodeError:
          print(response.text) # Print raw text if not JSON
  ```

  ```ts TypeScript theme={null}
  const https = require('https');

  const data = JSON.stringify({
    model: "jina-deepsearch-v1",
    messages: [
      {
        role: "user",
        content: "Hi!"
      },
      {
        role: "assistant",
        content: "Hi, how can I help you?"
      },
      {
        role: "user",
        content: "what's the latest blog post from jina ai?"
      }
    ],
    stream: true
  });

  const options = {
    hostname: 'aihubmix.com',
    path: '/v1/chat/completions',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Content-Length': data.length,
      'Authorization': 'Bearer sk-***' // Replace it by your AiHubMix Key
    }
  };

  const req = https.request(options, res => {
    console.log(`statusCode: ${res.statusCode}`);

    res.on('data', d => {
      process.stdout.write(d);
    });
  });

  req.on('error', error => {
    console.error(error);
  });

  req.write(data);
  req.end();
  ```
</CodeGroup>

### Descripción de la respuesta

La respuesta de DeepSearch se envía en streaming por defecto e incluye tanto los pasos intermedios de razonamiento como la respuesta final.
El último bloque del stream contiene la respuesta final, una lista de las URLs visitadas y los detalles de uso de tokens.
Si se desactiva el streaming, solo se devolverá la respuesta final: los pasos intermedios de "razonamiento" se omitirán.
**Nota:** Este objeto JSON difiere del formato utilizado por Jina AI.

```json theme={null}
{
  "id": "1745506101379",
  "object": "chat.completion.chunk",
  "created": 1745506101,
  "model": "jina-deepsearch-v1",
  "choices": [
    {
      "index": 0,
      "delta": {
        "role": "assistant",
        "reasoning_content": "<think>"
      }
    }
  ],
  "system_fingerprint": "fp_1745506101379"
}

// Streaming reason
{
  "id": "1745506101379",
  "object": "chat.completion.chunk",
  "created": 1745506101,
  "model": "jina-deepsearch-v1",
  "choices": [
    {
      "index": 0,
      "delta": {
        "reasoning_content": "thinking parts"
      }
    }
  ],
  "system_fingerprint": "fp_1745506101379"
}

// Reasoning finished
{
  "id": "1745506101379",
  "object": "chat.completion.chunk",
  "created": 1745506101,
  "model": "jina-deepsearch-v1",
  "choices": [
    {
      "index": 0,
      "delta": {
        "reasoning_content": "</think>\n\n"
      },
      "finish_reason": "thinking_end"
    }
  ],
  "system_fingerprint": "fp_1745506101379"
}

// The Final Response with URL
{
  "id": "1745506101379",
  "object": "chat.completion.chunk",
  "created": 1745506101,
  "model": "jina-deepsearch-v1",
  "choices": [
    {
      "index": 0,
      "delta": {
        "content": "Response content",
        "type": "text",
        "annotations": [
          {
            "type": "url_citation",
            "url_citation": {
              "url": "https://example.com",
              "title": "Page Title",
              "start_index": 0,
              "end_index": 0
            }
          }
        ]
      },
      "finish_reason": "stop"
    }
  ],
  "system_fingerprint": "fp_1745506101379",
  "usage": {
    "prompt_tokens": 673423,
    "completion_tokens": 109286,
    "total_tokens": 583555
  }
}

data: [DONE]
```

**Ejemplo de retorno en Python:** Consulta la salida en streaming devuelta directamente por la API.

## Búsqueda web (Search)

Basado en el `s.jina.ai` de Jina AI: pasa una consulta y obtén el cuerpo limpio de la página de resultados del buscador (SERP), listo para introducirlo directamente en un LLM para preguntas y respuestas con conexión web y RAG. El endpoint admite tanto `GET` como `POST`.

<Note>
  **Formato de respuesta (Markdown por defecto)**: por defecto devuelve una lista de resultados en **Markdown** concatenada, lista para pasar a un LLM; cuando necesites datos estructurados (`title` / `url` / `content` y `usage` de cada resultado), añade el encabezado de solicitud `Accept: application/json` para obtener JSON en su lugar.
</Note>

### Parámetros de la solicitud

<ParamField query="q" type="string" required>
  Texto de la consulta. Debe codificarse en URL cuando se llama desde código.
</ParamField>

<ParamField query="num" type="integer" default="5">
  Número máximo de resultados a devolver; la cantidad real depende de cuántos resultados haya disponibles.
</ParamField>

<ParamField query="gl" type="string">
  Código de país / región, p. ej. `US`.
</ParamField>

<ParamField query="hl" type="string">
  Idioma de la interfaz, p. ej. `en`.
</ParamField>

<ParamField query="site" type="string">
  Restringe la búsqueda a sitios concretos; se puede pasar varias veces, p. ej. `site=jina.ai&site=github.com`.
</ParamField>

<ParamField header="X-Respond-With" type="string" default="markdown">
  Formato del cuerpo de los resultados, uno de `markdown` / `html` / `text`.
</ParamField>

<ParamField header="X-Retain-Images" type="string">
  Política de retención de imágenes; pasa `none` para eliminar las imágenes y ahorrar tokens.
</ParamField>

<ParamField header="X-No-Cache" type="boolean">
  Omite la caché y obtiene los resultados más recientes.
</ParamField>

Además, la búsqueda invoca al Reader para extraer el cuerpo de cada resultado, por lo que todos los encabezados de solicitud `X-*` que controlan el formato del cuerpo listados en «Lector web (Reader)» también se aplican a los resultados de búsqueda.

### Ejemplo de llamada

La consulta y los parámetros pueden pasarse como parámetros de consulta de la URL mediante `GET` (recomendado, lo más conciso), o en un cuerpo de solicitud JSON mediante `POST`; ambos llegan al mismo endpoint y devuelven el mismo resultado. Los ejemplos siguientes añaden `Accept: application/json` para devolver JSON por defecto; **elimina ese encabezado para obtener una lista de resultados en Markdown limpia** (véase el primer ejemplo `Curl-markdown`).

<CodeGroup>
  ```shell Curl-markdown theme={null}
  # Sin el encabezado Accept → devuelve una lista de resultados en Markdown concatenada
  curl "https://aihubmix.com/v1/jina/search?q=AIHubMix&num=5&gl=US&hl=en" \
    -H "Authorization: Bearer sk-***"
  ```

  ```shell Curl-GET theme={null}
  curl "https://aihubmix.com/v1/jina/search?q=AIHubMix&num=5&gl=US&hl=en" \
    -H "Authorization: Bearer sk-***" \
    -H "Accept: application/json"
  ```

  ```shell Curl-POST theme={null}
  curl -X POST "https://aihubmix.com/v1/jina/search" \
    -H "Authorization: Bearer sk-***" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
      "q": "AIHubMix",
      "num": 5,
      "gl": "US",
      "hl": "en"
    }'
  ```

  ```py Python theme={null}
  import requests

  url = 'https://aihubmix.com/v1/jina/search'
  headers = {
      'Authorization': 'Bearer sk-***',  # Sustituye por tu clave de AiHubMix
      'Accept': 'application/json'
  }
  params = {'q': 'AIHubMix', 'num': 5, 'gl': 'US', 'hl': 'en'}

  response = requests.get(url, headers=headers, params=params)
  print(response.json())
  ```

  ```ts TypeScript theme={null}
  const url = 'https://aihubmix.com/v1/jina/search?q=AIHubMix&num=5&gl=US&hl=en';

  fetch(url, {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer sk-***', // Sustituye por tu clave de AiHubMix
      'Accept': 'application/json'
    }
  })
    .then(res => res.json())
    .then(data => console.log(data))
    .catch(err => console.error(err));
  ```
</CodeGroup>

### Descripción de la respuesta

**Por defecto (sin `Accept`) devuelve una lista en Markdown concatenada**, donde cada entrada indica sucesivamente el título, el enlace de origen, la descripción (si la hay) y el cuerpo:

```text theme={null}
[1] Title: AIHubMix - One Interface, Router All LLMs
[1] URL Source: https://aihubmix.com/?lang=en
[1] Description: Access every major LLM through a single, unified interface. Connect to ChatGPT, Claude, Gemini, DeepSeek and more.
[1] Content:
If requests to http://aihubmix.com fail, you can try using a VPN, or switch to the alternative baseURL: https://api.inferera.com …

[2] Title: AI Models & Pricing - AIHubMix
[2] URL Source: https://aihubmix.com/models?lang=en
[2] Content:
…
```

**Con `Accept: application/json` devuelve JSON estructurado**:

```json theme={null}
{
  "code": 200,
  "status": 200,
  "data": [
    {
      "title": "AIHubMix - One Interface, Router All LLMs",
      "url": "https://aihubmix.com/?lang=en",
      "content": "If requests to http://aihubmix.com fail, you can try using a VPN, or switch to the alternative …",
      "usage": { "tokens": 4244 }
    },
    {
      "title": "AI Models & Pricing - AIHubMix",
      "url": "https://aihubmix.com/models?lang=en",
      "content": "…",
      "usage": { "tokens": 4303 }
    }
  ]
}
```

* `data`: array de resultados de búsqueda (la cantidad se controla con `num`; el ejemplo anterior devuelve 5 pero aquí solo se muestran los 2 primeros; `content` es el cuerpo completo, truncado en el ejemplo), cada uno con `title`, `url`, `content`, `usage.tokens`.
* **Facturación**: se cobra por la suma de los `usage.tokens` de cada resultado; Jina cobra oficialmente un mínimo de **10000 tokens** por búsqueda, por lo que el cargo final es el mayor de los dos, es decir, `max(10000, suma de tokens)`.

## Lector web (Reader)

Basado en el `r.jina.ai` de Jina AI: pasa cualquier URL y obtén el cuerpo Markdown limpio de esa página tras la conversión, cómodo para extraer contenido web y alimentar un LLM. Además de páginas web, también admite el análisis de **imágenes** (descritas por un modelo de visión) y **archivos locales** (PDF, Word / Excel / PPT, HTML, imágenes).

<Note>
  **Formato de respuesta (Markdown por defecto)**: por defecto devuelve directamente el **cuerpo Markdown limpio**, listo para pasar a un LLM; cuando necesites **JSON** estructurado con `usage` y campos como `title` / `url` (el cuerpo está en `data.content`), añade el encabezado de solicitud `Accept: application/json`.
</Note>

### Parámetros de la solicitud

<ParamField path="URL de destino" type="string" required>
  La dirección web a leer, añadida directamente al final de la ruta del endpoint, p. ej. `/v1/jina/reader/https://jina.ai`.
</ParamField>

<ParamField body="file" type="file">
  El archivo local a subir; admite PDF, Word / Excel / PPT, HTML, imágenes, pasado en el campo `file` mediante `POST` como `multipart/form-data`.
</ParamField>

<ParamField body="url" type="string">
  Obligatorio al subir un archivo HTML, se usa como dirección de referencia para resolver los enlaces relativos de la página; no es necesario al subir un PDF.
</ParamField>

<ParamField header="X-Respond-With" type="string" default="markdown">
  Formato de retorno, uno de `markdown` / `html` / `text` / `screenshot` / `pageshot`.
</ParamField>

<ParamField header="X-Retain-Images" type="string" default="all">
  Política de retención de imágenes, una de `all` / `none` (eliminar imágenes para ahorrar tokens) / `alt`.
</ParamField>

<ParamField header="X-Retain-Links" type="string" default="all">
  Política de retención de enlaces, una de `all` / `none` / `text`.
</ParamField>

<ParamField header="X-With-Generated-Alt" type="boolean">
  Genera automáticamente texto descriptivo para las imágenes sin `alt`.
</ParamField>

<ParamField header="X-With-Links-Summary" type="boolean">
  Resume todos los enlaces al final del cuerpo.
</ParamField>

<ParamField header="X-With-Images-Summary" type="boolean">
  Resume todas las imágenes al final del cuerpo.
</ParamField>

<ParamField header="X-Engine" type="string">
  Motor de extracción, uno de `browser` / `direct` / `cf-browser-rendering`.
</ParamField>

<ParamField header="X-Target-Selector" type="string">
  Selector CSS; extrae solo la región de la página que coincide.
</ParamField>

<ParamField header="X-Remove-Selector" type="string">
  Selector CSS; elimina los elementos que coinciden (p. ej. `header, footer, nav`).
</ParamField>

<ParamField header="X-Timeout" type="integer">
  Tiempo de espera de la extracción en segundos, máx. 180.
</ParamField>

<ParamField header="X-No-Cache" type="boolean">
  Omite la caché y obtiene lo más reciente.
</ParamField>

<ParamField header="X-Md-Heading-Style" type="string" default="atx">
  Estilo de encabezados Markdown, uno de `atx` (`#`) / `setext` (subrayado).
</ParamField>

<ParamField header="X-Md-Bullet-List-Marker" type="string">
  Marcador de lista con viñetas Markdown, uno de `-` / `+` / `*`.
</ParamField>

<ParamField header="X-Md-Hr" type="string">
  Estilo de la línea horizontal Markdown, p. ej. `***`.
</ParamField>

<ParamField header="X-Md-Link-Style" type="string">
  Estilo de enlaces Markdown, uno de `inlined` / `referenced` / `discarded`.
</ParamField>

Los anteriores son solo las opciones comunes. **Todos** los encabezados de solicitud `X-*` compatibles con Jina (incluida toda la familia `X-Md-*`) así como los campos del cuerpo `POST` (como el script inyectado `injectPageScript`) son **reenviados tal cual** por la puerta de enlace; para la lista completa y los valores, consulta la [documentación oficial de Jina](https://r.jina.ai/docs).

### Formato de entrada multimodal

Reader admite tres tipos de entrada. **Las páginas web y las imágenes** se añaden directamente al final de la ruta del endpoint (`GET`); **los archivos locales** se suben mediante `POST` como `multipart/form-data`.

#### 1. URL de página web

```text theme={null}
GET /v1/jina/reader/https://example.com
```

#### 2. URL de imagen (devuelve una descripción visual)

La dirección de la imagen también se añade al final de la ruta. Reader usa un modelo de visión para generar una **descripción** (un caption, no un OCR literal) de la imagen y la coloca en `content`.

```text theme={null}
GET /v1/jina/reader/https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png
```

#### 3. Subir un archivo local (PDF / Word·Excel·PPT / HTML / imagen)

```text theme={null}
POST /v1/jina/reader
Content-Type: multipart/form-data

file=@./doc.pdf              # coloca el archivo en el campo file
url=https://example.com/...  # solo necesario al subir HTML, como dirección de referencia para resolver enlaces relativos
```

### Ejemplo de llamada

Por defecto devuelve directamente el cuerpo Markdown; añade `Accept: application/json` para obtener JSON estructurado. Los parámetros opcionales se pasan como encabezados de solicitud `X-*` y son **reenviados todos tal cual** por la puerta de enlace a Jina (para la lista completa, véase «Parámetros de la solicitud» arriba).

#### 1. Leer una página web

<CodeGroup>
  ```shell Básico (Markdown) theme={null}
  # Sin Accept → devuelve directamente el cuerpo Markdown limpio
  curl "https://aihubmix.com/v1/jina/reader/https://example.com" \
    -H "Authorization: Bearer sk-***"
  ```

  ```shell Avanzado (varios parámetros) theme={null}
  # Combina varios encabezados X-*, todos reenviados tal cual por la puerta de enlace a Jina:
  #   eliminar imágenes para ahorrar tokens · extraer solo la región #bodyContent · resumir enlaces al final
  curl "https://aihubmix.com/v1/jina/reader/https://en.wikipedia.org/wiki/Large_language_model" \
    -H "Authorization: Bearer sk-***" \
    -H "Accept: application/json" \
    -H "X-Retain-Images: none" \
    -H "X-Target-Selector: #bodyContent" \
    -H "X-With-Links-Summary: true"
  ```

  ```shell JSON theme={null}
  curl "https://aihubmix.com/v1/jina/reader/https://example.com" \
    -H "Authorization: Bearer sk-***" \
    -H "Accept: application/json"
  ```

  ```py Python theme={null}
  import requests

  url = 'https://aihubmix.com/v1/jina/reader/https://example.com'
  headers = {
      'Authorization': 'Bearer sk-***',  # Sustituye por tu clave de AiHubMix
      'Accept': 'application/json'
  }

  response = requests.get(url, headers=headers)
  print(response.json())
  ```

  ```ts TypeScript theme={null}
  const url = 'https://aihubmix.com/v1/jina/reader/https://example.com';

  fetch(url, {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer sk-***', // Sustituye por tu clave de AiHubMix
      'Accept': 'application/json'
    }
  })
    .then(res => res.json())
    .then(data => console.log(data))
    .catch(err => console.error(err));
  ```
</CodeGroup>

#### 2. Leer una imagen

```shell Curl theme={null}
curl "https://aihubmix.com/v1/jina/reader/https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png" \
  -H "Authorization: Bearer sk-***" \
  -H "Accept: application/json"
```

#### 3. Subir un archivo local

Sube mediante `POST` + `multipart/form-data`; al subir **HTML** debes incluir además el campo `url` como dirección de referencia. La facturación es la misma que al leer una URL.

<CodeGroup>
  ```shell PDF / Imagen / Office theme={null}
  curl -X POST "https://aihubmix.com/v1/jina/reader" \
    -H "Authorization: Bearer sk-***" \
    -H "Accept: application/json" \
    -F "file=@./doc.pdf"
  ```

  ```shell HTML (url obligatorio) theme={null}
  curl -X POST "https://aihubmix.com/v1/jina/reader" \
    -H "Authorization: Bearer sk-***" \
    -H "Accept: application/json" \
    -F "file=@./local.html" \
    -F "url=https://example.com/local.html"
  ```
</CodeGroup>

### Descripción de la respuesta

**Por defecto (sin `Accept`) devuelve directamente el cuerpo Markdown** (es decir, el contenido de `data.content` en el JSON de abajo). Por ejemplo, al leer `https://example.com`:

```text theme={null}
This domain is for use in documentation examples without needing permission. Avoid use in operations.

[Learn more](https://iana.org/domains/example)
```

**Con `Accept: application/json`** devuelve JSON estructurado. La estructura del JSON es la misma para los tres tipos de entrada: `data` es un único objeto que contiene `title` / `url` / `content` / `usage.tokens`. A continuación, las **respuestas reales** de los tres tipos de entrada (cuando `content` es demasiado largo, se conserva el principio y el resto se omite con `…`).

**① Leer una página web** (leyendo `https://example.com`):

```json theme={null}
{
  "code": 200,
  "status": 20000,
  "data": {
    "title": "Example Domain",
    "url": "https://example.com/",
    "content": "This domain is for use in documentation examples without needing permission. Avoid use in operations.\n\n[Learn more](https://iana.org/domains/example)",
    "usage": { "tokens": 29 }
  }
}
```

**② Leer una imagen** (`content` es la descripción generada por el modelo de visión):

```json theme={null}
{
  "code": 200,
  "status": 20000,
  "data": {
    "title": "googlelogo_color_272x92dp.png",
    "url": "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png",
    "content": "The logo for Google, consisting of the word Google in lowercase letters, with its colors being blue, red, yellow, and green, representing the company's innovative approach to information and computing services",
    "usage": { "tokens": 38 }
  }
}
```

**③ Subir un archivo local** (subiendo un artículo PDF; `content` es largo, solo se muestra el principio):

```json theme={null}
{
  "code": 200,
  "status": 20000,
  "data": {
    "title": "Unnoticeable Backdoor Attacks on Graph Neural Networks",
    "url": "blob:df586d587956e0ca72e50e9e12dc06fc44b7c4b480b8a640a6db7d6f488a7c91",
    "content": "# Unnoticeable Backdoor Attacks on Graph Neural Networks\n\n# Enyan Dai ∗\n\nemd5759@psu.edu\n\nThe Pennsylvania State University\n\nState College, USA\n\n## ABSTRACT\n\nGraph Neural Networks (GNNs) have achieved promising results in various tasks such as node classification and graph classification. …",
    "usage": { "tokens": 20535 }
  }
}
```

* `status`: el código de estado de negocio devuelto por Jina upstream; en una llamada de reader correcta es `20000` (coherente con el HTTP `200` externo).
* **Facturación**: se cobra por `data.usage.tokens` (el número real de tokens de salida), **sin cargo mínimo** (a diferencia del «mínimo de 10000 tokens por búsqueda» de la búsqueda); para contenido extremadamente corto se aplica una unidad mínima de facturación como suelo, de modo que nunca se produce un cargo de cero.

***

Última actualización: 2026-07-03
