openapi.json 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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_chat": {
  99. "post": {
  100. "responses": {},
  101. "operationId": "postSession_chat",
  102. "parameters": [],
  103. "requestBody": {
  104. "content": {
  105. "application/json": {
  106. "schema": {
  107. "type": "object",
  108. "properties": {
  109. "sessionID": {
  110. "type": "string"
  111. },
  112. "parts": {}
  113. },
  114. "required": [
  115. "sessionID"
  116. ]
  117. }
  118. }
  119. }
  120. }
  121. }
  122. }
  123. },
  124. "components": {
  125. "schemas": {
  126. "Session.Info": {
  127. "type": "object",
  128. "properties": {
  129. "id": {
  130. "type": "string",
  131. "pattern": "^ses"
  132. },
  133. "shareID": {
  134. "type": "string"
  135. },
  136. "title": {
  137. "type": "string"
  138. },
  139. "tokens": {
  140. "type": "object",
  141. "properties": {
  142. "input": {
  143. "type": "number"
  144. },
  145. "output": {
  146. "type": "number"
  147. },
  148. "reasoning": {
  149. "type": "number"
  150. }
  151. },
  152. "required": [
  153. "input",
  154. "output",
  155. "reasoning"
  156. ]
  157. }
  158. },
  159. "required": [
  160. "id",
  161. "title",
  162. "tokens"
  163. ]
  164. }
  165. }
  166. }
  167. }