leafspark/typingmind
1
1openapi: 3.0.32info:3 title: TypingMind API Documentation4 version: 1.1.05 description: "6 <h5 class='mt-8 mb-2'><b>API Hosts:</b></h5>7 <ol class='list-decimal mt-2'>8 <li>For US instances: <code>https://api.typingmind.com</code></li>9 <li>For EU instances: <code>https://api.eu.typingmind.com</code></li>10 </ol>11 <h5 class='mt-8 mb-2'><b>How to use the API:</b></h5>12 <ol class='list-decimal mt-2'>13 <li>Generate an API key by accessing the custom instance admin page (go to Integrations > API Integration).</li>14 <li>When making a request, include the API key in the request headers as <code>X-API-KEY</code>.</li>15 </ol>16 "17 18servers:19 - url: https://api.typingmind.com/api/v120 21tags:22 - name: Users23 - name: Characters24 - name: Chat25 - name: Chatlogs26 27paths:28 /users:29 post:30 operationId: addUser31 tags:32 - Users33 summary: Add a user to your chat instance34 requestBody:35 content:36 application/json:37 schema:38 type: object39 properties:40 email:41 type: string42 example: email@example.com43 tags:44 type: array45 items:46 type: string47 example: ['tag1', 'tag2']48 required: true49 responses:50 '200':51 description: OK52 content:53 application/json:54 schema:55 $ref: '#/components/schemas/User'56 '401':57 description: Unauthorized (API Key is missing or invalid)58 59 '500':60 description: Internal Server Error61 62 security:63 - ApiKeyAuth: []64 65 get:66 operationId: getUsers67 tags:68 - Users69 summary: Get all users in your chat instance70 parameters:71 - in: query72 name: email73 schema:74 type: string75 description: Email of the user76 example: email%40example.com77 78 responses:79 '200':80 description: OK81 content:82 application/json:83 schema:84 type: object85 properties:86 data:87 type: array88 items:89 oneOf:90 - $ref: '#/components/schemas/User'91 '401':92 description: Unauthorized (API Key is missing or invalid)93 94 '500':95 description: Internal Server Error96 97 security:98 - ApiKeyAuth: []99 100 /ai-characters:101 get:102 operationId: getCharacters103 tags:104 - Characters105 summary: Get all AI characters in your chat instance106 107 responses:108 '200':109 description: OK110 content:111 application/json:112 schema:113 type: object114 properties:115 data:116 type: array117 items:118 oneOf:119 - $ref: '#/components/schemas/Character'120 '401':121 description: Unauthorized (API Key is missing or invalid)122 123 '500':124 description: Internal Server Error125 126 security:127 - ApiKeyAuth: []128 129 130 /users/{id}:131 delete:132 operationId: deleteUser133 tags:134 - Users135 summary: Remove a user from your chat instance136 parameters:137 - in: path138 name: id139 schema:140 type: integer141 required: true142 description: ID of the user143 example: 123456144 responses:145 '200':146 description: Successful147 148 '401':149 description: Unauthorized (API Key is missing or invalid)150 151 '404':152 description: User Not Found153 154 '500':155 description: Internal Server Error156 157 security:158 - ApiKeyAuth: []159 160 patch:161 operationId: updateUser162 tags:163 - Users164 summary: Update a user165 parameters:166 - in: path167 name: id168 schema:169 type: integer170 required: true171 description: ID of the user172 example: 123456173 requestBody:174 content:175 application/json:176 schema:177 type: object178 properties:179 tags:180 type: array181 items:182 type: string183 example: ['tag1', 'tag2']184 required: true185 responses:186 '200':187 description: Successful188 189 '401':190 description: Unauthorized (API Key is missing or invalid)191 192 '404':193 description: User Not Found194 195 '500':196 description: Internal Server Error197 198 security:199 - ApiKeyAuth: []200 201 /chat/completions:202 post:203 operationId: createChatCompletions204 tags:205 - Chat206 summary: Create a model response for the given chat conversation207 208 requestBody:209 description: '<br>Find more information about the request body here:<br>210 <a href="https://platform.openai.com/docs/api-reference/chat/create" target="_blank">OpenAI API Reference</a><br>211 <a href="https://docs.anthropic.com/claude/reference/complete_post" target="_blank">Anthropic API Reference</a><br><br>'212 213 content:214 application/json:215 schema:216 type: object217 properties:218 model:219 type: string220 enum:221 [222 'gpt-3.5-turbo',223 'gpt-3.5-turbo-16k',224 'gpt-4',225 'gpt-4-32k',226 'claude-2',227 'claude-1',228 'claude-instant-1',229 'claude-instant-1.2',230 'gpt-3.5-turbo-0301',231 'gpt-4-0314',232 'gpt-4-32k-0314',233 ]234 stream:235 type: boolean236 messages:237 type: array238 items:239 type: object240 description: Use for GPT models241 prompt:242 type: string243 description: Use for Claude models244 activatedCharacterID:245 type: string246 description: AI character for this completion247 required:248 - model249 - messages250 - prompt251 example:252 model: 'gpt-3.5-turbo'253 stream: true254 messages:255 [256 {257 'role': 'system',258 'content': 'You are a helpful AI assistant.',259 },260 { 'role': 'user', 'content': 'hi' },261 ]262 263 required: true264 265 responses:266 '200':267 description: OK268 269 '401':270 description: Unauthorized (API Key is missing or invalid)271 272 '500':273 description: Internal Server Error274 275 security:276 - ApiKeyAuth: []277 /chatlogs:278 get:279 operationId: getChatlogs280 tags:281 - Chatlogs282 summary: Get chat logs in your chat instance283 parameters:284 - in: query285 name: startUnixTime286 schema:287 type: number288 description: Unix time of the start time289 example: 1640995200290 - in: query291 name: endUnixTime292 schema:293 type: number294 description: Unix time of the end time295 example: 1640995200296 297 responses:298 '200':299 description: OK300 content:301 application/json:302 schema:303 type: object304 properties:305 data:306 type: array307 items:308 oneOf:309 - $ref: '#/components/schemas/Chatlog'310 '401':311 description: Unauthorized (API Key is missing or invalid)312 313 '500':314 description: Internal Server Error315 316 security:317 - ApiKeyAuth: []318 319 320components:321 securitySchemes:322 ApiKeyAuth:323 type: apiKey324 in: header325 name: X-API-KEY326 327 schemas:328 User:329 type: object330 properties:331 id:332 type: string333 example: 123456334 email:335 type: string336 example: email@example.com337 createdAt:338 type: string339 tags:340 type: array341 items:342 type: string343 example: ['tag1', 'tag2']344 Character:345 type: object346 properties:347 id:348 type: string349 title:350 type: string351 description:352 type: string353 instruction:354 type: string355 defaultModel:356 type: string357 createdAt:358 type: string359 Chatlog:360 type: object361 properties:362 chatID:363 type: string364 example: 'U9H8EEJpLL'365 chatTitle:366 type: string367 example: 'Chat with an AI assistant'368 createdAt:369 type: string370 example: '2024-08-14T04:18:53.000Z'371 recordedAt:372 type: string373 example: '2024-08-14T04:18:53.000Z'374 conversationText:375 type: string376 example: 'User: Hello\n\nAssistant: Hi there!'377 