# Upload file

URL: https://clippie.ai/developers/docs/upload-file

Imports an image, video or audio file from a public https URL (up to 100 MB) so other tools can use it as fileId. REST callers can also send the file itself as multipart/form-data (field "file").

## At a glance

| Property | Value |
| --- | --- |
| REST | `POST https://api.clippie.ai/v1/files` |
| MCP tool | `upload_file` |
| Scope | `create` |
| Cost | Spends nothing. Needs the `create` scope. |
| Upload | Also takes `multipart/form-data` with the file in `file`, up to 100 MB. |

## Parameters

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `url` | body | string (URL) | No |  | Public https URL of the file to import. Up to 2048 chars. |
| `name` | body | string | No |  | File name to keep, e.g. "intro.mp4". Up to 120 chars. |

## Example

curl:

```bash
curl https://api.clippie.ai/v1/files \
  -H "Authorization: Bearer $CLIPPIE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/photo.jpg",
    "name": "photo.jpg"
  }'
```

upload-file.mjs:

```js
const auth = { Authorization: `Bearer ${process.env.CLIPPIE_API_KEY}` };

const res = await fetch('https://api.clippie.ai/v1/files', {
  method: 'POST',
  headers: { ...auth, 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "url": "https://example.com/photo.jpg",
    "name": "photo.jpg"
  }),
});
if (!res.ok) throw new Error((await res.json()).error.message);
console.log(await res.json());
```

## Response

`200` with JSON. The full response schema is in the [OpenAPI spec](https://api.clippie.ai/v1/openapi.json).

## From an MCP client

Your AI calls `upload_file` with the same fields as JSON arguments. See [MCP server](https://clippie.ai/developers/docs.md#mcp) to connect one.

tools/call:

```json
{
  "name": "upload_file",
  "arguments": {
    "url": "https://example.com/photo.jpg",
    "name": "photo.jpg"
  }
}
```
