1. Get Your API Key

1

Sign up

Create your account at console.openfiles.ai
2

Create API Key

Navigate to API KeysCreate API Key
3

Copy Your Key

Copy your API key (starts with oa_) and store it securely

2. Make Your First API Call

Let’s create your first file:
curl -X POST "https://api.openfiles.ai/functions/v1/api/files" \
  -H "Content-Type: application/json" \
  -H "x-api-key: oa_your_api_key_here" \
  -d '{
    "path": "hello-world.txt",
    "content": "Hello from OpenFiles API!",
    "contentType": "text/plain"
  }'

3. Read Your File Back

Now let’s read the file we just created:
curl -X GET "https://api.openfiles.ai/functions/v1/api/files/hello-world.txt" \
  -H "x-api-key: oa_your_api_key_here"

4. List All Your Files

See all files in your project:
curl -X GET "https://api.openfiles.ai/functions/v1/api/files" \
  -H "x-api-key: oa_your_api_key_here"

Core Concepts

File Paths

  • Use S3-style paths: documents/report.pdf
  • No leading slashes: /documents/report.pdf
  • Forward slashes on all platforms

Versioning

  • Every write creates a new version automatically
  • Access specific versions: GET /files/report.pdf?version=2
  • Version history: GET /files/report.pdf?versions

Content Types

  • Auto-detected from file extension
  • Or specify explicitly: "contentType": "application/json"
  • Supports text and binary files

Common Patterns

Organize Files with Folders

{
  "path": "projects/website/src/index.html",
  "content": "<!DOCTYPE html>...",
  "contentType": "text/html"
}

Edit Existing Files

{
  "oldString": "Hello World",
  "newString": "Hello OpenFiles"
}

Append to Log Files

{
  "content": "\n2025-01-15 10:30:00 - User logged in"
}

Next Steps

Ready to build something amazing? Check out our complete API reference for all available operations!