---
title: "POST /api/database/fields/table/{table_id}/generate-ai-formula/"
method: POST
path: "/api/database/fields/table/{table_id}/generate-ai-formula/"
tags: ["Database table fields"]
---

# POST /api/database/fields/table/{table_id}/generate-ai-formula/

`POST /api/database/fields/table/{table_id}/generate-ai-formula/`

This endpoint generates a Baserow formula for the table related to the provided id, based on the human readable input provided in the request body.
This is a **premium** feature.

## Path parameters

- `table_id` integer, required

## Request body

- GenerateFormulaWithAIRequest
  - `ai_type` string, required — The AI model type that must be used when generating the formula.
  - `ai_model` string, required — The AI model that must be used when generating the formula.
  - `ai_temperature` number, double, nullable — Between 0 and 2, adjusts response randomness—lower values yield focused answers, while higher values increase creativity.
  - `ai_prompt` string, required — The human readable input used to generate the formula.

## Response `200`

- GenerateFormulaWithAIResponse
  - `formula` string, required — The formula generated by the AI.

## Other responses

- `400`
- `404`

---

[API](https://skmtc.dev/baserow/apis/baserow-api-spec.md) · [All operations](https://skmtc.dev/baserow/apis/baserow-api-spec/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/baserow/baserow-api-spec/revisions/f3396317d932/schema)
