AI Chat

Setup

Configure AI Chat by adding your AI provider API keys and customizing assistant behavior.

AI Chat requires an API key from a supported AI provider. This page covers the administrator setup process.

Requirements

  • Administrator access to your Directus instance
  • API key from OpenAI or Anthropic (see below)
  • Users must have App access - Public (non-authenticated) or API-only users cannot use AI Chat
Note that all users of AI Chat will share a single API key from your configured provider. Usage limits and costs will be shared across all users. See your provider's dashboard for monitoring usage details and costs.

Get an API Key

You'll need an API key from at least one provider. Choose based on which models you want to use.

Configure API Keys in Directus

Go to Settings → AI in the Directus admin panel.

AI Settings page in Directus

Enter Your API Key

Add your API key for one or both providers:

  • OpenAI API Key - Enables GPT-5 models
  • Anthropic API Key - Enables Claude models
API keys are encrypted at rest in the database and masked in the UI.

Save Settings

Click Save to apply your changes. AI Chat is now available to all users with App access.

Custom System Prompt

Optionally customize how the AI assistant behaves in Settings → AI → Custom System Prompt.

The default system prompt provides the AI with helpful instructions on how to interact with Directus and is tuned to provide good results.

If you choose to customize the system prompt, it's recommended to use the following template as a starting point:

Leave blank to use the default behavior.

Managing Costs

AI Chat uses your own AI provider API keys. Every message and tool call costs money. Be mindful of usage, especially with larger models. You are responsible for the costs of your usage.

Tips for controlling costs:

  • Use faster, cheaper models (GPT-5 Nano, Claude Haiku 4.5) for simple tasks
  • Disable unused tools - disabled tools are not loaded into context, reducing token usage
  • Set spending limits in your OpenAI or Anthropic dashboard

Next Steps

User Guide

Learn how users interact with AI Chat.

Available Tools

See what actions the AI can perform.

Tips & Best Practices

Get the most out of AI Chat.

Security

Access control and data protection.

Get once-a-month release notes & real‑world code tips...no fluff. 🐰