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
Add API Keybutton. - Fill in the
Name,Description, and select theExpirationof the API key. - In the Model Access section, select either All models or Allowed models, and if choosing Allowed models, select which models this API key can access from the list.
- 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.
Edit Model Access
- Hover over the user avatar and navigate to the
API Keyspage. - Find the API key you want to edit.
- Click the
Editbutton in theOperationscolumn. - In the Model Access section, select either All models or Allowed models, and if choosing Allowed models, select which models this API key can access from the list.
- Click the
Savebutton.
Note
Changes will take effect within one minute.
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/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $GPUSTACK_API_KEY" \
-d '{
"model": "qwen3",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
],
"stream": true
}'