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

# Add Profile

> Create a new profile from signed image URLs.

Starts training asynchronously and returns a profile ID immediately.
Poll `GET /profiles/{profile_id}/status` to check when training completes.



## OpenAPI

````yaml https://api.photalabs.com/v1/phota/openapi.json post /v1/phota/profiles/add
openapi: 3.1.0
info:
  title: Phota API
  description: Create and manage profiles for photo editing and enhancement.
  version: v0.5.0
servers:
  - url: https://api.photalabs.com
security: []
tags:
  - name: Studio
    description: Image editing, generation, and enhancement.
  - name: Profiles
    description: 'Profile lifecycle: create, query, delete.'
paths:
  /v1/phota/profiles/add:
    post:
      tags:
        - Profiles
      summary: Add Profile
      description: >-
        Create a new profile from signed image URLs.


        Starts training asynchronously and returns a profile ID immediately.

        Poll `GET /profiles/{profile_id}/status` to check when training
        completes.
      operationId: add_profile_v1_phota_profiles_add_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddProfileRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddProfileResponse'
        '401':
          description: Missing or invalid API key in the X-API-Key header.
        '402':
          description: Insufficient prepaid credit balance.
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhotaError404Response'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhotaError500Response'
      security:
        - APIKeyHeader: []
components:
  schemas:
    AddProfileRequest:
      properties:
        image_urls:
          items:
            type: string
          type: array
          maxItems: 50
          minItems: 5
          title: Image Urls
          description: >-
            Publicly accessible URLs pointing to the training images. Supported
            formats: JPEG, PNG, WebP, and HEIC/HEIF. Images larger than 4K
            (4096px) are automatically resized; for best results, provide images
            at 4K or below. PNG images are transcoded to JPEG (quality 95) for
            storage efficiency. Image-count range depends on training_tier:
            "standard" requires 10–50, "fast" requires 5–10.
        training_tier:
          $ref: '#/components/schemas/TrainingTier'
          description: >-
            Training tier for the profile. "standard" trains on 10–50 images for
            highest quality; "fast" trains on 5–10 images for quicker turnaround
            at lower cost.
          default: standard
        tag:
          anyOf:
            - type: string
              maxLength: 128
              minLength: 1
            - type: 'null'
          title: Tag
          description: >-
            Optional immutable tag to group or namespace this profile (e.g.,
            your end-user's identifier).
      type: object
      required:
        - image_urls
      title: AddProfileRequest
      description: Request body for creating a new profile.
      examples:
        - image_urls:
            - https://example.com/photo1.jpg
            - >-
              https://storage.googleapis.com/bucket/photo2.jpg?X-Goog-Signature=...
          tag: user_abc123
        - image_urls:
            - https://example.com/photo1.jpg
            - https://example.com/photo2.jpg
            - https://example.com/photo3.jpg
            - https://example.com/photo4.jpg
            - https://example.com/photo5.jpg
            - https://example.com/photo6.jpg
          tag: user_abc123
          training_tier: fast
    AddProfileResponse:
      properties:
        profile_id:
          type: string
          title: Profile Id
          description: >-
            Unique identifier for the new profile. Use this to poll training
            status.
      type: object
      required:
        - profile_id
      title: AddProfileResponse
      description: Response returned after a profile is created.
    PhotaError404Response:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable error message.
        code:
          type: string
          enum:
            - NOT_FOUND
            - PROFILE_NOT_FOUND
            - PROFILE_NOT_READY
          title: Code
          description: Machine-readable error code.
        request_id:
          type: string
          title: Request Id
          description: Unique request identifier for support.
      type: object
      required:
        - detail
        - code
        - request_id
      title: PhotaError404Response
      description: Error response for 404 Not Found.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PhotaError500Response:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable error message.
        code:
          type: string
          const: INTERNAL_ERROR
          title: Code
          description: Machine-readable error code.
        request_id:
          type: string
          title: Request Id
          description: Unique request identifier for support.
      type: object
      required:
        - detail
        - code
        - request_id
      title: PhotaError500Response
      description: Error response for 500 Internal Server Error.
    TrainingTier:
      type: string
      enum:
        - standard
        - fast
      title: TrainingTier
      description: |-
        Training tier for a profile job.

        Attributes:
            STANDARD: Full-quality training (10-50 images, 500-1000 steps scaled by image count).
            FAST: Reduced-image, faster-turnaround training (5-10 images, 150-300 steps scaled by image count).
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````