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

# Embeddings

> Generate vector embeddings for semantic search and Retrieval-Augmented Generation.

The `/v1/embeddings` endpoint converts text inputs into high-dimensional vector representations for clustering, semantic search, and RAG pipelines.

<CodeGroup>
  ```python Python (OpenAI SDK) icon="python" theme={"theme":{"light":"ayu-dark","dark":"catppuccin-latte"}}
  from openai import OpenAI
  import os

  client = OpenAI(
      base_url="https://api.neosantara.xyz/v1",
      api_key=os.environ["NEOSANTARA_API_KEY"]
  )

  response = client.embeddings.create(
      model="gemini-embedding-001",
      input=[
          "Neosantara is Indonesia's AI Gateway for developers.",
          "Low latency architectures optimize inference speed."
      ]
  )

  for item in response.data:
      print(f"Index: {item.index}, Vector Length: {len(item.embedding)}")
  ```

  ```bash cURL icon="terminal" theme={"theme":{"light":"ayu-dark","dark":"catppuccin-latte"}}
  curl -X POST https://api.neosantara.xyz/v1/embeddings \
    -H "Authorization: Bearer $NEOSANTARA_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "gemini-embedding-001",
      "input": "Semantic search for financial records."
    }'
  ```
</CodeGroup>

## Request Parameters

| Parameter         | Type              | Required | Description                                                                          |
| :---------------- | :---------------- | :------- | :----------------------------------------------------------------------------------- |
| `model`           | `string`          | Yes      | Embedding model identifier (e.g., `gemini-embedding-001`, `text-embedding-3-small`). |
| `input`           | `string \| array` | Yes      | Single string or array of strings to embed.                                          |
| `dimensions`      | `integer`         | Optional | Output vector dimensionality (supported on select models).                           |
| `encoding_format` | `string`          | Optional | Return format: `"float"` or `"base64"`. Default `"float"`.                           |

## Available Embedding Models

| Model ID                 | Provider   | Context Window | Capabilities | Pricing (Input/Output per 1M) |
| :----------------------- | :--------- | :------------- | :----------- | :---------------------------- |
| `gemini-embedding-001`   | Google     | 2k tokens      | Embeddings   | $0.15 / $0                    |
| `nusa-embedding-0001`    | Neosantara | N/A            | Embeddings   | Free / Included               |
| `nv-embed-v1`            | NVIDIA     | 32k tokens     | Embeddings   | Rp 150 / Rp 0                 |
| `text-embedding-3-small` | OpenAI     | 8k tokens      | Embeddings   | $0.02 / $0                    |


## Related topics

- [Chat Completions](/en/gateway/chat-completions.md)
- [LlamaIndex](/en/integrations/llama-index.md)
- [LangChain Integration](/en/integrations/langchain.md)
