114 lines
3.4 KiB
YAML
114 lines
3.4 KiB
YAML
openapi: 3.0.0
|
|
info:
|
|
title: Billing API
|
|
description: This API describes the endpoints to register the use of external APIs.
|
|
contact: {}
|
|
version: '1.0'
|
|
servers:
|
|
- url: http://localhost:6001/api/v1/billing
|
|
variables: {}
|
|
paths:
|
|
/usage:
|
|
post:
|
|
tags:
|
|
- APIUsage
|
|
summary: Set usage
|
|
operationId: setUsage
|
|
parameters: []
|
|
requestBody:
|
|
description: ''
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
companyId:
|
|
type: string
|
|
example: "1"
|
|
callerId:
|
|
type: string
|
|
example: "17988310949"
|
|
quantityOfOperationAttempts:
|
|
type: string
|
|
example: "2"
|
|
chosenOperation:
|
|
type: string
|
|
example: "unblokUser"
|
|
requestLogsOpenAI:
|
|
type: string
|
|
example: "{}"
|
|
responseErrorLogsOpenAI:
|
|
type: string
|
|
example: "{}"
|
|
quantityOfCallsToFalconFlowAPI:
|
|
type: string
|
|
example: "2"
|
|
requestLogsFalconFlowAPI:
|
|
type: string
|
|
example: "{}"
|
|
responseErrorLogsFalconFlowAPI:
|
|
type: string
|
|
example: "{}"
|
|
provider:
|
|
type: string
|
|
example: "openai"
|
|
product:
|
|
type: string
|
|
example: "whisper"
|
|
usage:
|
|
type: string
|
|
description: "Time in seconds"
|
|
example: "15"
|
|
required:
|
|
- companyId
|
|
- callerId
|
|
- quantityOfOperationAttempts
|
|
- chosenOperation
|
|
- requestLogsOpenAI
|
|
- responseErrorLogsOpenAI
|
|
- quantityOfCallsToFalconFlowAPI
|
|
- requestLogsFalconFlowAPI
|
|
- responseErrorLogsFalconFlowAPI
|
|
- provider
|
|
- product
|
|
- usage
|
|
required: true
|
|
responses:
|
|
'200':
|
|
description: 'Successful response'
|
|
content:
|
|
application/json:
|
|
example:
|
|
apiUsage:
|
|
companyId: "1"
|
|
callerId: "17988310949"
|
|
quantityOfOperationAttempts: "2"
|
|
chosenOperation: "unblokUser"
|
|
requestLogsOpenAI: "{}"
|
|
responseErrorLogsOpenAI: "{}"
|
|
quantityOfCallsToFalconFlowAPI: "2"
|
|
requestLogsFalconFlowAPI: "{}"
|
|
responseErrorLogsFalconFlowAPI: "{}"
|
|
provider: "openai"
|
|
product: "whisper"
|
|
usage: 15
|
|
price: "0.006"
|
|
billingBy: "minute"
|
|
billingUnit: 1
|
|
total_cost: "0.0015000000"
|
|
_id: "66a8df390cbb7371c4ade653"
|
|
createdAt: "2024-07-30T12:40:25.782Z"
|
|
updatedAt: "2024-07-30T12:40:25.782Z"
|
|
__v: 0
|
|
deprecated: false
|
|
security:
|
|
- bearer: []
|
|
components:
|
|
securitySchemes:
|
|
bearer:
|
|
type: http
|
|
scheme: bearer
|
|
security: []
|
|
tags:
|
|
- name: APIUsage
|