Enabling Service
Graphite AI service OpenAI API key enable AI configuration setupYou can enable Graphite, Nhost’s AI service, with the following steps:
Check your database version
Section titled “Check your database version”Check your project’s settings and make sure the database version is at least 14.6-20231018-1. If it isn’t upgrade your database version (latest available version is recommended).

[postgres]version = '14.6-20231018-1'Get an OpenAPI key
Section titled “Get an OpenAPI key”Get an OpenAI API key from their customer portal.

Configure the service
Section titled “Configure the service”Finally, you can head to your project’s settings -> AI section and enable the service or, alternatively, use your TOML configuration file to enable the service:

[ai]# Version of the service to use. Check the settings page for available versionsversion = '0.3.1'
# Used to validate requests between postgres and the AI service.# The AI service will also include the header X-Graphite-Webhook-Secret# with this value set when calling external webhooks so the source of# the request can be validated.webhookSecret = '{{ secrets.GRAPHITE_WEBHOOK_SECRET }}'
[ai.autoEmbeddings]# How often to run the job that keeps embeddings up to datesynchPeriodMinutes = 5
[ai.openai]# Key to use for authenticating API requests to OpenAI.apiKey = '{{ secrets.OPENAI_API_KEY }}'# OpenAI organization to use.organization = 'my-org'
[ai.resources.compute]# Dedicated resources allocated for the servicecpu = 128memory = 256