Hugging Face Spaces URL Format Guide
Correct URL Format
For the space JatinAutonomousLabs/HonestAI, the correct URL format is:
Primary URL (with hyphens):
https://jatinautonomouslabs-honestai.hf.space
Alternative URL (if hyphens don't work):
https://jatinautonomouslabs-honest_ai.hf.space
How to Find Your Exact URL
Visit your Space page:
Check the Space Settings:
- Look for "Public URL" or "Space URL" in the settings
- The URL format is typically:
{username}-{spacename}.hf.space - Spaces convert underscores to hyphens in the URL
Test both formats:
# Try with hyphens (most common) curl https://jatinautonomouslabs-research-ai-assistant-api.hf.space/ # Try with underscores (if hyphens don't work) curl https://jatinautonomouslabs-research_ai_assistant_api.hf.space/
URL Format Rules
- Username:
JatinAutonomousLabs→jatinautonomouslabs(lowercase) - Space Name:
HonestAI→honestaiorhonest-ai(lowercase) - Domain:
.hf.space
Quick Test Script
import requests
# Try both URL formats
urls = [
"https://jatinautonomouslabs-honestai.hf.space",
"https://jatinautonomouslabs-honest-ai.hf.space"
]
for url in urls:
try:
response = requests.get(f"{url}/", timeout=5)
if response.status_code == 200:
print(f"✅ Working URL: {url}")
print(f"Response: {response.json()}")
break
else:
print(f"❌ {url} returned {response.status_code}")
except Exception as e:
print(f"❌ {url} failed: {e}")
Common Issues
404 Error:
- Space might still be building (check Space page)
- URL format might be wrong (try both formats)
- Space might not be public
503 Error:
- Space is running but API is initializing
- Wait 30-60 seconds and retry
CORS Errors:
- API has CORS enabled, but verify the URL is correct
Verification Steps
- ✅ Check Space is built and running
- ✅ Verify Space is public
- ✅ Test root endpoint first:
GET / - ✅ Test health endpoint:
GET /api/health - ✅ Use the working URL in your application