> 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).

# （旧）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 でのみ利用できます。クレジットベースのプランに移行していないレガシーの Workspaces では、 `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) でサポート |
| ---------------------------------------------------------------------------------------------------------- | --------------------- |
| [物体検出](/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 と 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
