Direct HTTP access to inference.sh.
Base URL
code
1https://api.inference.shAuthentication
All requests require an API key in the Authorization header:
code
1Authorization: Bearer inf_your_api_keyContent Type
code
1Content-Type: application/jsonError Responses
All errors return JSON with this structure:
json
1{2 "error": {3 "code": "invalid_request",4 "message": "Description of the error"5 }6}Error Codes
| Code | HTTP | Description |
|---|---|---|
unauthorized | 401 | Invalid or missing API key |
forbidden | 403 | Insufficient permissions |
not_found | 404 | Resource not found |
invalid_request | 400 | Malformed request |
rate_limited | 429 | Too many requests |
internal_error | 500 | Server error |
Rate Limits
| Endpoint | Limit |
|---|---|
| Run task | 100/minute |
| Get task | 1000/minute |
| Upload file | 50/minute |
Response headers:
code
1X-RateLimit-Remaining: 952X-RateLimit-Reset: 1640000000