This commit is contained in:
2026-05-09 18:24:08 +08:00
parent a0ed128bde
commit bc704d0c22
38 changed files with 481 additions and 378 deletions

View File

@@ -1,11 +1,11 @@
---
name: gpt-image-2-apimart
description: Generate or inspect project image assets through this repository's APIMart OpenAI-compatible gpt-image-2 workflow. Use when Codex needs to create puzzle template sample images, reproduce the server-rs gpt-image-2 request body, dry-run image prompts, batch-generate local project thumbnails, or debug APIMART_BASE_URL / APIMART_API_KEY image-generation configuration without exposing secrets.
description: Generate or inspect project image assets through this repository's VectorEngine gpt-image-2 workflow. Use when Codex needs to create puzzle template sample images, reproduce the server-rs gpt-image-2 request body, dry-run image prompts, batch-generate local project thumbnails, or debug VECTOR_ENGINE_BASE_URL / VECTOR_ENGINE_API_KEY image-generation configuration without exposing secrets. The directory name is historical.
---
# gpt-image-2 APIMart
# gpt-image-2 VectorEngine
Use this skill for project-local image asset generation that must match the repository's `server-rs` APIMart `gpt-image-2` path.
Use this skill for project-local image asset generation that must match the repository's `server-rs` VectorEngine `gpt-image-2-all` path. The folder still contains `apimart` in its name for compatibility with existing local plugin references.
## Workflow
@@ -24,15 +24,15 @@ Use this skill for project-local image asset generation that must match the repo
```
5. Save final project assets under `public/` or another explicitly requested workspace path.
6. Never print `APIMART_API_KEY`. Report only whether configuration exists.
6. Never print `VECTOR_ENGINE_API_KEY`. Report only whether configuration exists.
## Request Contract
The repository image path uses:
```text
POST {APIMART_BASE_URL}/images/generations
Authorization: Bearer {APIMART_API_KEY}
POST {VECTOR_ENGINE_BASE_URL}/v1/images/generations
Authorization: Bearer {VECTOR_ENGINE_API_KEY}
Content-Type: application/json
```
@@ -40,11 +40,10 @@ Default body:
```json
{
"model": "gpt-image-2",
"model": "gpt-image-2-all",
"prompt": "<prompt>",
"n": 1,
"official_fallback": true,
"size": "1:1"
"size": "1024x1024"
}
```
@@ -52,17 +51,11 @@ For a reference image, add:
```json
{
"image_urls": ["data:image/png;base64,..."]
"image": ["data:image/png;base64,..."]
}
```
Poll async responses with:
```text
GET {APIMART_BASE_URL}/tasks/{task_id}
```
Accept image output from `data[].url`, `data[].b64_json`, direct nested `url` fields, or async task results.
Accept image output from `data[].url`, `data[].b64_json`, or direct nested `url` fields. VectorEngine GPT-image-2-all currently returns synchronously; do not poll APIMart task endpoints.
## Environment
@@ -70,12 +63,12 @@ Load environment values from process env first, then `.env.secrets.local`, `.env
Required for live generation:
- `APIMART_BASE_URL`
- `APIMART_API_KEY`
- `VECTOR_ENGINE_BASE_URL`
- `VECTOR_ENGINE_API_KEY`
Optional:
- `APIMART_IMAGE_REQUEST_TIMEOUT_MS`
- `VECTOR_ENGINE_IMAGE_REQUEST_TIMEOUT_MS`
If the key or base URL is missing, stop after dry-run or explain the missing configuration. Do not ask the user to paste the key in chat.