← Back to home

Developers

Build chart integrations with the Charta API. Generate charts programmatically, connect via MCP, or use our TypeScript SDK.

REST API

Generate charts via HTTP. Send a JSON payload describing your chart and receive a rendered image or native Google Slides insert.

POST /api/v1/charts
curl -X POST https://api.getcharta.ai/v1/charts \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "waterfall",
    "title": "Revenue Bridge Q1 → Q2",
    "data": [
      { "label": "Q1 Revenue", "value": 1200 },
      { "label": "New Sales", "value": 340 },
      { "label": "Churn", "value": -120 },
      { "label": "Expansion", "value": 80 },
      { "label": "Q2 Revenue", "value": 1500, "total": true }
    ]
  }'

MCP Integration

Connect Charta to Claude, Cursor, or any MCP-compatible AI client. Let your AI assistant create and insert charts directly.

claude_desktop_config.json
{
  "mcpServers": {
    "charta": {
      "command": "npx",
      "args": ["-y", "@charta/mcp-server"],
      "env": {
        "CHARTA_API_KEY": "your-api-key"
      }
    }
  }
}

Available MCP Tools

  • create_chart — Generate a chart from structured data
  • list_chart_types — List all supported chart types
  • insert_into_slide — Insert a generated chart into a Google Slide
  • update_chart_data — Update data in an existing chart

TypeScript SDK

Type-safe chart generation with full autocomplete support.

Install
npm install @charta/sdk
Usage
import { Charta } from "@charta/sdk";

const charta = new Charta({ apiKey: process.env.CHARTA_API_KEY });

const chart = await charta.charts.create({
  type: "mekko",
  title: "Market Share by Segment",
  data: {
    categories: ["Enterprise", "Mid-Market", "SMB"],
    series: [
      { name: "Us", values: [45, 30, 15] },
      { name: "Competitor A", values: [30, 35, 40] },
      { name: "Others", values: [25, 35, 45] },
    ],
  },
});

// Insert into a Google Slide
await charta.slides.insert({
  presentationId: "your-presentation-id",
  slideIndex: 0,
  chartId: chart.id,
});

Authentication

All API requests require a Bearer token. Generate your API key in the Charta dashboard under Settings → API Keys. Keep your key secret — never expose it in client-side code.

Rate Limits

PlanRequests / minDaily credits
Free105
Plus3020
Business120Unlimited