Embeddings

/api/v1/embeddings

Create embeddings for the supplied input. input must be a string or an array of strings. Token arrays (integer IDs) are rejected with HTTP 400. LangChain OpenAIEmbeddings sends token arrays unless check_embedding_ctx_length is False. Wrappers that construct OpenAIEmbeddings without that flag, including gpt-researcher's openai provider, still send token arrays.

Authentication: This endpoint accepts either a Bearer API key or a SIGN-IN-WITH-X header for x402 wallet-based authentication. The legacy X-Sign-In-With-X header is also accepted during migration. When using x402, a 402 Payment Required response indicates insufficient balance and includes top-up instructions.

post/api/v1/embeddings

Request

  • Base URL: https://api.venice.ai
  • URL: https://api.venice.ai/api/v1/embeddings
  • Auth: one of:
    • HTTP bearer
    • API key in header SIGN-IN-WITH-X

Headers

Accept-Encodingstring
Example:gzip, br

Supported compression encodings (gzip, br)

Request body

dimensionsinteger

The number of dimensions the resulting output embeddings should have.

encoding_format'float' | 'base64'

The format to return the embeddings in. Can be either float or base64.

userstring

This is an unused parameter and is discarded by Venice. It is supported solely for API compatibility with OpenAI.

Example request

{
  "encoding_format": "float",
  "input": "The quick brown fox jumped over the lazy dog",
  "model": "text-embedding-bge-m3"
}

Response

OK

modelstring required

The name of the model used to generate the embedding.

object'list' required

The object type, which is always "list"

Example response

{
  "data": [
    {
      "embedding": [
        0.0023064255,
        -0.009327292,
        0.015797377
      ],
      "index": 0,
      "object": "embedding"
    }
  ],
  "model": "text-embedding-bge-m3",
  "object": "list",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.