File size: 2,441 Bytes
61782c5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# 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
1. **Visit your Space page:**
- Go to: https://huggingface.co/spaces/JatinAutonomousLabs/Research_AI_Assistant_API
2. **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
3. **Test both formats:**
```bash
# 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
```python
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
1. **404 Error:**
- Space might still be building (check Space page)
- URL format might be wrong (try both formats)
- Space might not be public
2. **503 Error:**
- Space is running but API is initializing
- Wait 30-60 seconds and retry
3. **CORS Errors:**
- API has CORS enabled, but verify the URL is correct
## Verification Steps
1. β
Check Space is built and running
2. β
Verify Space is public
3. β
Test root endpoint first: `GET /`
4. β
Test health endpoint: `GET /api/health`
5. β
Use the working URL in your application
|