> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/roboflow/roboflow-jp/deploy/serverless.md).

# (Legacy) Serverless Hosted API

{% hint style="info" %}
私たちは **推奨します** 当社の Serverless Hosted API の V2 の使用を推奨します。V2 API の方が高速です。\
\
[新しい API を始めるには、Serverless Hosted API V2 のドキュメントを参照してください。](/roboflow/roboflow-jp/deploy/serverless-hosted-api-v2.md)
{% endhint %}

## モデル対応

{% hint style="warning" %}
より新しいモデルアーキテクチャ（Florence-2、SAM 3 など）は、Serverless Hosted API V2 でのみ利用できます。クレジットベースのプランに移行していない従来のワークスペースでは、次の `402` これらのモデルを使用しようとするとエラーが発生します。 [プランをアップグレードしてください](/roboflow/roboflow-jp/billing/plans/purchase-a-plan.md) を通じて、サポートされているモデルの全セットにアクセスするには [Serverless Hosted API V2](/roboflow/roboflow-jp/deploy/serverless-hosted-api-v2.md).
{% endhint %}

Serverless Hosted API (v1) でサポートされているモデルタイプは次のとおりです:

| タスクタイプ                                                                                                     | Hosted API (v1) でサポート |
| ---------------------------------------------------------------------------------------------------------- | --------------------- |
| [Object Detection](/roboflow/roboflow-jp/deploy/serverless/object-detection.md)                            | ✅                     |
| [分類](/roboflow/roboflow-jp/deploy/serverless/classification.md)                                            | ✅                     |
| [インスタンスセグメンテーション](/roboflow/roboflow-jp/deploy/serverless/instance-segmentation.md)                        | ✅                     |
| [セマンティックセグメンテーション](/roboflow/roboflow-jp/deploy/serverless/instance-segmentation/semantic-segmentation.md) | ✅                     |
| [キーポイント検出](/roboflow/roboflow-jp/deploy/serverless/keypoint-detection.md)                                  | ✅                     |

## レイテンシ比較（v1 vs v2）

Serverless Hosted API に送信されたリクエストのエンドツーエンドレイテンシはいくつかの要因に左右されます:

1. モデルアーキテクチャ。実行時間に影響します
2. 画像のサイズと解像度。アップロード時間と、実行中のモデル推論時間に影響します
3. ネットワークのレイテンシと帯域幅。リクエストのアップロード時間とレスポンスのダウンロード時間に影響します。
4. サービスのサブスクリプション状況や、特定の時点における他のユーザーによる利用状況。これによりキュー待ちのレイテンシが発生する場合があります

<figure><img src="/files/a511a8f4156e5a364f5cc295a0031c1c08dc1363" alt=""><figcaption></figcaption></figure>

下の表では、v1 と v2 の Serverless Hosted API の代表的なベンチマークをいくつか示しています。ここでは、エンドツーエンドレイテンシ（E2E）と実行時間（Exec）の両方を示しています。これらの数値は参考情報であり、以下を使用して独自にベンチマークを実施することを推奨します [当社の推論ベンチマークツール](https://inference.roboflow.com/inference_helpers/cli_commands/benchmark/) または独自のカスタムベンチマーク。

<table><thead><tr><th width="176.14410400390625">モデル</th><th>V2 (E2E)</th><th>V2 (Exec)</th><th>V1 (E2E)</th><th>V1 (Exec)</th></tr></thead><tbody><tr><td>yolov8x-640</td><td>401 ms</td><td>29 ms</td><td>4084 ms</td><td>821 ms</td></tr><tr><td>yolov8m-640</td><td>757 ms</td><td>21 ms</td><td>572 ms</td><td>265 ms</td></tr><tr><td>yolov8n-640</td><td>384 ms</td><td>17 ms</td><td>312 ms</td><td>63 ms</td></tr><tr><td>yolov8x-1280</td><td>483 ms</td><td>97 ms</td><td>6431 ms</td><td>3032 ms</td></tr><tr><td>yolov8m-1280</td><td>416 ms</td><td>52 ms</td><td>1841 ms</td><td>1006 ms</td></tr><tr><td>yolov8n-1280</td><td>428 ms</td><td>35 ms</td><td>464 ms</td><td>157 ms</td></tr></tbody></table>

ユーザーの皆様には、自身のモデル推論とワークフローについて独自にベンチマークを実施し、特定のユースケースにおける実際の指標を把握することを推奨します。

## 制限

Serverless Hosted API (v1) は、具体的なタスクタイプにかかわらず、最大 5MB までのファイルを受け付けます。この制限には、画像ファイルサイズおよび添付されたリクエスト情報が含まれますが、これらに限定されません。

{% hint style="info" %}
リクエストが大きすぎる場合は、添付画像のサイズを小さくすることを推奨します。画像はサーバーに受信された後、モデルアーキテクチャが受け付ける入力サイズまでいずれにせよ縮小されるため、通常、性能低下につながることはありません。\
\
Python SDK など一部の SDK では、API に送信される前に、画像をモデルアーキテクチャの入力サイズへ自動的に縮小します。
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.roboflow.com/roboflow/roboflow-jp/deploy/serverless.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
