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

# Create embeddings

> OpenAI-compatible embeddings for models with
`supports_embeddings: true` (see `GET /v1/models`).

Output dimension is fixed at 1024. A `dimensions` field, if sent,
is silently ignored.




## OpenAPI

````yaml /openapi.yaml post /v1/embeddings
openapi: 3.1.0
info:
  title: Square1 API
  version: 1.0.0
  description: |
    OpenAI-compatible LLM gateway API.

    All endpoints live on `https://inference.square1.dev` and require a
    Square1 API key (`sq-arca-...`, or a legacy `ws-...` key) sent as a
    Bearer token.

    The wire format follows the OpenAI Chat Completions / Embeddings /
    Models conventions, with a small set of documented vendor extensions:
    the `reasoning_effort` request field, the `reasoning` delta/message
    field, and the `wellspring` quota-receipt block on chat responses.
servers:
  - url: https://inference.square1.dev
security:
  - bearerAuth: []
tags:
  - name: Chat
    description: OpenAI-compatible chat completions.
  - name: Embeddings
    description: OpenAI-compatible embeddings.
  - name: Models
    description: The model catalog as visible to your key.
  - name: Account
    description: Read-only introspection for the authenticated key.
  - name: Illustration
    description: NovelAI-compatible synchronous image generation.
paths:
  /v1/embeddings:
    post:
      tags:
        - Embeddings
      summary: Create embeddings
      description: |
        OpenAI-compatible embeddings for models with
        `supports_embeddings: true` (see `GET /v1/models`).

        Output dimension is fixed at 1024. A `dimensions` field, if sent,
        is silently ignored.
      operationId: createEmbedding
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmbeddingRequest'
            examples:
              basic:
                value:
                  model: qwen3-embedding
                  input:
                    - first text
                    - second text
      responses:
        '200':
          description: Embedding vectors, OpenAI list shape.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingResponse'
        '400':
          description: >
            Invalid request. Codes include `model_not_found` and
            `model_not_embedding` (the id is a chat model — use
            `/v1/chat/completions`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          description: Same quota / rate-limit codes as chat completions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          $ref: '#/components/responses/UpstreamError'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  schemas:
    EmbeddingRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          examples:
            - qwen3-embedding
            - voyage-4-lite
        input:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        encoding_format:
          type: string
          enum:
            - float
            - base64
          default: float
    EmbeddingResponse:
      type: object
      required:
        - object
        - data
        - model
        - usage
      properties:
        object:
          const: list
        data:
          type: array
          items:
            type: object
            required:
              - object
              - index
              - embedding
            properties:
              object:
                const: embedding
              index:
                type: integer
              embedding:
                description: >
                  1024-dimension vector — an array of floats, or a base64 string
                  when `encoding_format: base64`.
                oneOf:
                  - type: array
                    items:
                      type: number
                  - type: string
        model:
          type: string
        usage:
          type: object
          properties:
            prompt_tokens:
              type: integer
            total_tokens:
              type: integer
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              description: |
                Human-readable description. User-facing messages are in Korean.
            type:
              type: string
              description: >
                Error family, e.g. `invalid_request_error`, `rate_limit_error`,
                `quota_exceeded`, `access_denied`, `overloaded_error`,
                `server_error`, `service_unavailable`.
            code:
              type: string
              description: Machine-readable code (see the Errors guide).
            resets_at:
              type: string
              format: date-time
              description: >
                Present on `session_exhausted`, `weekly_exhausted`, and
                `abuse_cooldown` so clients can render a countdown.
  responses:
    Unauthorized:
      description: '`invalid_api_key` — missing, malformed, or revoked key.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: >
        Access denied. Codes include `geo_restricted` (service is
        region-locked), `account_unlinked` (community re-verification required —
        visit the dashboard), `legacy_account_upgrade_required` (finish the
        account upgrade in the dashboard), `guest_expired`, and `email_required`
        (when email enforcement is enabled).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UpstreamError:
      description: >
        `upstream_error` (and related codes) — the model service failed. Square1
        uses HTTP 500 for upstream failures (never 502).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unavailable:
      description: >
        Service unavailable. Codes: `maintenance` (operator maintenance window),
        `model_disabled` (operator turned this model off), `server_draining`
        (restart in progress — retry shortly).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        A Square1 API key: `Authorization: Bearer sq-arca-...` (legacy `ws-...`
        keys remain valid). Create and rotate keys from the dashboard.

````