---
title: Tworzenie przesyłania pliku | RunAPI
description: Prześlij jeden lokalny plik, zdalny adres URL HTTPS lub źródło base64
  i otrzymaj tymczasowy URL.
url: https://runapi.ai/pl/docs/api/files/create.md
canonical: https://runapi.ai/pl/docs/api/files/create
locale: pl
---

> Wersja HTML: https://runapi.ai/pl/docs/api/files/create
> Indeks witryny dla agentów: https://runapi.ai/llms.txt

# Tworzenie przesyłania pliku

Prześlij jeden lokalny plik, zdalny adres URL HTTPS lub źródło base64 i otrzymaj tymczasowy URL.

## Punkt końcowy

POST /api/v1/files

Bazowy URL: https://runapi.ai

Wersja API: v1

Uwierzytelnianie: Authorization: Bearer YOUR_API_KEY

## Żądanie

Wysyłaj wartości wyłącznie w podanej lokalizacji żądania.

### application/json - Base64 source

```json
{
  "file_name": {
    "description": "Opcjonalna nazwa pliku dla tworzonego przesyłania pliku.",
    "required": false,
    "type": "string"
  },
  "source": {
    "description": "Bajty źródłowe zakodowane w Base64.",
    "properties": {
      "data": {
        "description": "Dane Base64",
        "required": true,
        "type": "string"
      },
      "type": {
        "description": "Wybiera reprezentację źródła base64.",
        "required": true,
        "type": "string"
      }
    },
    "required": true,
    "type": "object"
  }
}
```

### application/json - URL source

```json
{
  "file_name": {
    "description": "Opcjonalna nazwa pliku dla tworzonego przesyłania pliku.",
    "required": false,
    "type": "string"
  },
  "source": {
    "description": "Zdalne źródło HTTPS do pobrania.",
    "properties": {
      "type": {
        "description": "Wybiera reprezentację źródła URL.",
        "required": true,
        "type": "string"
      },
      "url": {
        "description": "Publiczny adres HTTPS do pobrania.",
        "format": "uri",
        "required": true,
        "type": "string"
      }
    },
    "required": true,
    "type": "object"
  }
}
```

### multipart/form-data

```json
{
  "file": {
    "description": "Bajty lokalnego pliku do przesłania.",
    "format": "binary",
    "required": true,
    "type": "string"
  },
  "file_name": {
    "description": "Opcjonalna nazwa pliku dla tworzonego przesyłania pliku.",
    "required": false,
    "type": "string"
  }
}
```

## Odpowiedź sukcesu

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

## Odpowiedź błędu (401)

HTTP 401

### Schemat odpowiedzi

```json
{
  "properties": {
    "error": {
      "description": "Czytelny dla człowieka komunikat o błędzie.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Przykład odpowiedzi

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

## Odpowiedź błędu (403)

HTTP 403

### Schemat odpowiedzi

```json
{
  "properties": {
    "error": {
      "description": "Czytelny dla człowieka komunikat o błędzie.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Przykład odpowiedzi

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

## Odpowiedź błędu (400)

HTTP 400

### Schemat odpowiedzi

```json
{
  "properties": {
    "error": {
      "description": "Czytelny dla człowieka komunikat o błędzie.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Przykład odpowiedzi

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

## Odpowiedź błędu (408)

HTTP 408

### Schemat odpowiedzi

```json
{
  "properties": {
    "error": {
      "description": "Czytelny dla człowieka komunikat o błędzie.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Przykład odpowiedzi

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

## Odpowiedź błędu (413)

HTTP 413

### Schemat odpowiedzi

```json
{
  "properties": {
    "error": {
      "description": "Czytelny dla człowieka komunikat o błędzie.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Przykład odpowiedzi

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

## Odpowiedź błędu (415)

HTTP 415

### Schemat odpowiedzi

```json
{
  "properties": {
    "error": {
      "description": "Czytelny dla człowieka komunikat o błędzie.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Przykład odpowiedzi

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

## Odpowiedź błędu (422)

HTTP 422

### Schemat odpowiedzi

```json
{
  "properties": {
    "error": {
      "description": "Czytelny dla człowieka komunikat o błędzie.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Przykład odpowiedzi

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

## Odpowiedź błędu (429)

HTTP 429

### Schemat odpowiedzi

```json
{
  "properties": {
    "error": {
      "description": "Czytelny dla człowieka komunikat o błędzie.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Przykład odpowiedzi

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

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

## Powiązane materiały referencyjne

- [Pliki (Files)](https://runapi.ai/pl/docs/api/files.md)
- [Obiekt File Upload](https://runapi.ai/pl/docs/api/files/object.md)

---

## Więcej od RunAPI

- [Strona główna](https://runapi.ai/pl/.md)
- [Katalog modeli](https://runapi.ai/pl/models.md)
- [Cennik](https://runapi.ai/pl/pricing.md)
- [Dostawcy](https://runapi.ai/pl/models)
- [Dokumentacja](https://runapi.ai/pl/docs/guides)
- [SDK](https://runapi.ai/pl/sdk.md)
- [CLI](https://runapi.ai/pl/cli.md)
- [Serwer MCP](https://runapi.ai/pl/mcp.md)
- [Claude Code vs Cursor](https://runapi.ai/pl/claude-code-vs-cursor.md)
- [Konfiguracja Cursor API](https://runapi.ai/pl/cursor-api-setup.md)
- [RunAPI vs OpenRouter](https://runapi.ai/pl/openrouter-alternative.md)
- [Enterprise](https://runapi.ai/pl/contact.md)
- [Kontakt](https://runapi.ai/pl/contact.md)
- [Regulamin](https://runapi.ai/pl/terms.md)
- [Prywatność](https://runapi.ai/pl/privacy.md)
- [Indeks witryny dla agentów](https://runapi.ai/llms.txt)

Kontakt: contact@runapi.ai

## Dane strukturalne

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "pl",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/pl",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/pl/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "pl",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/pl",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/plicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "pl",
    "@type": "TechArticle",
    "headline": "Tworzenie przesyłania pliku",
    "description": "Prześlij jeden lokalny plik, zdalny adres URL HTTPS lub źródło base64 i otrzymaj tymczasowy URL.",
    "url": "https://runapi.ai/pl/docs/api/files/create",
    "mainEntityOfPage": "https://runapi.ai/pl/docs/api/files/create"
  }
]
```
