> For the complete documentation index, see [/llms.txt](/llms.txt).

> Source: /api/search/vector-stores/create-vector-store

# Create vector store

Create a new vector store.

OpenAPI spec: `./openapi/openapi-file-search.yaml`

- `POST /vector_stores`

<br />

## Response

**The vector store object**

<table><tbody><tr><td><strong>id</strong> string<br />Unique identifier for the vector store (e.g., <code>vs\_abc123def456</code>).</td></tr><tr><td><strong>object</strong> string<br />The object type, which is always <code>vector\_store</code>.</td></tr><tr><td><strong>created\_at</strong> integer<br />The Unix timestamp (in seconds) of when the vector store was created.</td></tr><tr><td><strong>name</strong> string<br />Name of the vector store. Always returned as a string — if the Create input omitted name, this is filled with <code>unnamed-</code> (OpenAI compat).</td></tr><tr><td><strong>usage\_bytes</strong> integer<br />Total bytes used by indexed files.</td></tr><tr><td><strong>file\_counts</strong> object<br />Breakdown of file statuses: <code>in\_progress</code>, <code>completed</code>, <code>failed</code>, <code>cancelled</code>, <code>total</code>.</td></tr><tr><td><strong>status</strong> string<br />Status of the vector store: <code>completed</code>, <code>in\_progress</code>, or <code>expired</code>.</td></tr><tr><td><strong>last\_active\_at</strong> integer or null<br />The Unix timestamp (in seconds) of when the vector store was last active.</td></tr><tr><td><strong>expires\_after</strong> object or null<br />Expiration policy. <code />.</td></tr><tr><td><strong>expires\_at</strong> integer or null<br />The Unix timestamp (in seconds) of when the vector store expires. <code>null</code> when no expiration policy is set.</td></tr><tr><td><strong>metadata</strong> object<br />User-defined key-value pairs (max 16 keys, key max 64 chars, value max 512 chars).</td></tr></tbody></table>

## Example

### Request

#### curl

```bash
curl -X POST https://api.upstage.ai/v2/vector_stores \
  -H "Authorization: Bearer $UPSTAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "product-docs",
    "metadata": {"team": "engineering"}
  }'
```

#### Python

```python
from openai import OpenAI

client = OpenAI(
    api_key="$UPSTAGE_API_KEY",
    base_url="https://api.upstage.ai/v2",
)

vector_store = client.vector_stores.create(
    name="product-docs",
    metadata={"team": "engineering"},
)
print(vector_store)
```

### Response

```json
{
  "id": "vs_abc123def456",
  "object": "vector_store",
  "created_at": 1711644800,
  "name": "product-docs",
  "usage_bytes": 0,
  "file_counts": {
    "in_progress": 0,
    "completed": 0,
    "failed": 0,
    "cancelled": 0,
    "total": 0
  },
  "status": "completed",
  "last_active_at": 1711644800,
  "expires_after": null,
  "expires_at": null,
  "metadata": {"team": "engineering"}
}
```