---
title: "Generate Chart"
method: POST
path: "/api/v1/gtm/charts/generate"
tags: ["GTM - Charts"]
---

# Generate Chart

`POST /api/v1/gtm/charts/generate`

## Request

- Base URL: `https://api.gemstoneaiapp.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.gemstoneaiapp.com/api/v1/gtm/charts/generate`
- Auth: none declared

Generate a branded chart and return its S3 URL.

Query spec shape varies by chart_type — see `app.charts.service._fetch_data` for details.
Can bypass DB fetch entirely by including `inline_data` in query_spec.

## Headers

- `x-admin-key` string, nullable

## Request body

- ChartGenerateRequest
  - `chart_type` string, required
  - `query_spec` object, required
  - `aspect` string
  - `title` string, required
  - `subtitle` string, nullable
  - `include_watermark` boolean

## Response `200`

Successful Response

- ChartGenerateResponse
  - `s3_url` string, required
  - `chart_type` string, required
  - `aspect` string, required
  - `generated_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/gemstoneaiapp/apis/gemstoneai-api.md) · [All operations](https://skmtc.dev/gemstoneaiapp/apis/gemstoneai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gemstoneaiapp/apis/gemstoneai-api/revisions/fcb441f55161?raw)
