> 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-hosted-api-v2.md).

# Serverless Hosted API

RoboflowにデプロイされたモデルにはREST APIが用意されており、そこから画像に対して推論を実行できます。このデプロイ方法は、デプロイ先のデバイスで常時インターネット接続がある環境に最適です。

Serverless Hosted APIを使用できます：

* [Workflowsで](/roboflow/roboflow-jp/deploy/serverless-hosted-api-v2/use-in-a-workflow.md)
* [REST APIで](/roboflow/roboflow-jp/deploy/serverless-hosted-api-v2/use-with-the-rest-api.md)
* 〜と [Inference Python SDK](/roboflow/roboflow-jp/deploy/serverless-hosted-api-v2/use-with-python-sdk.md)

### Inference server

当社のServerless Hosted APIは、 [Inference Server](https://inference.roboflow.com/api/)によって提供されています。つまり、以下に示すように、当社のServerless Hosted APIとself-hostingオプションを簡単に切り替えたり、その逆を行ったりできます：

```python
from inference_sdk import InferenceHTTPClient

CLIENT = InferenceHTTPClient(
    # api_url="http://localhost:9001" # Self-hosted Inference server
    api_url="https://serverless.roboflow.com", # 当社のServerless Hosted API
    api_key="API_KEY" # プライベートなモデルやデータにアクセスするためのオプション
)

result = CLIENT.infer("image.jpg", model_id="model-id/1")
print(result)
```

### 制限

当社のServerless Hosted APIは、20MBまでのファイルアップロードをサポートしています。より高解像度の画像では制限に達する場合があります。問題が発生した場合は、enterprise supportの担当者にご連絡いただくか、以下にメッセージを投稿してください。 [forum](https://discuss.roboflow.com).

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

***

これは当社のServerless Hosted APIのV2です。以下を参照してください。 [Serverless Hosted API v1](/roboflow/roboflow-jp/deploy/serverless.md) v1（旧バージョン）のAPIドキュメント。


---

# 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-hosted-api-v2.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.
