Skip to main content
POST
/
api
/
v0
/
suggestions
Suggestions Agent
curl --request POST \
  --url https://agents.graphy.dev/api/v0/suggestions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "config": {
    "type": "column",
    "data": {
      "columns": [
        {
          "key": "month",
          "label": "Month"
        },
        {
          "key": "sales",
          "label": "Sales"
        },
        {
          "key": "region",
          "label": "Region"
        }
      ],
      "rows": [
        {
          "month": "Jan",
          "sales": 100,
          "region": "North"
        },
        {
          "month": "Feb",
          "sales": 120,
          "region": "South"
        },
        {
          "month": "Mar",
          "sales": 115,
          "region": "North"
        }
      ]
    }
  },
  "userPrompt": "Show me interesting trends",
  "metadata": {
    "callId": "req-67890",
    "locale": "EN_US"
  }
}
'
{
  "message": "<string>"
}
Generate chart type and data preparation suggestions from a dataset. Send a GraphConfig and a prompt, receive suggested visualizations via Server-Sent Events.

Response

The response is a Server-Sent Events stream. See SSE Format for parsing details.
event: progress
data: {"message":"Generating suggestions..."}

event: complete
data: {"suggestions":[{"dataPrepPrompt":"...","chartType":"line","summary":"Monthly sales trend"}]}
Final response data:
interface SuggestionsResponse {
  suggestions: Suggestion[];
}

interface Suggestion {
  dataPrepPrompt: string;
  chartType: AiChartType;
  summary: string;
}

HTTP Status Codes

StatusDescription
200Success (stream begins)
400Invalid request body
401Invalid or missing API key
429Rate limit exceeded
500Internal server error
Errors may also arrive as SSE events within a 200 response. See Error Codes.

Authorizations

Authorization
string
header
required

Your Graphy API key

Body

application/json
config
object
required

The graph configuration object used to render charts. See Graph Config Schema for the complete reference.

userPrompt
string
required

Natural language description of what to visualize

Maximum string length: 10000
metadata
object

Optional tracking information for requests

Response

SSE stream with progress and completion events

SSE event name is "progress"

message
string