---
title: "Create a file upload"
method: POST
path: "/v1/files"
tags: ["files"]
---

# Create a file upload

`POST /v1/files`

## Request

- Base URL: `https://api.olostep.com`
- URL: `https://api.olostep.com/v1/files`
- Auth: HTTP bearer

Generates a pre-signed URL for uploading a JSON file. Upload the file to that URL, then call the complete endpoint to finalize it. The upload URL expires in 10 minutes.

## Request body

- object
  - `filename` string, required: The filename for the file. Must end with a .json extension.
  - `purpose` 'context' | 'batch': The purpose of the file. Supported values: 'context' or 'batch'.

## Response `200`

Default Response

- object: A pre-signed upload URL. Expires in 10 minutes.
  - `id` string, required
  - `object` string, required
  - `created` integer, required
  - `upload_url` string, uri, required
  - `expires_in` integer, required

## Other responses

- `400`: Default Response
- `401`: Default Response
- `429`: Default Response
- `502`: Default Response
- `504`: Default Response

---

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