Skip to main content
Embed text and generate completions using OpenAI models. See the API reference for all parameters.
OpenAI UDFs make API calls that incur per-token costs. Each row processed results in one or more API requests billed to your account. Review OpenAI pricing before running on large tables.
Set the OPENAI_API_KEY environment variable before calling any factory function below. The key is read at UDF creation time and serialized with the UDF — no cluster-level env_vars configuration is needed.

Embeddings

Compare models by adding multiple embedding columns at once:

Generation

Generate text from OpenAI chat completion models. Supports both text and binary (image) input columns. See the API reference for all parameters. Add a summary and an image caption in one call, using different models:

API Reference

  • OpenAIopenai_udf() and openai_embedding_udf() — all parameters including column, prompt, model, mime_type, dimensions, and normalize