curl https://api.electronhub.ai/v1/auth/proxy/update/ek-proxy-1234567890abcdef \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ELECTRONHUB_API_KEY " \
-d '{
"name": "Updated Production Key",
"expires_at": 1767225600,
"allocated_ammount": 150.0,
"model_whitelist": ["gpt-4o", "claude-3-5-sonnet-20241022", "dall-e-3"],
"ip_whitelist": ["192.168.1.0/24"]
}'
Success Response
Error Response
{
"message" : "Proxy key updated"
}
Overview
Update the configuration of an existing proxy key. You can modify all settings including name, expiration, credit allocation, and access restrictions. This is useful for adjusting permissions as project requirements change.
Path Parameters
The proxy key ID to update (starts with ek-proxy-)
Request Body
Updated human-readable name for the proxy key (max 25 characters)
New expiration timestamp in seconds since Unix epoch. Use -1 for no expiration
New credit amount to allocate to this proxy key (must be positive)
Updated list of model IDs this key can access. Leave empty to allow all models
Updated list of IP addresses or CIDR blocks allowed to use this key. Leave empty to allow all IPs
Important Notes
Credit Changes : When increasing allocated_ammount, the difference is deducted from your account. When decreasing, unused credits are returned.
Active Requests : Changes take effect immediately. Any ongoing requests with the proxy key will continue with the old settings.
Usage Preservation : The used_ammount is preserved when updating. Only the allocation limit changes.
Common Update Scenarios
{
"name" : "Production Key" ,
"expires_at" : 1767225600 , // New date
"allocated_ammount" : 100.0 ,
"model_whitelist" : [ "gpt-4o" ],
"ip_whitelist" : [ "192.168.1.0/24" ]
}
{
"name" : "Production Key" ,
"expires_at" : 1735689600 ,
"allocated_ammount" : 200.0 , // Increased from 100.0
"model_whitelist" : [ "gpt-4o" ],
"ip_whitelist" : [ "192.168.1.0/24" ]
}
{
"name" : "Production Key" ,
"expires_at" : 1735689600 ,
"allocated_ammount" : 100.0 ,
"model_whitelist" : [ "gpt-4o" , "claude-3-5-sonnet-20241022" ], // Added restrictions
"ip_whitelist" : [ "192.168.1.0/24" ]
}
{
"name" : "Production Key" ,
"expires_at" : 1735689600 ,
"allocated_ammount" : 100.0 ,
"model_whitelist" : [ "gpt-4o" ],
"ip_whitelist" : [ "10.0.0.0/8" , "203.0.113.0/24" ] // New IP ranges
}
Error Codes
Bad Request - Invalid input data or validation failed
Unauthorized - Invalid or missing API key
Forbidden - You don’t have permission to update this proxy key
Not Found - Proxy key doesn’t exist
Rate Limited - Too many requests, please slow down
Enter your API key (starts with 'ek-')
Maximum string length: 25
Expiration timestamp in seconds (-1 for no expiration)
List of allowed models (empty for all models)
Example: [ "gpt-4o" , "claude-3-5-sonnet-20241022" ] List of allowed IP addresses or CIDR blocks (empty for all IPs)
Example: [ "192.168.1.0/24" , "203.0.113.42" ] Proxy key updated successfully