curl https://api.electronhub.ai/v1/auth/key/regen \
-H "Authorization: Bearer $ELECTRONHUB_API_KEY"
import httpx
client = httpx.Client()
response = client.get(
"https://api.electronhub.ai/v1/auth/key/regen",
headers={
"Authorization": f"Bearer {api_key}"
}
)
result = response.json()
new_api_key = result["key"]
print(f"New API key: {new_api_key}")
# Important: Update your applications with the new key
print("Remember to update all applications with the new API key!")
const response = await fetch('https://api.electronhub.ai/v1/auth/key/regen', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ELECTRONHUB_API_KEY}`,
},
});
const result = await response.json();
const newApiKey = result.key;
console.log(`New API key: ${newApiKey}`);
// Important: Update your applications with the new key
console.log('Remember to update all applications with the new API key!');
{
"key": "ek-1234567890abcdef1234567890abcdef"
}
API Reference
Regenerate API Key
Generate a new API key for the authenticated user
GET
/
auth
/
key
/
regen
curl https://api.electronhub.ai/v1/auth/key/regen \
-H "Authorization: Bearer $ELECTRONHUB_API_KEY"
import httpx
client = httpx.Client()
response = client.get(
"https://api.electronhub.ai/v1/auth/key/regen",
headers={
"Authorization": f"Bearer {api_key}"
}
)
result = response.json()
new_api_key = result["key"]
print(f"New API key: {new_api_key}")
# Important: Update your applications with the new key
print("Remember to update all applications with the new API key!")
const response = await fetch('https://api.electronhub.ai/v1/auth/key/regen', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ELECTRONHUB_API_KEY}`,
},
});
const result = await response.json();
const newApiKey = result.key;
console.log(`New API key: ${newApiKey}`);
// Important: Update your applications with the new key
console.log('Remember to update all applications with the new API key!');
{
"key": "ek-1234567890abcdef1234567890abcdef"
}
Immediately invalidates the current primary API key. Proxy keys are unaffected. The old key cannot be recovered.
curl https://api.electronhub.ai/v1/auth/key/regen \
-H "Authorization: Bearer $ELECTRONHUB_API_KEY"
import httpx
client = httpx.Client()
response = client.get(
"https://api.electronhub.ai/v1/auth/key/regen",
headers={
"Authorization": f"Bearer {api_key}"
}
)
result = response.json()
new_api_key = result["key"]
print(f"New API key: {new_api_key}")
# Important: Update your applications with the new key
print("Remember to update all applications with the new API key!")
const response = await fetch('https://api.electronhub.ai/v1/auth/key/regen', {
method: 'GET',
headers: {
'Authorization': `Bearer ${process.env.ELECTRONHUB_API_KEY}`,
},
});
const result = await response.json();
const newApiKey = result.key;
console.log(`New API key: ${newApiKey}`);
// Important: Update your applications with the new key
console.log('Remember to update all applications with the new API key!');
{
"key": "ek-1234567890abcdef1234567890abcdef"
}
⌘I
