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

> ## Agent Instructions
> Call https://api.feyn.ai only; the hosts behind it are not public.
> Authenticate with a workspace API key in the Authorization header: `Authorization: Bearer fn_...`. Keep keys server-side.
> For chat completions, use the official OpenAI SDK with base_url https://api.feyn.ai/v1 and a model ID from GET /v1/models.
> On 429, wait for the Retry-After header before retrying. Failed requests are not charged.

# Cut out an object with MultiMatte

> Send a base64 photo and name the object to keep; get a transparent PNG back. Also served at `/multimatte/v1/cutout`.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/cutout
openapi: 3.1.0
info:
  title: Feyn API
  version: 1.0.0
  description: Fine-tuned models, chat completions, traces and scores on api.feyn.ai.
servers:
  - url: https://api.feyn.ai
security:
  - bearerAuth: []
paths:
  /v1/cutout:
    post:
      summary: Cut out an object with MultiMatte
      description: >-
        Send a base64 photo and name the object to keep; get a transparent PNG
        back. Also served at `/multimatte/v1/cutout`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - image_base64
              properties:
                model:
                  type: string
                  description: >-
                    `multimatte`. Optional while MultiMatte is the only cutout
                    model.
                  example: multimatte
                image_base64:
                  type: string
                  description: >-
                    JPEG, PNG, WebP or HEIC, base64-encoded. Up to 5 MB before
                    encoding; sides over 2048 px are downscaled.
                prompt:
                  type: string
                  description: The object to keep. Defaults to the main foreground subject.
                  example: the dog
      responses:
        '200':
          description: An RGBA PNG at the input size (after any downscale).
          headers:
            X-Feyn-Inference-Ms:
              schema:
                type: string
              description: Model time in milliseconds.
            X-Feyn-Prompt:
              schema:
                type: string
              description: The prompt used, percent-encoded.
          content:
            image/png:
              schema:
                type: string
                format: binary
        '401':
          $ref: '#/components/responses/Error'
        '402':
          $ref: '#/components/responses/Error'
        '413':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/Error'
        '429':
          $ref: '#/components/responses/Error'
        '503':
          $ref: '#/components/responses/Error'
components:
  responses:
    Error:
      description: An error. See the errors guide for each status.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              enum:
                - invalid_request_error
                - auth_error
                - billing_error
                - permission_error
                - rate_limit_error
                - api_error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A workspace API key (`fn_...`).

````

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