---
title: ファイルのコンテンツを取得する | RunAPI
description: 保存されたFileの正確なバイト列をストリームします。
url: https://runapi.ai/ja/docs/api/protocol/files/content.md
canonical: https://runapi.ai/ja/docs/api/protocol/files/content
locale: ja
---

> HTML 版: https://runapi.ai/ja/docs/api/protocol/files/content
> エージェント向けサイトインデックス: https://runapi.ai/llms.txt

# ファイルのコンテンツを取得する

保存されたFileの正確なバイト列をストリームします。

## エンドポイント

GET /v1/files/:file_id/content

ベースURL: https://runapi.ai

API バージョン: v1

認証: Authorization: Bearer YOUR_API_KEY

## リクエスト

指定されたリクエストの場所にのみ値を送信してください。

### パスパラメータ

```json
{
  "file_id": {
    "description": "RunAPIのファイルID。",
    "required": true,
    "type": "string"
  }
}
```

## 成功レスポンス

HTTP 200 - GET /v1/files/:file_id/content

```json
"binary File content"
```

## エラーレスポンス (401)

HTTP 401

### レスポンススキーマ

```json
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}
```

### レスポンス例

```json
{
  "error": {
    "code": "authentication_error",
    "message": "Missing API key",
    "param": null,
    "type": "authentication_error"
  }
}
```

## エラーレスポンス (404)

HTTP 404

### レスポンススキーマ

```json
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}
```

### レスポンス例

```json
{
  "error": {
    "code": "not_found",
    "message": "File not found",
    "param": null,
    "type": "invalid_request_error"
  }
}
```

## エラーレスポンス (502)

HTTP 502

### レスポンススキーマ

```json
{
  "additionalProperties": true,
  "properties": {
    "error": {
      "additionalProperties": true,
      "properties": {
        "code": {
          "type": [
            "string",
            "null"
          ]
        },
        "message": {
          "type": "string"
        },
        "param": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "message",
        "type"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "type": "object"
}
```

### レスポンス例

```json
{
  "error": {
    "code": "storage_write_failed",
    "message": "File storage failed",
    "param": null,
    "type": "server_error"
  }
}
```

## cURLの例



### curl

```curl
curl -X GET https://runapi.ai/v1/files/file_abc123/content \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

## 関連リファレンス

- [永続ファイル](https://runapi.ai/ja/docs/api/protocol/files.md)
- [Fileオブジェクト](https://runapi.ai/ja/docs/api/protocol/files/object.md)

---

## RunAPI のその他の情報

- [ホーム](https://runapi.ai/ja/.md)
- [モデルカタログ](https://runapi.ai/ja/models.md)
- [料金](https://runapi.ai/ja/pricing.md)
- [プロバイダー](https://runapi.ai/ja/models)
- [ドキュメント](https://runapi.ai/ja/docs/guides)
- [SDK](https://runapi.ai/ja/sdk.md)
- [CLI](https://runapi.ai/ja/cli.md)
- [MCP Server](https://runapi.ai/ja/mcp.md)
- [Claude Code と Cursor](https://runapi.ai/ja/claude-code-vs-cursor.md)
- [Cursor API セットアップ](https://runapi.ai/ja/cursor-api-setup.md)
- [RunAPI と OpenRouter の比較](https://runapi.ai/ja/openrouter-alternative.md)
- [エンタープライズ](https://runapi.ai/ja/contact.md)
- [お問い合わせ](https://runapi.ai/ja/contact.md)
- [利用規約](https://runapi.ai/ja/terms.md)
- [プライバシー](https://runapi.ai/ja/privacy.md)
- [エージェント向けサイトインデックス](https://runapi.ai/llms.txt)

お問い合わせ: contact@runapi.ai

## 構造化データ

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "ja",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/ja",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/ja/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "ja",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/ja",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/jaicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "ja",
    "@type": "TechArticle",
    "headline": "ファイルのコンテンツを取得する",
    "description": "保存されたFileの正確なバイト列をストリームします。",
    "url": "https://runapi.ai/ja/docs/api/protocol/files/content",
    "mainEntityOfPage": "https://runapi.ai/ja/docs/api/protocol/files/content"
  }
]
```
