---
title: "Upload Media"
method: POST
path: "/media/upload"
tags: ["Write Actions"]
---

# Upload Media

`POST /media/upload`

## Request

- Base URL: `https://api.twitterapis.com/twitter`
- URL: `https://api.twitterapis.com/twitter/media/upload`
- Auth: HTTP bearer

Upload a base64-encoded image as the authenticated account and receive a media_id you can attach when creating a tweet. Runs as your own logged-in account. Billed at $0.0008 per call. Cost: $0.0008 per call.

## Request body

- object
  - `media_data` string, required: Base64-encoded image bytes, sent in the JSON request body.

## Response `200`

Upload an image and get a media_id to attach to a tweet.

- object
  - `ok` boolean: True when the upload succeeded (media_id is present).
  - `media_id` string: The uploaded media's ID; pass it to tweet/create to attach the image.

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `402`: Insufficient credits
- `403`: Forbidden
- `404`: Not found
- `429`: Rate limited
- `5XX`: Server error

---

[API](https://skmtc.dev/twitterapis/apis/twitterapis-api.md) · [All operations](https://skmtc.dev/twitterapis/apis/twitterapis-api/llms.txt) · [OpenAPI document](https://skmtc.dev/twitterapis/apis/twitterapis-api/revisions/a33ce0fedb3c?raw)
