|
14 | 14 | { |
15 | 15 | "name": "Open API", |
16 | 16 | "description": "Developer APIs authenticated by API Key" |
17 | | - }, |
18 | | - { |
19 | | - "name": "API Key Management", |
20 | | - "description": "Dashboard APIs (JWT required) for API key lifecycle" |
21 | 17 | } |
22 | 18 | ], |
23 | 19 | "paths": { |
|
110 | 106 | "Open API" |
111 | 107 | ], |
112 | 108 | "summary": "Send chat message (SSE)", |
113 | | - "description": "Send message to AstrBot chat pipeline and receive streaming SSE response. Reuses /api/chat/send behavior.", |
| 109 | + "description": "Send message to AstrBot chat pipeline and receive streaming SSE response. Reuses /api/chat/send behavior. If session_id/conversation_id is omitted, server will create a new UUID session_id.", |
114 | 110 | "security": [ |
115 | 111 | { |
116 | 112 | "ApiKeyHeader": [] |
|
127 | 123 | "plain": { |
128 | 124 | "value": { |
129 | 125 | "message": "Hello", |
| 126 | + "username": "alice", |
130 | 127 | "session_id": "my_session_001", |
131 | 128 | "enable_streaming": true |
132 | 129 | } |
|
143 | 140 | "attachment_id": "9a2f8c72-e7af-4c0e-b352-111111111111" |
144 | 141 | } |
145 | 142 | ], |
| 143 | + "username": "alice", |
146 | 144 | "session_id": "my_session_001", |
147 | 145 | "selected_provider": "openai_chat_completion", |
148 | 146 | "selected_model": "gpt-4.1-mini", |
|
152 | 150 | "withConfig": { |
153 | 151 | "value": { |
154 | 152 | "message": "Use a specific config for this session", |
| 153 | + "username": "alice", |
155 | 154 | "session_id": "my_session_001", |
156 | 155 | "config_id": "default", |
157 | 156 | "enable_streaming": true |
158 | 157 | } |
| 158 | + }, |
| 159 | + "autoSessionWithUsername": { |
| 160 | + "value": { |
| 161 | + "message": "hello", |
| 162 | + "username": "alice", |
| 163 | + "enable_streaming": true |
| 164 | + } |
159 | 165 | } |
160 | 166 | } |
161 | 167 | } |
|
187 | 193 | "Open API" |
188 | 194 | ], |
189 | 195 | "summary": "List chat sessions with pagination", |
190 | | - "description": "List chat sessions created under the current API key identity.", |
| 196 | + "description": "List chat sessions for the specified username.", |
191 | 197 | "security": [ |
192 | 198 | { |
193 | 199 | "ApiKeyHeader": [] |
|
220 | 226 | "type": "string" |
221 | 227 | }, |
222 | 228 | "description": "Optional platform filter" |
| 229 | + }, |
| 230 | + { |
| 231 | + "name": "username", |
| 232 | + "in": "query", |
| 233 | + "required": true, |
| 234 | + "schema": { |
| 235 | + "type": "string" |
| 236 | + }, |
| 237 | + "description": "Target username." |
223 | 238 | } |
224 | 239 | ], |
225 | 240 | "responses": { |
|
307 | 322 | } |
308 | 323 | } |
309 | 324 | }, |
310 | | - "/api/apikey/list": { |
311 | | - "get": { |
312 | | - "tags": [ |
313 | | - "API Key Management" |
314 | | - ], |
315 | | - "summary": "List API keys", |
316 | | - "description": "Dashboard endpoint. Requires dashboard JWT token.", |
317 | | - "security": [ |
318 | | - { |
319 | | - "DashboardBearer": [] |
320 | | - } |
321 | | - ], |
322 | | - "responses": { |
323 | | - "200": { |
324 | | - "description": "OK" |
325 | | - }, |
326 | | - "401": { |
327 | | - "$ref": "#/components/responses/Unauthorized" |
328 | | - } |
329 | | - } |
330 | | - } |
331 | | - }, |
332 | | - "/api/apikey/create": { |
333 | | - "post": { |
334 | | - "tags": [ |
335 | | - "API Key Management" |
336 | | - ], |
337 | | - "summary": "Create API key", |
338 | | - "description": "Dashboard endpoint. The plaintext key is returned only once.", |
339 | | - "security": [ |
340 | | - { |
341 | | - "DashboardBearer": [] |
342 | | - } |
343 | | - ], |
344 | | - "requestBody": { |
345 | | - "required": true, |
346 | | - "content": { |
347 | | - "application/json": { |
348 | | - "schema": { |
349 | | - "type": "object", |
350 | | - "properties": { |
351 | | - "name": { |
352 | | - "type": "string" |
353 | | - }, |
354 | | - "scopes": { |
355 | | - "type": "array", |
356 | | - "items": { |
357 | | - "type": "string", |
358 | | - "enum": [ |
359 | | - "chat", |
360 | | - "file", |
361 | | - "send_message", |
362 | | - "bot" |
363 | | - ] |
364 | | - } |
365 | | - }, |
366 | | - "expires_in_days": { |
367 | | - "type": "integer", |
368 | | - "minimum": 1 |
369 | | - } |
370 | | - } |
371 | | - } |
372 | | - } |
373 | | - } |
374 | | - }, |
375 | | - "responses": { |
376 | | - "200": { |
377 | | - "description": "OK" |
378 | | - }, |
379 | | - "401": { |
380 | | - "$ref": "#/components/responses/Unauthorized" |
381 | | - } |
382 | | - } |
383 | | - } |
384 | | - }, |
385 | | - "/api/apikey/revoke": { |
386 | | - "post": { |
387 | | - "tags": [ |
388 | | - "API Key Management" |
389 | | - ], |
390 | | - "summary": "Revoke API key", |
391 | | - "security": [ |
392 | | - { |
393 | | - "DashboardBearer": [] |
394 | | - } |
395 | | - ], |
396 | | - "requestBody": { |
397 | | - "required": true, |
398 | | - "content": { |
399 | | - "application/json": { |
400 | | - "schema": { |
401 | | - "type": "object", |
402 | | - "required": [ |
403 | | - "key_id" |
404 | | - ], |
405 | | - "properties": { |
406 | | - "key_id": { |
407 | | - "type": "string" |
408 | | - } |
409 | | - } |
410 | | - } |
411 | | - } |
412 | | - } |
413 | | - }, |
414 | | - "responses": { |
415 | | - "200": { |
416 | | - "description": "OK" |
417 | | - } |
418 | | - } |
419 | | - } |
420 | | - }, |
421 | | - "/api/apikey/delete": { |
422 | | - "post": { |
423 | | - "tags": [ |
424 | | - "API Key Management" |
425 | | - ], |
426 | | - "summary": "Delete API key", |
427 | | - "security": [ |
428 | | - { |
429 | | - "DashboardBearer": [] |
430 | | - } |
431 | | - ], |
432 | | - "requestBody": { |
433 | | - "required": true, |
434 | | - "content": { |
435 | | - "application/json": { |
436 | | - "schema": { |
437 | | - "type": "object", |
438 | | - "required": [ |
439 | | - "key_id" |
440 | | - ], |
441 | | - "properties": { |
442 | | - "key_id": { |
443 | | - "type": "string" |
444 | | - } |
445 | | - } |
446 | | - } |
447 | | - } |
448 | | - } |
449 | | - }, |
450 | | - "responses": { |
451 | | - "200": { |
452 | | - "description": "OK" |
453 | | - } |
454 | | - } |
455 | | - } |
456 | | - }, |
457 | 325 | "/api/open/v1/configs": { |
458 | 326 | "get": { |
459 | 327 | "tags": [ |
|
494 | 362 | "in": "header", |
495 | 363 | "name": "X-API-Key", |
496 | 364 | "description": "Open API key. Authorization: Bearer <api_key> is also accepted." |
497 | | - }, |
498 | | - "DashboardBearer": { |
499 | | - "type": "http", |
500 | | - "scheme": "bearer", |
501 | | - "bearerFormat": "JWT" |
502 | 365 | } |
503 | 366 | }, |
504 | 367 | "responses": { |
|
694 | 557 | "type": "object", |
695 | 558 | "required": [ |
696 | 559 | "message", |
697 | | - "session_id" |
| 560 | + "username" |
698 | 561 | ], |
699 | 562 | "properties": { |
700 | 563 | "message": { |
|
711 | 574 | ] |
712 | 575 | }, |
713 | 576 | "session_id": { |
714 | | - "type": "string" |
| 577 | + "type": "string", |
| 578 | + "description": "Optional chat session ID. If omitted (and conversation_id is also omitted), server creates a UUID automatically." |
| 579 | + }, |
| 580 | + "conversation_id": { |
| 581 | + "type": "string", |
| 582 | + "description": "Alias of session_id." |
| 583 | + }, |
| 584 | + "username": { |
| 585 | + "type": "string", |
| 586 | + "description": "Target username." |
715 | 587 | }, |
716 | 588 | "selected_provider": { |
717 | 589 | "type": "string" |
|
0 commit comments