# Sending Requests to AI Gateway

After successfully creating an AI Gateway, you can start sending requests to the configured AI model by following these steps:

**Step 1:** Access the [AI Gateway Portal](http://aigateway.console.vngcloud.vn/) and locate the gateway you just created.

**Step 2:** In the Providers & Model section, find the AI model you configured. Click the Curl command icon to get a sample request.

<figure><img src="/files/QUXXxVhwwuTiPHWZhuxu" alt=""><figcaption></figcaption></figure>

**Step 3:** Copy the displayed curl command and execute it on your local machine (via Terminal or Command Prompt).

<figure><img src="/files/ElvtQN3CCzV4Tu8aH9qu" alt=""><figcaption></figcaption></figure>

Example:

```bash
curl -X POST https://user-60108-gateway-0b50037b-93.ai-gateway.vngcloud.vn/deepseek/deepseek-chat/chat/completions \
     --header 'Authorization: Bearer {AUTHENTICATION_TOKEN}' \
     --header 'Content-Type: application/json' \
     --data '{
       "model": "deepseek-chat",
       "messages": [
         {
           "role": "user",
           "content": "What is AI?"
         }
       ]
     }'
```

**Note:**

* Replace `{AUTHENTICATION_TOKEN}` with the token provided after creating the Gateway
* You can modify the prompt content (the question in the "content" field) to suit your use case.
* If your AI Gateway is using Authenticated Gateway mode, you must include a header named cf-aig-authorization in your HTTP request.

For example, instead of using:

```http
Authorization: Bearer {AUTHENTICATION_TOKEN}
```

You must use:

```http
cf-aig-authorization: Bearer {AUTHENTICATION_TOKEN}
```

After sending the request, you will receive a response from the AI model in JSON format.


---

# 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.vngcloud.vn/vng-cloud-document/ai-stack/ai-gateway/get-starting-with-ai-gateway/sending-requests-to-ai-gateway.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.
