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

# Embeddings (ZeroClick)

> OpenAI-style embeddings authenticated by a ZeroClick HMAC signature instead of an API key.

This is the [Embeddings](/api-reference/embeddings) endpoint behind **ZeroClick**, ZeroGPU's agent-payment layer. Same request/response bodies and same model routing as `/v1/embeddings` — only authentication, authorization, and metering differ.

* **Authentication** — no `x-api-key`. A buying agent calls ZeroClick's hosted pay URL; ZeroClick proxies the request and signs the raw request bytes with an HMAC in the `zc-signature` header. A request is authenticated **only** by a valid signature.
* **Authorization** — a ZeroClick allowance check runs before any billable work. It fails *open* on a transient ZeroClick outage (the signature has already verified), but never for a missing or invalid signature.
* **Metering** — billed on input tokens only. The `prompt_tokens` from the response's `usage` are settled with ZeroClick and reported via the `zc-usage` response header. Stripe metering is bypassed; ZeroClick is the sole biller.

Handle errors the same way as [API error codes](/docs/production-patterns#handle-status-codes-explicitly).


## OpenAPI

````yaml api-reference/openapi/zeroclick.openapi.json POST /zeroclick/v1/embeddings
openapi: 3.1.0
info:
  title: ZeroGPU Orchestration API — ZeroClick endpoints
  version: 1.0.0
  description: >
    OpenAPI specification for the ZeroClick-authenticated orchestration
    endpoints

    (`/zeroclick/v1/*`).


    ZeroClick sits in front of the ZeroGPU Orchestration API as the

    agent-payment layer. A buying agent calls ZeroClick's hosted pay URL;

    ZeroClick then proxies the request to these endpoints, signing the raw

    request bytes with an HMAC in the `zc-signature` header. From this API's

    perspective, a request is authenticated **only** by a valid `zc-signature`

    — there is no `x-api-key` on these routes.


    These endpoints mirror the standard `/v1/chat/completions`,

    `/v1/responses`, `/v1/embeddings`, `/v1/moderations` and `/v1/audio/*`

    orchestration endpoints (same request/response bodies,

    same model routing), differing only in:
      * **Authentication** — the `zc-signature` HMAC is verified over the raw
        request bytes instead of an API key.
      * **Authorization** — a ZeroClick allowance check runs before any
        billable work. It fails *open* on a transient ZeroClick outage (the
        signature has already verified), but never for a missing/invalid
        signature.
      * **Metering** — actual usage is reported back to ZeroClick via the
        `zc-usage` response header on success: input/output tokens for the
        text endpoints, audio seconds for the audio endpoints. Stripe metering is intentionally
        bypassed; ZeroClick is the sole biller.
servers:
  - url: https://api.zerogpu.ai
    description: Production
security: []
tags:
  - name: ZeroClick
    description: ZeroClick agent-payment authenticated orchestration endpoints.
paths:
  /zeroclick/v1/embeddings:
    post:
      tags:
        - ZeroClick
      summary: Create embeddings (ZeroClick-authenticated)
      description: >
        OpenAI-style Embeddings endpoint. Billed on input tokens only;
        `zc-usage`

        reports the `prompt_tokens` from the response's `usage`.


        Authenticated by verifying the `zc-signature` HMAC over the raw

        request bytes; the same orchestration as `/v1/embeddings` runs behind
        it.
      operationId: zeroclickCreateEmbedding
      parameters:
        - $ref: '#/components/parameters/ZcRequestId'
        - $ref: '#/components/parameters/ZcAgentId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEmbeddingRequest'
            example:
              model: all-minilm-l6-v2
              input: >-
                ZeroGPU runs high-volume inference tasks on small models at the
                edge.
      responses:
        '200':
          description: >-
            OpenAI embeddings list. Includes the `zc-usage` header settling
            actual usage with ZeroClick.
          headers:
            zc-usage:
              $ref: '#/components/headers/ZcUsage'
            x-request-id:
              $ref: '#/components/headers/XRequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmbeddingResponse'
              example:
                object: list
                data:
                  - object: embedding
                    index: 0
                    embedding:
                      - 0.012601
                      - -0.072932
                      - 0.043332
                      - 0.028129
                      - 0.033064
                      - -0.078302
                      - -0.153619
                      - -0.011621
                model: all-MiniLM-L6-v2
                usage:
                  prompt_tokens: 18
                  total_tokens: 18
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/ZeroClickUnauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - ZeroClickSignature: []
components:
  parameters:
    ZcRequestId:
      name: zc-request-id
      in: header
      required: false
      description: >-
        ZeroClick request id, echoed in logs for correlation. Set by ZeroClick
        when it proxies the request.
      schema:
        type: string
        example: zcreq_1
    ZcAgentId:
      name: zc-agent-id
      in: header
      required: false
      description: >-
        Identifier of the buying agent. Used to partition logs/analytics by
        agent; becomes the synthesized caller identity.
      schema:
        type: string
        example: agt_1
  schemas:
    CreateEmbeddingRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          description: >-
            Embedding model to use. Embedding models are routable only on this
            endpoint.
          enum:
            - all-minilm-l6-v2
            - bge-small-en-v1.5
          example: all-minilm-l6-v2
        input:
          description: >-
            Text to embed. A single string, or an array of strings (one vector
            per element). Inputs are truncated at the model's max token length.
          oneOf:
            - type: string
              minLength: 1
            - type: array
              minItems: 1
              items:
                type: string
                minLength: 1
    EmbeddingResponse:
      type: object
      description: An OpenAI-compatible embedding list.
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            $ref: '#/components/schemas/Embedding'
        model:
          type: string
          description: The resolved model id.
          example: all-MiniLM-L6-v2
        usage:
          $ref: '#/components/schemas/EmbeddingUsage'
    Embedding:
      type: object
      properties:
        object:
          type: string
          example: embedding
        index:
          type: integer
          description: Position of the input this vector was produced from.
          example: 0
        embedding:
          type: array
          description: The embedding vector. 384 dimensions for both models.
          items:
            type: number
    EmbeddingUsage:
      type: object
      description: Embeddings are billed on input tokens only; there are no output tokens.
      properties:
        prompt_tokens:
          type: integer
          example: 18
        total_tokens:
          type: integer
          example: 18
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
          properties:
            message:
              type: string
            type:
              type: string
            param:
              type: string
            code:
              type: string
    ZeroClickSignatureError:
      type: object
      required:
        - error
      description: >-
        Returned when the `zc-signature` is missing/invalid or ZeroClick is
        unconfigured.
      properties:
        error:
          type: string
          const: invalid_zeroclick_signature
    PaymentRequiredError:
      type: object
      description: >-
        ZeroClick `payment_required` denial body, produced by the
        `@zeroclickai/sellers` SDK.
      additionalProperties: true
  headers:
    ZcUsage:
      description: |
        Usage report settled with ZeroClick, present on `200` responses. Encodes
        the actual usage metered against the request's ZeroClick service slug
        (the kebab-cased model id, e.g. `lfm2-5-1-2b-instruct`): `input_tokens`
        and `output_tokens` for chat completions, responses and moderations,
        `input_tokens` only for embeddings, and `audio_seconds` for the audio
        endpoints.
      schema:
        type: string
    XRequestId:
      description: Correlation id for this request, present on every response.
      schema:
        type: string
    RetryAfter:
      description: Seconds to wait before retrying.
      schema:
        type: integer
  responses:
    BadRequest:
      description: >-
        Invalid request — malformed JSON, or a missing/invalid required field
        such as `model` or `messages`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            invalidJson:
              value:
                error:
                  message: Invalid JSON body
            missingModel:
              value:
                error:
                  message: Missing or invalid "model"
    ZeroClickUnauthorized:
      description: >
        The `zc-signature` was missing or invalid, or ZeroClick is not
        configured

        for this environment. Unsigned/unverifiable traffic is treated as

        unauthenticated.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ZeroClickSignatureError'
          example:
            error: invalid_zeroclick_signature
    PaymentRequired:
      description: |
        The ZeroClick allowance check denied the request (e.g. insufficient
        allowance or a stale signature timestamp). Body follows ZeroClick's
        `payment_required` schema as returned by the SDK.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PaymentRequiredError'
    RateLimited:
      description: >-
        Rate limit reached. Limits are counted per ZeroClick agent, so one busy
        agent does not throttle the others. Wait at least `retry-after` seconds,
        then retry.
      headers:
        retry-after:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              message: >-
                Rate limit reached for LFM2.5-1.2B-Instruct in organization
                org_123 on requests per min (RPM): Limit 60, Used 60, Requested
                1. Please try again in 1s.
              type: rate_limit_error
              param: null
              code: requests_per_minute_exceeded
    InternalError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            error:
              message: Internal error
              type: internal_error
  securitySchemes:
    ZeroClickSignature:
      type: apiKey
      in: header
      name: zc-signature
      description: |
        HMAC signature minted by ZeroClick over the raw request bytes, of the
        form `t=<unix-seconds>,kid=<key-id>,v1=<hex-hmac>`. Verified by the
        `@zeroclickai/sellers` SDK against the seller's signing secret keyed by
        `kid`. A missing or invalid signature is rejected with `401`
        `invalid_zeroclick_signature`; this is never failed open.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.