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

# Embeddings

> POST /inference/v1/embeddings — Semantic search over Hindi and English documents

Generate vector embeddings for text. Power RAG pipelines, semantic search, and document retrieval from Indian data centers.

```
POST https://api.forii.in/inference/v1/embeddings
```

## Request

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    response = client.embeddings.create(
        model="forii/embed-v3",
        input=[
            "What is the GST rate for textiles?",
            "भारत में टेक्सटाइल का GST दर क्या है?"
        ]
    )

    print(len(response.data[0].embedding))  # 1024
    print(response.usage)  # {"prompt_tokens": 20, "total_tokens": 20}
    ```
  </Tab>

  <Tab title="JavaScript">
    ```javascript theme={null}
    const response = await client.embeddings.create({
      model: "forii/embed-v3",
      input: [
        "What is the GST rate for textiles?",
        "भारत में टेक्सटाइल का GST दर क्या है?",
      ],
    });

    console.log(response.data[0].embedding.length); // 1024
    console.log(response.usage); // { prompt_tokens: 20, total_tokens: 20 }
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl https://api.forii.in/inference/v1/embeddings \
      -H "Authorization: Bearer $FORII_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "forii/embed-v3",
        "input": [
          "What is the GST rate for textiles?",
          "भारत में टेक्सटाइल का GST दर क्या है?"
        ]
      }'
    ```
  </Tab>
</Tabs>

## Response

```json theme={null}
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "index": 0,
      "embedding": [0.0023, -0.0091, 0.0147, ...]
    },
    {
      "object": "embedding",
      "index": 1,
      "embedding": [0.0041, -0.0078, 0.0082, ...]
    }
  ],
  "model": "forii/embed-v3",
  "usage": {
    "prompt_tokens": 20,
    "total_tokens": 20
  }
}
```

## Parameters

| Parameter         | Type          | Required | Default | Description                                    |
| ----------------- | ------------- | -------- | ------- | ---------------------------------------------- |
| `model`           | string        | Yes      | —       | `forii/embed-v3`                               |
| `input`           | string\|array | Yes      | —       | Text or array of texts to embed                |
| `dimensions`      | integer       | No       | 1024    | Output dimensions (variable-length embeddings) |
| `encoding_format` | string        | No       | `float` | `float` or `base64`                            |

## Pricing

| Model            | ₹/1K tokens |
| ---------------- | ----------- |
| `forii/embed-v3` | ₹0.003      |

<Info>
  Embedding costs are extremely low. 1 million tokens costs ₹3. This makes bulk document indexing affordable for RAG pipelines.
</Info>

## Use cases

* **RAG (Retrieval-Augmented Generation)** — Index documents in Hindi and English, retrieve relevant context for chat completions
* **Semantic search** — Find similar documents across languages
* **Clustering** — Group similar content by embedding distance
* **Deduplication** — Detect near-duplicate documents

## Related

* [Chat Completions](/docs/api-reference/chat-completions) — Generate text from embeddings
* [Models](/docs/api-reference/models) — Browse available models
