---
title: "Configure API keys for AI services"
description: "Set up API credentials for OpenAI, Anthropic, and other AI providers so Pixeltable can access them."
url: "https://www.pixeltable.com/notebooks/workflow-api-keys"
updated: "2026-04-10"
---

# Configure API keys for AI services

Set up API credentials for OpenAI, Anthropic, and other AI providers so Pixeltable can access them.

- **Type:** Notebook
- **Group:** Core Operations

## How it works

You configure API keys using one of three methods, depending on your needs. Pixeltable automatically discovers credentials from environment variables or config files—no code changes needed.

## What it covers

- Set API keys using environment variables
- Store keys in a config file for all projects
- Use getpass for one-time session keys

## What it uses

- **Install:** `pip install pixeltable`
- **Environment variables it names:** `OPENAI_API_KEY`
- **Pixeltable calls:** `pxt.home()`

## Open it

- **Open in Colab:** https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/howto/cookbooks/core/workflow-api-keys.ipynb
- **Docs page:** https://docs.pixeltable.com/howto/cookbooks/core/workflow-api-keys
- **Source on GitHub:** https://github.com/pixeltable/pixeltable/blob/release/docs/release/howto/cookbooks/core/workflow-api-keys.ipynb
