Skip to content

Commit f380d42

Browse files
committed
Add http file showcasing how to use the management API
No public client for now since it deviates from the gRPC protocol for everything else. Perhaps we'll introduce a typed API at some point?
1 parent 9a1c5a2 commit f380d42

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

src/xAI.Tests/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
http-client.env.json

src/xAI.Tests/management.http

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
### List API keys
2+
GET https://management-api.x.ai/auth/teams/{{teamId}}/api-keys
3+
Authorization: Bearer {{token}}
4+
5+
### List ACL values
6+
GET https://management-api.x.ai/auth/teams/{{teamId}}/endpoints
7+
Authorization: Bearer {{token}}
8+
9+
### List models
10+
GET https://management-api.x.ai/auth/teams/{{teamId}}/models
11+
Authorization: Bearer {{token}}
12+
13+
### Validate management key
14+
GET https://management-api.x.ai/auth/management-keys/validation
15+
Authorization: Bearer {{token}}
16+
17+
### Create API key
18+
POST https://management-api.x.ai/auth/teams/{{teamId}}/api-keys
19+
Authorization: Bearer {{token}}
20+
21+
{
22+
"name": "kzu-user",
23+
"acls": [
24+
"api-key:endpoint:*",
25+
"api-key:model:*"
26+
]
27+
}
28+
29+
### Check API Key
30+
GET https://management-api.x.ai/auth/api-keys/{{userKeyId}}/propagation
31+
Authorization: Bearer {{token}}
32+
33+
### Delete the key
34+
DELETE https://management-api.x.ai/auth/api-keys/{{userKeyId}}
35+
Authorization: Bearer {{token}}

0 commit comments

Comments
 (0)