> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gostudio.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Modify a person's apparent age in a photo

> Modifies the apparent age of a person in a photo to the specified `target_age`. The model is chosen automatically based on `target_age` and `age_mode`.

The call blocks until processing completes (up to ~4 minutes) and returns the finished image URLs directly. Credits are deducted before generation begins and refunded if the job fails.

If `webhook_url` is provided, the result is also POSTed to that URL after generation completes (fire-and-forget, no retries). Must be HTTPS.




## OpenAPI

````yaml /openapi.yaml post /api/v2/apps/age-modifier
openapi: 3.0.3
info:
  title: GoStudio API
  version: 2.0.0
  description: >
    The GoStudio v2 REST API. Every response uses a standard envelope: successes
    return `{ status, data }`; errors return `{ status, error: { type, code,
    message } }`.


    All endpoints require a **Bearer token** in the `Authorization` header. The
    one exception is the provider webhook callback, which is authenticated by
    signature.
servers:
  - url: https://www.gostudio.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Watermark Remover
    description: AI watermark removal — orchestration, model metadata, and job polling.
  - name: Photo
    description: >-
      AI photo generation — generate, recreate, and manage trained profile
      photos.
  - name: Image
    description: Image utilities — group photo composition and image-to-prompt analysis.
  - name: Media
    description: Media upload and CDN management.
  - name: Apps
    description: GoStudio application tools — age modifier and other transformations.
  - name: Job Status
    description: Generic job polling — works across all GoStudio tools.
  - name: Webhooks
    description: Endpoints called by external services, not by your application.
paths:
  /api/v2/apps/age-modifier:
    post:
      tags:
        - Apps
      summary: Modify a person's apparent age in a photo
      description: >
        Modifies the apparent age of a person in a photo to the specified
        `target_age`. The model is chosen automatically based on `target_age`
        and `age_mode`.


        The call blocks until processing completes (up to ~4 minutes) and
        returns the finished image URLs directly. Credits are deducted before
        generation begins and refunded if the job fails.


        If `webhook_url` is provided, the result is also POSTed to that URL
        after generation completes (fire-and-forget, no retries). Must be HTTPS.
      operationId: runAgeModifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgeModifierRequest'
            examples:
              basic:
                summary: Age to 65
                value:
                  image_url: https://example.com/portrait.jpg
                  target_age: 65
                  gender: female
              with_webhook:
                summary: With webhook
                value:
                  image_url: https://example.com/portrait.jpg
                  target_age: 10
                  gender: male
                  webhook_url: https://myapp.example.com/webhooks/age-modifier
      responses:
        '200':
          description: Age modification completed successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 200
                  data:
                    $ref: '#/components/schemas/AgeModifierJobResult'
        '400':
          description: Missing or invalid request fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missing_field:
                  summary: Missing required field
                  value:
                    status: 400
                    error:
                      type: missing_required_field
                      code: 40011
                      message: image_url is required.
                invalid_url:
                  summary: Invalid image URL
                  value:
                    status: 400
                    error:
                      type: invalid_input
                      code: 40012
                      message: image_url must be a valid HTTPS URL.
                invalid_webhook:
                  summary: Invalid webhook URL
                  value:
                    status: 400
                    error:
                      type: invalid_input
                      code: 40012
                      message: webhook_url must be HTTPS.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    AgeModifierRequest:
      type: object
      required:
        - image_url
      properties:
        image_url:
          type: string
          format: uri
          description: HTTPS URL of the input photo. Also accepted as `input_image_url`.
          example: https://example.com/portrait.jpg
        target_age:
          type: integer
          description: Desired apparent age in years.
          default: 30
          minimum: 1
          maximum: 100
          example: 65
        gender:
          type: string
          description: Subject gender hint.
          enum:
            - none
            - male
            - female
            - other
          default: none
        age_mode:
          type: string
          description: >
            Age modification strategy. The model is chosen automatically based
            on this field and `target_age`.
          enum:
            - selected_age
            - age_progression
          default: selected_age
        webhook_url:
          type: string
          format: uri
          description: >
            HTTPS URL to receive the result after generation completes. Delivery
            is fire-and-forget — sent once, never retried.
          example: https://myapp.example.com/webhooks/age-modifier
    AgeModifierJobResult:
      type: object
      properties:
        job_id:
          type: integer
          description: Numeric job ID.
          example: 12345
        status:
          type: string
          enum:
            - processing
            - completed
            - failed
          description: >
            Current state of the job. `output_urls` and `credits_deducted` are
            present only when `completed`; `error` is present only when
            `failed`.
        output_urls:
          type: array
          description: >-
            CDN URLs for the generated images. Present when `status` is
            `completed`.
          items:
            type: string
            format: uri
          nullable: true
        credits_deducted:
          type: integer
          description: Credits spent. Present when `status` is `completed`.
          nullable: true
          example: 10
        credit_balance:
          type: integer
          description: Remaining credit balance. Present when `status` is `completed`.
          nullable: true
          example: 490
        error:
          type: string
          description: Failure reason. Present when `status` is `failed`.
          nullable: true
        created_at:
          type: string
          format: date-time
          description: When the job was created.
        updated_at:
          type: string
          format: date-time
          description: When the job was last updated.
    ErrorResponse:
      type: object
      properties:
        status:
          type: integer
          example: 400
        error:
          type: object
          properties:
            type:
              type: string
              example: validation_error
            code:
              type: string
              example: invalid_input
            dev:
              type: integer
              example: 40001
            message:
              type: string
              example: Some information is invalid.
  responses:
    Unauthorized:
      description: Missing or invalid Authorization Bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 401
            error:
              type: authentication_error
              code: unauthorized
              dev: 40100
              message: Missing or invalid Authorization Bearer token.
    PaymentRequired:
      description: The account does not have enough credits for this request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 402
            error:
              type: billing_error
              code: insufficient_credits
              dev: 40200
              message: You don't have enough credits.
    RateLimited:
      description: Too many requests.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 429
            error:
              type: rate_limit_error
              code: rate_limited
              dev: 42900
              message: You're doing that too often. Please wait a moment.
    ServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 500
            error:
              type: system_error
              code: internal_error
              dev: 50000
              message: Something went wrong on our end.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        Supabase user JWT (or an internal service token). Send as
        `Authorization: Bearer <token>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.