MuseSpark
MuseSpark
Models & toolsTools

Ai Age Filter API guide

Ai Age Filter API: Transform a portrait toward a selected age stage, from baby to very old. Supply one image and choose an age preset.

Model overview

Transform a portrait toward a selected age stage, from baby to very old. Supply one image and choose an age preset.

API integration

DocumentationValue
API invocation identifierai-age-filter
IntegrationAsync task API

Use this invocation identifier in API requests. Check your authorized model catalog for access. Follow the Quickstart for your first complete call.

Request parameters

Studio presets describe the form setup, not guaranteed server defaults. Send preset values explicitly to reproduce them.

imagestringNon-nullRequired

The URL of the input image.

Media types: image/*.

agestringNon-nullRequired

Target age: baby (2), child (8), teen (15), young adult (22), middle aged (45), old (75), very old (90).

Allowed values: "baby", "child", "teen", "young_adult", "middle_aged", "old", "very_old".

Studio preset: "old".

No parameters match. Clear the search or reset the filters.

Model rules

Parameter meaning

  • The image supplies the portrait; age selects the target life stage. Use an age preset rather than a numeric age.

Reference media

  • Use a well-lit, front-facing portrait with the face unobstructed. Strong filters, sunglasses, and extreme head angles can reduce the usefulness of the result.

Request examples

Replace example media URLs and YOUR_... input identifiers with your own valid resources. Examples are checked against the exported item schema; media access and paid execution are separate runtime checks.

Set MUSESPARK_API_KEY and a stable MUSESPARK_REQUEST_ID before submitting. Preserve the request ID for retries of the same request and use a new ID for new work. Python examples use requests; JavaScript examples use Node.js 20 or later. The standalone Quickstart includes task polling and recovery.

Create an older portrait

curl --fail-with-body 'https://api.musespark.ai/api/v1/openapi/task' \
  -H "Authorization: Bearer $MUSESPARK_API_KEY" \
  -H "X-Idempotency-Key: $MUSESPARK_REQUEST_ID" \
  -H 'Content-Type: application/json' \
  -d '{
  "item_key": "ai-age-filter",
  "parameters": {
    "age": "old",
    "image": "https://example.com/adult-portrait.jpg"
  }
}'

Parameters used: age · image.

Apply the young-adult preset

curl --fail-with-body 'https://api.musespark.ai/api/v1/openapi/task' \
  -H "Authorization: Bearer $MUSESPARK_API_KEY" \
  -H "X-Idempotency-Key: $MUSESPARK_REQUEST_ID" \
  -H 'Content-Type: application/json' \
  -d '{
  "item_key": "ai-age-filter",
  "parameters": {
    "age": "young_adult",
    "image": "https://example.com/adult-portrait.jpg"
  }
}'

Parameters used: age · image.

Output

The output is an edited portrait representing the selected age stage.

Creation returns a task ID inside data. Poll that task until completion, then save data.result.output_urls and any data.result.batch_results. See the task lifecycle for terminal states, result retention, and errors.

Troubleshooting

A numeric age is rejected. Use one of the documented age strings, such as old or young_adult.

age

Facial details are distorted or obscured. Use a sharper front-facing portrait with even lighting and no sunglasses.

image

For rejected inputs, check the field type, accepted values, and conditional requirements in Request parameters and Model rules. Correct the affected fields before submitting again.

If creation times out, preserve the request identity and any known task ID. Follow Errors, timeouts and retries before submitting again.

The public input snapshot was exported on 2026-11-09. Current prices and availability are listed in the model center.