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

# 2.2 Pikaframes

> Generate a video by combining your first and last frame. Upload two images to define the start and end points, and let the AI create a smooth transition between them.



## OpenAPI

````yaml post /generate/2.2/pikaframes
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /generate/2.2/pikaframes:
    post:
      summary: Generate 2 2 Keyframe
      operationId: generate_2_2_keyframe_generate_2_2_pikaframes_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_generate_2_2_keyframe_generate_2_2_pikaframes_post
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |

            curl -X POST "https://devapi.pika.art/generate/2.2/pikaframes" \
                 -H "X-API-KEY: your_api_key" \
                 -H "Accept: application/json" \
                 -F "promptText=the tomato morphs into a sharp knife" \
                 -F "negativePrompt=blurry, low quality, unrealistic" \
                 -F "seed=12345" \
                 -F "duration=3" \
                 -F "resolution=1080p" \
                 -F "keyFrames=@tomato.jpeg;type=image/jpeg" \
                 -F "keyFrames=@knife.jpeg;type=image/jpeg"
        - lang: python
          label: Python
          source: >

            import requests

            import json


            endpoint = f"https://devapi.pika.art/generate/2.2/pikaframes"


            payload = {
                "promptText": "the tomato morphs into a sharp knife",
                "negativePrompt": "blurry, low quality, unrealistic, fake",
                "seed": 12345,
                "duration": 3,            # anything between 1 and 10
                "resolution": "1080p"
            }


            headers = {
                "X-API-KEY": token,
                "Accept": "application/json"
            }

            files = [              
                ("keyFrames", ("tomato.jpeg", open("tomato.jpeg", "rb"), "image/jpeg")),
                ("keyFrames", ("knife.jpeg", open("knife.jpeg", "rb"), "image/jpeg"))
            ]


            response = requests.post(endpoint, data=payload, headers=headers,
            files=files)

            print(response.json())
components:
  schemas:
    Body_generate_2_2_keyframe_generate_2_2_pikaframes_post:
      properties:
        keyFrames:
          items:
            type: string
            format: binary
          type: array
          title: Keyframes
          max_items: 2
          min_items: 2
        promptText:
          type: string
          title: Prompttext
        negativePrompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Negativeprompt
        seed:
          anyOf:
            - type: integer
            - type: 'null'
          title: Seed
        resolution:
          type: string
          title: Resolution
          default: 1080p
        duration:
          type: integer
          title: Duration
          default: 5
      type: object
      required:
        - keyFrames
        - promptText
      title: Body_generate_2_2_keyframe_generate_2_2_pikaframes_post
    GenerateResponse:
      properties:
        video_id:
          type: string
          title: Video Id
      type: object
      required:
        - video_id
      title: GenerateResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````