Custom API Endpoints

InstantStudio Endpoints are custom image generation APIs that are designed to address your business goals. Create branded selfies, unique image manipulations, or business tools that meet your needs and can be used where your users are. Use this screen to test your endpoint either from the form below or via the API.

CNY-SnakeYear
CNY-SnakeYear
Endpoint ID
PrOhEE
Credit Required
10.0
Image Expiration
N/A
Output Format
jpeg

This workflow contains Moondream + AutoGen + Flux Snake Year scene Each endpoint output one generation but two outputs, with frame or without.

This document provides an example of how to post a job for a specific endpoint and then query its status until it is completed.

Endpoint JSON Format

This is the JSON representation of this endpoint:

{
  "name": "CNY-SnakeYear",
  "coverUrl": "https://toolkit.instantstudio.ai/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6NzM3NzAyLCJwdXIiOiJibG9iX2lkIn19--9f5ef50ee765e29aa49818a6e28ae55fc3398bd2/ComfyUI_00087__%E5%89%AF%E6%9C%AC.png",
  "endpointId": "PrOhEE",
  "fieldIds": [
    "data[#22][load_image]",
    "data[flux-sampler-parameters-seed#56][seed]"
  ]
}

Submit a Job

To submit a job, use the POST method with the necessary parameters for the endpoint. Below is an example:

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
    -F "data[#22][load_image]=@/path/to/file" \
    -F "data[flux-sampler-parameters-seed#56][seed]=20" \
    "https://toolkit.instantstudio.ai/api/v1/jobs?endpoint=PrOhEE"

Sample Response:

{
  "job_id": "44fefe50-2547-494f-aaa2-71dc3f661234",
  "job_state": "pending",
  "started_at": null,
  "completed_at": null
}

Step 2: Query the Job Status

Once the job is submitted, use the GET method to query its status using the job_id from the response.

curl -X GET -H "Authorization: Bearer <api_key>" \
    "https://toolkit.instantstudio.ai/api/v1/jobs/44fefe50-2547-494f-aaa2-71dc3f661234"

Sample Responses:

  • In Queue:
{
  "job_id": "44fefe50-2547-494f-aaa2-71dc3f661234",
  "job_state": "in_queue",
  "started_at": null,
  "completed_at": null
}
  • Processing:
{
  "job_id": "44fefe50-2547-494f-aaa2-71dc3f661234",
  "job_state": "processing",
  "started_at": "2024-12-11T13:47:30.421+08:00",
  "completed_at": null
}
  • Succeeded:
{
  "job_id": "44fefe50-2547-494f-aaa2-71dc3f661234",
  "job_state": "succeeded",
  "started_at": "2024-12-11T13:47:30.421+08:00",
  "completed_at": "2024-12-11T13:51:00.829+08:00",
  "image_urls": [
    "..."
  ]
}

Notes:

  • Continue polling the GET endpoint until the job_state is "succeeded" or "failed".
  • Ensure to save the generated images (image_urls) before the job data is deleted after 24 hours.

Generated Images