---
title: OpenAI connector reference
description: Reference information for the OpenAI connector, including supported tables and destination schemas.
canonical_url: https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/openai-reference
---

# OpenAI connector reference

> [!NOTE]
> **Beta**
>
> This feature is in [Beta](https://docs.databricks.com/aws/en/release-notes/release-types.md). To use it, a workspace admin must turn on **Lakeflow Connect for OpenAI** from the **Previews** page. See [Manage Databricks previews](https://docs.databricks.com/aws/en/admin/workspace-settings/manage-previews.md).

This page has reference information for the managed OpenAI connector, including supported source tables and destination table schemas.

## <a id="supported-tables" />Supported source tables

The OpenAI connector supports the following source tables, all under the `default` source schema:

| Source table                      | Primary key        | Description                                                                                         | Sync mode         | Cursor field   |
| --------------------------------- | ------------------ | --------------------------------------------------------------------------------------------------- | ----------------- | -------------- |
| `audit_logs`                      | `id`               | Organization audit log events, such as API key, user, project, and login events. One row per event. | Incremental       | `effective_at` |
| `users`                           | `id`               | Members of your OpenAI organization, including name, email, and organization role.                  | Full refresh only | -              |
| `projects`                        | `id`               | Projects in your OpenAI organization, including archived projects, with status and creation time.   | Full refresh only | -              |
| `invites`                         | `id`               | Pending and accepted invitations to your OpenAI organization, including the invited email and role. | Full refresh only | -              |
| `admin_api_keys`                  | `id`               | Organization-level Admin API keys, including name, redacted value, and last-used time.              | Full refresh only | -              |
| `certificates`                    | `id`               | Certificates uploaded to your OpenAI organization.                                                  | Full refresh only | -              |
| `project_users`                   | `id`, `project_id` | Members of each project in your organization, including their project role.                         | Full refresh only | -              |
| `project_service_accounts`        | `id`, `project_id` | Service accounts belonging to each project in your organization.                                    | Full refresh only | -              |
| `project_api_keys`                | `id`, `project_id` | API keys belonging to each project, including name, redacted value, and owner.                      | Full refresh only | -              |
| `project_rate_limits`             | `id`, `project_id` | Per-model rate limits configured for each project.                                                  | Full refresh only | -              |
| `project_certificates`            | `id`, `project_id` | Certificates associated with each project in your organization.                                     | Full refresh only | -              |
| `usage_completions`               | `start_time`       | Daily completions usage for your organization, aggregated into time buckets.                        | Incremental       | `start_time`   |
| `usage_embeddings`                | `start_time`       | Daily embeddings usage for your organization, aggregated into time buckets.                         | Incremental       | `start_time`   |
| `usage_moderations`               | `start_time`       | Daily moderations usage for your organization, aggregated into time buckets.                        | Incremental       | `start_time`   |
| `usage_images`                    | `start_time`       | Daily image generation usage for your organization, aggregated into time buckets.                   | Incremental       | `start_time`   |
| `usage_audio_speeches`            | `start_time`       | Daily text-to-speech usage for your organization, aggregated into time buckets.                     | Incremental       | `start_time`   |
| `usage_audio_transcriptions`      | `start_time`       | Daily speech-to-text usage for your organization, aggregated into time buckets.                     | Incremental       | `start_time`   |
| `usage_vector_stores`             | `start_time`       | Daily vector store usage for your organization, aggregated into time buckets.                       | Incremental       | `start_time`   |
| `usage_code_interpreter_sessions` | `start_time`       | Daily code interpreter session usage for your organization, aggregated into time buckets.           | Incremental       | `start_time`   |
| `costs`                           | `start_time`       | Daily spend for your organization, aggregated into time buckets.                                    | Full refresh only | -              |

## <a id="connector-options" />Connector options

See [Examples](https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/openai-pipeline.md#examples) for usage.

| Option           | Type                            | Scope    | Required | Applies to                                                | Description                                                                                                                                                                            |
| ---------------- | ------------------------------- | -------- | -------- | --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `start_datetime` | String (`yyyy-MM-ddTHH:mm:ssZ`) | Pipeline | No       | All incremental tables (`audit_logs`, `usage_*`, `costs`) | Earliest date and time from which to ingest data. Defaults to 365 days before the first sync. Applies only to the first sync of each table; later syncs resume from the stored cursor. |

## <a id="destination-table-schemas" />Destination table schemas

### <a id="audit-logs-schema" />`audit_logs`

**Primary key:** `id`
**Cursor field:** `effective_at`

| Field          | Data type |
| -------------- | --------- |
| `object`       | `STRING`  |
| `id`           | `STRING`  |
| `type`         | `STRING`  |
| `effective_at` | `BIGINT`  |
| `actor`        | `STRING`  |
| `project`      | `STRING`  |
| `raw_event`    | `STRING`  |

### <a id="users-schema" />`users`

**Primary key:** `id`
**Sync mode:** Full refresh only

| Field      | Data type |
| ---------- | --------- |
| `id`       | `STRING`  |
| `object`   | `STRING`  |
| `name`     | `STRING`  |
| `email`    | `STRING`  |
| `role`     | `STRING`  |
| `added_at` | `BIGINT`  |

### <a id="projects-schema" />`projects`

**Primary key:** `id`
**Sync mode:** Full refresh only

| Field         | Data type |
| ------------- | --------- |
| `id`          | `STRING`  |
| `object`      | `STRING`  |
| `name`        | `STRING`  |
| `status`      | `STRING`  |
| `created_at`  | `BIGINT`  |
| `archived_at` | `BIGINT`  |

### <a id="invites-schema" />`invites`

**Primary key:** `id`
**Sync mode:** Full refresh only

| Field         | Data type |
| ------------- | --------- |
| `id`          | `STRING`  |
| `object`      | `STRING`  |
| `created_at`  | `BIGINT`  |
| `status`      | `STRING`  |
| `accepted_at` | `BIGINT`  |
| `email`       | `STRING`  |
| `expires_at`  | `BIGINT`  |
| `projects`    | `STRING`  |
| `role`        | `STRING`  |

### <a id="admin-api-keys-schema" />`admin_api_keys`

**Primary key:** `id`
**Sync mode:** Full refresh only

| Field            | Data type |
| ---------------- | --------- |
| `id`             | `STRING`  |
| `object`         | `STRING`  |
| `name`           | `STRING`  |
| `redacted_value` | `STRING`  |
| `created_at`     | `BIGINT`  |
| `last_used_at`   | `BIGINT`  |
| `expires_at`     | `BIGINT`  |
| `owner`          | `STRING`  |

### <a id="certificates-schema" />`certificates`

**Primary key:** `id`
**Sync mode:** Full refresh only

| Field        | Data type |
| ------------ | --------- |
| `id`         | `STRING`  |
| `object`     | `STRING`  |
| `name`       | `STRING`  |
| `created_at` | `BIGINT`  |

### <a id="project-users-schema" />`project_users`

**Primary key:** `id`, `project_id`
**Sync mode:** Full refresh only

| Field        | Data type |
| ------------ | --------- |
| `id`         | `STRING`  |
| `object`     | `STRING`  |
| `name`       | `STRING`  |
| `email`      | `STRING`  |
| `role`       | `STRING`  |
| `added_at`   | `BIGINT`  |
| `project_id` | `STRING`  |

### <a id="project-service-accounts-schema" />`project_service_accounts`

**Primary key:** `id`, `project_id`
**Sync mode:** Full refresh only

| Field        | Data type |
| ------------ | --------- |
| `id`         | `STRING`  |
| `object`     | `STRING`  |
| `name`       | `STRING`  |
| `role`       | `STRING`  |
| `created_at` | `BIGINT`  |
| `project_id` | `STRING`  |

### <a id="project-api-keys-schema" />`project_api_keys`

**Primary key:** `id`, `project_id`
**Sync mode:** Full refresh only

| Field                  | Data type |
| ---------------------- | --------- |
| `id`                   | `STRING`  |
| `object`               | `STRING`  |
| `name`                 | `STRING`  |
| `redacted_value`       | `STRING`  |
| `created_at`           | `BIGINT`  |
| `last_used_at`         | `BIGINT`  |
| `owner`                | `STRING`  |
| `owner_project_access` | `STRING`  |
| `project_id`           | `STRING`  |

### <a id="project-rate-limits-schema" />`project_rate_limits`

**Primary key:** `id`, `project_id`
**Sync mode:** Full refresh only

| Field                          | Data type |
| ------------------------------ | --------- |
| `id`                           | `STRING`  |
| `object`                       | `STRING`  |
| `model`                        | `STRING`  |
| `max_requests_per_1_minute`    | `BIGINT`  |
| `max_tokens_per_1_minute`      | `BIGINT`  |
| `max_images_per_1_minute`      | `BIGINT`  |
| `batch_1_day_max_input_tokens` | `BIGINT`  |
| `project_id`                   | `STRING`  |

### <a id="project-certificates-schema" />`project_certificates`

**Primary key:** `id`, `project_id`
**Sync mode:** Full refresh only

| Field        | Data type |
| ------------ | --------- |
| `id`         | `STRING`  |
| `object`     | `STRING`  |
| `name`       | `STRING`  |
| `created_at` | `BIGINT`  |
| `project_id` | `STRING`  |

### <a id="usage-completions-schema" />`usage_completions`

**Primary key:** `start_time`
**Cursor field:** `start_time`

| Field            | Data type |
| ---------------- | --------- |
| `object`         | `STRING`  |
| `start_time`     | `BIGINT`  |
| `start_time_iso` | `STRING`  |
| `end_time`       | `BIGINT`  |
| `end_time_iso`   | `STRING`  |
| `results`        | `STRING`  |

### <a id="usage-embeddings-schema" />`usage_embeddings`

**Primary key:** `start_time`
**Cursor field:** `start_time`

| Field            | Data type |
| ---------------- | --------- |
| `object`         | `STRING`  |
| `start_time`     | `BIGINT`  |
| `start_time_iso` | `STRING`  |
| `end_time`       | `BIGINT`  |
| `end_time_iso`   | `STRING`  |
| `results`        | `STRING`  |

### <a id="usage-moderations-schema" />`usage_moderations`

**Primary key:** `start_time`
**Cursor field:** `start_time`

| Field            | Data type |
| ---------------- | --------- |
| `object`         | `STRING`  |
| `start_time`     | `BIGINT`  |
| `start_time_iso` | `STRING`  |
| `end_time`       | `BIGINT`  |
| `end_time_iso`   | `STRING`  |
| `results`        | `STRING`  |

### <a id="usage-images-schema" />`usage_images`

**Primary key:** `start_time`
**Cursor field:** `start_time`

| Field            | Data type |
| ---------------- | --------- |
| `object`         | `STRING`  |
| `start_time`     | `BIGINT`  |
| `start_time_iso` | `STRING`  |
| `end_time`       | `BIGINT`  |
| `end_time_iso`   | `STRING`  |
| `results`        | `STRING`  |

### <a id="usage-audio-speeches-schema" />`usage_audio_speeches`

**Primary key:** `start_time`
**Cursor field:** `start_time`

| Field            | Data type |
| ---------------- | --------- |
| `object`         | `STRING`  |
| `start_time`     | `BIGINT`  |
| `start_time_iso` | `STRING`  |
| `end_time`       | `BIGINT`  |
| `end_time_iso`   | `STRING`  |
| `results`        | `STRING`  |

### <a id="usage-audio-transcriptions-schema" />`usage_audio_transcriptions`

**Primary key:** `start_time`
**Cursor field:** `start_time`

| Field            | Data type |
| ---------------- | --------- |
| `object`         | `STRING`  |
| `start_time`     | `BIGINT`  |
| `start_time_iso` | `STRING`  |
| `end_time`       | `BIGINT`  |
| `end_time_iso`   | `STRING`  |
| `results`        | `STRING`  |

### <a id="usage-vector-stores-schema" />`usage_vector_stores`

**Primary key:** `start_time`
**Cursor field:** `start_time`

| Field            | Data type |
| ---------------- | --------- |
| `object`         | `STRING`  |
| `start_time`     | `BIGINT`  |
| `start_time_iso` | `STRING`  |
| `end_time`       | `BIGINT`  |
| `end_time_iso`   | `STRING`  |
| `results`        | `STRING`  |

### <a id="usage-code-interpreter-sessions-schema" />`usage_code_interpreter_sessions`

**Primary key:** `start_time`
**Cursor field:** `start_time`

| Field            | Data type |
| ---------------- | --------- |
| `object`         | `STRING`  |
| `start_time`     | `BIGINT`  |
| `start_time_iso` | `STRING`  |
| `end_time`       | `BIGINT`  |
| `end_time_iso`   | `STRING`  |
| `results`        | `STRING`  |

### <a id="costs-schema" />`costs`

**Primary key:** `start_time`
**Sync mode:** Full refresh only

| Field        | Data type |
| ------------ | --------- |
| `object`     | `STRING`  |
| `start_time` | `BIGINT`  |
| `end_time`   | `BIGINT`  |
| `results`    | `STRING`  |
