Spaces:
Paused
Paused
|
Download setup-api-key.md from visualisable-ai/api: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/spaces/visualisable-ai/api/resolve/main/setup-api-key.md
- Command line
-
hf download hf://spaces/visualisable-ai/api/setup-api-key.md
-
curl -L -o setup-api-key.md https://huggingface.co/spaces/visualisable-ai/api/resolve/main/setup-api-key.md
1.32 kB
API Key Setup Instructions
Generated API Key
c5fd7c64cf05a6cbfae3a8cdc4edb25fa4735b324489776fdcf114aefba12748
Steps to Add to HuggingFace Spaces:
- Go to your HuggingFace Space: https://huggingface.co/spaces/garyboon/visualisable-ai-backend
- Click on "Settings" (gear icon) in the top right
- Scroll down to "Repository secrets"
- Click "New secret"
- Add:
- Name:
API_KEY - Value:
c5fd7c64cf05a6cbfae3a8cdc4edb25fa4735b324489776fdcf114aefba12748
- Name:
- Click "Add new secret"
Frontend Configuration
Add this API key to your frontend environment variables:
For Vercel:
- Go to your Vercel project settings
- Navigate to Environment Variables
- Add:
- Name:
NEXT_PUBLIC_API_KEY - Value:
c5fd7c64cf05a6cbfae3a8cdc4edb25fa4735b324489776fdcf114aefba12748
- Name:
For local development:
Create .env.local in your frontend directory:
NEXT_PUBLIC_API_KEY=c5fd7c64cf05a6cbfae3a8cdc4edb25fa4735b324489776fdcf114aefba12748
NEXT_PUBLIC_API_URL=https://garyboon-visualisable-ai-backend.hf.space
Testing the API Key
Once configured, test with:
curl -H "X-API-Key: c5fd7c64cf05a6cbfae3a8cdc4edb25fa4735b324489776fdcf114aefba12748" \
https://garyboon-visualisable-ai-backend.hf.space/health
Should return the health status if the key is correctly configured.