Skip to main content

Embeddings API

Return an embedding for a given text and, optionally, an image.

Endpoint

POST /embed

Request Body (EmbedRequest)

FieldTypeRequiredDescription
textStringYesThe input text for generating embeddings.
image_bytesStringNoOptional. Base64-encoded image bytes.
image_urlStringNoOptional. The URL of the image.

Example Request

Example Body
{
  "text": "Industrial style workbench",
  "image_bytes": "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAMCAgMCAgMD..."
}

Response Body (EmbedResponse)

Returns a JSON object containing the generated embedding.
FieldTypeDescription
embeddingArrayA list of floating point numbers representing the embedding vector.

Example Response

Example Response
{
  "embedding": [0.23, 0.56, 0.87, -0.12, 0.45, 0.78]
}

Responses

  • 200 OK: Successful Response (EmbedResponse)
  • 422 Validation Error: (HTTPValidationError)