POST
/
auth
/
proxy
/
update
/
{proxy_key}
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"]
  }'
{
  "message": "Proxy key updated"
}
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"]
  }'
{
  "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

proxy_key
string
required
The proxy key ID to update (starts with ek-proxy-)

Request Body

name
string
required
Updated human-readable name for the proxy key (max 25 characters)
expires_at
integer
required
New expiration timestamp in seconds since Unix epoch. Use -1 for no expiration
allocated_ammount
number
required
New credit amount to allocate to this proxy key (must be positive)
model_whitelist
array
Updated list of model IDs this key can access. Leave empty to allow all models
ip_whitelist
array
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

Error Codes

400
error
Bad Request - Invalid input data or validation failed
401
error
Unauthorized - Invalid or missing API key
403
error
Forbidden - You don’t have permission to update this proxy key
404
error
Not Found - Proxy key doesn’t exist
429
error
Rate Limited - Too many requests, please slow down

Authorizations

Authorization
string
header
required

Enter your API key (starts with 'ek-')

Path Parameters

proxy_key
string
required

Proxy key ID

Body

application/json

Response

200 - application/json

Proxy key updated successfully

The response is of type object.