Skip to content

Commit 7efcffc

Browse files
feat: more improvements to api keys api refs
1 parent 5bd55b7 commit 7efcffc

6 files changed

Lines changed: 23 additions & 23 deletions

File tree

docs/api-references/service-endpoints/key-get.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"prefix": {
3939
"type": "string",
4040
"description": "Key prefix.",
41-
"example": "325b9499"
41+
"example": "b747e891"
4242
},
4343
"scopes": {
4444
"type": "array",
@@ -48,11 +48,11 @@
4848
"type": "string",
4949
"enum": [
5050
"model:chat",
51+
"model:responses",
5152
"model:image",
5253
"model:audio",
5354
"model:video",
5455
"model:embeddings",
55-
"model:responses",
5656
"model:speech",
5757
"model:ocr"
5858
]

docs/api-references/service-endpoints/keys-delete.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
"name": "prefix",
1919
"in": "path",
2020
"required": true,
21-
"description": "Key prefix to delete. Passed in the URL path. This is the first 8 characters of the API key you want to delete. Only these 8 characters are visible in the dashboard (the rest are masked with asterisks). You can also obtain this value via the POST method (see the `prefix` field in its response).",
21+
"description": "Prefix of the API key to delete. Passed in the URL path. This is the first 8 characters of the API key you want to delete. Only these 8 characters are visible in the dashboard (the rest are masked with asterisks). You can also obtain this value via the POST method (see the `prefix` field in its response).",
2222
"schema": {
2323
"type": "string",
24-
"example": "19e32b2c"
24+
"example": "b747e891"
2525
}
2626
}
2727
],
@@ -38,8 +38,8 @@
3838
"properties": {
3939
"prefix": {
4040
"type": "string",
41-
"description": "Deleted key prefix.",
42-
"example": "19e32b2c"
41+
"description": "Prefix of the deleted API key.",
42+
"example": "b747e891"
4343
},
4444
"deleted": {
4545
"type": "boolean",
@@ -65,15 +65,15 @@
6565
"x-codeSamples": [
6666
{
6767
"lang": "cURL",
68-
"source": "curl -L \\\n --request DELETE \\\n --url 'https://api.aimlapi.com/v1/keys/19e32b2c' \\\n --header 'Authorization: Bearer <YOUR_MANAGEMENT_KEY>'"
68+
"source": "curl -L \\\n --request DELETE \\\n --url 'https://api.aimlapi.com/v1/keys/b747e891' \\\n --header 'Authorization: Bearer <YOUR_MANAGEMENT_KEY>'"
6969
},
7070
{
7171
"lang": "JavaScript",
72-
"source": "async function main() {\n const response = await fetch(\"https://api.aimlapi.com/v1/keys/19e32b2c\", {\n method: \"DELETE\",\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();"
72+
"source": "async function main() {\n const response = await fetch(\"https://api.aimlapi.com/v1/keys/b747e891\", {\n method: \"DELETE\",\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();"
7373
},
7474
{
7575
"lang": "Python",
76-
"source": "import requests\nimport json\n\n\ndef main():\n url = \"https://api.aimlapi.com/v1/keys/19e32b2c\"\n headers = {\n \"Authorization\": \"Bearer <YOUR_MANAGEMENT_KEY>\"\n }\n\n response = requests.delete(url, headers=headers)\n data = response.json()\n print(json.dumps(data, indent=2, ensure_ascii=False))\n\n\nif __name__ == \"__main__\":\n main()"
76+
"source": "import requests\nimport json\n\n\ndef main():\n url = \"https://api.aimlapi.com/v1/keys/b747e891\"\n headers = {\n \"Authorization\": \"Bearer <YOUR_MANAGEMENT_KEY>\"\n }\n\n response = requests.delete(url, headers=headers)\n data = response.json()\n print(json.dumps(data, indent=2, ensure_ascii=False))\n\n\nif __name__ == \"__main__\":\n main()"
7777
}
7878
]
7979
}

docs/api-references/service-endpoints/keys-get.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"prefix": {
4141
"type": "string",
4242
"description": "Key prefix.",
43-
"example": "0fed75b7"
43+
"example": "b747e891"
4444
},
4545
"scopes": {
4646
"type": "array",
@@ -50,11 +50,11 @@
5050
"type": "string",
5151
"enum": [
5252
"model:chat",
53+
"model:responses",
5354
"model:image",
5455
"model:audio",
5556
"model:video",
5657
"model:embeddings",
57-
"model:responses",
5858
"model:speech",
5959
"model:ocr"
6060
]

docs/api-references/service-endpoints/keys-patch.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"description": "Prefix of the API key to update. Passed in the URL path.",
2222
"schema": {
2323
"type": "string",
24-
"example": "0fed75b7"
24+
"example": "b747e891"
2525
}
2626
}
2727
],
@@ -67,7 +67,7 @@
6767
"prefix": {
6868
"type": "string",
6969
"description": "Key prefix.",
70-
"example": "0fed75b7"
70+
"example": "b747e891"
7171
},
7272
"scopes": {
7373
"type": "array",
@@ -77,11 +77,11 @@
7777
"type": "string",
7878
"enum": [
7979
"model:chat",
80+
"model:responses",
8081
"model:image",
8182
"model:audio",
8283
"model:video",
8384
"model:embeddings",
84-
"model:responses",
8585
"model:speech",
8686
"model:ocr"
8787
]
@@ -142,15 +142,15 @@
142142
"x-codeSamples": [
143143
{
144144
"lang": "cURL",
145-
"source": "curl -L \\\n --request PATCH \\\n --url 'https://api.aimlapi.com/v1/keys/0fed75b7' \\\n --header 'Authorization: Bearer <YOUR_MANAGEMENT_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"disabled\": false\n }'"
145+
"source": "curl -L \\\n --request PATCH \\\n --url 'https://api.aimlapi.com/v1/keys/b747e891' \\\n --header 'Authorization: Bearer <YOUR_MANAGEMENT_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"disabled\": false\n }'"
146146
},
147147
{
148148
"lang": "JavaScript",
149-
"source": "async function main() {\n const response = await fetch(\"https://api.aimlapi.com/v1/keys/0fed75b7\", {\n method: \"PATCH\",\n headers: {\n \"Authorization\": \"Bearer <YOUR_MANAGEMENT_KEY>\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n disabled: false\n })\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
149+
"source": "async function main() {\n const response = await fetch(\"https://api.aimlapi.com/v1/keys/b747e891\", {\n method: \"PATCH\",\n headers: {\n \"Authorization\": \"Bearer <YOUR_MANAGEMENT_KEY>\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n disabled: false\n })\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
150150
},
151151
{
152152
"lang": "Python",
153-
"source": "import requests\nimport json\n\n\ndef main():\n prefix = \"0fed75b7\"\n url = f\"https://api.aimlapi.com/v1/keys/{prefix}\"\n headers = {\n \"Authorization\": \"Bearer <YOUR_MANAGEMENT_KEY>\",\n \"Content-Type\": \"application/json\"\n }\n\n payload = {\n \"disabled\": False\n }\n\n response = requests.patch(url, headers=headers, json=payload)\n data = response.json()\n print(json.dumps(data, indent=2, ensure_ascii=False))\n\n\nif __name__ == \"__main__\":\n main()"
153+
"source": "import requests\nimport json\n\n\ndef main():\n prefix = \"b747e891\"\n url = f\"https://api.aimlapi.com/v1/keys/{prefix}\"\n headers = {\n \"Authorization\": \"Bearer <YOUR_MANAGEMENT_KEY>\",\n \"Content-Type\": \"application/json\"\n }\n\n payload = {\n \"disabled\": False\n }\n\n response = requests.patch(url, headers=headers, json=payload)\n data = response.json()\n print(json.dumps(data, indent=2, ensure_ascii=False))\n\n\nif __name__ == \"__main__\":\n main()"
154154
}
155155
]
156156
}

docs/api-references/service-endpoints/keys-post.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@
9999
"type": "string",
100100
"enum": [
101101
"model:chat",
102+
"model:responses",
102103
"model:image",
103104
"model:audio",
104105
"model:video",
105106
"model:embeddings",
106-
"model:responses",
107107
"model:speech",
108108
"model:ocr"
109109
]

docs/api-references/service-endpoints/keys-put.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@
5050
"type": "string",
5151
"enum": [
5252
"model:chat",
53+
"model:responses",
5354
"model:image",
5455
"model:audio",
5556
"model:video",
5657
"model:embeddings",
57-
"model:responses",
5858
"model:speech",
5959
"model:ocr"
6060
]
@@ -102,7 +102,7 @@
102102
},
103103
"prefix": {
104104
"type": "string",
105-
"example": "98ca6267"
105+
"example": "b747e891"
106106
},
107107
"scopes": {
108108
"type": "array",
@@ -165,15 +165,15 @@
165165
"x-codeSamples": [
166166
{
167167
"lang": "cURL",
168-
"source": "curl -L \\\n --request PUT \\\n --url 'https://api.aimlapi.com/v1/keys/98ca6267' \\\n --header 'Authorization: Bearer <YOUR_MANAGEMENT_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"name\": \"next key api new 2\",\n \"disabled\": false,\n \"limit\": {\n \"retention\": \"week\",\n \"threshold\": 30\n }\n }'"
168+
"source": "curl -L \\\n --request PUT \\\n --url 'https://api.aimlapi.com/v1/keys/b747e891' \\\n --header 'Authorization: Bearer <YOUR_MANAGEMENT_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"name\": \"next key api new 2\",\n \"disabled\": false,\n \"limit\": {\n \"retention\": \"week\",\n \"threshold\": 30\n }\n }'"
169169
},
170170
{
171171
"lang": "JavaScript",
172-
"source": "async function main() {\n const response = await fetch(\"https://api.aimlapi.com/v1/keys/98ca6267\", {\n method: \"PUT\",\n headers: {\n \"Authorization\": \"Bearer <YOUR_MANAGEMENT_KEY>\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n name: \"next key api new 2\",\n disabled: false,\n limit: { retention: \"week\", threshold: 30 }\n })\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
172+
"source": "async function main() {\n const response = await fetch(\"https://api.aimlapi.com/v1/keys/b747e891\", {\n method: \"PUT\",\n headers: {\n \"Authorization\": \"Bearer <YOUR_MANAGEMENT_KEY>\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n name: \"next key api new 2\",\n disabled: false,\n limit: { retention: \"week\", threshold: 30 }\n })\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
173173
},
174174
{
175175
"lang": "Python",
176-
"source": "import requests\nimport json\n\n\ndef main():\n prefix = \"98ca6267\"\n url = f\"https://api.aimlapi.com/v1/keys/{prefix}\"\n\n headers = {\n \"Authorization\": \"Bearer <YOUR_MANAGEMENT_KEY>\",\n \"Content-Type\": \"application/json\"\n }\n\n payload = {\n \"name\": \"next key api new 2\",\n \"disabled\": False,\n \"limit\": {\n \"retention\": \"week\",\n \"threshold\": 30\n }\n }\n\n response = requests.put(url, headers=headers, json=payload)\n data = response.json()\n print(json.dumps(data, indent=2, ensure_ascii=False))\n\n\nif __name__ == \"__main__\":\n main()"
176+
"source": "import requests\nimport json\n\n\ndef main():\n prefix = \"b747e891\"\n url = f\"https://api.aimlapi.com/v1/keys/{prefix}\"\n\n headers = {\n \"Authorization\": \"Bearer <YOUR_MANAGEMENT_KEY>\",\n \"Content-Type\": \"application/json\"\n }\n\n payload = {\n \"name\": \"next key api new 2\",\n \"disabled\": False,\n \"limit\": {\n \"retention\": \"week\",\n \"threshold\": 30\n }\n }\n\n response = requests.put(url, headers=headers, json=payload)\n data = response.json()\n print(json.dumps(data, indent=2, ensure_ascii=False))\n\n\nif __name__ == \"__main__\":\n main()"
177177
}
178178
]
179179
}

0 commit comments

Comments
 (0)