用 Craft 創想

將 Craft 的 API 與其他工具結合使用
啟用 API 後,您的 Craft 文件即可用於您建立的應用程式。您可以將 API 與任何 AI 輔助編碼工具或 Vibe 編碼平台搭配使用。
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 其他工具.

步驟1
Open the “Imagine” tab

步驟2
Click “Add Your First API Connection”

步驟3
Configure your API connection with a name.

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

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

步驟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.

步驟1
前往您首選的 AI 工具或平台,並附加您從 Craft 下載的 AI 包;或者,對於本地運行的工具,請將包放入運行該工具的空目錄中。
現在您可以新增提示來描述您想要建立的應用程式。以下是一個非常通用的範例,可用於測試:
請建立一個網站,將我的 Craft 文件內容視覺化。附件中包含如何存取這些資料及其結構的說明。

步驟2
您的AI工具將分析文檔,並使用API取得資料並建立網站。





