# Create Index

> This endpoint creates an index.

## Endpoint

`POST https://api.upstash.com/v2/vector/index`

## Request body

- `name` (string, required): Name of the index
- `region` (enum<string>, required): Region of the database
- `similarity_function` (enum<string>, required): Similarity function that's used to calculate the distance between two vectors
- `dimension_count` (number, required): The amount of values in a single vector
- `type` (enum<string>): The payment plan of your index
- `embedding_model` (enum<string>): The embedding model to use for the index
- `index_type` (enum<string>): The type of the vector index
- `sparse_embedding_model` (enum<string>): The sparse embedding model to be used for indexes

## Responses

### 200 - Index created successfully

- `customer_id` (string): The associated ID of the owner of the index
- `id` (string): Unique ID of the index
- `name` (string): The name of the index
- `similarity_function` (enum<string>): Similarity function that's used to calculate the distance between two vectors
- `dimension_count` (number): The amount of values in a single vector
- `embedding_model` (enum<string>): The predefined embedding model to vectorize your plain text
- `sparse_embedding_model` (enum<string>): The sparse embedding model to be used for indexes
- `endpoint` (string): The REST endpoint of the index
- `token` (string): The REST authentication token for the index
- `read_only_token` (string): The REST authentication read only token for the index
- `type` (enum<string>): The payment plan of the index
- `region` (enum<string>): The region where the index is currently deployed
- `max_vector_count` (number): The number of maximum that your index can contain
- `max_daily_updates` (number): The number of maximum update operations you can perform in a day. Only upsert operations are included in update count.
- `max_daily_queries` (number): The number of maximum query operations you can perform in a day. Only query operations are included in query count.
- `max_monthly_bandwidth` (number): The maximum amount of monthly bandwidth for the index. Unit is bytes. -1 if the limit is unlimited.
- `max_writes_per_second` (number): The number of maximum write operations you can perform per second. Only upsert operations are included in write count.
- `max_query_per_second` (number): The number of maximum query operations you can perform per second. Only query operations are included in query count.
- `max_reads_per_request` (number): The number of maximum vectors in a read operation. Query and fetch operations are included in read operations.
- `max_writes_per_request` (number): The number of maximum vectors in a write operation. Only upsert operations are included in write operations.
- `max_total_metadata_size` (number): The amount of maximum size for the total metadata sizes in your index.
- `reserved_price` (number): Monthly pricing of your index. Only available for fixed and pro plans.
- `creation_time` (number): The creation time of the vector index in UTC as unix timestamp.
- `index_type` (enum<string>): The type of the vector index
- `throughput_vector` (object[]): Throughput data for the vector index over time
  - `x` (string): Timestamp when measurement was taken
  - `y` (number): The measured value

## cURL

```bash
curl --request POST \
  --url https://api.upstash.com/v2/vector/index \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "myindex",
    "region": "us-east-1",
    "similarity_function": "COSINE",
    "dimension_count": 1024,
    "type": "payg",
    "embedding_model": "BGE_M3"
  }'
```
