Imagine With Craft

Use Craft's API With Other Tools

With the API switched on, your Craft docs are ready to power the apps you create. You can use the API with any AI assisted coding tool or vibe coding platform.

Craft
Other Tools

Enabling the API for Documents

First, you have to enable the API in order for Craft to setup an API endpoint for your documents. Then, you use the API endpoint URL to connect to the server from Other Tools.

Step 1

Open the “Imagine” tab

Step 2

Click “Add Your First API Connection”

Step 3

Configure your API connection with a name.

Step 4

Click “Add Document” to select which documents this API connection has access to.

Step 5

The API URL that will be used to interact with your document is now displayed at the top

Step 6

Click the “Download AI Bundle” button. This will download a folder containing the API documentation and the content of your doc.

Using the API in Other Tools

Once the API is enabled for your Craft docs, you can now focus on writing a prompt that the tool will use to generate your project.

In order for the tool to see how to use the API and understand the structure of your documents, you attach the AI bundle to your prompt. This bundle is a markdown document that contains the current content of your Craft docs as well as the API documentation.

Step 1

Go to your preferred AI tool or platform, and attach the AI bundle you downloaded from Craft, or for locally run tools, place the bundle into an empty directory where you run the tool.

Now you can add a prompt to describe the app you want to build. Here is a very general example that can be used for testing:

Please create a website that visualises the content of my connected Craft docs. You find instructions on how to access this data and its structure in the attached file.

Step 2

Your AI tool will analyze the document and use the API to fetch the data and build the website.

Some Ideas to Get You Started

Browse Examples