# OpenAI

> Set up an OpenAI account, project, and API key for use with Any2Info.

Before you can use OpenAI as an AI provider, set up an account, project, and API key on the OpenAI platform.

## 1. Create an account

- 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, for example `ai-studio-production` or `ai-studio-development`.
- Make sure the project is associated with the correct billing setup.

Projects let you isolate environments (dev/test/prod), track usage per application or team, and apply consistent security and cost controls.

## 3. Create an API key

- Generate an API key within the OpenAI project.
- Copy the key immediately: it's only shown once.

**Secure storage**

- Store API keys in a secure location, such as a secrets manager or encrypted storage.
- Never hardcode API keys in source code.
- Rotate keys periodically, especially for production environments.

Within Any2Info, API keys are stored separately from connection definitions to prevent accidental exposure: see [Connections](/no-code-platform/ai-studio/connections/).

## 4. Logging

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

Typical logging includes request metadata, the model used, token usage, and errors and failures. It should **not** include full document contents (unless explicitly required) or personal/sensitive data without proper justification.

## 5. Usage and cost monitoring

OpenAI provides usage metrics at the project level. Monitor:

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

Set internal budgets or alerts where possible, use lighter models for analysis tasks when appropriate, and review usage periodically as agents are added or modified.

## Next steps

Once your OpenAI account and project are set up, create a [connection](/no-code-platform/ai-studio/connections/) in Data Studio, select OpenAI as the provider, and continue to [creating your first agent](/no-code-platform/ai-studio/create-agent/).