Skip to main content
Generate embeddings and receive the complete raw API response including all metadata. Use this when you need access to token usage, model information, or other response details not included in the standard openai_embed() function.

Samples

Get raw embedding response

Receive the full API response:

Extract token usage

Check how many tokens were used:

Arguments

Returns

JSONB: The complete API response including:
  • object: Response type
  • data: Array of embedding objects
  • model: Model used
  • usage: Token usage information
  • openai_embed(): standard embedding function returning just the vector