Skip to main content

HTTP Status Codes

Error Response Format

All errors return a consistent JSON structure:

Common Error Codes

Authentication Errors

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
HTTP 429 - Too many requests in time windowSolution:
  • Implement exponential backoff
  • Check X-RateLimit-Reset header
  • Upgrade tier for higher limits

File Operation Errors

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
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
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
HTTP 413 - File exceeds size limitsSolution:
  • Check tier limits (Free: 10MB, Pro: 100MB)
  • Break large files into chunks
  • Consider upgrading for larger limits
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