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

# Jina AI

Portkey provides a robust and secure gateway to facilitate the integration of various models into your applications, including [Jina AI embedding & reranker models](https://jina.ai/).

With Portkey, you can take advantage of features like fast AI gateway access, observability, and more, all while ensuring the secure management of your API keys through a [virtual key](/product/ai-gateway/virtual-keys) system.

<Note>
  Provider Slug. `jina`
</Note>

## Portkey SDK Integration with Jina AI Models

Portkey provides a consistent API to interact with models from various providers. To integrate Jina AI with Portkey:

### 1. Install the Portkey SDK

Add the Portkey SDK to your application to interact with Jina AI's API through Portkey's gateway.

<Tabs>
  <Tab title="NodeJS">
    ```sh theme={"system"}
    npm install --save portkey-ai
    ```
  </Tab>

  <Tab title="Python">
    ```sh theme={"system"}
    pip install portkey-ai
    ```
  </Tab>
</Tabs>

### 2. Initialize Portkey with the Virtual Key

To use JinaAI with Portkey, [get your API key from here](https://jina.ai/), then add it to Portkey to create the virtual key.

<Tabs>
  <Tab title="NodeJS SDK">
    ```js theme={"system"}
    import Portkey from 'portkey-ai'

    const portkey = new Portkey({
        apiKey: "PORTKEY_API_KEY", // defaults to process.env["PORTKEY_API_KEY"]
        virtualKey: "JINA_AI_VIRTUAL_KEY" // Your Jina AI Virtual Key
    })
    ```
  </Tab>

  <Tab title="Python SDK">
    ```python theme={"system"}
    from portkey_ai import Portkey

    portkey = Portkey(
        api_key="PORTKEY_API_KEY",  # Replace with your Portkey API key
        virtual_key="JINA_AI_VIRTUAL_KEY"   # Replace with your virtual key for Jina AI
    )
    ```
  </Tab>
</Tabs>

### **3. Invoke Embeddings with** Jina AI

Use the Portkey instance to send your embeddings requests to Jina AI. You can also override the virtual key directly in the API call if needed.

<Tabs>
  <Tab title="NodeJS SDK">
    ```js theme={"system"}
    const embeddings = await portkey.embeddings.create({
        input: "embed this",
        model: "jina-embeddings-v2-base-es",
    });
    ```
  </Tab>

  <Tab title="Python SDK">
    ```py theme={"system"}
    embeddings = portkey.embeddings.create(
      input = "embed this",
      model = "jina-embeddings-v2-base-de"
    )
    ```
  </Tab>
</Tabs>

### Using Jina AI Reranker Models

Portkey also supports the Reranker models by Jina AI through the REST API.

<Tabs>
  <Tab title="cURL">
    ```sh theme={"system"}
    curl https://api.portkey.ai/v1/rerank \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer $JINA_AI_API_KEY" \
      -H "x-portkey-provider: jina" \
      -d '{
        "model": "jina-reranker-v1-base-en",
        "query": "Organic skincare products for sensitive skin",
        "documents": [
          "Eco-friendly kitchenware for modern homes",
          "Biodegradable cleaning supplies for eco-conscious consumers",
          "Organic cotton baby clothes for sensitive skin"
        ],
        "top_n": 2
    }'
    ```
  </Tab>
</Tabs>

## Supported Models

Portkey works with all the embedding & reranker models offered by Jina AI. You can browse the full list of Jina AI models [here](https://jina.ai/embeddings#apiform).

## Next Steps

The complete list of features supported in the SDK are available on the link below.

<Card title="SDK" href="/api-reference/portkey-sdk-client" />

You'll find more information in the relevant sections:

1. [Add metadata to your requests](/product/observability/metadata)
2. [Add gateway configs to your J](/product/ai-gateway/configs)ina AI[ requests](/product/ai-gateway/configs)
3. [Tracing Jina AI requests](/product/observability/traces)
4. [Setup a fallback from OpenAI Embeddings to Jina AI](/product/ai-gateway/fallbacks)
