openapi.json 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. {
  2. "openapi": "3.1.0",
  3. "info": {
  4. "title": "opencode",
  5. "description": "opencode api",
  6. "version": "1.0.0"
  7. },
  8. "paths": {
  9. "/session_create": {
  10. "post": {
  11. "responses": {
  12. "200": {
  13. "description": "Successfully created session",
  14. "content": {
  15. "application/json": {
  16. "schema": {
  17. "$ref": "#/components/schemas/Session.Info"
  18. }
  19. }
  20. }
  21. }
  22. },
  23. "operationId": "postSession_create",
  24. "parameters": [],
  25. "description": "Create a new session"
  26. }
  27. },
  28. "/session_share": {
  29. "post": {
  30. "responses": {
  31. "200": {
  32. "description": "Successfully shared session",
  33. "content": {
  34. "application/json": {
  35. "schema": {
  36. "$ref": "#/components/schemas/Session.Info"
  37. }
  38. }
  39. }
  40. }
  41. },
  42. "operationId": "postSession_share",
  43. "parameters": [],
  44. "description": "Share the session",
  45. "requestBody": {
  46. "content": {
  47. "application/json": {
  48. "schema": {
  49. "type": "object",
  50. "properties": {
  51. "sessionID": {
  52. "type": "string"
  53. }
  54. },
  55. "required": [
  56. "sessionID"
  57. ]
  58. }
  59. }
  60. }
  61. }
  62. }
  63. },
  64. "/session_messages": {
  65. "post": {
  66. "responses": {
  67. "200": {
  68. "description": "Successfully created session",
  69. "content": {
  70. "application/json": {
  71. "schema": {}
  72. }
  73. }
  74. }
  75. },
  76. "operationId": "postSession_messages",
  77. "parameters": [],
  78. "description": "Get messages for a session",
  79. "requestBody": {
  80. "content": {
  81. "application/json": {
  82. "schema": {
  83. "type": "object",
  84. "properties": {
  85. "sessionID": {
  86. "type": "string"
  87. }
  88. },
  89. "required": [
  90. "sessionID"
  91. ]
  92. }
  93. }
  94. }
  95. }
  96. }
  97. },
  98. "/session_list": {
  99. "post": {
  100. "responses": {
  101. "200": {
  102. "description": "List of sessions",
  103. "content": {
  104. "application/json": {
  105. "schema": {
  106. "type": "array",
  107. "items": {
  108. "type": "object",
  109. "properties": {
  110. "id": {
  111. "type": "string",
  112. "pattern": "^ses"
  113. },
  114. "shareID": {
  115. "type": "string"
  116. },
  117. "title": {
  118. "type": "string"
  119. },
  120. "tokens": {
  121. "type": "object",
  122. "properties": {
  123. "input": {
  124. "type": "number"
  125. },
  126. "output": {
  127. "type": "number"
  128. },
  129. "reasoning": {
  130. "type": "number"
  131. }
  132. },
  133. "required": [
  134. "input",
  135. "output",
  136. "reasoning"
  137. ]
  138. }
  139. },
  140. "required": [
  141. "id",
  142. "title",
  143. "tokens"
  144. ]
  145. }
  146. }
  147. }
  148. }
  149. }
  150. },
  151. "operationId": "postSession_list",
  152. "parameters": [],
  153. "description": "List all sessions"
  154. }
  155. },
  156. "/session_chat": {
  157. "post": {
  158. "responses": {},
  159. "operationId": "postSession_chat",
  160. "parameters": [],
  161. "requestBody": {
  162. "content": {
  163. "application/json": {
  164. "schema": {
  165. "type": "object",
  166. "properties": {
  167. "sessionID": {
  168. "type": "string"
  169. },
  170. "parts": {}
  171. },
  172. "required": [
  173. "sessionID"
  174. ]
  175. }
  176. }
  177. }
  178. }
  179. }
  180. }
  181. },
  182. "components": {
  183. "schemas": {
  184. "Session.Info": {
  185. "type": "object",
  186. "properties": {
  187. "id": {
  188. "type": "string",
  189. "pattern": "^ses"
  190. },
  191. "shareID": {
  192. "type": "string"
  193. },
  194. "title": {
  195. "type": "string"
  196. },
  197. "tokens": {
  198. "type": "object",
  199. "properties": {
  200. "input": {
  201. "type": "number"
  202. },
  203. "output": {
  204. "type": "number"
  205. },
  206. "reasoning": {
  207. "type": "number"
  208. }
  209. },
  210. "required": [
  211. "input",
  212. "output",
  213. "reasoning"
  214. ]
  215. }
  216. },
  217. "required": [
  218. "id",
  219. "title",
  220. "tokens"
  221. ]
  222. }
  223. }
  224. }
  225. }