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

# Create RAG Configuration

> Creates a new RAG configuration using LLM, embedding, and vector store credentials.

### Endpoint

**POST** `/v3/rag/`

### Authentication

API Key (`x-api-key`) must be included in the header.

### Request Body (JSON)

```json theme={null}
{
  "user_id": "string",
  "llm_credential_id": "string",
  "embedding_credential_id": "string",
  "vector_db_credential_id": "string",
  "description": "",
  "collection_name": "string",
  "llm_model": "string",
  "embedding_model": "string",
  "vector_store_provider": "string",
  "semantic_data_model": false,
  "meta_data": {}
}
```

### Curl Request

```bash theme={null}
curl -X POST "https://rag-dev.test.studio.lyzr.ai/v3/rag/" ^
-H "accept: application/json" ^
-H "content-type: application/json" ^
-H "x-api-key: sk-default-REDACTED" ^
-d "{
  \"user_id\": \"string\",
  \"llm_credential_id\": \"string\",
  \"embedding_credential_id\": \"string\",
  \"vector_db_credential_id\": \"string\",
  \"description\": \"\",
  \"collection_name\": \"string\",
  \"llm_model\": \"string\",
  \"embedding_model\": \"string\",
  \"vector_store_provider\": \"string\",
  \"semantic_data_model\": false,
  \"meta_data\": {}
}"
```

### Response Example

```json theme={null}
{
  "id": "string",
  "user_id": "string",
  "llm_credential_id": "string",
  "embedding_credential_id": "string",
  "vector_db_credential_id": "string",
  "description": "",
  "collection_name": "string",
  "llm_model": "string",
  "embedding_model": "string",
  "vector_store_provider": "string",
  "semantic_data_model": false,
  "meta_data": {}
}
```

### Error Response (422 Validation Error)

```json theme={null}
{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
```


## OpenAPI

````yaml post /rag/
openapi: 3.0.3
info:
  title: Lyzr RAG API
  version: 1.0.0
  description: API for creating RAG configurations.
servers:
  - url: https://rag-prod.studio.lyzr.ai/v3
security: []
paths:
  /rag/:
    post:
      tags:
        - RAG
      summary: Create RAG Config
      description: >-
        Creates a new RAG configuration using LLM, embedding, and vector store
        credentials.
      operationId: createRagConfig
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - user_id
                - llm_credential_id
                - embedding_credential_id
                - vector_db_credential_id
                - collection_name
                - llm_model
                - embedding_model
                - vector_store_provider
              properties:
                user_id:
                  type: string
                llm_credential_id:
                  type: string
                embedding_credential_id:
                  type: string
                vector_db_credential_id:
                  type: string
                description:
                  type: string
                  example: ''
                collection_name:
                  type: string
                llm_model:
                  type: string
                embedding_model:
                  type: string
                vector_store_provider:
                  type: string
                semantic_data_model:
                  type: boolean
                  default: false
                meta_data:
                  type: object
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  user_id:
                    type: string
                  llm_credential_id:
                    type: string
                  embedding_credential_id:
                    type: string
                  vector_db_credential_id:
                    type: string
                  description:
                    type: string
                  collection_name:
                    type: string
                  llm_model:
                    type: string
                  embedding_model:
                    type: string
                  vector_store_provider:
                    type: string
                  semantic_data_model:
                    type: boolean
                  meta_data:
                    type: object
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: array
                    items:
                      type: object
                      properties:
                        loc:
                          type: array
                          items:
                            oneOf:
                              - type: string
                              - type: integer
                        msg:
                          type: string
                        type:
                          type: string
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````