> ## Documentation Index
> Fetch the complete documentation index at: https://upstash-bulkdlqdelete.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

<Check>
  **Prerequisite**

  You need an Upstash account before creating a vector, create one
  [here](https://console.upstash.com).
</Check>

## Create an Index

Once you logged in, you can create a Vector Index by clicking on the `Create Index` button in the Vector tab.

<Frame style={{width: '600px'}}>
  <img src="https://mintlify.s3-us-west-1.amazonaws.com/upstash-bulkdlqdelete/img/vector/getstarted/create_index.png" />
</Frame>

**Name:** Type a name for your index.

**Region:** Choose the region for your index. For optimal performance, select the region closest to your applications. We plan to support additional regions and cloud providers. Feel free to send your requests to [support@upstash.com](mailto:support@upstash.com)

**Dimensions:** Select the dimensions and distance metric depending on your model.

<Frame style={{width: '600px'}}>
  <img src="https://mintlify.s3-us-west-1.amazonaws.com/upstash-bulkdlqdelete/img/vector/getstarted/select_plan.png" />
</Frame>

**Free:** The free plan is suitable for small projects. It has a limit of 10,000 queries and 10,000 updates limit daily.

**Pay as You Go:** Pay as you go plan is a flexible plan with per-request-pricing. It is suitable for projects with unpredictable traffic.

**Fixed:** Fixed plan is suitable for projects with predictable traffic. It has a fixed monthly price with 1M query and 1M update limit daily.

**Pro:** Pro plan is suitable for projects with high traffic and storage needs. It has a fixed monthly price with extra security and isolation features.

**Enterprise:** If you plan to have over a billion vectors then Enterprise plan is for you. It has a fixed monthly price with extra security and isolation features. Contact us at [sales@upstash.com](mailto:sales@upstash.com) for more information.

## Insert Index

You can access data in your index using REST API or our SDKs. You can copy the sample code from the `Connect` section in the console.

<Tabs>
  <Tab title="Python">
    ```python
    from upstash_vector import Index

    index = Index(url="<UPSTASH_VECTOR_REST_URL>", token="<UPSTASH_VECTOR_REST_TOKEN>")

    index.upsert(
      vectors=[
        ("1", [0.6, 0.8], {"metadata_field": "metadata_value"}),
      ]
    )
    ```
  </Tab>

  <Tab title="JavaScript">
    ```ts
    import { Index } from "@upstash/vector";

    const index = new Index({
        url: "<UPSTASH_VECTOR_REST_URL>",
        token: "<UPSTASH_VECTOR_REST_TOKEN>",
    })

    await index.upsert({ id: "1", vector: [0.6, 0.8], metadata: {metadata_field: "metadata_value"} })
    ```
  </Tab>

  <Tab title="Go">
    ```go
    import "github.com/upstash/vector-go"

    func main() {
      index := vector.NewIndex("<UPSTASH_VECTOR_REST_URL>", "<UPSTASH_VECTOR_REST_TOKEN>")

      index.Upsert(vector.Upsert{
    	  Id:       "1",
    	  Vector:   []float32{0.6, 0.8},
    	  Metadata: map[string]any{"metadata_field": "metadata_value"},
      })
    }
    ```
  </Tab>

  <Tab title="cURL">
    ```shell
    curl -H "Authorization: Bearer UPSTASH_VECTOR_REST_TOKEN" \
    -d '{"id": "1", "vector": [0.6, 0.8], "metadata": {"metadata_field": "metadata_value"}}' \
    https://UPSTASH_VECTOR_REST_URL/upsert
    ```
  </Tab>
</Tabs>

## Query Index

You can perform a similarity search by providing a query vector as a parameter. The dimension of the query vector must match the dimension of your index. Also, you can query by metadata filtering.

<Note>
  Upstash is eventually consistent, so there may be a delay before the newly inserted or updated vectors are ready for querying.
</Note>

<Tabs>
  <Tab title="Python">
    ```python
    from upstash_vector import Index

    index = Index(url="<UPSTASH_VECTOR_REST_URL>", token="<UPSTASH_VECTOR_REST_TOKEN>")

    index.query(
        vector=[0.6, 0.8],
        top_k=3,
        include_vectors=True,
        include_metadata=True,
    )
    ```
  </Tab>

  <Tab title="JavaScript">
    ```ts
    import { Index } from "@upstash/vector";

    const index = new Index({
      url: "<UPSTASH_VECTOR_REST_URL>",
      token: "<UPSTASH_VECTOR_REST_TOKEN>",
    })

    await index.query({ vector: [0.6, 0.8], topK: 3, includeVectors: true, includeMetadata: true })
    ```
  </Tab>

  <Tab title="Go">
    ```go
    import "github.com/upstash/vector-go"

    func main() {
      index := vector.NewIndex("<UPSTASH_VECTOR_REST_URL>", "<UPSTASH_VECTOR_REST_TOKEN>")

      index.Query(vector.Query{
    	  Vector:          []float32{0.6, 0.8},
    	  TopK:            3,
    	  IncludeVectors:  true,
    	  IncludeMetadata: true,
      })
    }
    ```
  </Tab>

  <Tab title="cURL">
    ```shell

    curl -H "Authorization: Bearer UPSTASH_VECTOR_REST_TOKEN" \
    -d '{"vector": [0.6, 0.8], "topK": 3, "includeVectors": "true", "includeMetadata": "true"}' \
    https://UPSTASH_VECTOR_REST_URL/query
    ```
  </Tab>
</Tabs>

## Charts and Query Browser

<Frame style={{width: '600px'}}>
  <img src="https://mintlify.s3-us-west-1.amazonaws.com/upstash-bulkdlqdelete/img/vector/getstarted/charts.png" />
</Frame>

In Upstash console, you can see the charts of your index and query your index with a simple UI. There are following charts:

* **Daily Requests:** The number of queries and updates to your index in the last 5 days.
* **Throughput:** The number of queries and updates to your index in the selected time period.
* **Latency:** The mean and P99 latency of queries and updates to your index in the selected time period.
* **Vector Count:** The number of vectors in your index in the selected time period.
* **Data Size:** The size of your index in the selected time period.
