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

# Create embeddings

> Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.



## OpenAPI

````yaml post /v2/router/embeddings
openapi: 3.1.0
info:
  title: orq.ai API
  version: '2.0'
  description: orq.ai API documentation
servers:
  - url: https://api.orq.ai
security:
  - ApiKey: []
tags:
  - description: List models available through the AI Router.
    name: Models
  - name: Guardrail Rules
  - name: Policies
  - name: Routing Rules
  - name: API keys
    description: >-
      API keys authenticate programmatic access to the workspace. The unified
      key model exposes opaque tokens, per-domain access grants, and budget /
      rate-limit constraints (see ADR 0001 and ADR 0002).
  - name: Budgets
    description: >-
      Budgets govern spend, token usage, and request rate across six scopes:
      workspace, project, identity, api-key, provider, and model. A budget is
      hierarchical and defense-in-depth — every applicable budget is a hard
      gate, and the most restrictive one wins per dimension (see ADR 0007).
  - name: Documentation
    description: >-
      Search the orq.ai documentation. Proxies the workspace's query to the
      hosted docs search index.
  - name: Files
    description: File upload and retrieval operations.
  - name: Identities
    description: >-
      Identities represent end users from your system for usage and engagement
      tracking.
  - name: Projects
    description: Projects organize resources within a workspace
  - name: Skills
    description: >-
      Skills are modular instructions you can use to codify processes and
      conventions
  - name: Responses
  - description: >-
      Run agents on a cadence — cron, interval, or one-off. Minimum firing
      interval is 1 hour.
    name: Agent Schedules
  - name: Embeddings
  - name: Reporting
    description: >-
      GenAI reporting API over canonical analytics rollups. Accepts a metric
      name, time range, grain, group-by, and filters; returns a typed time
      series and optional totals.
externalDocs:
  url: https://docs.orq.ai
  description: orq.ai Documentation
paths:
  /v2/router/embeddings:
    post:
      tags:
        - Embeddings
      summary: Create embeddings
      description: >-
        Get a vector representation of a given input that can be easily consumed
        by machine learning models and algorithms.
      operationId: createEmbedding
      requestBody:
        content:
          application/json:
            examples:
              array_of_strings:
                summary: Array of strings input
                value:
                  input:
                    - The food was delicious
                    - And the waiter was friendly
                  model: openai/text-embedding-3-small
              single_string:
                summary: Single string input
                value:
                  input: The food was delicious and the waiter...
                  model: openai/text-embedding-3-small
            schema:
              additionalProperties: false
              properties:
                cache:
                  $ref: '#/components/schemas/EmbeddingCacheConfig'
                  description: Cache configuration for the request.
                dimensions:
                  description: >-
                    The number of dimensions the resulting output embeddings
                    should have.
                  format: int64
                  type: integer
                encoding_format:
                  description: >-
                    The format to return the embeddings in. Can be either float
                    or base64.
                  enum:
                    - float
                    - base64
                  type: string
                fallbacks:
                  description: Array of fallback models to use if primary model fails.
                  items:
                    $ref: '#/components/schemas/FallbackConfig'
                  type:
                    - array
                    - 'null'
                input:
                  anyOf:
                    - description: A single text string to embed. Must be non-empty.
                      minLength: 1
                      title: String
                      type: string
                    - description: >-
                        An array of strings or token arrays to embed. Must be
                        non-empty.
                      items:
                        anyOf:
                          - type: string
                            minLength: 1
                          - items:
                              type: integer
                            minItems: 1
                            type: array
                      minItems: 1
                      title: Array
                      type: array
                  description: Input text to embed, encoded as a string or array of tokens.
                load_balancer:
                  $ref: '#/components/schemas/EmbeddingLoadBalancerConfig'
                  description: Load balancer configuration for the request.
                model:
                  description: ID of the model to use.
                  type: string
                name:
                  description: >-
                    The name to display on the trace. If not specified, the
                    default system name will be used.
                  type: string
                orq:
                  $ref: '#/components/schemas/EmbeddingOrqParams'
                  description: >-
                    Orq platform extension parameters. Top-level equivalents
                    take priority when both are set.
                retry:
                  $ref: '#/components/schemas/EmbeddingRetryConfig'
                  description: Retry configuration for the request.
                timeout:
                  $ref: '#/components/schemas/EmbeddingTimeoutConfig'
                  description: Timeout configuration to apply to the request.
                user:
                  description: A unique identifier representing your end-user.
                  type: string
              required:
                - model
                - input
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  data:
                    description: List of embedding objects.
                    items:
                      $ref: '#/components/schemas/PublicEmbeddingData'
                    minItems: 0
                    type:
                      - array
                      - 'null'
                  model:
                    description: ID of the model used.
                    type: string
                  object:
                    description: Always "list".
                    enum:
                      - list
                    type: string
                  usage:
                    $ref: '#/components/schemas/PublicEmbeddingUsage'
                    description: The usage information for the request.
                required:
                  - object
                  - data
                  - model
                  - usage
                type: object
          description: Returns the embedding vector.
components:
  schemas:
    EmbeddingCacheConfig:
      additionalProperties: false
      properties:
        ttl:
          description: >-
            Time to live for cached responses in seconds. Maximum 259200 seconds
            (3 days).
          format: int64
          type: integer
        type:
          description: Cache type.
          enum:
            - exact_match
          type: string
      required:
        - type
      type: object
    FallbackConfig:
      additionalProperties: false
      properties:
        model:
          type: string
      required:
        - model
      type: object
    EmbeddingLoadBalancerConfig:
      additionalProperties: false
      properties:
        models:
          description: Array of models with weights for load balancing requests.
          items:
            $ref: '#/components/schemas/EmbeddingLoadBalancerModelConfig'
          type:
            - array
            - 'null'
        type:
          description: Load balancer type.
          enum:
            - weight_based
          type: string
      required:
        - type
        - models
      type: object
    EmbeddingOrqParams:
      additionalProperties: false
      properties:
        cache:
          $ref: '#/components/schemas/EmbeddingCacheConfig'
          description: 'Deprecated: use top-level cache instead.'
        contact:
          $ref: '#/components/schemas/EmbeddingContactParams'
          description: >-
            Deprecated: use identity instead. Information about the contact
            making the request.
        fallbacks:
          description: 'Deprecated: use top-level fallbacks instead.'
          items:
            $ref: '#/components/schemas/FallbackConfig'
          type:
            - array
            - 'null'
        identity:
          $ref: '#/components/schemas/PublicIdentity'
          description: Information about the identity making the request.
        load_balancer:
          $ref: '#/components/schemas/EmbeddingLoadBalancerConfig'
          description: 'Deprecated: use top-level load_balancer instead.'
        name:
          description: 'Deprecated: use top-level name instead.'
          type: string
        retry:
          $ref: '#/components/schemas/EmbeddingRetryConfig'
          description: 'Deprecated: use top-level retry instead.'
        timeout:
          $ref: '#/components/schemas/EmbeddingTimeoutConfig'
          description: 'Deprecated: use top-level timeout instead.'
      type: object
    EmbeddingRetryConfig:
      additionalProperties: false
      properties:
        count:
          description: Number of retry attempts (1-5).
          format: int64
          type: integer
        on_codes:
          description: HTTP status codes that trigger retry logic.
          items:
            format: int64
            type: integer
          type:
            - array
            - 'null'
      required:
        - count
        - on_codes
      type: object
    EmbeddingTimeoutConfig:
      additionalProperties: false
      properties:
        call_timeout:
          description: Timeout value in milliseconds.
          format: int64
          type: integer
      required:
        - call_timeout
      type: object
    PublicEmbeddingData:
      additionalProperties: false
      properties:
        embedding:
          description: >-
            The embedding vector, which is a list of floats. The length of
            vector depends on the model. Can also be a base64-encoded string
            when encoding_format is base64.
        index:
          description: The index of the embedding in the list of embeddings.
          format: int64
          type: integer
        object:
          description: The object type, which is always "embedding".
          enum:
            - embedding
          type: string
      required:
        - object
        - index
        - embedding
      type: object
    PublicEmbeddingUsage:
      additionalProperties: false
      properties:
        prompt_tokens:
          description: The number of tokens used by the prompt.
          format: int64
          type: integer
        total_tokens:
          description: The total number of tokens used by the request.
          format: int64
          type: integer
      required:
        - prompt_tokens
        - total_tokens
      type: object
    EmbeddingLoadBalancerModelConfig:
      additionalProperties: false
      properties:
        model:
          description: Model identifier for load balancing.
          type: string
        weight:
          description: Weight assigned to this model for load balancing.
          format: double
          type: number
      required:
        - model
        - weight
      type: object
    EmbeddingContactParams:
      additionalProperties: false
      properties:
        display_name:
          type: string
        email:
          type: string
        id:
          type: string
        metadata:
          items:
            type: object
            additionalProperties: {}
          type:
            - array
            - 'null'
        tags:
          items:
            type: string
          type:
            - array
            - 'null'
      required:
        - id
      type: object
    PublicIdentity:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the contact
          example: contact_01ARZ3NDEKTSV4RRFFQ69G5FAV
        display_name:
          type: string
          description: Display name of the contact
          example: Jane Doe
        email:
          type: string
          format: email
          description: Email address of the contact
          example: jane.doe@example.com
        metadata:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: >-
            A hash of key/value pairs containing any other data about the
            contact
          example:
            - department: Engineering
              role: Senior Developer
        logo_url:
          type: string
          description: URL to the contact's avatar or logo
          example: https://example.com/avatars/jane-doe.jpg
        tags:
          type: array
          items:
            type: string
          description: A list of tags associated with the contact
          example:
            - hr
            - engineering
      required:
        - id
      description: >-
        Information about the identity making the request. If the identity does
        not exist, it will be created automatically.
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````