# Using MaaS with AI Gateway

To enable MaaS to leverage AI Gateway features (such as Rate Limiting, Model Caching, etc.), follow these steps:

**Step 1**: Access the AI Gateway interface on the GreenNode Console via: <http://aigateway.console.vngcloud.vn/>

**Step 2**: In the left-hand menu, select AI Gateway, then click the Create an AI Gateway button.

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

**Step 3**: On the Create New Gateway screen, fill in the following information:

* **AI Gateway Name:** Provide a memorable name for your gateway. The name must contain only a–z, A–Z, 0–9, underscore (\_) or hyphen (-), and be between 5 and 50 characters.
* **Model Provider:**

  * Select OpenAI Compatible as the AI model provider.
  * **Model Type**: Select the Model Type (refer to [MaaS](https://aiplatform.console.vngcloud.vn/models) in the AI Platform portal).
  * **Model Endpoint**: Enter the model URL (refer to [MaaS](https://aiplatform.console.vngcloud.vn/models) in the AI Platform portal).

  ```
  <figure><img src="/broken/files/g41wCXIWChs9gqtqIDzp" alt=""><figcaption></figcaption></figure>
  ```

  * **Authentication info**:

    * header\_name: Enter `Authorization`.
    * header\_value: Enter the MaaS API Key (created in the AI Platform [Portal ](https://aiplatform.console.vngcloud.vn/keys)).

    <figure><img src="/files/uBMqUkWItwQJxfNRyeG5" alt=""><figcaption></figcaption></figure>
* **Gateway Config:** By default, the system enables the Authenticated Gateway feature.

**Step 4**: Click Create an AI Gateway. Your AI Gateway will be initialized and ready to use.

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

**Step 5:** After the AI Gateway is created, generate a Token to call the API.

**Step 6:** After creating the token, you can configure specific rate limits for each token based on your needs

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

<figure><img src="/files/6Wr6i1v4tSkW5j09IXzK" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/63Kixf2LNLgkWdngbnUd" alt=""><figcaption></figcaption></figure>

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

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

Example:

```
curl --request POST \
--url 'https://user-55461-demo-aigateway.ai-gateway.vngcloud.vn/openai-compatible/gemini-2.5-pro/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {AUTHENTICATION_TOKEN}' \
--data '{
  "model": "gemini-2.5-pro",
  "messages": [
    {
      "role": "user",
      "content": "What is AI?"
    }
  ]
}'
```

Note:

* Replace `{AUTHENTICATION_TOKEN}` with the token created in Step 5.


---

# 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-platform/model-as-a-service/using-maas-with-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.
