add api key settings and agent docs
This commit is contained in:
19
README.md
19
README.md
@@ -29,6 +29,23 @@ The UI runs on port `3000`. The HTTP API runs separately on port `3002`.
|
||||
3. Check the API:
|
||||
`http://localhost:3002/api/health`
|
||||
|
||||
You can change the server API key without restarting:
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:3002/api/config/api-key \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"apiKey\":\"YOUR_GEMINI_API_KEY\",\"persist\":true}"
|
||||
```
|
||||
|
||||
You can also pass a temporary Gemini key for one call:
|
||||
|
||||
```bash
|
||||
curl -X POST http://localhost:3002/api/generate \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "x-gemini-api-key: YOUR_GEMINI_API_KEY" \
|
||||
-d "{\"prompt\":\"Create a clean product poster\"}"
|
||||
```
|
||||
|
||||
### API examples
|
||||
|
||||
Generate or edit with JSON/base64:
|
||||
@@ -58,3 +75,5 @@ curl -X POST http://localhost:3002/api/analyze-document \
|
||||
```
|
||||
|
||||
Optional API auth: set `API_AUTH_TOKEN`, then send either `Authorization: Bearer <token>` or `x-api-key: <token>`.
|
||||
|
||||
For Agent-facing image editing instructions, see `API图片修改-Agent.md`.
|
||||
|
||||
Reference in New Issue
Block a user