openapi.json 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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_chat": {
  29. "post": {
  30. "responses": {},
  31. "operationId": "postSession_chat",
  32. "parameters": [],
  33. "requestBody": {
  34. "content": {
  35. "application/json": {
  36. "schema": {
  37. "type": "object",
  38. "properties": {
  39. "sessionID": {
  40. "type": "string"
  41. },
  42. "parts": {}
  43. },
  44. "required": [
  45. "sessionID"
  46. ]
  47. }
  48. }
  49. }
  50. }
  51. }
  52. }
  53. },
  54. "components": {
  55. "schemas": {
  56. "Session.Info": {
  57. "type": "object",
  58. "properties": {
  59. "id": {
  60. "type": "string",
  61. "pattern": "^ses"
  62. },
  63. "title": {
  64. "type": "string"
  65. },
  66. "tokens": {
  67. "type": "object",
  68. "properties": {
  69. "input": {
  70. "type": "number"
  71. },
  72. "output": {
  73. "type": "number"
  74. },
  75. "reasoning": {
  76. "type": "number"
  77. }
  78. },
  79. "required": [
  80. "input",
  81. "output",
  82. "reasoning"
  83. ]
  84. }
  85. },
  86. "required": [
  87. "id",
  88. "title",
  89. "tokens"
  90. ]
  91. }
  92. }
  93. }
  94. }