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

# Qdrant

[Qdrant](https://qdrant.tech/) is an open-source vector similarity search engine built for production-ready vector search applications.
It provides a convenient API to store, search, and manage vectors with additional payload data.

Obiguard provides a proxy to Qdrant, allowing you to use virtual keys and observability features.

## Obiguard SDK Integration with Qdrant

Obiguard provides a consistent API to interact with models from various providers. To integrate Qdrant with Obiguard:

### 1. Install the Obiguard SDK

Add the Obiguard SDK to your application to interact with Qdrant through Obiguard's gateway.

<Tabs>
  <Tab title="Python SDK">
    ```sh theme={null}
    pip install obiguard
    ```
  </Tab>
</Tabs>

### 2. Initialize Obiguard with a Virtual Key

To use Qdrant with Obiguard, get your API key from [Qdrant App](https://cloud.qdrant.io/), then add it to Obiguard to create your
[Qdrant virtual key](/virtual-keys#using-virtual-keys).

<Tabs>
  <Tab title="Python SDK">
    ```python theme={null}
    from obiguard import Obiguard

    client = Obiguard(
      obiguard_api_key="vk-obg***",  # Your Obiguard virtual key
    )
    ```
  </Tab>

  <Tab title="OpenAI Python SDK">
    ```python theme={null}
    from openai import OpenAI
    from obiguard import OBIGUARD_GATEWAY_URL, createHeaders

    client = OpenAI(
      api_key="QDRANT_API_KEY",
      base_url=OBIGUARD_GATEWAY_URL,
      default_headers=createHeaders(
        obiguard_api_key="vk-obg***",  # Your Obiguard virtual key
        provider="qdrant",
        custom_host="QDRANT_HOST" # Replace with your Qdrant host
      )
    )
    ```
  </Tab>
</Tabs>

### 3. Use the Obiguard SDK to interact with Qdrant

<Tabs>
  <Tab title="Python SDK">
    ```python theme={null}
    from obiguard import Obiguard

    client = Obiguard(
      obiguard_api_key="vk-obg***",  # Your Obiguard virtual key
      custom_host="QDRANT_HOST" # Replace with your Qdrant host
    )

    response = client.post(
      url="https://xxxx-xxx-xxx-xx-xxxxxx.us-west-2-0.aws.cloud.qdrant.io", # Qdrant search endpoint, you can use any Qdrant endpoint
    )

    print(response)
    ```
  </Tab>

  <Tab title="OpenAI Python">
    ```python theme={null}
    from openai import OpenAI
    from obiguard import OBIGUARD_GATEWAY_URL, createHeaders

    openai = OpenAI(
      api_key='QDRANT_API_KEY',
      base_url=OBIGUARD_GATEWAY_URL,
      default_headers=createHeaders(
        provider="qdrant",
        obiguard_api_key="vk-obg***",  # Your Obiguard virtual key
        custom_host="QDRANT_HOST" # Replace with your Qdrant host
      )
    )

    response = openai.post(
      url="https://xxxx-xxx-xxx-xx-xxxxxx.us-west-2-0.aws.cloud.qdrant.io", # Qdrant search endpoint, You can use any Qdrant endpoint
    )

    print(response)
    ```
  </Tab>

  <Tab title="cURL">
    ```sh theme={null}
    curl --location --request POST 'https://xxxx-xxx-xxx-xx-xxxxxx.us-west-2-0.aws.cloud.qdrant.io' \
      -H 'x-obiguard-custom-host: $QDRANT_HOST' \
      -H "x-obiguard-api-key: $OBIGUARD_API_KEY" \
    ```
  </Tab>
</Tabs>
