# OpenAI

### 1. Create an account with the AI provider

Before using OpenAI, an account must be created.

* Go to the OpenAI platform
* Sign up using an organization account rather than a personal account (recommended)
* Verify the account according to OpenAI’s requirements

***

### 2. Create a project

OpenAI organizes usage and billing through **projects**.

* Create a new project within your OpenAI organization
* Use a clear naming convention (e.g. `ai-studio-production` or `ai-studio-development`)
* Ensure the project is associated with the correct billing setup

Projects allow you to:

* Isolate environments (dev / test / prod)
* Track usage per application or team
* Apply consistent security and cost controls

<figure><img src="https://870194474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_kE41Rl4pOtwKfvvQq%2Fuploads%2FTt6ljAG2oJ8wlkNSBN8P%2Fimage.png?alt=media&#x26;token=168ba01d-4383-4b48-bb00-c67337f4c2ce" alt=""><figcaption></figcaption></figure>

***

### 3. Create an API key (and secure storage)

To connect the platform to OpenAI, an API key is required.

#### Create an API key

* Generate an API key within the OpenAI project
* Copy the key immediately, as it will only be shown once

#### Secure storage

* Store API keys in a secure location (e.g. secrets manager or encrypted storage)
* Never hardcode API keys in source code
* Rotate keys periodically, especially for production environments

Within the platform, API keys are stored separately from connection definitions to prevent accidental exposure.

<figure><img src="https://870194474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_kE41Rl4pOtwKfvvQq%2Fuploads%2Ft6N4kPgTaXdtI2HvzwrY%2Fimage.png?alt=media&#x26;token=7b39fdd1-389f-4267-94d0-5cbad45ab91d" alt=""><figcaption></figcaption></figure>

***

### 4. Logging

Logging provides insight into how OpenAI is being used and helps with debugging and compliance.

Typical logging includes:

* Request metadata
* Model used
* Token usage
* Errors and failures

Logging **should not** include:

* Full document contents (unless explicitly required)
* Personal or sensitive data without proper justification

<figure><img src="https://870194474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_kE41Rl4pOtwKfvvQq%2Fuploads%2F8QSFutDx7kNRbfrRB9OR%2Fimage.png?alt=media&#x26;token=a8a6fb0f-1c09-4b5f-914c-13131caef23e" alt=""><figcaption></figcaption></figure>

***

### 5. Usage and cost monitoring

OpenAI provides usage metrics at the project level.

You should regularly monitor:

* Token usage per model
* Cost per project or environment
* Spikes in usage that may indicate misconfiguration

**Recommendations:**

* Set internal budgets or alerts where possible
* Use lighter models for analysis tasks when appropriate
* Review usage periodically as agents are added or modified

<figure><img src="https://870194474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M_kE41Rl4pOtwKfvvQq%2Fuploads%2FveoawFjaIIv7UxV38Kbh%2Fimage.png?alt=media&#x26;token=f66d45b1-da1b-4c42-b9c4-8131242033be" alt=""><figcaption></figcaption></figure>

***

### Next steps

Once your OpenAI account and project are set up:

* Create a connection in **Data Studio**
* Select OpenAI as the provider
* Proceed to creating your first AI agent
