From 330a3dd0f2f865cdd932e4e1377545f839094393 Mon Sep 17 00:00:00 2001 From: sangarshanan Date: Tue, 12 Sep 2023 16:45:28 +0530 Subject: [PATCH 1/2] Add usage endpoint to API docs --- docs/api-spec.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/api-spec.md b/docs/api-spec.md index 00814c8..ec6aba9 100644 --- a/docs/api-spec.md +++ b/docs/api-spec.md @@ -17,6 +17,7 @@ Beatoven.ai API uses an API token based authentication. With each request, you n - [Checking composition status](https://github.com/Beatoven/public-api/blob/main/docs/api-spec.md#checking-composition-status) - [Fetching a track](https://github.com/Beatoven/public-api/blob/main/docs/api-spec.md#get-composed-track) - [Fetching supported options](https://github.com/Beatoven/public-api/blob/main/docs/api-spec.md#supported-options) +- [API Usage](api-usage) ## Creating a new track @@ -373,3 +374,25 @@ You can use this API, to get the supported values for track parameters like genr Fields like `genre`, `mood` and `tempo` might be self-explainatory. `blockedParameters`: While most of the options in genre, mood and tempo can be combined to create a track. Some combinations might lead to errors due to limitations in our composition system. The list in the value of `blockedParameters` is a list of those combinations. + + +## API Usage + +Get usage info of your API token + + +**Endpoint** + +`GET /api/v1/usage` + +**Payload Example** + +```json +{ + "email": "test@email.com", + "usage": { + "calls_made": 10, + "remaining_calls": 1729, + }, +} +``` From 5f28017b46f3899ccc8968ae19b8d9b80aae1f1c Mon Sep 17 00:00:00 2001 From: sangarshanan Date: Tue, 12 Sep 2023 16:47:48 +0530 Subject: [PATCH 2/2] Link index --- docs/api-spec.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/api-spec.md b/docs/api-spec.md index ec6aba9..1772b1f 100644 --- a/docs/api-spec.md +++ b/docs/api-spec.md @@ -17,7 +17,8 @@ Beatoven.ai API uses an API token based authentication. With each request, you n - [Checking composition status](https://github.com/Beatoven/public-api/blob/main/docs/api-spec.md#checking-composition-status) - [Fetching a track](https://github.com/Beatoven/public-api/blob/main/docs/api-spec.md#get-composed-track) - [Fetching supported options](https://github.com/Beatoven/public-api/blob/main/docs/api-spec.md#supported-options) -- [API Usage](api-usage) +- [API Usage](https://github.com/Beatoven/public-api/blob/main/docs/api-spec.md#api-usage) + ## Creating a new track