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

# Finish a file upload

> Finish a picture upload. The picture becomes a private asset in your Summer library, with a fileUrl to send as imageUrl.



## OpenAPI

````yaml scripts/api/sources/openapi.json POST /files/complete
openapi: 3.1.0
info:
  title: Summer API
  version: '1'
  description: >-
    Curated, tested game-dev models: 3D, images, video, voice, sound and music,
    into your Summer assets.
servers:
  - url: https://www.summerengine.com/v1
security:
  - bearer: []
paths:
  /files/complete:
    post:
      summary: Finish an image upload
      description: >-
        Finish an image upload: the image becomes a private file in your Summer
        library, with a URL to pass as imageUrl.
      operationId: assets_upload_complete
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 128
          description: >-
            A new key for each new request; the same key returns the first
            answer.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                publicId:
                  description: public_id from the upload's answer.
                  type: string
                  minLength: 1
                  maxLength: 300
                version:
                  description: version from the upload's answer.
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
                uploadSignature:
                  description: signature from the upload's answer (not the one in fields).
                  type: string
                  minLength: 1
                  maxLength: 128
                format:
                  type: string
                  enum:
                    - png
                    - jpg
                    - jpeg
                    - webp
                title:
                  default: Uploaded image
                  type: string
                  minLength: 1
                  maxLength: 200
              required:
                - publicId
                - version
                - uploadSignature
                - format
              additionalProperties: false
      responses:
        '200':
          description: Done.
          content:
            application/json:
              schema:
                type: object
                properties:
                  assetId:
                    type: string
                  fileUrl:
                    type: string
                  width:
                    type: number
                  height:
                    type: number
                required:
                  - assetId
                  - fileUrl
                  - width
                  - height
                additionalProperties: false
        default:
          description: An error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - param
            - request_id
            - doc_url
          properties:
            type:
              type: string
            code:
              type: string
              description: >-
                A stable code: invalid_input, not_signed_in, no_credits (the
                paid balance), over_limit (the app's own spend limit), ...
            message:
              type: string
            param:
              type:
                - string
                - 'null'
              description: The field to fix, such as input.prompt or Idempotency-Key.
            request_id:
              type: string
            doc_url:
              type: string
            fix_url:
              type: string
              description: Where the person fixes it, such as adding credits.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        A Summer sign-in: an OAuth 2.1 access token, valid one hour. Sign in
        once with npx -y summer-engine login, then print a token with summer
        token. Each app you sign in spends your paid credits up to the limit you
        set in Connected apps.

````

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