uvicorn main:app --reload
- Generate JWT token
python test_jwt.py
- Authenticate
curl -X POST "http://127.0.0.1:8000/" -H "Content-Type: application/x-www-form-urlencoded" -d "token=YOUR_JWT_TOKEN"
- Get Metadata
curl -X GET "http://127.0.0.1:8000/metadata" -H "Authorization: Bearer mysecureapikey"
- Get Quotas
curl -X GET "http://127.0.0.1:8000/quota" -H "Authorization: Bearer mysecureapikey"
- Update Quotas
curl -X PUT "http://127.0.0.1:8000/quota" -H "Authorization: Bearer mysecureapikey" -H "Content-Type: application/json" -d '
[
{
"limit": 100,
"scope": "total"
},
{
"limit": 100,
"scope": "user"
},
{
"limit": 500,
"scope": "user",
"feature": "gpt-3"
}
]'
- Get Course Quota
curl -X GET "http://127.0.0.1:8000/quota/course/course-123" -H "Authorization: Bearer mysecureapikey"
- Update Course Quota
curl -X PUT "http://127.0.0.1:8000/quota/course/course-123" -H "Authorization: Bearer mysecureapikey" -H "Content-Type: application/json" -d '
[
{
"limit": 100,
"scope": "course"
},
{
"limit": 10,
"scope": "course-user"
}
]'
- Get Quota for All Course Members
curl -X GET "http://127.0.0.1:8000/quota/course/course-123/user" -H "Authorization: Bearer mysecureapikey"
- Get Quota for a Specific Course Member
curl -X GET "http://127.0.0.1:8000/quota/course/course-123/user/user-456" -H "Authorization: Bearer mysecureapikey"