API Reference

Quick Start Filters

πŸ“˜

The overall API call flow is:

  1. Each request requires an api key (X-API-key header) to submit a generation task, which returns an event id
  2. Through the event_id, you can get the generation status
  3. When the generation status is READY, you can download the file through the URL.

Prerequisites

  • Glam API Platform account

Log in to the Glam API platform

Please log in to the Glam API platform

Set up API key

Step 1

Click the Create API Key button in API Key section

Step 2

Please enter a name for your API key

Step 3

After entering the name, your API key will be displayed. Please store it securely as it will only be shown once.


Log in to readme.io (optional)

If you log in to the readme.io platform your api keys will appear automatically. More info


Generation process

Step 1

Copy filter name from Filters dashboard

Step 2

Use generate method to start generation process.

Headers:

  • X-API-key - API Key generated on the website

Body:

  • media_url - link to the image for processing
  • filter_name - the name of the filter to use

curl --request POST \
     --url https://api.glam.ai/api/v1/generate \
     --header 'X-API-Key: 32cefw12AUTHKfffEY' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "media_url": "https://static.getglam.app/profiles/3b67cf99601a4520a509d4546b8437c1/falai/bb20e51a55feb5e809f0a15cbca2040c.jpg",
  "filter_name": "real_sunset"
}
'

Response:

event_id - generation id. Required to get the result of the generation

{
  "event_id": "7f8d44f6-8cfc-4067-a6e0-42294a3cc41b-u1"
}

Step 3

Use the get result method to see the generated result

Headers:

  • X-API-key - API Key generated on the website

Path:

  • event_id - generation id from previous step
curl --request GET \
     --url https://api.glam.ai/api/v1/result/7f8d44f6-8cfc-4067-a6e0-42294a3cc41b-u1 \
     --header 'X-API-Key: 32cefw12AUTHKfffEY' \
     --header 'accept: application/json'

Response:

  • media_urls - list of generation results
  • status - generation status
{
  "media_urls": [
    "https://static.getglam.app/comfyui/processings/api/outputs/7f8d44f6-8cfc-4067-a6e0-42294a3cc41b-u1_0.jpg"
  ],
  "status": "READY"
}

Possible generation statuses

  • IN_PROGRESS - the generation in progress
  • READY - the result of the generation is ready
  • FAILED - the generation failed with an error

❗️

The number of parallel generations depends on your current plan

You can check and change the current plan in Billing section (see Max parallel requests plan field)