curl https://api.electronhub.ai/v1/auth/proxy/update \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ELECTRONHUB_API_KEY" \
-d '{
"proxy_key": "ek-proxy-1234567890abcdef",
"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"]
}'
import httpx
import time
expires_at = int(time.time()) + (60 * 24 * 60 * 60)
response = httpx.post(
"https://api.electronhub.ai/v1/auth/proxy/update",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
},
json={
"proxy_key": "ek-proxy-1234567890abcdef",
"name": "Updated Production Key",
"expires_at": expires_at,
"allocated_ammount": 150.0,
"model_whitelist": ["gpt-4o", "claude-3-5-sonnet-20241022", "dall-e-3"],
"ip_whitelist": ["192.168.1.0/24"],
},
)
result = response.json()
print(f"Update result: {result['message']}")
const expiresAt = Math.floor(Date.now() / 1000) + (60 * 24 * 60 * 60);
const response = await fetch('https://api.electronhub.ai/v1/auth/proxy/update', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ELECTRONHUB_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
proxy_key: 'ek-proxy-1234567890abcdef',
name: 'Updated Production Key',
expires_at: expiresAt,
allocated_ammount: 150.0,
model_whitelist: ['gpt-4o', 'claude-3-5-sonnet-20241022', 'dall-e-3'],
ip_whitelist: ['192.168.1.0/24'],
}),
});
const result = await response.json();
console.log(`Update result: ${result.message}`);
{
"message": "Proxy key updated"
}
{
"detail": "Allocated ammount cannot exceed your daily limit of 100"
}
Proxy Keys
Update Proxy Key
Update an existing proxy key’s configuration
POST
/
auth
/
proxy
/
update
curl https://api.electronhub.ai/v1/auth/proxy/update \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ELECTRONHUB_API_KEY" \
-d '{
"proxy_key": "ek-proxy-1234567890abcdef",
"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"]
}'
import httpx
import time
expires_at = int(time.time()) + (60 * 24 * 60 * 60)
response = httpx.post(
"https://api.electronhub.ai/v1/auth/proxy/update",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
},
json={
"proxy_key": "ek-proxy-1234567890abcdef",
"name": "Updated Production Key",
"expires_at": expires_at,
"allocated_ammount": 150.0,
"model_whitelist": ["gpt-4o", "claude-3-5-sonnet-20241022", "dall-e-3"],
"ip_whitelist": ["192.168.1.0/24"],
},
)
result = response.json()
print(f"Update result: {result['message']}")
const expiresAt = Math.floor(Date.now() / 1000) + (60 * 24 * 60 * 60);
const response = await fetch('https://api.electronhub.ai/v1/auth/proxy/update', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ELECTRONHUB_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
proxy_key: 'ek-proxy-1234567890abcdef',
name: 'Updated Production Key',
expires_at: expiresAt,
allocated_ammount: 150.0,
model_whitelist: ['gpt-4o', 'claude-3-5-sonnet-20241022', 'dall-e-3'],
ip_whitelist: ['192.168.1.0/24'],
}),
});
const result = await response.json();
console.log(`Update result: ${result.message}`);
{
"message": "Proxy key updated"
}
{
"detail": "Allocated ammount cannot exceed your daily limit of 100"
}
Identify the key with body field proxy_key. Legacy POST /v1/auth/proxy/update/ still works but is discouraged.
curl https://api.electronhub.ai/v1/auth/proxy/update \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ELECTRONHUB_API_KEY" \
-d '{
"proxy_key": "ek-proxy-1234567890abcdef",
"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"]
}'
import httpx
import time
expires_at = int(time.time()) + (60 * 24 * 60 * 60)
response = httpx.post(
"https://api.electronhub.ai/v1/auth/proxy/update",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
},
json={
"proxy_key": "ek-proxy-1234567890abcdef",
"name": "Updated Production Key",
"expires_at": expires_at,
"allocated_ammount": 150.0,
"model_whitelist": ["gpt-4o", "claude-3-5-sonnet-20241022", "dall-e-3"],
"ip_whitelist": ["192.168.1.0/24"],
},
)
result = response.json()
print(f"Update result: {result['message']}")
const expiresAt = Math.floor(Date.now() / 1000) + (60 * 24 * 60 * 60);
const response = await fetch('https://api.electronhub.ai/v1/auth/proxy/update', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ELECTRONHUB_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
proxy_key: 'ek-proxy-1234567890abcdef',
name: 'Updated Production Key',
expires_at: expiresAt,
allocated_ammount: 150.0,
model_whitelist: ['gpt-4o', 'claude-3-5-sonnet-20241022', 'dall-e-3'],
ip_whitelist: ['192.168.1.0/24'],
}),
});
const result = await response.json();
console.log(`Update result: ${result.message}`);
{
"message": "Proxy key updated"
}
{
"detail": "Allocated ammount cannot exceed your daily limit of 100"
}
Authorizations
Enter your API key (starts with 'ek-')
Body
application/json
The proxy key to update (must be one you own)
Required string length:
1 - 256Example:
"ek-proxy-1234567890abcdef"
Name of the proxy key
Maximum string length:
25Example:
"Updated API Key"
Expiration timestamp in seconds (-1 for no expiration)
Example:
1735689600
Allocated credit amount
Required range:
x >= 0Example:
15
Spend window for the allocation
Available options:
daily, weekly, monthly 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"]
Response
Proxy key updated successfully
Example:
"Proxy key updated"
