|
18 | 18 | "name": "prefix", |
19 | 19 | "in": "path", |
20 | 20 | "required": true, |
21 | | - "description": "Prefix of the API key to update. Passed in the URL path. This is the first 8 characters of the API key. 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 update. Passed in the URL path. This is the first 8 characters of your API key, visible in the dashboard. You can also obtain this value via the GET method (see the `prefix` field in its response).", |
22 | 22 | "schema": { |
23 | 23 | "type": "string", |
24 | 24 | "example": "b747e891" |
|
110 | 110 | }, |
111 | 111 | "prefix": { |
112 | 112 | "type": "string", |
113 | | - "description": "Key prefix. Passed in the URL path. This is the first 8 characters of your API key, visible in the dashboard. You can also obtain this value via the POST method (see the `prefix` field in its response).", |
| 113 | + "description": "Key prefix. This is the first 8 characters of your API key, visible in the dashboard. You can also obtain this value via the GET method (see the `prefix` field in its response).", |
114 | 114 | "example": "b747e891" |
115 | 115 | }, |
116 | 116 | "scopes": { |
|
191 | 191 | "x-codeSamples": [ |
192 | 192 | { |
193 | 193 | "lang": "cURL", |
194 | | - "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 }'" |
| 194 | + "source": "curl -L \\\n --request PATCH \\\n --url 'https://api.aimlapi.com/v1/keys/<API_KEY_PREFIX>' \\\n --header 'Authorization: Bearer <YOUR_MANAGEMENT_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"disabled\": false\n }'" |
195 | 195 | }, |
196 | 196 | { |
197 | 197 | "lang": "JavaScript", |
198 | | - "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();" |
| 198 | + "source": "async function main() {\n const response = await fetch(\"https://api.aimlapi.com/v1/keys/<API_KEY_PREFIX>\", {\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();" |
199 | 199 | }, |
200 | 200 | { |
201 | 201 | "lang": "Python", |
202 | | - "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()" |
| 202 | + "source": "import requests\nimport json\n\n\ndef main():\n url = f\"https://api.aimlapi.com/v1/keys/<API_KEY_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()" |
203 | 203 | } |
204 | 204 | ] |
205 | 205 | } |
|
0 commit comments