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

# Embeddings API

> Generate vector embeddings from text for semantic search and similarity operations

# Embeddings API

The Embeddings API allows you to convert text into numerical vector representations that capture semantic meaning. These embeddings enable powerful operations like:

* Semantic text search
* Text clustering and classification
* Content recommendation
* Similarity comparisons

## Available Models

Gately AI offers several embedding models with different dimensions and performance characteristics:

| Model                      | Dimensions | Context Window | Best For                      |
| -------------------------- | ---------- | -------------- | ----------------------------- |
| jina-embeddings-v3         | 1024       | 8192 tokens    | General purpose, multilingual |
| text-embedding-3-large     | 3072       | 8191 tokens    | High accuracy applications    |
| text-embedding-3-small     | 1536       | 8191 tokens    | Efficient, general purpose    |
| jina-embeddings-v2-base-en | 768        | 8192 tokens    | English text optimization     |

## Example Usage

```python theme={null}
from openai import OpenAI

client = OpenAI(
    api_key="your-api-key",
    base_url="https://api.gately.ai/v1"
)

response = client.embeddings.create(
    model="jina-embeddings-v3",
    input=["Your text to convert to embeddings"]
)

embeddings = response.data[0].embedding
print(f"Generated embedding vector with {len(embeddings)} dimensions")
```

```javascript theme={null}
import OpenAI from "openai";

const openai = new OpenAI({
  apiKey: "your-api-key",
  baseURL: "https://api.gately.ai/v1"
});

const response = await openai.embeddings.create({
  model: "jina-embeddings-v3",
  input: ["Your text to convert to embeddings"]
});

const embeddings = response.data[0].embedding;
console.log(`Generated embedding vector with ${embeddings.length} dimensions`);
```

## Response Format

The API returns a list of embedding vectors corresponding to each input text, along with usage information:

```json theme={null}
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "embedding": [0.0023064255, -0.009327292, ...], // Vector of floating point numbers
      "index": 0
    }
  ],
  "model": "jina-embeddings-v3",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}
```

## Best Practices

* Use consistent embedding models for related datasets
* For long texts, consider chunking into smaller segments
* Normalize embeddings if performing cosine similarity
* Cache embeddings for frequently used content


## OpenAPI

````yaml POST /v1/embeddings
openapi: 3.0.1
info:
  title: TaamCloud API
  description: >-
    A collection of AI services including chat, embeddings, reranking, and media
    generation
  version: 1.0.0
servers:
  - url: https://api.gately.ai
    description: Main API server
  - url: https://uploud.taam.cloud
    description: File Processing server
security:
  - bearerAuth: []
paths:
  /v1/embeddings:
    post:
      tags:
        - Embeddings
      summary: Generate embeddings
      description: >-
        Create vector embeddings from text input for semantic search and
        similarity operations
      operationId: embeddings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingsRequest'
            examples:
              Simple:
                value:
                  model: jina-embeddings-v3
                  input:
                    - Generate vector representations of this text
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingsResponse'
components:
  schemas:
    EmbeddingsRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          example: jina-embeddings-v3
        input:
          type: array
          items:
            type: string
    EmbeddingsResponse:
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Enter your API key prefixed with 'Bearer '

````