namastetools/ai-image-editor

AI Image Editor

Transform and edit images using AI with custom text prompts and advanced controls.

Inference
Commercial use
Partner

Table of contents

About

Transform and edit images using AI with custom text prompts and advanced controls.

1. Calling the API

Setup your API Key

Set NAMASTE_KEY as an environment variable in your runtime.

export NAMASTE_KEY="YOUR_API_KEY"

Submit a request

Make a POST request to the API endpoint with your file and parameters.

HTTP (cURL)

curl -X POST "https://www.namaste.tools/api/models/ai-image-editor" \
  -H "Authorization: Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{\n  "prompt": "example_string",\n  "image_urls": [\n    "https://example.com/image1.jpg",\n    "https://example.com/image2.jpg"\n  ],\n  "num_images": 1\n}'

2. Authentication

The API uses an API Key for authentication. Include your API key in the Authorization header of all requests.

API Key

Include your API key in the Authorization header using Bearer token format.

Authorization: Key YOUR_API_KEY

3. Queue

The API uses an asynchronous queue system for processing requests.

Submit a request

Submit your request to the queue and receive a request ID for tracking.

{
  "prompt": "example_string",
  "image_urls": [
    "https://example.com/image1.jpg",
    "https://example.com/image2.jpg"
  ],
  "num_images": 1
}

Fetch request status

Check the status of your request using the request ID.

GET /api/models/ai-image-editor/requests/{request_id}/status

Get the result

Retrieve the processed result once the request is completed.

GET /api/models/ai-image-editor/requests/{request_id}

4. Files

Different ways to provide files to the API.

Hosted files (URL)

Provide URLs to publicly accessible files. The API requires publicly accessible file URIs that can be downloaded without authentication.

{
  "prompt": "example_string",
  "image_urls": [
    "https://example.com/image1.jpg",
    "https://example.com/image2.jpg"
  ],
  "num_images": 1
}

Uploading files

Upload your files to any cloud storage provider (AWS S3, Google Cloud Storage, Azure Blob, etc.) and then use the public URL in your API request. The API accepts publicly accessible URLs only.

Step 1: Upload to Cloud Storage

Upload your image to any cloud provider and get a publicly accessible URL.

Supported cloud providers: AWS S3, Google Cloud Storage, Azure Blob Storage, Cloudinary, Imgur, or any service that provides publicly accessible URLs.

Step 2: Use the URL in API Request

{
  "prompt": "example_string",
  "image_urls": [
    "https://example.com/image1.jpg",
    "https://example.com/image2.jpg"
  ],
  "num_images": 1
}

5. Schema

Input

The API accepts the following input parameters:

promptstringrequired
The prompt for image editing
image_urlslist<string>required
List of URLs of input images for editing
num_imagesinteger
Number of images to generate
Default: 1Min: 1
output_format"png" | "jpeg" | "webp"
Output format for the generated images
Options: png, jpeg, webp

Output

The API returns the following output format:

imageslist<object>required
Array of generated/edited images
descriptionstringrequired
Description of the generated/edited content

Additional Information

Additional information about the API.

Supported Formats

.png, .jpg, .jpeg

API Limits

Processing timeout:30 seconds
Rate limit:100 requests/minute
Concurrent requests:5 per account

Error Responses

400Bad Request - Invalid parameters
401Unauthorized - Invalid API key
402Payment Required - Insufficient credits
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Ready to get started?

Start using our API to integrate AI Image Editor into your applications today.