Skip to content

Commit 40744e9

Browse files
feat: add key-get.json
1 parent 7e5a533 commit 40744e9

1 file changed

Lines changed: 120 additions & 0 deletions

File tree

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"title": "AIML API",
5+
"version": "1.0.0"
6+
},
7+
"servers": [
8+
{
9+
"url": "https://api.aimlapi.com"
10+
}
11+
],
12+
"paths": {
13+
"/key": {
14+
"get": {
15+
"operationId": "KeysController_getLatestKey_v1",
16+
"responses": {
17+
"200": {
18+
"description": "Retrieve parameters of the latest API key.",
19+
"content": {
20+
"application/json": {
21+
"schema": {
22+
"type": "object",
23+
"properties": {
24+
"data": {
25+
"type": "object",
26+
"properties": {
27+
"name": {
28+
"type": "string",
29+
"nullable": true,
30+
"description": "API key name.",
31+
"example": "test"
32+
},
33+
"disabled": {
34+
"type": "boolean",
35+
"description": "Indicates whether the key is disabled.",
36+
"example": false
37+
},
38+
"prefix": {
39+
"type": "string",
40+
"description": "Key prefix.",
41+
"example": "325b9499"
42+
},
43+
"scopes": {
44+
"type": "array",
45+
"nullable": true,
46+
"description": "Effective scopes assigned to the key.",
47+
"items": {
48+
"type": "string"
49+
},
50+
"example": null
51+
},
52+
"limit": {
53+
"nullable": true,
54+
"type": "object",
55+
"description": "Spending limits configuration (if set).",
56+
"properties": {
57+
"retention": {
58+
"type": "string",
59+
"example": "week"
60+
},
61+
"threshold": {
62+
"type": "number",
63+
"example": 25
64+
}
65+
}
66+
},
67+
"created_at": {
68+
"type": "string",
69+
"format": "date-time",
70+
"description": "Creation timestamp (UTC).",
71+
"example": "2026-02-18T06:57:29.232Z"
72+
},
73+
"updated_at": {
74+
"type": "string",
75+
"format": "date-time",
76+
"description": "Last update timestamp (UTC).",
77+
"example": "2026-02-18T06:57:29.232Z"
78+
},
79+
"monthly_usage": {
80+
"type": "number",
81+
"description": "Current monthly usage amount.",
82+
"example": 0
83+
}
84+
},
85+
"required": [
86+
"disabled",
87+
"prefix",
88+
"created_at",
89+
"updated_at",
90+
"monthly_usage"
91+
]
92+
}
93+
},
94+
"required": [
95+
"data"
96+
]
97+
}
98+
}
99+
}
100+
}
101+
},
102+
"x-hideTryItPanel": false,
103+
"x-codeSamples": [
104+
{
105+
"lang": "cURL",
106+
"source": "curl -L \\\n --request GET \\\n --url 'https://api.aimlapi.com/v1/key' \\\n --header 'Authorization: Bearer <YOUR_MANAGEMENT_KEY>'"
107+
},
108+
{
109+
"lang": "JavaScript",
110+
"source": "async function main() {\n const response = await fetch(\"https://api.aimlapi.com/v1/key\", {\n method: \"GET\",\n headers: {\n \"Authorization\": \"Bearer <YOUR_MANAGEMENT_KEY>\"\n }\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
111+
},
112+
{
113+
"lang": "Python",
114+
"source": "import requests\nimport json\n\n\ndef main():\n url = \"https://api.aimlapi.com/v1/key\"\n headers = {\n \"Authorization\": \"Bearer <YOUR_MANAGEMENT_KEY>\"\n }\n\n response = requests.get(url, headers=headers)\n data = response.json()\n print(json.dumps(data, indent=2, ensure_ascii=False))\n\n\nif __name__ == \"__main__\":\n main()"
115+
}
116+
]
117+
}
118+
}
119+
}
120+
}

0 commit comments

Comments
 (0)