API Keys
Create and manage API keys for authenticating with the Socaity platform.
- Log in at socaity.ai
- Navigate to Account → API Keys
- Click Create key
- Give the key a descriptive name (e.g.
production-app) - Copy the key — it will not be shown again
Store your API key securely. If exposed, rotate it immediately from the dashboard.
The recommended approach is to set SOCAITY_API_KEY as an environment variable. All SDK constructors will pick it up automatically.
terminal
# .env (never commit this file)
SOCAITY_API_KEY=sk_your-key-here
# Or export inline for shell sessions
export SOCAITY_API_KEY=sk_your-key-herepython
import os
from socaity import face2face
# All models read SOCAITY_API_KEY — including Replicate-backed ones
f2f = face2face(api_key=os.getenv("SOCAITY_API_KEY"))
result = f2f.swap_img_to_img(
source_img="me.jpg",
target_img="target.jpg",
).get_result()Environment Variables
Always load keys from environment variables, never hard-code them in source.
Keep Out of Git
Add .env to .gitignore. Use a secrets manager for CI/CD pipelines.
One Key per Service
Create separate keys per service or environment so you can rotate them independently.
Rotate Regularly
Rotate keys every 90 days or immediately after any suspected exposure.
To rotate a key: create a new key, update your environment variables, then delete the old key from the dashboard.
Deleting a key is immediate and irreversible. Make sure all services are updated before deleting.