API Documentation

Step1X-Edit provides a simple yet powerful API that allows you to easily integrate image editing capabilities into your applications.

Authentication

Before using the API, you'll need to obtain an API key. You can register and get your key at fal.ai.

Authorization: Bearer your-api-key

API Endpoints

Image Editing

Request URL

POST https://fal.ai/models/fal-ai/step1x-edit/api

Request Body Example

{
  "input": {
    "image_url": "https://example.com/image.jpg",
    "prompt": "Change the background to blue"
  }
}

Response Example

{
  "image_url": "https://fal.ai/output/xxxxx.jpg"
}

Code Examples

Python

import requests

api_key = "your-api-key"
headers = {
    "Authorization": f"Bearer {api_key}",
    "Content-Type": "application/json"
}

data = {
    "input": {
        "image_url": "https://example.com/image.jpg",
        "prompt": "Change the background to blue"
    }
}

response = requests.post(
    "https://fal.ai/models/fal-ai/step1x-edit/api",
    headers=headers,
    json=data
)

result = response.json()
print(result["image_url"])

JavaScript

const response = await fetch(
  "https://fal.ai/models/fal-ai/step1x-edit/api",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer your-api-key",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      input: {
        image_url: "https://example.com/image.jpg",
        prompt: "Change the background to blue"
      }
    })
  }
);

const result = await response.json();
console.log(result.image_url);

Notes

  • Image URL must be publicly accessible
  • Supported image formats: JPEG, PNG
  • Recommended image resolution: up to 1024x1024
  • API rate limits apply, refer to official documentation