LogoLogo
  • Overview
  • Quick Start
  • Authentication
  • Rate limits
  • Errors
  • Image Editing API
    • Image I/O
    • Image Operations
      • Restorations
      • Resizing
      • Outpainting
      • Generative Editing
      • Color Adjustments
      • Background
      • Padding
      • Privacy
    • API Reference
    • Async API Reference
    • Batch API Reference
    • Upload API Reference
  • image generation api
    • Image Generation I/O
    • Image Generation Options
    • API Reference
  • AI Background API
    • AI Background I/O
    • AI Background Options
      • Object
      • Scene
      • Product Shadow
    • API Reference
  • Image to Video API
    • Image to Video I/O
    • Image to Video Options
    • Async API Reference
  • Storage Connectors
    • Overview
    • AWS S3
    • Google Cloud Storage
    • Web Folder
    • API Reference
  • Guides
    • E-commerce
    • Real Estate
    • Printing
  • Redoc
  • Blog
Powered by GitBook
On this page
  • Get your API keys
  • Make an image processing request
Edit on GitHub

Quick Start

Get up and running with Claid API within minutes

PreviousOverviewNextAuthentication

Last updated 7 months ago

Get your API keys

Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error. You can generate and manage API keys in .

Make an image processing request

To make your first request, send an authenticated request to the endpoint. All you need to do is just replace API key placeholder with your actual API key.

This sample request will perform ML-based color adjustment, sharpen the image and turn it into 800x800 square.

POST /v1-beta1/image/edit HTTP/1.1
Host: api.claid.ai
Authorization: Bearer {YOUR_API_KEY}
Content-Type: application/json

{
    "input": "https://claid.ai/doc-samples/bag.jpeg",
    "operations": {
        "resizing": {
            "width": 800,
            "height": 800,
            "fit": "crop"
        },
        "adjustments": {
            "hdr": 60,
            "sharpness": 40
        }
    },
    "output": {
        "format": {
	    "type": "jpeg",
	    "quality": 90
	}
    }
}
curl -X POST --location "https://api.claid.ai/v1-beta1/image/edit" --http1.1 \
    -H "Host: api.claid.ai" \
    -H "Authorization: Bearer {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -d "{
            \"input\": \"https://claid.ai/doc-samples/bag.jpeg\",
            \"operations\": {
                \"resizing\": {
                    \"width\": 800,
                    \"height\": 800,
                    \"fit\": \"crop\"
                },
                \"adjustments\": {
                    \"hdr\": 60,
                    \"sharpness\": 40
                }
            },
            \"output\": {
                \"format\": {
        	    \"type\": \"jpeg\",
        	    \"quality\": 90
        	}
            }
        }"

Your response should be similar to following:

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 319
Connection: keep-alive
ratelimit-limit: 120, 120;w=60, 4;w=1
ratelimit-remaining: 118
ratelimit-reset: 42
x-request-id: 4005f581-723f-4c79-85a1-bdd752718887


{
  "data": {
    "input": {
      "ext": "jpeg",
      "mps": 4.1472,
      "mime": "image/jpeg",
      "format": "JPEG",
      "width": 2880,
      "height": 1440
    },
    "output": {
      "ext": "jpeg",
      "mps": 0.64,
      "mime": "image/jpeg",
      "format": "JPEG",
      "width": 800,
      "height": 800,
      "tmp_url": "....."
    }
  }
}

And here's the sample image we just used in our request (left) and the result it produced (right).

your Claid account
image editing
Input image
Output image, 800x800 square