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

# Create Embeddings

> Creates an embedding vector representing the input text.



## OpenAPI

````yaml POST /embeddings
openapi: 3.0.3
info:
  title: Traceport Gateway API
  description: |
    OpenAI-compatible unified gateway API for Traceport.
    Supports multiple LLM providers (OpenAI, Anthropic, Google, Bedrock) through
    a single set of endpoints. All endpoints require API key authentication via
    the `Authorization: Bearer <api-key>` header.
  version: 1.0.0
  contact:
    name: Traceport
    url: https://traceport.ai
servers:
  - url: /v1
    description: API v1
security:
  - BearerAuth: []
tags:
  - name: Chat Completions
    description: Create chat completions (supports streaming)
  - name: Embeddings
    description: Create text embeddings
  - name: Batches
    description: Manage batch processing jobs
  - name: Files
    description: Upload and manage files for batch processing
  - name: Workflow
    description: Execute server-side workflows
  - name: Prompts
    description: Run published prompt templates
  - name: Realtime
    description: Build interactive, low-latency AI applications with persistent connections
paths:
  /embeddings:
    post:
      tags:
        - Embeddings
      summary: Create Embeddings
      description: Creates an embedding vector representing the input text.
      operationId: createEmbedding
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingRequest'
      responses:
        '200':
          description: Embedding response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    EmbeddingRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          description: Model identifier.
        input:
          description: Text to embed — a single string or array of strings.
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        encoding_format:
          type: string
          enum:
            - float
            - base64
        dimensions:
          type: integer
          nullable: true
        user:
          type: string
    EmbeddingResponse:
      type: object
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            $ref: '#/components/schemas/Embedding'
        model:
          type: string
        usage:
          $ref: '#/components/schemas/Usage'
    Embedding:
      type: object
      properties:
        object:
          type: string
          example: embedding
        embedding:
          type: array
          items:
            type: number
            format: double
        index:
          type: integer
    Usage:
      type: object
      properties:
        prompt_tokens:
          type: integer
        completion_tokens:
          type: integer
        total_tokens:
          type: integer
        prompt_tokens_details:
          $ref: '#/components/schemas/PromptTokensDetails'
        completion_tokens_details:
          $ref: '#/components/schemas/CompletionTokensDetails'
        cache_creation_input_tokens:
          type: integer
          description: Anthropic — tokens used to create the cache.
        cache_read_input_tokens:
          type: integer
          description: Anthropic — tokens read from cache.
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message.
    PromptTokensDetails:
      type: object
      properties:
        cached_tokens:
          type: integer
    CompletionTokensDetails:
      type: object
      properties:
        reasoning_tokens:
          type: integer
        accepted_prediction_tokens:
          type: integer
        rejected_prediction_tokens:
          type: integer
  responses:
    BadRequest:
      description: Bad request — invalid or missing parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized — missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key passed as a Bearer token.

````