Skip to content

Commit dbefb80

Browse files
committed
docs: update OpenAPI specification to include username parameter and remove API Key Management section
1 parent af758d3 commit dbefb80

File tree

1 file changed

+32
-160
lines changed

1 file changed

+32
-160
lines changed

public/openapi.json

Lines changed: 32 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
{
1515
"name": "Open API",
1616
"description": "Developer APIs authenticated by API Key"
17-
},
18-
{
19-
"name": "API Key Management",
20-
"description": "Dashboard APIs (JWT required) for API key lifecycle"
2117
}
2218
],
2319
"paths": {
@@ -110,7 +106,7 @@
110106
"Open API"
111107
],
112108
"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.",
114110
"security": [
115111
{
116112
"ApiKeyHeader": []
@@ -127,6 +123,7 @@
127123
"plain": {
128124
"value": {
129125
"message": "Hello",
126+
"username": "alice",
130127
"session_id": "my_session_001",
131128
"enable_streaming": true
132129
}
@@ -143,6 +140,7 @@
143140
"attachment_id": "9a2f8c72-e7af-4c0e-b352-111111111111"
144141
}
145142
],
143+
"username": "alice",
146144
"session_id": "my_session_001",
147145
"selected_provider": "openai_chat_completion",
148146
"selected_model": "gpt-4.1-mini",
@@ -152,10 +150,18 @@
152150
"withConfig": {
153151
"value": {
154152
"message": "Use a specific config for this session",
153+
"username": "alice",
155154
"session_id": "my_session_001",
156155
"config_id": "default",
157156
"enable_streaming": true
158157
}
158+
},
159+
"autoSessionWithUsername": {
160+
"value": {
161+
"message": "hello",
162+
"username": "alice",
163+
"enable_streaming": true
164+
}
159165
}
160166
}
161167
}
@@ -187,7 +193,7 @@
187193
"Open API"
188194
],
189195
"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.",
191197
"security": [
192198
{
193199
"ApiKeyHeader": []
@@ -220,6 +226,15 @@
220226
"type": "string"
221227
},
222228
"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."
223238
}
224239
],
225240
"responses": {
@@ -307,153 +322,6 @@
307322
}
308323
}
309324
},
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-
},
457325
"/api/open/v1/configs": {
458326
"get": {
459327
"tags": [
@@ -494,11 +362,6 @@
494362
"in": "header",
495363
"name": "X-API-Key",
496364
"description": "Open API key. Authorization: Bearer <api_key> is also accepted."
497-
},
498-
"DashboardBearer": {
499-
"type": "http",
500-
"scheme": "bearer",
501-
"bearerFormat": "JWT"
502365
}
503366
},
504367
"responses": {
@@ -694,7 +557,7 @@
694557
"type": "object",
695558
"required": [
696559
"message",
697-
"session_id"
560+
"username"
698561
],
699562
"properties": {
700563
"message": {
@@ -711,7 +574,16 @@
711574
]
712575
},
713576
"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."
715587
},
716588
"selected_provider": {
717589
"type": "string"

0 commit comments

Comments
 (0)