# Python SDK와 함께 사용

Python에서 작업하는 경우, Serverless API와 상호작용하는 가장 편리한 방법은 Inference Python SDK를 사용하는 것입니다.

다음을 사용하려면 [Inference SDK](https://inference.roboflow.com/inference_helpers/inference_sdk/)를 먼저 설치하세요:

```
pip install inference-sdk
```

Serverless Hosted API에 요청을 보내려면 다음 코드를 사용하세요:

<pre class="language-python"><code class="lang-python"><strong>from inference_sdk import InferenceHTTPClient
</strong>
CLIENT = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key="API_KEY"
)

result = CLIENT.infer("image.jpg", model_id="model-id/1")
print(result)
</code></pre>

위에서 다음을 지정하세요 [model ID](https://docs.roboflow.com/developer/authentication/workspace-and-project-ids) 와 [API key](https://docs.roboflow.com/developer/authentication/find-your-roboflow-api-key). 이 코드는 모델을 실행하고 결과를 반환합니다.

#### Roboflow Instant Model

Serverless API는 Roboflow [Instant Model](/roboflow/roboflow-ko/train/roboflow-instant.md)도 실행할 수 있습니다. Instant Model은 다른 모델과 마찬가지로 실행할 수 있지만, confidence threshold가 Instant Model에서는 민감할 수 있다는 점에 유의하세요.

{% hint style="info" %}
최적의 confidence는 모델이 학습된 이미지 수에 따라 달라집니다. 최적의 confidence threshold는 보통 0.85에서 0.99 사이입니다.
{% endhint %}

```python
configuration = InferenceConfiguration(
    confidence_threshold=0.95
)
CLIENT.configure(configuration)

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


---

# Agent Instructions: 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-ko/deploy/serverless-hosted-api-v2/use-with-python-sdk.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.
