---
title: Creare un File Upload | RunAPI
description: Carica un file locale, un URL HTTPS remoto o una sorgente base64 e ricevi
  un URL temporaneo.
url: https://runapi.ai/it/docs/api/files/create.md
canonical: https://runapi.ai/it/docs/api/files/create
locale: it
---

> Versione HTML: https://runapi.ai/it/docs/api/files/create
> Indice del sito per gli agenti: https://runapi.ai/llms.txt

# Creare un File Upload

Carica un file locale, un URL HTTPS remoto o una sorgente base64 e ricevi un URL temporaneo.

## Endpoint

POST /api/v1/files

URL di base: https://runapi.ai

Versione API: v1

Autenticazione: Authorization: Bearer YOUR_API_KEY

## Richiesta

Invia i valori solo nella posizione di richiesta elencata.

### application/json - Base64 source

```json
{
  "file_name": {
    "description": "Nome file opzionale per il File Upload creato.",
    "required": false,
    "type": "string"
  },
  "source": {
    "description": "Byte sorgente codificati in Base64.",
    "properties": {
      "data": {
        "description": "Dati Base64",
        "required": true,
        "type": "string"
      },
      "type": {
        "description": "Seleziona la rappresentazione sorgente base64.",
        "required": true,
        "type": "string"
      }
    },
    "required": true,
    "type": "object"
  }
}
```

### application/json - URL source

```json
{
  "file_name": {
    "description": "Nome file opzionale per il File Upload creato.",
    "required": false,
    "type": "string"
  },
  "source": {
    "description": "Sorgente HTTPS remota da scaricare.",
    "properties": {
      "type": {
        "description": "Seleziona la rappresentazione sorgente tramite URL.",
        "required": true,
        "type": "string"
      },
      "url": {
        "description": "URL HTTPS pubblico da scaricare.",
        "format": "uri",
        "required": true,
        "type": "string"
      }
    },
    "required": true,
    "type": "object"
  }
}
```

### multipart/form-data

```json
{
  "file": {
    "description": "Byte del file locale da caricare.",
    "format": "binary",
    "required": true,
    "type": "string"
  },
  "file_name": {
    "description": "Nome file opzionale per il File Upload creato.",
    "required": false,
    "type": "string"
  }
}
```

## Risposta di successo

HTTP 201 - POST /api/v1/files

```json
{
  "created_at": "2026-07-27T10:00:00.000Z",
  "expires_at": "2026-07-27T11:00:00.000Z",
  "file_name": "mask.png",
  "mime_type": "image/png",
  "size_bytes": 204800,
  "url": "https://file.runapi.ai/temp/user-uploads/mask.png"
}
```

## Risposta di errore (401)

HTTP 401

### Schema della risposta

```json
{
  "properties": {
    "error": {
      "description": "Messaggio di errore leggibile.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Esempio di risposta

```json
{
  "error": "Authentication required"
}
```

## Risposta di errore (403)

HTTP 403

### Schema della risposta

```json
{
  "properties": {
    "error": {
      "description": "Messaggio di errore leggibile.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Esempio di risposta

```json
{
  "error": "Standard API key required"
}
```

## Risposta di errore (400)

HTTP 400

### Schema della risposta

```json
{
  "properties": {
    "error": {
      "description": "Messaggio di errore leggibile.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Esempio di risposta

```json
{
  "error": "Only HTTPS URLs are allowed"
}
```

## Risposta di errore (408)

HTTP 408

### Schema della risposta

```json
{
  "properties": {
    "error": {
      "description": "Messaggio di errore leggibile.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Esempio di risposta

```json
{
  "error": "Download timeout"
}
```

## Risposta di errore (413)

HTTP 413

### Schema della risposta

```json
{
  "properties": {
    "error": {
      "description": "Messaggio di errore leggibile.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Esempio di risposta

```json
{
  "error": "File size exceeds the maximum allowed size"
}
```

## Risposta di errore (415)

HTTP 415

### Schema della risposta

```json
{
  "properties": {
    "error": {
      "description": "Messaggio di errore leggibile.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Esempio di risposta

```json
{
  "error": "This content type is not supported"
}
```

## Risposta di errore (422)

HTTP 422

### Schema della risposta

```json
{
  "properties": {
    "error": {
      "description": "Messaggio di errore leggibile.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Esempio di risposta

```json
{
  "error": "File upload failed. Please try again."
}
```

## Risposta di errore (429)

HTTP 429

### Schema della risposta

```json
{
  "properties": {
    "error": {
      "description": "Messaggio di errore leggibile.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Esempio di risposta

```json
{
  "error": "Too many file uploads for this account. Please retry later."
}
```

## Esempio cURL



### curl

```curl
curl -X POST https://runapi.ai/api/v1/files \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"source":{"type":"url","url":"https://cdn.runapi.ai/public/samples/mask.png"},"file_name":"mask.png"}'
```

## Riferimento correlato

- [File](https://runapi.ai/it/docs/api/files.md)
- [Oggetto File Upload](https://runapi.ai/it/docs/api/files/object.md)

---

## Altre risorse di RunAPI

- [Home](https://runapi.ai/it/.md)
- [Catalogo dei modelli](https://runapi.ai/it/models.md)
- [Prezzi](https://runapi.ai/it/pricing.md)
- [Fornitori](https://runapi.ai/it/models)
- [Documentazione](https://runapi.ai/it/docs/guides)
- [SDK](https://runapi.ai/it/sdk.md)
- [CLI](https://runapi.ai/it/cli.md)
- [MCP Server](https://runapi.ai/it/mcp.md)
- [Claude Code vs Cursor](https://runapi.ai/it/claude-code-vs-cursor.md)
- [Configurazione Cursor API](https://runapi.ai/it/cursor-api-setup.md)
- [RunAPI vs OpenRouter](https://runapi.ai/it/openrouter-alternative.md)
- [Enterprise](https://runapi.ai/it/contact.md)
- [Contatti](https://runapi.ai/it/contact.md)
- [Termini](https://runapi.ai/it/terms.md)
- [Privacy](https://runapi.ai/it/privacy.md)
- [Indice del sito per gli agenti](https://runapi.ai/llms.txt)

Contatti: contact@runapi.ai

## Dati strutturati

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "it",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/it",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/it/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "it",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/it",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/iticon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "it",
    "@type": "TechArticle",
    "headline": "Creare un File Upload",
    "description": "Carica un file locale, un URL HTTPS remoto o una sorgente base64 e ricevi un URL temporaneo.",
    "url": "https://runapi.ai/it/docs/api/files/create",
    "mainEntityOfPage": "https://runapi.ai/it/docs/api/files/create"
  }
]
```
