OpenAI
Connect the OpenAI API to let agents send completions to GPT models and generate embeddings through the vault.
Prerequisites
- An OpenAI account with API access at platform.openai.com
Getting Your API Key
- Go to platform.openai.com/api-keys
- Click Create new secret key
- Give it a name and copy the key (starts with
sk-...)
Connecting
- Go to Connections in the dashboard
- Select the LLM Access tab
- Click Connect OpenAI
- Paste your API key
- Click Connect
Singleton
OpenAI is a singleton service -- only one connection per workspace. Agents use service: "openai" instead of a connection ID.
Vault API Usage
vault_execute({
service: "openai",
method: "POST",
url: "https://api.openai.com/v1/chat/completions",
body: {
model: "gpt-4o",
messages: [{ role: "user", content: "Hello!" }]
}
})
The vault automatically adds the Authorization: Bearer header.
Available Endpoints
| Method | URL Path | Description |
|---|---|---|
| POST | /v1/chat/completions | Send a chat completion request |
| POST | /v1/embeddings | Generate embeddings |
| GET | /v1/models | List available models |