Skip to main content
POST
/
api
/
v0
/
generate
Chart Maker Agent
curl --request POST \
  --url https://agents.graphy.dev/api/v0/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "config": {
    "type": "column",
    "data": {
      "columns": [
        {
          "key": "quarter",
          "label": "Quarter"
        },
        {
          "key": "revenue",
          "label": "Revenue"
        }
      ],
      "rows": [
        {
          "quarter": "Q1",
          "revenue": 50000
        },
        {
          "quarter": "Q2",
          "revenue": 62000
        },
        {
          "quarter": "Q3",
          "revenue": 58000
        },
        {
          "quarter": "Q4",
          "revenue": 71000
        }
      ]
    }
  },
  "userPrompt": "Change this to a line chart with a trend line",
  "metadata": {
    "callId": "req-12345",
    "locale": "EN_US"
  }
}
'
{
  "message": "<string>"
}
Modify charts using natural language. Send a GraphConfig and a prompt, receive an updated GraphConfig via Server-Sent Events.

Response

The response is a Server-Sent Events stream. See SSE Format for parsing details.
event: progress
data: {"percentage":25,"message":"Analyzing chart structure..."}

event: progress
data: {"percentage":50,"message":"Applying changes..."}

event: complete
data: {"config":{...},"response":{"message":"Changed to line chart and added trend line"}}
Final response data:
interface GenerateResponse {
  config: GraphConfig;
  response: {
    message: string;
    steps?: 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 instruction describing the desired changes

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