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

# IA

> Pregunta a ChatGPT.

Cada servicio es una petición `POST` con tu token. Consulta [Llama a Total API desde Total.js](../../guides/call-from-totaljs/) y [Llama a Total API por HTTP](../../guides/call-over-http/).

## API

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

Type: `rest`

Hace una pregunta a ChatGPT.

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `value` | `String` | yes |  | La pregunta. |
| `output` | `String` | no | `text` | `text` o `image`. |
| `size` | `String` | no |  | El tamaño de una imagen: `small`, `medium` o `large`. Solo con `output: image`. |

Returns: `Object` Un objeto con la respuesta en `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: Respuesta
```json
{ "text": "Total.js Platform is a web development platform for Node.js..." }
```
