> For the complete documentation index, see [llms.txt](https://docs.cloudeka.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudeka.ai/deka-gpu-documentations/panduan-untuk-enterprise/deka-llm/how-to-create-simple-prompt-with-deka-llm/post-chat-completions.md).

# Kirim Chat Completions

Setelah memastikan model yang dipilih sesuai dengan model saat membuat **Deka LLM** di **Service Portal Cloudeka**, kirim permintaan ke [**https://dekallm.cloudeka.ai/v1/chat/completions**](https://dekallm.cloudeka.ai/v1/chat/completions) berdasarkan input Anda. Pada **Deka LLM API** yang diimpor ke **Postman**, pilih **Chat Completions**.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe1oZwOxZxBSwJCslTBovp7wyJ1XExb6QQV2l8kAEH3A4h4SPRd9rdq1ehI41SI23eYqm3Kh49RcabdS0Y5kMfQMdqoiyM_QGm36x8mDLHn9obTd2cg3uXk_etZVhivbirwMA5a?key=GS8CzK7EJ_o4WD1SQATjJA" alt=""><figcaption></figcaption></figure>

Pada tab **Authorization**, pilih **Auth Type: Bearer Token**. Masukkan **Secret Key** yang diperoleh dari bagian [**Dapatkan Secret Key**](/deka-gpu-documentations/panduan-untuk-enterprise/deka-llm/how-to-create-simple-prompt-with-deka-llm/get-secret-key.md) ke kolom **Token**.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc6bjjvYedMEXMGiNy__WZ1O0EDveACjrdZd4px3outJv6SHFwBTp1XdDbUs10rGgm-_cSUdloU2K-teN6m6XuVPwFZ0yTxu4dbQfxTNZ68kkyLc_ZPq5LAX_d66Gb9Ev3BRovS?key=GS8CzK7EJ_o4WD1SQATjJA" alt=""><figcaption></figcaption></figure>

Pada kolom **{{baseurl}}**, ganti nilainya dengan **Deka LLM API URL** [**https://dekallm.cloudeka.ai/**](https://dekallm.cloudeka.ai/). Kemudian, hapus **?model=\<string>** dari URL permintaan.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdbX6_oXaHeNfnrIj17AqZYQcC57KS39fBT0PeqRO9TgUok3Vgtm3waCuy_-WVaM-aDa2s0nrn320iTQ3SDh-8MjC2X2Rf2KqHc6R5-ks5dhFtj1pUIX6lZKTg4SNAVJHlBXTDHjQ?key=GS8CzK7EJ_o4WD1SQATjJA" alt=""><figcaption></figcaption></figure>

Pada tab **Body**, pilih **raw**.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXddqC5cNBS-QMS62OlZc6c3NBg5M4ct-6AXQ7K34VB-TfNh8KRueXf9MfUaZ3PDA3m_-vydQ3yY8FSvBK7dbCnogdpQ2jYEXKLND-_hr001bGjdcNtiegNBihYby2BJRaU7En0vpg?key=GS8CzK7EJ_o4WD1SQATjJA" alt=""><figcaption></figcaption></figure>

Salin sintaks berikut ke kolom input **raw**.

```json
{
    "model": "qwen/qwen2-vl-72b-instruct", 
    "messages": [
        {
            "role": "system",
            "content": "You are a story teller"
        },
        {
            "role": "user",
            "content": "Write a poem about Frodo's journey"
        }
    ],
    "stream": false,
    "temperature": 0.9,
    "top_p": 1
}
```

Penjelasan sintaks:

```json
"model": "qwen/qwen2-vl-72b-instruct", 
```

Kolom ini menentukan model yang digunakan. Pastikan nilainya sesuai dengan model yang dipilih pada bagian [**Dapatkan Model**](/deka-gpu-documentations/panduan-untuk-enterprise/deka-llm/how-to-create-simple-prompt-with-deka-llm/get-model.md).

```json
    "messages": [
        {
            "role": "system",
            "content": "You are a story teller"
        },
        {
            "role": "user",
            "content": "Write a poem about Frodo's journey"
        }
    ], 
```

Bagian ini berisi daftar pesan dalam **percakapan LLM**. Pesan tersebut memberi konteks kepada model melalui perannya dan instruksi Anda.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXffKO5UfLjGVmZwfn82TcnrBzty0XBCtW9DLJndCsJyGprXcAXYWz8CTVOl7xVmDekTSHWxgTz21VXP50m_EUZc1ODINp-qZ9CDM4HjpqZC-wTjOe7r_PB-sz8yFemr3q6QdcNG?key=GS8CzK7EJ_o4WD1SQATjJA" alt=""><figcaption></figcaption></figure>

Klik tombol **Send** untuk mendapatkan respons yang dihasilkan **LLM** berdasarkan input Anda.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc8F4Xa9kQ-ElnVfe0JFj0euLphDUBWwnvX7Asp7xH0x8XVUOuFcXZ-XbanYHqNrCOCu0QWTJbzJxkcJX-f4dt3GWchXDzOVMc9zEqwwlZ8-TKfBBQN75yh-9LX73RpQ2G9s-mm0A?key=GS8CzK7EJ_o4WD1SQATjJA" alt=""><figcaption></figcaption></figure>

Anda akan menerima respons seperti berikut.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcRBk0e_XMrJtoO7HmSS5AG7nqlWEQpp5iu3EzfTOhIalnD3WcHxvMsRpmealG5_onzFUgN0-OQEvD8gYsd9ad7CCvyuOfsc4G3rqG1qEQ80vCAcLniOXfjMO2eDtjwHY_BOkP0?key=GS8CzK7EJ_o4WD1SQATjJA" alt=""><figcaption></figcaption></figure>

Isi respons akan serupa dengan berikut.

```json
{
    "id": "d0029aca5f9d49b58ca53cfcc962adf1",
    "choices": [
        {
            "finish_reason": "stop",
            "index": 0,
            "message": {
                "content": "Frodo's journey was a long one,\nThrough trials and through pain,\nBut he had courage in his heart,\nAnd he held on through the rain.\n\nHe walked alone across the lands,\nHis feet sore, his heart beating,\nBut he never lost his way,\nAnd he never stopped believing.\n\nHe faced the dark and the darkness,\nWith a light that dimly glowed,\nAnd he kept on pushing forward,\nWith a determination he'd never showed.\n\nThrough fire and through water,\nThrough the shadows and the night,\nHe kept on walking, step by step,\nAnd he never lost sight.\n\nHe faced the Ring and its power,\nWith a heart full of fear,\nBut he summoned up the strength,\nAnd he resisted its lure with cheer.\n\nAnd in the end, he reached his goal,\nThe fire where the Ring belong,\nAnd he threw it into the flame,\nAnd his journey was finally gone.\n\nSo here's to Frodo, brave and true,\nA hero to the end,\nHis journey was a long one,\nBut it's one that will never end.",
                "role": "assistant",
                "tool_calls": null,
                "function_call": null
            }
        }
    ],
    "created": 1740291974,
    "model": "Qwen/Qwen2-VL-72B-Instruct",
    "object": "chat.completion",
    "system_fingerprint": null,
    "usage": {
        "completion_tokens": 216,
        "prompt_tokens": 28,
        "total_tokens": 244,
        "completion_tokens_details": null,
        "prompt_tokens_details": null
    },
    "service_tier": null
}
```
