# Response on prompt

## POST Prompt

<https://api.fullmetal.ai/agent/prompt>

**Request Headers**

* Content-Type: application/json
* apikey: Your API key (required for authentication), see [*HERE*](/docs/getting-an-api-key.md)

**Request Body**

The request body should be in JSON format and must include the following fields

```json
{
  "agentId": "string",        // The ID of the agent to which the prompt is sent (required)
  "prompt": "string",         // The prompt text to be sent to the agent (required)
  "systemPrompt": "string",   // Optional system prompt to provide context (optional)
  "stream": "boolean"         // Indicates whether to use streaming for the response (optional)
}
```

{% tabs %}
{% tab title="JS" %}
**Example**

```javascript
var myHeaders = new Headers();
myHeaders.append("apikey", "{{apikey}}");

var raw = "{\r\n      \"prompt\": \"Hello, how are you?\",\r\n      \"agentId\": \"{{agentId}}\",\r\n      \"stream\": false\r\n}";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.fullmetal.ai/agent/prompt", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="CURL" %}
**Example**

```javascript
curl --location 'https://api.fullmetal.ai/agent/prompt' \
--header 'apikey: {{apikey}}' \
--data '{
      "prompt": "Hello, how are you?",
      "agentId": "{{agentId}}",
      "stream": false
}'
```

{% endtab %}

{% tab title="PYTHON" %}
**Example**

```javascript
import requests

url = "https://api.fullmetal.ai/agent/prompt"

payload = "{\r\n      \"prompt\": \"Hello, how are you?\",\r\n      \"agentId\": \"{{agentId}}\",\r\n      \"stream\": true\r\n}"
headers = {
  'apikey': '{{apikey}}'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}
{% endtabs %}

**Response**

```json
{
  "response": "I'm just a language model, I don't have emotions or feelings like humans do, but I'm functioning properly and ready to assist you. I'm here to help with any questions or topics you'd like to discuss. How can I help you today?",
  "model": [
    "Llama-3.2-1B-Instruct-q4f16_1-MLC"
  ],
  "speed": "13.86",
  "elapsedTime": "16.24"
}
```

For more information please visit the [postman collection](https://documenter.getpostman.com/view/32411802/2sB2cd3Hda)


---

# 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://fullmetal.gitbook.io/docs/api-docs/response-on-prompt.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.
