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

# Upload media

> Upload media to twitter.You must set the login_cookie.You can get the login_cookie from /twitter/user_login_v2.Trial operation price: $0.003 per call. 



## OpenAPI

````yaml POST /twitter/upload_media_v2
openapi: 3.0.1
info:
  title: TwitterAPI.io the most stable/fastest/cheapest twitter api.
  description: Provide the most stable/fastest/cheapest twitter api.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.twitterapi.io
security:
  - ApiKeyAuth: []
paths:
  /twitter/upload_media_v2:
    post:
      description: >-
        Upload media to twitter.You must set the login_cookie.You can get the
        login_cookie from /twitter/user_login_v2.Trial operation price: $0.003
        per call. 
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - login_cookies
                - proxy
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: The media file to upload (image, video, etc.)
                proxy:
                  type: string
                  description: >-
                    The proxy to use.Please use high-quality residential proxies
                    and avoid free proxies. Required. Example:
                    http://username:password@ip:port . You can get proxy from:
                    https://www.webshare.io/?referral_code=4e0q1n00a504
                login_cookies:
                  type: string
                  description: >-
                    The login cookies of the user. You can get the login_cookie
                    from /twitter/user_login_v2. Optional for media upload,
                    required for posting tweets
                is_long_video:
                  type: boolean
                  description: >-
                    If this is True, videos longer than 2:20 can be
                    uploaded.(Twitter Premium only)
      responses:
        '200':
          description: Upload media response
          content:
            application/json:
              schema:
                type: object
                properties:
                  media_id:
                    type: string
                    description: The id of the uploaded media.
                  status:
                    type: string
                    description: Status of the request.success or error
                  msg:
                    type: string
                    description: Message of the request.error message
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````