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

# Quick Start

> Get started with Moorcheh in under 5 minutes

## Prerequisites

<Steps>
  <Step title="Sign Up">
    Create your account at [console.moorcheh.ai](https://console.moorcheh.ai)
  </Step>

  <Step title="Get Your API Key">
    Navigate to the API Keys section in your dashboard and generate a new API key

    <Warning>
      Store your API key securely. Never commit it to version control or share it publicly.
    </Warning>
  </Step>
</Steps>

## Base URL

All API endpoints are accessible at:

```
https://api.moorcheh.ai/v1
```

## Authentication

The Moorcheh API uses API key authentication. Include your API key in the `x-api-key` header with every request.

<Tabs>
  <Tab title="Python SDK">
    ## Install the SDK

    ```bash theme={null}
    pip install moorcheh-sdk
    ```

    ## Initialize the Client

    ```python theme={null}
    from moorcheh_sdk import MoorchehClient

    # Initialize client
    client = MoorchehClient(
        api_key="your-api-key-here",
        base_url="https://api.moorcheh.ai/v1"
    )
    ```

    ## Create a Namespace

    ```python theme={null}
    # Create a vector namespace
    client.create_namespace(
        namespace_name="my-vectors",
        type="vector",
        vector_dimension=1536
    )
    ```

    ## Upload Vectors

    ```python theme={null}
    # Upload vector embeddings
    vectors = [
        {
            "id": "vec-1",
            "vector": [0.1, 0.2, 0.3, ...],  # 1536-dimensional vector
            "source": "document-1",
            "index": 0
        },
        {
            "id": "vec-2",
            "vector": [0.4, 0.5, 0.6, ...],
            "source": "document-2",
            "index": 1
        }
    ]

    result = client.upload_vectors(
        namespace_name="my-vectors",
        vectors=vectors
    )
    print(f"Uploaded {result['processed']} vectors")
    ```

    ## Search

    ```python theme={null}
    # Perform vector similarity search
    query_vector = [0.1, 0.2, 0.3, ...]  # Your query vector

    results = client.search(
        namespaces=["my-vectors"],
        query=query_vector,
        top_k=5
    )

    # Display results
    for match in results["matches"]:
        print(f"ID: {match['id']}, Score: {match['score']}")
    ```
  </Tab>

  <Tab title="REST API">
    ## Create a Namespace

    ```bash theme={null}
    curl -X POST "https://api.moorcheh.ai/v1/namespaces" \
      -H "Content-Type: application/json" \
      -H "x-api-key: your-api-key-here" \
      -d '{
        "namespace_name": "my-vectors",
        "type": "vector",
        "vector_dimension": 1536
      }'
    ```

    ## Upload Vectors

    ```bash theme={null}
    curl -X POST "https://api.moorcheh.ai/v1/namespaces/my-vectors/vectors" \
      -H "Content-Type: application/json" \
      -H "x-api-key: your-api-key-here" \
      -d '{
        "vectors": [
          {
            "id": "vec-1",
            "vector": [0.1, 0.2, 0.3, ...],
            "source": "document-1"
          }
        ]
      }'
    ```

    ## Search

    ```bash theme={null}
    curl -X POST "https://api.moorcheh.ai/v1/search" \
      -H "Content-Type: application/json" \
      -H "x-api-key: your-api-key-here" \
      -d '{
        "namespaces": ["my-vectors"],
        "query": [0.1, 0.2, 0.3, ...],
        "top_k": 5
      }'
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Explore the complete API documentation
  </Card>

  <Card title="Python SDK" icon="python" href="/python-sdk/introduction">
    Learn more about the Python SDK
  </Card>

  <Card title="Integrations" icon="plug" href="/integrations/langchain/overview">
    Integrate with LangChain, LlamaIndex, and more
  </Card>

  <Card title="Support" icon="headset" href="mailto:support@moorcheh.ai">
    Get help from our team
  </Card>
</CardGroup>

## Common Issues

<AccordionGroup>
  <Accordion title="Authentication Failed">
    **Error**: `401 Unauthorized`

    **Solution**:

    * Verify your API key is correct
    * Ensure you're using the header `x-api-key` (all lowercase)
    * Check that your API key hasn't been disabled
  </Accordion>

  <Accordion title="Namespace Not Found">
    **Error**: `404 Namespace not found`

    **Solution**:

    * Create the namespace first using the create namespace endpoint
    * Verify the namespace name matches exactly (case-sensitive)
  </Accordion>

  <Accordion title="Vector Dimension Mismatch">
    **Error**: `400 Vector dimension mismatch`

    **Solution**:

    * Ensure all vectors match the dimension specified when creating the namespace
    * Verify your embedding model output dimension
  </Accordion>
</AccordionGroup>
