# OpenAI

> Add AI features on your own OpenAI key: chat, images, embeddings, and audio, with the spend guardrails that keep the bill yours to set.

Connect OpenAI once and your app can use its models directly: chat and text generation, embeddings, image generation, audio, and moderation. This guide covers the connection, what to ask for, and what it costs where.

## Connect it

### Get an API key from OpenAI

In the [OpenAI dashboard](https://platform.openai.com/api-keys), create an API key. The key needs billing set up on the OpenAI side; their free trial credits work for testing.

### Paste it into Vaulter

Open **Vault → Connectors**, pick OpenAI, and paste the key into the secure form. The key goes into Vaulter's connection layer, not your project files, and [the agent never sees it](/docs/data/secrets-vault).

### Ask for the feature

Describe the outcome, not the API:

> Add an assistant tab where users can ask questions about their own saved recipes, answered by OpenAI.

The agent wires the calls, the loading states, and the error handling.

## What your app can do with it

The connection covers OpenAI's main surfaces: chat and text completions, embeddings for search and similarity, image generation, audio (speech-to-text and text-to-speech), and content moderation. Genuinely off-menu operations, like managing your OpenAI account or keys, are [blocked by the endpoint policy](/docs/integrations/limits-and-scope) in every context.

## Who pays for what

Two meters run, and they are separate:

- **Vaulter tokens** pay for building the feature, like any other feature. Your app calling OpenAI at runtime [costs no Vaulter tokens](/docs/account/tokens).
- **Your OpenAI account** pays for every model call your app makes, in preview and in production, because the connection is your API key. This is an [owner-shared connection](/docs/integrations/limits-and-scope): all of your app's users ride on it.

Because strangers can spend your OpenAI budget once the app is published, set the **owner spend quota** before you publish an AI feature to the open internet. It caps calls per 30 days and pauses the feature instead of surprising you with a bill.

## Frequently asked

#### Which model will my app use?

The agent picks a sensible current model for the job and you can override it by name: "use gpt-4o-mini for the chat feature". If OpenAI retires a model later, ask the agent to update the feature.

#### Can my users bring their own OpenAI keys?

No. The connection is the workspace's. If per-user AI billing is core to your product, describe that goal in chat and the agent can propose designs, but the built-in connector always runs on your key.

#### My AI feature stopped working in production

Check three things in order: your OpenAI account has billing headroom, your Vaulter owner spend quota has not been reached (calls fail with a payment-required error when it has), and the [rate limit](/docs/integrations/limits-and-scope) of 60 calls per minute is not being hit by a retry loop.
