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

# Create a Runway character performance

> Use CometAPI with Runway Control a character API to start character performance tasks from a reference video, driving facial expressions and body motion.

Use this endpoint to transfer performance from a reference clip onto a character image or character video.

## Before you call it

* Send the required `X-Runway-Version` header, for example `2024-11-06`
* Use `model: act_two`
* Provide one `character` asset and one `reference` asset as accessible HTTPS URLs
* Start with `bodyControl: true` and a moderate `expressionIntensity` before tuning style

## Output ratio

| Setting | Supported values                                                                       | Default starting point | Boundary behavior                                                           |
| ------- | -------------------------------------------------------------------------------------- | ---------------------- | --------------------------------------------------------------------------- |
| `ratio` | `1280:720`, `720:1280`, or another ratio accepted by the selected Runway model/version | `1280:720`             | Keep the character and reference assets close to the requested frame shape. |

## Task flow

<Steps>
  <Step title="Submit the character-performance request">
    Create the task with your character asset, reference asset, and motion settings.
  </Step>

  <Step title="Store the returned task id">
    Keep the returned `id`, because you need it for later polling.
  </Step>

  <Step title="Poll task status">
    Continue with [Get a Runway task](./runway-to-get-task-details) until the task reaches a terminal state and provider metadata includes the finished output.
  </Step>
</Steps>

## Input roles

* `character` is the subject you want to animate
* `reference` is the source clip that provides facial performance or body motion
* `bodyControl` decides whether motion transfer includes body movement in addition to expression transfer
* `contentModeration` applies provider moderation thresholds to the request


## OpenAPI

````yaml api/openapi/video/runway/official-format/post-control-a-character.openapi.json POST /runwayml/v1/character_performance
openapi: 3.1.0
info:
  title: Control a Character API
  version: 1.0.0
  description: >-
    Create a Runway character-performance task through the official-format
    CometAPI route.
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /runwayml/v1/character_performance:
    post:
      summary: Create a Runway character-performance task
      description: >-
        Submit a character asset plus a reference performance clip and receive a
        task id for later polling.
      operationId: control_a_character
      parameters:
        - name: X-Runway-Version
          in: header
          required: true
          description: Runway version header, for example `2024-11-06`.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - character
                - reference
                - bodyControl
                - expressionIntensity
                - seed
                - model
                - ratio
                - contentModeration
              properties:
                character:
                  type: object
                  description: >-
                    The character to control. You can either provide a video or
                    an image.
                  required:
                    - type
                    - uri
                  properties:
                    type:
                      type: string
                    uri:
                      type: string
                  default:
                    type: video
                    uri: https://your-video-host/source.mp4
                reference:
                  type: object
                  description: >-
                    Reference performance clip. Provide `type` (`video`) and
                    `uri` (HTTPS URL).
                  required:
                    - type
                    - uri
                  properties:
                    type:
                      type: string
                    uri:
                      type: string
                  default:
                    type: video
                    uri: https://your-video-host/source.mp4
                bodyControl:
                  type: boolean
                  description: Enable body control.
                  default: true
                expressionIntensity:
                  type: integer
                  description: >-
                    Intensity of the expression transfer. Higher values produce
                    more exaggerated expressions.
                  default: 1
                seed:
                  type: integer
                  description: Random seed for reproducible results.
                  default: 1
                model:
                  type: string
                  description: The model variant to use. Must be act_two.
                  default: act_two
                ratio:
                  type: string
                  description: >-
                    Requested output frame shape, for example 1280:720 or
                    720:1280. Keep the character and reference assets close to
                    the requested frame shape.
                  default: '1280:720'
                contentModeration:
                  type: object
                  required:
                    - publicFigureThreshold
                  properties:
                    publicFigureThreshold:
                      type: string
                      description: >-
                        Threshold for public-figure detection. Use `auto` for
                        default behavior.
                  default:
                    publicFigureThreshold: auto
              default:
                character:
                  type: video
                  uri: https://your-video-host/source.mp4
                reference:
                  type: video
                  uri: https://your-video-host/source.mp4
                bodyControl: true
                expressionIntensity: 1
                seed: 1
                model: act_two
                ratio: '1280:720'
                contentModeration:
                  publicFigureThreshold: auto
            examples:
              Default:
                summary: Default
                value:
                  character:
                    type: video
                    uri: https://your-video-host/source.mp4
                  reference:
                    type: video
                    uri: https://your-video-host/source.mp4
                  bodyControl: true
                  expressionIntensity: 3
                  seed: 4294967295
                  model: act_two
                  ratio: '1280:720'
                  contentModeration:
                    publicFigureThreshold: auto
      responses:
        '200':
          description: Task accepted.
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                properties:
                  id:
                    type: string
                example:
                  id: 5b91e444-c232-deaf-a4d7-8aef3e57336b
      x-codeSamples:
        - lang: Shell
          label: Default
          source: |
            curl https://api.cometapi.com/runwayml/v1/character_performance \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                  "character": {
                    "type": "video",
                    "uri": "https://your-video-host/character.mp4"
                  },
                  "reference": {
                    "type": "video",
                    "uri": "https://your-video-host/performance.mp4"
                  },
                  "model": "act_two",
                  "ratio": "1280:720"
                }'
        - lang: Python
          label: Default
          source: >
            import os

            import requests


            response = requests.post(
                "https://api.cometapi.com/runwayml/v1/character_performance",
                headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
                json={
                        "character": {
                                "type": "video",
                                "uri": "https://your-video-host/character.mp4"
                        },
                        "reference": {
                                "type": "video",
                                "uri": "https://your-video-host/performance.mp4"
                        },
                        "model": "act_two",
                        "ratio": "1280:720"
                },
            )


            task = response.json()

            print(task["id"])  # poll GET /runwayml/v1/tasks/{id} until the
            output array appears
        - lang: JavaScript
          label: Default
          source: >
            const response = await
            fetch("https://api.cometapi.com/runwayml/v1/character_performance",
            {
                method: "POST",
                headers: {
                    Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
                    "Content-Type": "application/json",
                },
                body: JSON.stringify({
                        "character": {
                            "type": "video",
                            "uri": "https://your-video-host/character.mp4"
                        },
                        "reference": {
                            "type": "video",
                            "uri": "https://your-video-host/performance.mp4"
                        },
                        "model": "act_two",
                        "ratio": "1280:720"
                    }),
            });


            const task = await response.json();

            console.log(task.id); // poll GET /runwayml/v1/tasks/{id} until the
            output array appears
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication. Use your CometAPI key.

````