---
title: "Create Sql Generation"
method: POST
path: "/api/prompts/{id}/sql-generations"
tags: ["Generation"]
---

# Create Sql Generation

`POST /api/prompts/{id}/sql-generations`

## Path parameters

- `id` string, required

## Request body

- SQLGenerationRequest
  - `finetuning_id` string
  - `low_latency_mode` boolean
  - `evaluate` boolean
  - `sql` string
  - `metadata` object

## Response `200`

Successful Response

- SQLGenerationResponse
  - `id` string
  - `prompt_id` string
  - `finetuning_id` string
  - `sql` string
  - `status` 'VALID' | 'INVALID' — An enumeration.
  - `tokens_used` integer
  - `confidence_score` number
  - `error` string
  - `completed_at` string, date-time
  - `created_at` string, date-time
  - `metadata` SQLGenerationMetadata
    - `dh_internal` DHSQLGenerationMetadata
      - `organization_id` string

## Other responses

- `404` — Not found
- `422` — Validation Error

---

[API](https://skmtc.net/dataherald/apis/fastapi.md) · [All operations](https://skmtc.net/dataherald/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/dataherald/fastapi/versions/e168e98625a8/schema)
