You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.3 KiB
1.3 KiB
API Key Management
GPUStack supports authentication using API keys. Each GPUStack user can generate and manage their own API keys.
Create API Key
- Hover over the user avatar and navigate to the
API Keyspage. - Click the
New API Keybutton. - Fill in the
Name,Description, and select theExpirationof the API key. - Click the
Savebutton. - Copy and store the key somewhere safe, then click the
Donebutton.
!!! note
Please note that you can only see the generated API key once upon creation.
Delete API Key
- Hover over the user avatar and navigate to the
API Keyspage. - Find the API key you want to delete.
- Click the
Deletebutton in theOperationscolumn. - Confirm the deletion.
Use API Key
GPUStack supports using the API key as a bearer token. The following is an example using curl:
export GPUSTACK_API_KEY=your_api_key
curl http://your_gpustack_server_url/v1-openai/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GPUSTACK_API_KEY" \
-d '{
"model": "llama3",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
],
"stream": true
}'