> ## Documentation Index
> Fetch the complete documentation index at: https://docs.olostep.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ファイルアップロードの作成

> JSONファイルをアップロードするための事前署名付きURLを生成します。アップロード後、アップロードを完了するために[完了エンドポイント](/api-reference/files/complete)を呼び出す必要があります。



## OpenAPI

````yaml ja/openapi/files.json POST /v1/files
openapi: 3.0.3
info:
  title: ファイル API
  version: 1.0.0
servers:
  - url: https://api.olostep.com
security: []
paths:
  /v1/files:
    post:
      summary: ファイルアップロードの作成
      description: >-
        JSONファイルをアップロードするための事前署名付きURLを生成します。アップロード後、アップロードを完了するためにcompleteエンドポイントを呼び出す必要があります。アップロードURLは10分で期限切れになります。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                  description: ファイルのファイル名。拡張子は.jsonで終わる必要があります。
                  pattern: \.json$
                purpose:
                  type: string
                  description: >-
                    ファイルの目的。サポートされている値: 'context' または 'batch'。デフォルトは 'context'
                    です。
                  enum:
                    - context
                    - batch
                  default: context
              required:
                - filename
      responses:
        '200':
          description: アップロードURLを含む成功したレスポンス。
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: ファイルID
                  object:
                    type: string
                    description: オブジェクトの種類。このエンドポイントでは "file.upload"。
                  created:
                    type: integer
                    description: 作成されたエポックタイムスタンプ
                  upload_url:
                    type: string
                    format: uri
                    description: ファイルをアップロードするための事前署名付きURL。10分で期限切れになります。
                  expires_in:
                    type: integer
                    description: アップロードURLが期限切れになるまでの秒数（600秒 = 10分）
        '400':
          description: 不正なリクエスト。ファイル名がないか、無効なファイルタイプ（.jsonファイルのみサポート）。
        '401':
          description: 無効なAPIキー
        '500':
          description: 内部サーバーエラー
      security:
        - Authorization: []
components:
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer
      description: Bearer <token>形式のBearer認証ヘッダー。<token>はあなたの認証トークンです。

````