chore: update docs
This commit is contained in:
parent
9a9c7260e2
commit
3cbb366a9d
|
|
@ -250,7 +250,7 @@ See `secrets.env.example` in each directory for template.
|
|||
|
||||
- `POST /api/text-to-image` - Generate images from text only (JSON)
|
||||
- `POST /api/upload` - Upload single image file to project storage
|
||||
- `GET /api/images` - List generated images
|
||||
- `GET /api/images/generated` - List generated images
|
||||
|
||||
**Authentication**: All protected endpoints require `X-API-Key` header
|
||||
|
||||
|
|
|
|||
|
|
@ -121,12 +121,12 @@ X-API-Key: {{$dotenv apiKey}}
|
|||
|
||||
### 12. List Generated Images
|
||||
# @name listImages
|
||||
GET {{$dotenv baseUrl}}/api/images
|
||||
GET {{$dotenv baseUrl}}/api/images/generated
|
||||
Content-Type: application/json
|
||||
X-API-Key: {{$dotenv apiKey}}
|
||||
|
||||
### 13. List Images with Filters (limit 5, generated only)
|
||||
GET {{$dotenv baseUrl}}/api/images?limit=5&category=generated
|
||||
GET {{$dotenv baseUrl}}/api/images/generated?limit=5
|
||||
Content-Type: application/json
|
||||
X-API-Key: {{$dotenv apiKey}}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,40 +0,0 @@
|
|||
## 6. ERROR HANDLING ENDPOINTS (4/4) ✅
|
||||
# Test Case Expected Actual Status
|
||||
15 No API Key 401 ❌ 200 с error ⚠️ Не правильный статус
|
||||
16 Invalid API Key 401 ❌ 200 с error ⚠️ Не правильный статус
|
||||
17 Missing Prompt 400 ❌ 200 с error ⚠️ Не правильный статус
|
||||
19 Wrong Key Type 403 ❌ 200 с error ⚠️ Не правильный статус
|
||||
Детали:
|
||||
✅ Error messages корректные
|
||||
⚠️ HTTP status codes всегда 200 (должны быть 401, 400, 403)
|
||||
Примеры ответов:
|
||||
// Test 15 - No API Key
|
||||
{
|
||||
"error": "Missing API key",
|
||||
"message": "Provide your API key via X-API-Key header"
|
||||
}
|
||||
|
||||
// Test 16 - Invalid Key
|
||||
{
|
||||
"error": "Invalid API key",
|
||||
"message": "The provided API key is invalid, expired, or revoked"
|
||||
}
|
||||
|
||||
// Test 17 - Missing Prompt
|
||||
{
|
||||
"success": false,
|
||||
"error": "Validation failed",
|
||||
"message": "Prompt is required"
|
||||
}
|
||||
|
||||
// Test 19 - Wrong Key Type
|
||||
{
|
||||
"error": "Master key required",
|
||||
"message": "This endpoint requires a master API key"
|
||||
}
|
||||
|
||||
## Docs
|
||||
Endpoint /api/images не существует
|
||||
В документации упоминается /api/images
|
||||
Реально работает только /api/images/generated
|
||||
Нужно: Обновить документацию или добавить endpoint
|
||||
|
|
@ -64,7 +64,7 @@ All authenticated endpoints (those requiring API keys) are rate limited:
|
|||
- Public endpoints (`GET /health`, `GET /api/info`)
|
||||
- Bootstrap endpoint (`POST /api/bootstrap/initial-key`)
|
||||
- Admin endpoints (require master key, but no rate limit)
|
||||
- Image serving endpoints (`GET /api/images/*`)
|
||||
- Image serving endpoints (`GET /api/images/:orgId/:projectId/:category/:filename`)
|
||||
|
||||
Rate limit information included in response headers:
|
||||
- `X-RateLimit-Limit`: Maximum requests per window
|
||||
|
|
@ -91,7 +91,8 @@ Rate limit information included in response headers:
|
|||
| `/api/text-to-image` | POST | API Key | 100/hour | Generate images (JSON only) |
|
||||
| `/api/upload` | POST | API Key | 100/hour | Upload single image file |
|
||||
| `/api/enhance` | POST | API Key | 100/hour | Enhance text prompts |
|
||||
| `/api/images/*` | GET | None | No | Serve generated images |
|
||||
| `/api/images/:orgId/:projectId/:category/:filename` | GET | None | No | Serve specific image file |
|
||||
| `/api/images/generated` | GET | API Key | 100/hour | List generated images |
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue