From ca2d3dc6d2cf311e45e77d9c48f83c2d14141875 Mon Sep 17 00:00:00 2001 From: RutamBhagat Date: Sat, 21 Dec 2024 06:24:53 -0800 Subject: [PATCH] docs(credit-usage-api): add new endpoint documentation for credit usage --- apps/api/v1-openapi.json | 82 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/apps/api/v1-openapi.json b/apps/api/v1-openapi.json index 6cd2b3da..5b57e511 100644 --- a/apps/api/v1-openapi.json +++ b/apps/api/v1-openapi.json @@ -719,7 +719,89 @@ } } } + }, + "/credit-usage": { + "get": { + "summary": "Get remaining credits for the authenticated team", + "operationId": "getCreditUsage", + "tags": [ + "Billing" + ], + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + }, + "data": { + "type": "object", + "properties": { + "remaining_credits": { + "type": "number", + "description": "Number of credits remaining for the team", + "example": 1000 + } + } + } + } + } + } + } + }, + "404": { + "description": "Credit usage information not found", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": false + }, + "error": { + "type": "string", + "example": "Could not find credit usage information" + } + } + } + } + } + }, + "500": { + "description": "Server error", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": false + }, + "error": { + "type": "string", + "example": "Internal server error while fetching credit usage" + } + } + } + } + } + } + } } + } }, "components": { "securitySchemes": {