HTTP Status Codes
Code | Meaning | Description |
---|---|---|
200 | Success | Request completed successfully |
400 | Bad Request | Invalid request parameters or format |
401 | Unauthorized | Missing or invalid authentication |
404 | Not Found | File or resource doesn’t exist |
409 | Conflict | File already exists (write operation) |
422 | Unprocessable Entity | Business rule violation |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Server-side error |
Error Response Format
All errors return a consistent JSON structure:Common Error Codes
Authentication Errors
INVALID_API_KEY
INVALID_API_KEY
HTTP 401 - API key is missing, malformed, or invalidSolution:
- Verify your API key starts with
oa_
- Check for extra spaces or characters
- Regenerate key if compromised
RATE_LIMIT_EXCEEDED
RATE_LIMIT_EXCEEDED
HTTP 429 - Too many requests in time windowSolution:
- Implement exponential backoff
- Check
X-RateLimit-Reset
header - Upgrade tier for higher limits
File Operation Errors
FILE_NOT_FOUND
FILE_NOT_FOUND
HTTP 404 - Requested file doesn’t existSolution:
- Verify file path (no leading slashes)
- Use
list_files
to check available files - Ensure file was created successfully
FILE_ALREADY_EXISTS
FILE_ALREADY_EXISTS
HTTP 409 - File exists, use edit/overwrite insteadSolution:
- Use
edit_file
for partial updates - Use
overwrite_file
to replace content - Add version parameter to create new version
INVALID_PATH
INVALID_PATH
HTTP 400 - File path format is invalidSolution:
- Use forward slashes:
folder/file.txt
- No leading slashes:
folder/file.txt
not/folder/file.txt
- Avoid special characters in paths
CONTENT_TOO_LARGE
CONTENT_TOO_LARGE
HTTP 413 - File exceeds size limitsSolution:
- Check tier limits (Free: 10MB, Pro: 100MB)
- Break large files into chunks
- Consider upgrading for larger limits
STRING_NOT_FOUND
STRING_NOT_FOUND
HTTP 422 - String to replace not found in fileSolution:
- Verify exact string match (case-sensitive)
- Check for invisible characters or encoding
- Use
read_file
to see current content
Error Handling Best Practices
Retry Logic
Implement exponential backoff for transient errors:Logging and Monitoring
Track error patterns to improve reliability:Getting Help
If you encounter persistent errors:Check API Status
Visit status.openfiles.ai for service status
Email Support
Contact our team at support@openfiles.ai