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

68 lines
1.3 KiB
Plaintext
Raw Normal View History

2025-03-26 16:44:26 +01:00
meta {
name: Credits (username)
type: http
seq: 1
}
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",
"userName": "nzambello"
}
}
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
}
```
}