Skip to content

Commit 262de16

Browse files
committed
Add OpenAI integration section
1 parent 34bb4e2 commit 262de16

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

docs/workspace/agent-panel.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,37 @@ You can view or edit your rule file anytime from the Dreamflow File Editor. Once
328328
- Update the file when your architecture or policies change.
329329

330330

331+
## OpenAI Integration
332+
Dreamflow Agent lets you add AI-powered features to your app without needing your own OpenAI API key. When you use the Agent to generate an AI feature, Dreamflow automatically connects to OpenAI through a secure proxy using Dreamflow’s internal API key.
333+
334+
This allows you to **test and experiment with AI capabilities instantly**. All credit usage during development is billed to your Dreamflow account.
335+
336+
**How It Works**
337+
338+
Dreamflow automatically routes all AI-related requests through its **OpenAI proxy**, which securely handles authentication and API calls.
339+
340+
```
341+
Your App → Dreamflow Proxy → OpenAI API
342+
```
343+
344+
When you generate an AI feature through the Agent (for example, *“Add an AI habit suggestion generator”*), Dreamflow automatically includes an OpenAI configuration file similar to the one below:
345+
346+
![open-ai-integration](imgs/open-ai-integration.avif)
347+
348+
These environment variables are injected by Dreamflow when running your app in preview mode.
349+
350+
### Update API Key
351+
352+
When you export your project or deploy it to production, you must update your configuration to use your **own OpenAI API key** instead of Dreamflow’s proxy.
353+
354+
You can do this directly inside the file generated by Dreamflow. Here’s an example:
355+
356+
```jsx
357+
// Replace these with your own OpenAI credentials
358+
const String apiKey = 'YOUR_OPENAI_API_KEY';
359+
const String endpoint = 'https://api.openai.com/v1';
360+
```
361+
331362
## FAQ
332363

333364
<details>
56.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)