> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloud.vessl.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 첫 요청 보내기

> 기존에 쓰던 SDK에서 base URL, API Key, 모델 ID만 바꿔 Provisioned Throughput 엔드포인트를 호출하는 방법을 안내해요.

엔드포인트는 **OpenAI Chat Completions API**, <strong>Anthropic Messages API</strong>와 호환돼요. 기존에 쓰던 SDK를 그대로 두고 base URL과 API Key를 바꾼 다음, `model` 필드에 모델 ID를 넣으면 돼요.

## 시작하기 전에

* 활성화된 계약이 필요해요. 모델 페이지의 <strong>Deploy options</strong> 카드에 <strong>Provisioned capacity is live</strong>가 표시돼요. [계약 관리하기](/ko/inference/contracts)를 참고하세요.
* 계약 시작 시 발급된 API Key가 필요해요. PoC(Proof of Concept) 기간에는 샘플 키를 사용해요.
* 모델 페이지에서 복사한 모델 ID가 필요해요. [모델 살펴보기](/ko/inference/models)를 참고하세요.

## 엔드포인트

|              |                                                            |
| ------------ | ---------------------------------------------------------- |
| **Base URL** | `https://inference.cloud.vessl.ai/v1`                      |
| **인증**       | bearer 토큰으로 보내는 API Key(`Authorization: Bearer <api-key>`) |
| **모델**       | 모델 페이지에서 모델 이름 옆에 표시되는 모델 ID                               |

## 요청 예시

먼저 API Key를 `VESSL_API_KEY` 환경 변수로 설정하세요.

```bash theme={null}
export VESSL_API_KEY="<api-key>"
```

<CodeGroup>
  ```bash cURL theme={null}
  curl https://inference.cloud.vessl.ai/v1/chat/completions \
    -H "Authorization: Bearer $VESSL_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "<model-id>",
      "messages": [
        {"role": "user", "content": "Hello! Who are you?"}
      ]
    }'
  ```

  ```python Python theme={null}
  import json
  import os
  import urllib.request

  request = urllib.request.Request(
      "https://inference.cloud.vessl.ai/v1/chat/completions",
      method="POST",
      headers={
          "Authorization": f"Bearer {os.environ['VESSL_API_KEY']}",
          "Content-Type": "application/json",
      },
      data=json.dumps({
          "model": "<model-id>",
          "messages": [
              {"role": "user", "content": "Hello! Who are you?"},
          ],
      }).encode(),
  )

  with urllib.request.urlopen(request, timeout=120) as response:
      body = json.load(response)

  print(body["choices"][0]["message"]["content"])
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch("https://inference.cloud.vessl.ai/v1/chat/completions", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.VESSL_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model: "<model-id>",
      messages: [
        { role: "user", content: "Hello! Who are you?" },
      ],
    }),
  });

  if (!response.ok) {
    throw new Error(`Request failed: ${response.status} ${await response.text()}`);
  }

  const body = await response.json();
  console.log(body.choices[0].message.content);
  ```
</CodeGroup>

<Tip>
  모델 페이지에서 <strong>Get started</strong>를 클릭하면 위와 같은 요청이 해당 모델의 ID가 채워진 채로 열려요.
</Tip>

## 대시보드 확인하기

엔드포인트로 트래픽이 들어오면 모델 페이지의 <strong>Usage summary</strong>에 토큰 사용량과 비용이 표시되고, <strong>Monitoring Dashboard</strong>에서 토큰 사용량, 성능, 안정성을 확인할 수 있어요. [인퍼런스 상태 모니터링하기](/ko/inference/monitor-usage)를 참고하세요.
