# API Documentation Stream API

For detailed documentation, visit:[ gmINFRA API Documentation](https://infra.gm.ai/)

Endpoint: <https://model.gm.ai/v1/chat/completions>

**Making Your First API Request**

To run your first API request, paste the following command into your terminal:

> curl -X POST <https://model.gm.ai/v1/chat/completions>  \\
>
> &#x20;   -H "Content-Type: application/json" \\
>
> &#x20;   -d '{
>
> &#x20;       "model": "gm-01-8B",
>
> &#x20;       "messages": \[
>
> &#x20;           {
>
> &#x20;               "role": "user",
>
> &#x20;               "content": "What is BTC?"
>
> &#x20;           }
>
> &#x20;       ],
>
> &#x20;       "stream": "true",
>
> &#x20;       "temperature": 1
>
> &#x20;   }'

#### Request Body Explanation:

* model (string): The model to use for the API call. Example: "gm-01-8B".
* messages (array): The list of messages in the chat, including user and assistant input. Example: \[ { "role": "user", "content": "What is BTC?" }, { "role": "assistant", "content": "BTC stands for Bitcoin. Would you like to know its current price?" } ]
* stream (string): Whether or not to stream the response. Example: "true".
* temperature (number): The temperature setting for the API call, affecting randomness. Example: 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.gm.ai/gmai-ecosystem/gminfra/gmmodel/developer-guideline/api-documentation-stream-api.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.
