Spaces:
Runtime error
Runtime error
Akash Yadav commited on
Commit ·
fb8468e
1
Parent(s): e61cceb
Add complete API reference docs
Browse files- docs/api-reference.json +442 -0
docs/api-reference.json
ADDED
|
@@ -0,0 +1,442 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_info": {
|
| 3 |
+
"base_url": "https://akash1313-selfapi-v2.hf.space",
|
| 4 |
+
"auth": "Authorization: Bearer YOUR_API_KEY",
|
| 5 |
+
"note": "All endpoints require API_KEY as Bearer token. Replace BASE with base_url in curl examples."
|
| 6 |
+
},
|
| 7 |
+
|
| 8 |
+
"chatgpt": {
|
| 9 |
+
"health": {
|
| 10 |
+
"method": "GET",
|
| 11 |
+
"url": "/gpt/health",
|
| 12 |
+
"response": { "ok": true, "mode": "chatgpt-api-bridge", "extensionConnected": true, "extension": {} }
|
| 13 |
+
},
|
| 14 |
+
"cookies_status": {
|
| 15 |
+
"method": "GET",
|
| 16 |
+
"url": "/gpt/api/cookies/status",
|
| 17 |
+
"response": { "ok": true, "has_cookies": true, "last_sync": "2026-06-16T05:00:00Z", "cookie_header_len": 1234, "extension_connected": true }
|
| 18 |
+
},
|
| 19 |
+
"chat": {
|
| 20 |
+
"method": "GET or POST",
|
| 21 |
+
"url": "/gpt/api/chat",
|
| 22 |
+
"type": "json",
|
| 23 |
+
"body": {
|
| 24 |
+
"prompt": "hello (required)",
|
| 25 |
+
"wait_for_response": true,
|
| 26 |
+
"conversation_id": "xxx or 'new' to start fresh (optional)",
|
| 27 |
+
"model": "gpt-5 (optional, uses default)",
|
| 28 |
+
"thinking_effort": "low|medium|high (optional)"
|
| 29 |
+
},
|
| 30 |
+
"note": "GET also works with query params: ?prompt=hello&model=gpt-5&conversation_id=new",
|
| 31 |
+
"response": {
|
| 32 |
+
"ok": true,
|
| 33 |
+
"response": "Hi! How can I help?",
|
| 34 |
+
"conversation_id": "xxx-xxx",
|
| 35 |
+
"images": ["output/prompt_name.png"]
|
| 36 |
+
}
|
| 37 |
+
},
|
| 38 |
+
"chat_with_image_edit": {
|
| 39 |
+
"method": "POST",
|
| 40 |
+
"url": "/gpt/api/chat/edit",
|
| 41 |
+
"type": "multipart/form-data",
|
| 42 |
+
"body": {
|
| 43 |
+
"prompt": "edit this image, make it cartoon style (required)",
|
| 44 |
+
"image": "<file upload> (optional)",
|
| 45 |
+
"conversation_id": "xxx or 'new' (optional)",
|
| 46 |
+
"model": "gpt-5 (optional)"
|
| 47 |
+
},
|
| 48 |
+
"note": "Upload image + prompt for ChatGPT image editing (DALL-E). Image is uploaded to ChatGPT then sent with prompt.",
|
| 49 |
+
"response": {
|
| 50 |
+
"ok": true,
|
| 51 |
+
"response": "Here's your edited image...",
|
| 52 |
+
"conversation_id": "xxx-xxx",
|
| 53 |
+
"images": ["output/cartoon_style_fileID.png"]
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"bulk_chat": {
|
| 57 |
+
"method": "POST",
|
| 58 |
+
"url": "/gpt/api/chat/bulk",
|
| 59 |
+
"type": "json",
|
| 60 |
+
"body": {
|
| 61 |
+
"prompts": ["question 1", "question 2", "question 3"],
|
| 62 |
+
"delay_seconds": 2
|
| 63 |
+
},
|
| 64 |
+
"response": {
|
| 65 |
+
"ok": true,
|
| 66 |
+
"count": 3,
|
| 67 |
+
"results": [
|
| 68 |
+
{ "prompt": "question 1", "response": "answer 1" },
|
| 69 |
+
{ "prompt": "question 2", "response": "answer 2" }
|
| 70 |
+
]
|
| 71 |
+
}
|
| 72 |
+
},
|
| 73 |
+
"openai_compatible": {
|
| 74 |
+
"method": "POST",
|
| 75 |
+
"url": "/gpt/v1/chat/completions",
|
| 76 |
+
"type": "json",
|
| 77 |
+
"body": {
|
| 78 |
+
"model": "gpt-5",
|
| 79 |
+
"messages": [
|
| 80 |
+
{ "role": "system", "content": "You are helpful" },
|
| 81 |
+
{ "role": "user", "content": "hello" }
|
| 82 |
+
],
|
| 83 |
+
"stream": false
|
| 84 |
+
},
|
| 85 |
+
"note": "Drop-in replacement for OpenAI API. Use as base_url in OpenAI SDKs.",
|
| 86 |
+
"response": {
|
| 87 |
+
"id": "chatcmpl-xxx",
|
| 88 |
+
"object": "chat.completion",
|
| 89 |
+
"created": 1781588072,
|
| 90 |
+
"model": "gpt-5",
|
| 91 |
+
"choices": [{ "index": 0, "message": { "role": "assistant", "content": "Hello!" }, "finish_reason": "stop" }]
|
| 92 |
+
}
|
| 93 |
+
},
|
| 94 |
+
"download_image": {
|
| 95 |
+
"method": "GET",
|
| 96 |
+
"url": "/gpt/api/download?file_id=FILE_ID&prompt=optional_prompt",
|
| 97 |
+
"note": "Download ChatGPT generated images by file_id. Auto-saved to output/ folder.",
|
| 98 |
+
"response": "binary image/png"
|
| 99 |
+
},
|
| 100 |
+
"get_conversation": {
|
| 101 |
+
"method": "GET",
|
| 102 |
+
"url": "/gpt/api/conversation?conversation_id=CONV_ID",
|
| 103 |
+
"note": "Fetch full conversation data from ChatGPT backend",
|
| 104 |
+
"response": "raw ChatGPT conversation JSON"
|
| 105 |
+
},
|
| 106 |
+
"sniffs": {
|
| 107 |
+
"method": "GET or DELETE",
|
| 108 |
+
"url": "/gpt/api/sniffs",
|
| 109 |
+
"note": "GET: list sniffed requests. DELETE: clear sniffs.",
|
| 110 |
+
"response": { "ok": true, "count": 5, "sniffs": [] }
|
| 111 |
+
},
|
| 112 |
+
"reload_extension": {
|
| 113 |
+
"method": "GET",
|
| 114 |
+
"url": "/gpt/api/ext/reload",
|
| 115 |
+
"note": "Force reload Chrome extension files from disk",
|
| 116 |
+
"response": { "ok": true, "message": "reload request sent" }
|
| 117 |
+
}
|
| 118 |
+
},
|
| 119 |
+
|
| 120 |
+
"gemini": {
|
| 121 |
+
"status": {
|
| 122 |
+
"method": "GET",
|
| 123 |
+
"url": "/gemini/status",
|
| 124 |
+
"query": "?user_id=optional",
|
| 125 |
+
"response_active": { "session_id": "127.0.0.1", "initialized": true, "conversation_id": "c_xxx", "expired": false },
|
| 126 |
+
"response_inactive": { "session_id": "127.0.0.1", "active": false }
|
| 127 |
+
},
|
| 128 |
+
"chat_text_form": {
|
| 129 |
+
"method": "POST",
|
| 130 |
+
"url": "/gemini/chat",
|
| 131 |
+
"type": "application/x-www-form-urlencoded",
|
| 132 |
+
"body": {
|
| 133 |
+
"prompt": "hello (required)",
|
| 134 |
+
"new_chat": "true|false (optional, default false)",
|
| 135 |
+
"user_id": "session_id (optional, defaults to IP)",
|
| 136 |
+
"stream": "true|false (optional, default false)"
|
| 137 |
+
},
|
| 138 |
+
"response": {
|
| 139 |
+
"text": "Hey there! How's it going?",
|
| 140 |
+
"conversation_id": "c_xxx",
|
| 141 |
+
"response_id": "r_xxx",
|
| 142 |
+
"choice_id": "rc_xxx",
|
| 143 |
+
"images": null,
|
| 144 |
+
"videos": null,
|
| 145 |
+
"elapsed": 4.5
|
| 146 |
+
}
|
| 147 |
+
},
|
| 148 |
+
"chat_text_json": {
|
| 149 |
+
"method": "POST",
|
| 150 |
+
"url": "/gemini/chat",
|
| 151 |
+
"type": "application/json",
|
| 152 |
+
"body": {
|
| 153 |
+
"prompt": "hello",
|
| 154 |
+
"new_chat": true,
|
| 155 |
+
"user_id": "optional",
|
| 156 |
+
"stream": false
|
| 157 |
+
},
|
| 158 |
+
"note": "Same endpoint, accepts JSON too"
|
| 159 |
+
},
|
| 160 |
+
"chat_with_images": {
|
| 161 |
+
"method": "POST",
|
| 162 |
+
"url": "/gemini/chat",
|
| 163 |
+
"type": "multipart/form-data",
|
| 164 |
+
"body": {
|
| 165 |
+
"prompt": "describe this image",
|
| 166 |
+
"new_chat": "true",
|
| 167 |
+
"image": "<file1>",
|
| 168 |
+
"images": "<file2>, <file3>"
|
| 169 |
+
},
|
| 170 |
+
"note": "Max 10 images. Field name 'image' or 'images' both work. Supports image understanding + generation.",
|
| 171 |
+
"response": {
|
| 172 |
+
"text": "This image shows...",
|
| 173 |
+
"conversation_id": "c_xxx",
|
| 174 |
+
"response_id": "r_xxx",
|
| 175 |
+
"images": ["http://host/output/img_r_xxx_0.png"],
|
| 176 |
+
"videos": ["http://host/output/vid_r_xxx_0.mp4"],
|
| 177 |
+
"elapsed": 5.2
|
| 178 |
+
}
|
| 179 |
+
},
|
| 180 |
+
"chat_stream": {
|
| 181 |
+
"method": "POST",
|
| 182 |
+
"url": "/gemini/chat",
|
| 183 |
+
"type": "form or json",
|
| 184 |
+
"body": { "prompt": "write a long poem", "stream": true },
|
| 185 |
+
"note": "SSE stream. Each chunk: data: {\"text\":\"chunk\"}. Final: full response JSON then data: [DONE]. Text-only mode.",
|
| 186 |
+
"response_stream": [
|
| 187 |
+
"data: {\"text\":\"Once upon\"}",
|
| 188 |
+
"data: {\"text\":\" a time\"}",
|
| 189 |
+
"data: {full response JSON with images/videos}",
|
| 190 |
+
"data: [DONE]"
|
| 191 |
+
]
|
| 192 |
+
},
|
| 193 |
+
"openai_compatible": {
|
| 194 |
+
"method": "POST",
|
| 195 |
+
"url": "/gemini/v1/chat/completions",
|
| 196 |
+
"type": "json",
|
| 197 |
+
"body": {
|
| 198 |
+
"model": "gemini-2.5-flash (optional, any name works)",
|
| 199 |
+
"messages": [{ "role": "user", "content": "hello" }],
|
| 200 |
+
"stream": false
|
| 201 |
+
},
|
| 202 |
+
"note": "OpenAI-compatible drop-in. Supports streaming (SSE) too. Use as base_url in any OpenAI SDK.",
|
| 203 |
+
"response": {
|
| 204 |
+
"id": "chatcmpl-xxx",
|
| 205 |
+
"object": "chat.completion",
|
| 206 |
+
"created": 1781588072,
|
| 207 |
+
"model": "gemini-2.5-flash",
|
| 208 |
+
"choices": [{ "index": 0, "message": { "role": "assistant", "content": "Hello!" }, "finish_reason": "stop" }]
|
| 209 |
+
},
|
| 210 |
+
"response_stream": [
|
| 211 |
+
"data: {\"id\":\"chatcmpl-xxx\",\"object\":\"chat.completion.chunk\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Hello\"}}]}",
|
| 212 |
+
"data: {\"id\":\"chatcmpl-xxx\",\"choices\":[{\"index\":0,\"finish_reason\":\"stop\"}]}",
|
| 213 |
+
"data: [DONE]"
|
| 214 |
+
]
|
| 215 |
+
},
|
| 216 |
+
"music": {
|
| 217 |
+
"method": "POST",
|
| 218 |
+
"url": "/gemini/music",
|
| 219 |
+
"type": "json",
|
| 220 |
+
"body": {
|
| 221 |
+
"prompt": "lofi chill hip hop beats (required)",
|
| 222 |
+
"user_id": "optional",
|
| 223 |
+
"new_chat": false
|
| 224 |
+
},
|
| 225 |
+
"note": "Generates music via Gemini. Downloads tracks locally. Returns local URLs.",
|
| 226 |
+
"response": {
|
| 227 |
+
"text": "Here's your music...",
|
| 228 |
+
"music": [{ "title": "Lofi Chill", "download_url": "original_url", "local_path": "http://host/output/music_xxx_0.mp3", "duration": "3:45" }],
|
| 229 |
+
"conversation_id": "c_xxx"
|
| 230 |
+
}
|
| 231 |
+
},
|
| 232 |
+
"reset": {
|
| 233 |
+
"method": "POST",
|
| 234 |
+
"url": "/gemini/reset",
|
| 235 |
+
"type": "json",
|
| 236 |
+
"body": { "user_id": "optional" },
|
| 237 |
+
"response": { "status": "success", "message": "Session reset" }
|
| 238 |
+
},
|
| 239 |
+
"get_output": {
|
| 240 |
+
"method": "GET",
|
| 241 |
+
"url": "/gemini/output/{filename}",
|
| 242 |
+
"note": "Download generated images/videos/music from output folder",
|
| 243 |
+
"response": "binary file"
|
| 244 |
+
}
|
| 245 |
+
},
|
| 246 |
+
|
| 247 |
+
"flow": {
|
| 248 |
+
"health": {
|
| 249 |
+
"method": "GET",
|
| 250 |
+
"url": "/flow/health",
|
| 251 |
+
"response": { "status": "healthy", "extension_connected": true, "has_flow_key": true }
|
| 252 |
+
},
|
| 253 |
+
"generate_video_t2v": {
|
| 254 |
+
"method": "POST",
|
| 255 |
+
"url": "/flow/generate/video",
|
| 256 |
+
"type": "json",
|
| 257 |
+
"body": {
|
| 258 |
+
"prompt": "a cat surfing a wave, cinematic (required)",
|
| 259 |
+
"aspect": "portrait|landscape (default: portrait)",
|
| 260 |
+
"duration": "4|6|8|10 (default: 10)",
|
| 261 |
+
"count": "1-4 (default: 1)",
|
| 262 |
+
"project_id": "optional"
|
| 263 |
+
},
|
| 264 |
+
"note": "Text-to-Video. Polls until complete, downloads automatically.",
|
| 265 |
+
"response": {
|
| 266 |
+
"success": true,
|
| 267 |
+
"outputs": [{ "media_id": "xxx", "filename": "omni_xxx_1.mp4", "download_url": "/download/omni_xxx_1.mp4" }]
|
| 268 |
+
}
|
| 269 |
+
},
|
| 270 |
+
"generate_video_i2v": {
|
| 271 |
+
"method": "POST",
|
| 272 |
+
"url": "/flow/generate/video",
|
| 273 |
+
"type": "json",
|
| 274 |
+
"body": {
|
| 275 |
+
"prompt": "animate this photo",
|
| 276 |
+
"start": "image file path OR media_id OR base64 data",
|
| 277 |
+
"aspect": "portrait",
|
| 278 |
+
"duration": 8
|
| 279 |
+
},
|
| 280 |
+
"note": "Image-to-Video. Pass start image as file path, media_id, or base64."
|
| 281 |
+
},
|
| 282 |
+
"generate_video_fl": {
|
| 283 |
+
"method": "POST",
|
| 284 |
+
"url": "/flow/generate/video",
|
| 285 |
+
"type": "json",
|
| 286 |
+
"body": {
|
| 287 |
+
"prompt": "smooth transition",
|
| 288 |
+
"start": "start frame image (path/media_id/base64)",
|
| 289 |
+
"end": "end frame image (path/media_id/base64)",
|
| 290 |
+
"duration": 8
|
| 291 |
+
},
|
| 292 |
+
"note": "First-Last frame mode. Generates video between two keyframes."
|
| 293 |
+
},
|
| 294 |
+
"generate_video_r2v": {
|
| 295 |
+
"method": "POST",
|
| 296 |
+
"url": "/flow/generate/video",
|
| 297 |
+
"type": "json",
|
| 298 |
+
"body": {
|
| 299 |
+
"prompt": "make a video in this style",
|
| 300 |
+
"ref": ["reference_image_1 (path/media_id/base64)", "reference_image_2"],
|
| 301 |
+
"duration": 8
|
| 302 |
+
},
|
| 303 |
+
"note": "Reference-to-Video. Uses reference images for style/content guidance."
|
| 304 |
+
},
|
| 305 |
+
"generate_video_v2v": {
|
| 306 |
+
"method": "POST",
|
| 307 |
+
"url": "/flow/generate/video",
|
| 308 |
+
"type": "json",
|
| 309 |
+
"body": {
|
| 310 |
+
"prompt": "restyle as anime",
|
| 311 |
+
"edit": "existing_video_media_id",
|
| 312 |
+
"duration": 10
|
| 313 |
+
},
|
| 314 |
+
"note": "Video-to-Video editing. Restyle/edit existing video."
|
| 315 |
+
},
|
| 316 |
+
"edit_video": {
|
| 317 |
+
"method": "POST",
|
| 318 |
+
"url": "/flow/edit/video",
|
| 319 |
+
"type": "json",
|
| 320 |
+
"body": {
|
| 321 |
+
"prompt": "make it look like watercolor painting",
|
| 322 |
+
"video_media_id": "xxx (required)",
|
| 323 |
+
"aspect": "portrait",
|
| 324 |
+
"fps": 24,
|
| 325 |
+
"duration": 10,
|
| 326 |
+
"start_frame": 0,
|
| 327 |
+
"end_frame": null,
|
| 328 |
+
"download": false
|
| 329 |
+
},
|
| 330 |
+
"note": "Advanced V2V edit with frame control. Set download=true for direct binary response.",
|
| 331 |
+
"response": {
|
| 332 |
+
"success": true,
|
| 333 |
+
"outputs": [{ "media_id": "xxx", "filename": "edit_xxx_1.mp4", "download_url": "/download/edit_xxx_1.mp4" }]
|
| 334 |
+
}
|
| 335 |
+
},
|
| 336 |
+
"generate_image_t2i": {
|
| 337 |
+
"method": "POST",
|
| 338 |
+
"url": "/flow/generate/image",
|
| 339 |
+
"type": "json",
|
| 340 |
+
"body": {
|
| 341 |
+
"prompt": "neon city at night (required)",
|
| 342 |
+
"aspect": "portrait|landscape|square|4x3|3x4 (default: portrait)",
|
| 343 |
+
"count": "1-4 (default: 1)",
|
| 344 |
+
"project_id": "optional"
|
| 345 |
+
},
|
| 346 |
+
"note": "Text-to-Image generation.",
|
| 347 |
+
"response": {
|
| 348 |
+
"success": true,
|
| 349 |
+
"outputs": [{ "media_id": "xxx", "filename": "img_xxx_1.png", "download_url": "/download/img_xxx_1.png", "remote_url": "https://...", "downloaded": true }]
|
| 350 |
+
}
|
| 351 |
+
},
|
| 352 |
+
"generate_image_i2i": {
|
| 353 |
+
"method": "POST",
|
| 354 |
+
"url": "/flow/generate/image",
|
| 355 |
+
"type": "json",
|
| 356 |
+
"body": {
|
| 357 |
+
"prompt": "make it look vintage",
|
| 358 |
+
"ref": ["reference_image (path/media_id/base64)"],
|
| 359 |
+
"aspect": "square",
|
| 360 |
+
"count": 1
|
| 361 |
+
},
|
| 362 |
+
"note": "Image-to-Image. Uses reference images for style transfer."
|
| 363 |
+
},
|
| 364 |
+
"upload_image": {
|
| 365 |
+
"method": "POST",
|
| 366 |
+
"url": "/flow/upload/image",
|
| 367 |
+
"type": "multipart/form-data",
|
| 368 |
+
"body": {
|
| 369 |
+
"file": "<file upload> (OR)",
|
| 370 |
+
"path": "/local/path/to/image.jpg (OR)",
|
| 371 |
+
"project_id": "optional"
|
| 372 |
+
},
|
| 373 |
+
"note": "Upload image to Google Flow. Returns media_id for use in generation.",
|
| 374 |
+
"response": { "success": true, "media_id": "xxx" }
|
| 375 |
+
},
|
| 376 |
+
"upload_video": {
|
| 377 |
+
"method": "POST",
|
| 378 |
+
"url": "/flow/upload/video",
|
| 379 |
+
"type": "multipart/form-data",
|
| 380 |
+
"body": {
|
| 381 |
+
"file": "<file upload> (OR)",
|
| 382 |
+
"path": "/local/path/to/video.mp4 (OR)",
|
| 383 |
+
"project_id": "optional"
|
| 384 |
+
},
|
| 385 |
+
"note": "Upload video to Google Flow. Returns media_id for use in V2V editing.",
|
| 386 |
+
"response": { "success": true, "media_id": "xxx", "data": {} }
|
| 387 |
+
},
|
| 388 |
+
"download": {
|
| 389 |
+
"method": "GET",
|
| 390 |
+
"url": "/flow/download/{filename}",
|
| 391 |
+
"note": "Download any generated file from output folder. Supports mp4, png, jpg.",
|
| 392 |
+
"response": "binary file with correct content-type"
|
| 393 |
+
}
|
| 394 |
+
},
|
| 395 |
+
|
| 396 |
+
"curl_examples": {
|
| 397 |
+
"_note": "Replace BASE with https://akash1313-selfapi-v2.hf.space and KEY with your API key",
|
| 398 |
+
|
| 399 |
+
"gpt_health": "curl -H 'Authorization: Bearer KEY' BASE/gpt/health",
|
| 400 |
+
"gpt_chat": "curl -X POST BASE/gpt/api/chat -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"prompt\":\"hello\",\"wait_for_response\":true}'",
|
| 401 |
+
"gpt_chat_with_model": "curl -X POST BASE/gpt/api/chat -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"prompt\":\"hello\",\"model\":\"gpt-5\",\"thinking_effort\":\"high\"}'",
|
| 402 |
+
"gpt_chat_new_convo": "curl -X POST BASE/gpt/api/chat -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"prompt\":\"hello\",\"conversation_id\":\"new\"}'",
|
| 403 |
+
"gpt_image_edit": "curl -X POST BASE/gpt/api/chat/edit -H 'Authorization: Bearer KEY' -F 'prompt=make this cartoon style' -F 'image=@photo.jpg'",
|
| 404 |
+
"gpt_bulk": "curl -X POST BASE/gpt/api/chat/bulk -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"prompts\":[\"q1\",\"q2\"],\"delay_seconds\":2}'",
|
| 405 |
+
"gpt_openai": "curl -X POST BASE/gpt/v1/chat/completions -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"model\":\"gpt-5\",\"messages\":[{\"role\":\"user\",\"content\":\"hello\"}]}'",
|
| 406 |
+
"gpt_download": "curl -H 'Authorization: Bearer KEY' 'BASE/gpt/api/download?file_id=FILE_ID'",
|
| 407 |
+
|
| 408 |
+
"gemini_status": "curl -H 'Authorization: Bearer KEY' BASE/gemini/status",
|
| 409 |
+
"gemini_chat_form": "curl -X POST BASE/gemini/chat -H 'Authorization: Bearer KEY' -d 'prompt=hello&new_chat=true'",
|
| 410 |
+
"gemini_chat_json": "curl -X POST BASE/gemini/chat -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"prompt\":\"hello\",\"new_chat\":true}'",
|
| 411 |
+
"gemini_chat_continue": "curl -X POST BASE/gemini/chat -H 'Authorization: Bearer KEY' -d 'prompt=tell me more&new_chat=false'",
|
| 412 |
+
"gemini_with_image": "curl -X POST BASE/gemini/chat -H 'Authorization: Bearer KEY' -F 'prompt=describe this' -F 'new_chat=true' -F 'image=@photo.jpg'",
|
| 413 |
+
"gemini_multi_images": "curl -X POST BASE/gemini/chat -H 'Authorization: Bearer KEY' -F 'prompt=compare these' -F 'images=@img1.jpg' -F 'images=@img2.jpg'",
|
| 414 |
+
"gemini_stream": "curl -X POST BASE/gemini/chat -H 'Authorization: Bearer KEY' -d 'prompt=write a poem&stream=true'",
|
| 415 |
+
"gemini_openai": "curl -X POST BASE/gemini/v1/chat/completions -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"model\":\"gemini-2.5-flash\",\"messages\":[{\"role\":\"user\",\"content\":\"hello\"}]}'",
|
| 416 |
+
"gemini_openai_stream": "curl -X POST BASE/gemini/v1/chat/completions -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"model\":\"gemini\",\"messages\":[{\"role\":\"user\",\"content\":\"hello\"}],\"stream\":true}'",
|
| 417 |
+
"gemini_music": "curl -X POST BASE/gemini/music -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"prompt\":\"lofi beats\"}'",
|
| 418 |
+
"gemini_reset": "curl -X POST BASE/gemini/reset -H 'Authorization: Bearer KEY'",
|
| 419 |
+
"gemini_get_file": "curl -H 'Authorization: Bearer KEY' BASE/gemini/output/img_xxx_0.png -o image.png",
|
| 420 |
+
|
| 421 |
+
"flow_health": "curl -H 'Authorization: Bearer KEY' BASE/flow/health",
|
| 422 |
+
"flow_video_t2v": "curl -X POST BASE/flow/generate/video -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"prompt\":\"sunset timelapse\",\"aspect\":\"landscape\",\"duration\":8}'",
|
| 423 |
+
"flow_video_i2v": "curl -X POST BASE/flow/generate/video -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"prompt\":\"animate this\",\"start\":\"/path/to/image.jpg\",\"duration\":8}'",
|
| 424 |
+
"flow_video_fl": "curl -X POST BASE/flow/generate/video -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"prompt\":\"morph between\",\"start\":\"/path/start.jpg\",\"end\":\"/path/end.jpg\",\"duration\":8}'",
|
| 425 |
+
"flow_video_r2v": "curl -X POST BASE/flow/generate/video -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"prompt\":\"in this style\",\"ref\":[\"/path/ref.jpg\"],\"duration\":8}'",
|
| 426 |
+
"flow_video_v2v": "curl -X POST BASE/flow/generate/video -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"prompt\":\"restyle anime\",\"edit\":\"video_media_id\",\"duration\":10}'",
|
| 427 |
+
"flow_edit_video": "curl -X POST BASE/flow/edit/video -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"prompt\":\"watercolor\",\"video_media_id\":\"xxx\",\"fps\":24,\"duration\":10}'",
|
| 428 |
+
"flow_image_t2i": "curl -X POST BASE/flow/generate/image -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"prompt\":\"neon city\",\"aspect\":\"square\",\"count\":2}'",
|
| 429 |
+
"flow_image_i2i": "curl -X POST BASE/flow/generate/image -H 'Authorization: Bearer KEY' -H 'Content-Type: application/json' -d '{\"prompt\":\"vintage style\",\"ref\":[\"/path/ref.jpg\"]}'",
|
| 430 |
+
"flow_upload_image": "curl -X POST BASE/flow/upload/image -H 'Authorization: Bearer KEY' -F 'file=@image.jpg'",
|
| 431 |
+
"flow_upload_video": "curl -X POST BASE/flow/upload/video -H 'Authorization: Bearer KEY' -F 'file=@video.mp4'",
|
| 432 |
+
"flow_download": "curl -H 'Authorization: Bearer KEY' BASE/flow/download/omni_xxx_1.mp4 -o video.mp4"
|
| 433 |
+
},
|
| 434 |
+
|
| 435 |
+
"error_codes": {
|
| 436 |
+
"401": "Missing or wrong API_KEY",
|
| 437 |
+
"400": "Bad request (missing prompt, invalid form, etc.)",
|
| 438 |
+
"502": "Backend server not reachable (still booting or crashed)",
|
| 439 |
+
"503": "API_KEY not set on server OR extension not connected",
|
| 440 |
+
"504": "Request timed out (session auto-reset)"
|
| 441 |
+
}
|
| 442 |
+
}
|