---
title: Einen File-Upload erstellen | RunAPI
description: Eine lokale Datei, eine remote HTTPS-URL oder eine Base64-Quelle hochladen
  und eine temporäre URL erhalten.
url: https://runapi.ai/de/docs/api/files/create.md
canonical: https://runapi.ai/de/docs/api/files/create
locale: de
---

> HTML-Version: https://runapi.ai/de/docs/api/files/create
> Website-Index für KI-Agenten: https://runapi.ai/llms.txt

# Einen File-Upload erstellen

Eine lokale Datei, eine remote HTTPS-URL oder eine Base64-Quelle hochladen und eine temporäre URL erhalten.

## Endpunkt

POST /api/v1/files

Basis-URL: https://runapi.ai

API-Version: v1

Authentifizierung: Authorization: Bearer YOUR_API_KEY

## Anfrage

Werte nur am angegebenen Anfrage-Speicherort senden.

### application/json - Base64 source

```json
{
  "file_name": {
    "description": "Optionaler Dateiname für den erstellten Datei-Upload.",
    "required": false,
    "type": "string"
  },
  "source": {
    "description": "Base64-kodierte Quell-Bytes.",
    "properties": {
      "data": {
        "description": "Base64-Daten",
        "required": true,
        "type": "string"
      },
      "type": {
        "description": "Wählt die base64-Quellrepräsentation aus.",
        "required": true,
        "type": "string"
      }
    },
    "required": true,
    "type": "object"
  }
}
```

### application/json - URL source

```json
{
  "file_name": {
    "description": "Optionaler Dateiname für den erstellten Datei-Upload.",
    "required": false,
    "type": "string"
  },
  "source": {
    "description": "Remote-HTTPS-Quelle zum Herunterladen.",
    "properties": {
      "type": {
        "description": "Wählt die URL-Quellrepräsentation aus.",
        "required": true,
        "type": "string"
      },
      "url": {
        "description": "Öffentliche HTTPS-URL zum Herunterladen.",
        "format": "uri",
        "required": true,
        "type": "string"
      }
    },
    "required": true,
    "type": "object"
  }
}
```

### multipart/form-data

```json
{
  "file": {
    "description": "Lokale Datei-Bytes zum Hochladen.",
    "format": "binary",
    "required": true,
    "type": "string"
  },
  "file_name": {
    "description": "Optionaler Dateiname für den erstellten Datei-Upload.",
    "required": false,
    "type": "string"
  }
}
```

## Erfolgsantwort

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"
}
```

## Fehlerantwort (401)

HTTP 401

### Antwort-Schema

```json
{
  "properties": {
    "error": {
      "description": "Für Menschen lesbare Fehlermeldung.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Antwortbeispiel

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

## Fehlerantwort (403)

HTTP 403

### Antwort-Schema

```json
{
  "properties": {
    "error": {
      "description": "Für Menschen lesbare Fehlermeldung.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Antwortbeispiel

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

## Fehlerantwort (400)

HTTP 400

### Antwort-Schema

```json
{
  "properties": {
    "error": {
      "description": "Für Menschen lesbare Fehlermeldung.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Antwortbeispiel

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

## Fehlerantwort (408)

HTTP 408

### Antwort-Schema

```json
{
  "properties": {
    "error": {
      "description": "Für Menschen lesbare Fehlermeldung.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Antwortbeispiel

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

## Fehlerantwort (413)

HTTP 413

### Antwort-Schema

```json
{
  "properties": {
    "error": {
      "description": "Für Menschen lesbare Fehlermeldung.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Antwortbeispiel

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

## Fehlerantwort (415)

HTTP 415

### Antwort-Schema

```json
{
  "properties": {
    "error": {
      "description": "Für Menschen lesbare Fehlermeldung.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Antwortbeispiel

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

## Fehlerantwort (422)

HTTP 422

### Antwort-Schema

```json
{
  "properties": {
    "error": {
      "description": "Für Menschen lesbare Fehlermeldung.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Antwortbeispiel

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

## Fehlerantwort (429)

HTTP 429

### Antwort-Schema

```json
{
  "properties": {
    "error": {
      "description": "Für Menschen lesbare Fehlermeldung.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Antwortbeispiel

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

## cURL-Beispiel



### 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"}'
```

## Verwandte Referenz

- [Dateien](https://runapi.ai/de/docs/api/files.md)
- [Datei-Upload-Objekt](https://runapi.ai/de/docs/api/files/object.md)

---

## Mehr von RunAPI

- [Startseite](https://runapi.ai/de/.md)
- [Modellkatalog](https://runapi.ai/de/models.md)
- [Preise](https://runapi.ai/de/pricing.md)
- [Anbieter](https://runapi.ai/de/models)
- [Dokumentation](https://runapi.ai/de/docs/guides)
- [SDKs](https://runapi.ai/de/sdk.md)
- [CLI](https://runapi.ai/de/cli.md)
- [MCP Server](https://runapi.ai/de/mcp.md)
- [Claude Code vs Cursor](https://runapi.ai/de/claude-code-vs-cursor.md)
- [Cursor API-Einrichtung](https://runapi.ai/de/cursor-api-setup.md)
- [RunAPI vs OpenRouter](https://runapi.ai/de/openrouter-alternative.md)
- [Enterprise](https://runapi.ai/de/contact.md)
- [Kontakt](https://runapi.ai/de/contact.md)
- [Bedingungen](https://runapi.ai/de/terms.md)
- [Datenschutz](https://runapi.ai/de/privacy.md)
- [Website-Index für KI-Agenten](https://runapi.ai/llms.txt)

Kontakt: contact@runapi.ai

## Strukturierte Daten

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "de",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/de",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/de/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "de",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/de",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/deicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "de",
    "@type": "TechArticle",
    "headline": "Einen File-Upload erstellen",
    "description": "Eine lokale Datei, eine remote HTTPS-URL oder eine Base64-Quelle hochladen und eine temporäre URL erhalten.",
    "url": "https://runapi.ai/de/docs/api/files/create",
    "mainEntityOfPage": "https://runapi.ai/de/docs/api/files/create"
  }
]
```
