bruno/memori-dashboard/Billing - Credits/Credits (userID).bru

68 lines
1.3 KiB
Plaintext

meta {
name: Credits (userID)
type: http
seq: 2
}
post {
url: {{host}}/api/credits
body: json
auth: inherit
}
headers {
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0
}
body:json {
{
"tenant": "www.aisuru.com",
"userID": "262103a9-527b-4a82-b399-9b18bf3c42d8"
}
}
docs {
Verify credits and operations a user has enough tokens for.
Example:
```sh
http -v POST http://localhost:3000/api/credits userName=nicola tenant=aisuru-staging-tokenized.aclambda.online
http -v POST http://localhost:3000/api/credits userID=585ec0ff-e805-495e-b8fc-5b0b8dd288ff tenant=aisuru-staging-tokenized.aclambda.online
```
Returns:
```json
{
"outcome": {
"twin_creation": {
"cost": 1,
"permitted": true
},
"session_creation": {
"cost": 1,
"permitted": true
},
"dt_session_creation": {
"cost": 1,
"permitted": true
},
"gpt_messages": {
"cost": 1,
"permitted": true
},
"dt_gpt_messages": {
"cost": 3,
"permitted": false
},
"import_document": {
"cost": 6,
"permitted": false
}
},
"tokens": 1
}
```
}