---
title: OpenAI
sidebarTitle: OpenAI
---
import { PyEmbeddingOpenaiBasic } from '/snippets/integrations.mdx';
LanceDB registers the OpenAI embeddings function in the registry by default, as `openai`. Below are the parameters that you can customize when creating the instances:
| Parameter | Type | Default Value | Description |
|---|---|---|---|
| `name` | `str` | `"text-embedding-ada-002"` | The name of the model. |
| `dim` | `int` | Model default | Requested output dimensions for models that support shortening embeddings. Required for model names other than the OpenAI ones listed by `model_names()` (for example a model served behind an OpenAI-compatible `base_url`), where it is the model's embedding dimension. Use `func.ndims()` when defining the vector field. |
| `use_azure` | bool | `False` | Set true to use Azure OpenAI SDK |
Set your OpenAI API key before running the example:
```bash Bash icon="terminal"
export OPENAI_API_KEY="your-api-key"
```
{PyEmbeddingOpenaiBasic}