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

# Submit an Embedding Request

> Submit an embedding request using the OpenRouter-compatible Embeddings API on ShuYou.

## Overview

Generate text embeddings through OpenRouter's embedding router on ShuYou.

<Info title="Official OpenRouter format">
  Request parameters follow the [OpenRouter official API](https://openrouter.ai/docs/api) exactly. ShuYou only routes and forwards your request — **all client parameters are preserved**.
</Info>

**Base URL:** `https://api.shuyou.ai/openrouter`

**Endpoint:** `POST /v1/embeddings`

Pass an OpenRouter embedding model slug (for example `openai/text-embedding-3-small`) and either a string or array of strings in `input`.


## OpenAPI

````yaml en/api-reference/provider-series/openrouter/create-embeddings.json POST /openrouter/v1/embeddings
openapi: 3.1.0
info:
  title: Submit an Embedding Request
  version: 1.0.0
servers:
  - url: https://api.shuyou.ai
security:
  - bearerAuth: []
paths:
  /openrouter/v1/embeddings:
    post:
      tags:
        - OpenRouter Compatible API
      summary: Submit an Embedding Request
      description: Submits an embedding request to the OpenRouter embeddings router.
      operationId: createOpenRouterEmbeddings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingRequest'
            examples:
              simple:
                summary: Single text input
                value:
                  model: openai/text-embedding-3-small
                  input: The quick brown fox jumps over the lazy dog
              batch:
                summary: Batch strings
                value:
                  model: openai/text-embedding-3-small
                  input:
                    - First document
                    - Second document
              dimensions:
                summary: Custom dimensions
                value:
                  model: openai/text-embedding-3-small
                  input: ShuYou OpenRouter embeddings
                  dimensions: 1536
                  encoding_format: float
      responses:
        '200':
          description: Embedding vectors for the input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingResponse'
              example:
                object: list
                data:
                  - object: embedding
                    index: 0
                    embedding:
                      - 0.0023064255
                      - -0.009327292
                      - 0.015797377
                model: openai/text-embedding-3-small
                usage:
                  prompt_tokens: 8
                  total_tokens: 8
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    EmbeddingRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          description: >-
            OpenRouter embedding model slug (e.g.
            `openai/text-embedding-3-small`).
          example: openai/text-embedding-3-small
        input:
          description: Text or list of texts to embed.
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          example: The quick brown fox jumps over the lazy dog
        dimensions:
          type: integer
          minimum: 1
          description: Optional output embedding dimensions.
        encoding_format:
          type: string
          enum:
            - float
            - base64
          default: float
          description: Format of the returned embedding vectors.
        input_type:
          type: string
          description: Optional input type hint (e.g. `search_query`, `search_document`).
        user:
          type: string
          description: Optional end-user identifier for abuse monitoring.
      additionalProperties: true
    EmbeddingResponse:
      type: object
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            type: object
            properties:
              object:
                type: string
                example: embedding
              index:
                type: integer
              embedding:
                type: array
                items:
                  type: number
        model:
          type: string
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            total_tokens:
              type: integer
      additionalProperties: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key

````