---
title: AI
project: Total API
version: 2026
section: reference
language: en
license: 
url: https://totaljs.es/docs/total-api/2026/reference/ai/
updated: 2026-11-20T06:51:47.968Z
---

# AI

> Ask ChatGPT.

Every service is a `POST` request with your token. See [Call Total API from Total.js](../../guides/call-from-totaljs/) and [Call Total API over HTTP](../../guides/call-over-http/).

## API

### POST https://api.totaljs.com/chatgpt/

Type: `rest`

Asks ChatGPT a question.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `value` | `String` | yes |  | The question. |
| `output` | `String` | no | `text` | `text` or `image`. |
| `size` | `String` | no |  | The size of an image: `small`, `medium` or `large`. Only with `output: image`. |

Returns: `Object` An object with the answer in `text`.

Example: Total.js
```js
var answer = await API('TAPI', 'chatgpt', 'What is Total.js Platform?').promise();
console.log(answer.text);
```

Example: REST
```bash
curl -X POST https://api.totaljs.com/chatgpt/ \
	-H "Content-Type: application/json" \
	-H "X-Token: YOUR_TOKEN" \
	-d '{ "value": "What is Total.js Platform?" }'
```

Example: Response
```json
{ "text": "Total.js Platform is a web development platform for Node.js..." }
```
