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

# Generate embeddings

> 
Generate embeddings for an array of texts.

**Authentication:**
- Requires `x-api-key` header with valid API key or internal service key.
- Requires `x-runflow-tenant-id` header for tenant identification.

**Credential Resolution:**
- Credentials are resolved automatically from tenant's LLM Providers configuration.
- Use 'providerName' to specify which provider configuration to use.

**Supported Providers:**
- `openai`: text-embedding-3-small, text-embedding-3-large, text-embedding-ada-002
- `azure_openai`: Azure OpenAI deployments
- `cohere`: embed-english-v3.0, embed-multilingual-v3.0

**Example Request:**
```json
{
  "input": ["Hello, world!", "How are you?"],
  "model": "text-embedding-3-small",
  "dimensions": 1536
}
```
    



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/runtime/v1/embeddings
openapi: 3.0.0
info:
  title: Runflow Runtime API
  description: >-
    Programmatic surface for the Runflow platform — used by the SDK, the CLI,
    the execution engine, and any server-to-server caller. Authenticate with an
    `x-api-key` header (or `Authorization: Bearer ...`).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.runflow.ai
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
tags: []
paths:
  /api/v1/runtime/v1/embeddings:
    post:
      tags:
        - Runtime API - Embeddings
      summary: Generate embeddings
      description: >-

        Generate embeddings for an array of texts.


        **Authentication:**

        - Requires `x-api-key` header with valid API key or internal service
        key.

        - Requires `x-runflow-tenant-id` header for tenant identification.


        **Credential Resolution:**

        - Credentials are resolved automatically from tenant's LLM Providers
        configuration.

        - Use 'providerName' to specify which provider configuration to use.


        **Supported Providers:**

        - `openai`: text-embedding-3-small, text-embedding-3-large,
        text-embedding-ada-002

        - `azure_openai`: Azure OpenAI deployments

        - `cohere`: embed-english-v3.0, embed-multilingual-v3.0


        **Example Request:**

        ```json

        {
          "input": ["Hello, world!", "How are you?"],
          "model": "text-embedding-3-small",
          "dimensions": 1536
        }

        ```
            
      operationId: RuntimeEmbeddingsController_generateEmbeddings
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateEmbeddingsDto'
      responses:
        '200':
          description: Embeddings generated successfully
          content:
            application/json:
              schema:
                example:
                  embeddings:
                    - - 0.123
                      - -0.456
                      - ...
                    - - 0.789
                      - -0.012
                      - ...
                  model: text-embedding-3-small
                  dimensions: 1536
                  usage:
                    promptTokens: 10
                    totalTokens: 10
        '400':
          description: Invalid request (empty input, unsupported provider, etc.)
        '401':
          description: Missing or invalid API key
        '500':
          description: Provider error (API key not configured, rate limit, etc.)
      security:
        - bearer: []
components:
  schemas:
    GenerateEmbeddingsDto:
      type: object
      properties:
        input:
          description: Array of texts to generate embeddings for
          example:
            - Hello, world!
            - How are you?
          type: array
          items:
            type: string
        model:
          type: string
          description: Embeddings model
          example: text-embedding-3-small
          default: text-embedding-3-small
        provider:
          type: string
          description: Embeddings provider
          enum:
            - openai
            - azure_openai
            - cohere
          default: openai
        providerName:
          type: string
          description: >-
            Provider name (configured in LLM Providers) for credential
            resolution
          example: My OpenAI Production
        dimensions:
          type: number
          description: Embedding dimensions (only for models that support it)
          example: 1536
      required:
        - input

````