Hugging Face Spaces URL Format Guide
Correct URL Format
For the space JatinAutonomousLabs/Research_AI_Assistant_API, the correct URL format is:
Primary URL (with hyphens):
https://jatinautonomouslabs-research-ai-assistant-api.hf.space
Alternative URL (if hyphens don't work):
https://jatinautonomouslabs-research_ai_assistant_api.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:
Research_AI_Assistant_APIβresearch-ai-assistant-api(lowercase, underscores β hyphens) - Domain:
.hf.space
Quick Test Script
import requests
# Try both URL formats
urls = [
"https://jatinautonomouslabs-research-ai-assistant-api.hf.space",
"https://jatinautonomouslabs-research_ai_assistant_api.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