openai_embed() function.
Samples
Get raw embedding response
Receive the full API response:Extract token usage
Check how many tokens were used:Arguments
This function accepts the same arguments asopenai_embed().
Returns
JSONB: The complete API response including:
object: Response typedata: Array of embedding objectsmodel: Model usedusage: Token usage information
Related functions
openai_embed(): standard embedding function returning just the vector