banatie-service/docs/api/api.rest

122 lines
3.3 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@base = http://localhost:3000
# Replace with your actual API key (e.g., bnt_abc123...)
@apiKey = bnt_d0da2d441cd2f22a0ec13897629b4438cc723f0bcb320d646a41ed05a985fdf8
# Replace with your master key for admin endpoints
@masterKey = bnt_71475a11d69344ff9db2236ff4f10cfca34512b29c7ac1a74f73c156d708e226
### Health
GET {{base}}/health
### Info
GET {{base}}/api/info
### Bootstrap - Create First Master Key (One-time only)
POST {{base}}/api/bootstrap/initial-key
### Admin - Create New API Key (Requires Master Key)
POST {{base}}/api/admin/keys
Content-Type: application/json
X-API-Key: {{masterKey}}
{
"type": "project",
"projectId": "my-project",
"name": "My Project Key",
"expiresInDays": 90
}
### Admin - List All API Keys (Requires Master Key)
GET {{base}}/api/admin/keys
X-API-Key: {{masterKey}}
### Admin - Revoke API Key (Requires Master Key)
DELETE {{base}}/api/admin/keys/KEY_ID_HERE
X-API-Key: {{masterKey}}
### Enhance Prompt (Requires API Key)
POST {{base}}/api/enhance
Content-Type: application/json
X-API-Key: {{apiKey}}
{
"prompt": "Два мага сражаются в снежном лесу. У одного из них в руках посох, из которого вырывается молния, а другой маг защищается щитом из льда. Вокруг них падают снежинки, и на заднем плане видны заснеженные деревья и горы.",
"options": {
"imageStyle": "photorealistic",
"aspectRatio": "landscape",
"mood": "serene and peaceful",
"lighting": "golden hour",
"cameraAngle": "wide shot",
"outputFormat": "detailed",
"negativePrompts": ["blurry", "low quality"]
}
}
### Generate Image from Text (Requires API Key)
POST {{base}}/api/text-to-image
Content-Type: application/json
X-API-Key: {{apiKey}}
{
"prompt": "A majestic eagle soaring over snow-capped mountains",
"filename": "test-eagle"
}
### Generate Image with Files (Requires API Key)
POST {{base}}/api/generate
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary
X-API-Key: {{apiKey}}
------WebKitFormBoundary
Content-Disposition: form-data; name="prompt"
A majestic dragon soaring through a crystal cave filled with glowing blue crystals, sunbeams piercing through cracks in the ceiling creating dramatic lighting, highly detailed fantasy art style
------WebKitFormBoundary
Content-Disposition: form-data; name="filename"
dragon-crystal-cave
------WebKitFormBoundary
Content-Disposition: form-data; name="autoEnhance"
true
------WebKitFormBoundary
Content-Disposition: form-data; name="enhancementOptions"
{"imageStyle":"illustration","aspectRatio":"landscape","mood":"mystical and dramatic","lighting":"magical glow with sunbeams","cameraAngle":"wide shot","negativePrompts":["blurry","low quality","amateur"]}
------WebKitFormBoundary
Content-Disposition: form-data; name="referenceImages"; filename="reference.jpg"
Content-Type: image/jpeg
< ./reference.jpg
------WebKitFormBoundary--
### Generate Image - Text to Image
POST http://localhost:3000/api/text-to-image
Content-Type: application/json
X-API-Key: bnt_61ba018f01474491cbaacec4509220d7154fffcd011f005eece4dba7889fba99
{
"prompt": "фотография детской кроватки в стиле piratespunk",
"filename": "generated_image",
"autoEnhance": true
}