Guide · Chile electricity market

Chile electricity market API: how to get marginal cost, generation and demand from the Coordinador Eléctrico Nacional

How to get official data on Chile's national grid (Sistema Eléctrico Nacional, SEN) from your code or an AI agent: what the Coordinador's public information system publishes, how its API works directly, and how to receive marginal cost per bus, generation by technology or plant and demand as clean JSON with Better Llama's MCP tool, with no user_key to request.

What is the Coordinador Eléctrico Nacional and which data does it publish?

The Coordinador Eléctrico Nacional (CEN) is the technical body that coordinates the operation of Chile's national grid, from Arica to Chiloé. Its public information system (Sistema de Información Pública, SIP) exposes by API the data most used to analyze the electricity market:

  • Marginal cost per bus: the cost of supplying one more MWh at each point of the grid, in USD/MWh. The preliminary (online) value comes every 15 minutes; the real or final one, weeks later.
  • Real generation per plant, hour by hour, and daily generation by technology (hydro, solar, wind, thermal, geothermal and batteries).
  • Net system demand and estimated real demand per bus.
  • Catalogs of power plants and transmission lines, facility limitations, ancillary-service instructions and unserved energy.

For example, on November 20, 2026 the SEN generated 277,184 MWh; hydro supplied 35.1% and solar 26.2%, according to the real query shown below. Every answer from our tool carries the citation «Fuente: Coordinador Eléctrico Nacional, Sistema de Información Pública» with the link www.coordinador.cl.

Two ways to get Coordinador data by API

1. The SIP API, directly

The Coordinador developer portal gives you a free credential (user_key) when you subscribe to the «Sistema de Información Pública» plan. The credential goes as a parameter in every call. For example, daily generation by technology for one day:

curl · SIP API
curl -s "https://sipub.api.coordinador.cl/generacion-real/v3/getDailySum?date=2026-11-20&user_key=$CEN_USER_KEY"

The integration is up to you: each dataset has its own route and version, paging differs between routes, one day of marginal cost is about 145,000 rows, the API does not filter by bus and the free plan's quota is 60 queries per hour.

2. Better Llama's Coordinador tool (over MCP)

Our tool Electricity market (Coordinador Eléctrico), get_chile_electricity_market, queries that same API and returns a ready-to-use result:

  • No user_key to request: during the beta we use ours, limited to one call per minute and cached for an hour. To use yours, send it in the X-CEN-Key header.
  • A single dataset parameter for the 11 datasets, with dates in Chile time and up to 31 days per call.
  • A text filter by bus, plant, technology or company (filter), which the original API lacks.
  • Local and UTC date-time, numeric values with their unit, and the source attribution in every answer.

Use it as an MCP tool from Claude, Cursor or other agents, or over HTTP with JSON-RPC from any language.

Step by step: get Coordinador Eléctrico data

Step 1. Choose the dataset

Pass one of these 11 values in dataset:

datasetWhat it returnsUnit
costo_marginal_onlinePreliminary marginal cost per bus, every 15 minutesUSD/MWh
costo_marginal_realReal (final) marginal cost per bus; published weeks laterUSD/MWh
generacion_realHourly real generation per plantMW
generacion_diariaDaily total generation by technologyMWh
demanda_netaHourly net system demandMWh
demanda_real_estimadaEstimated real demand (withdrawals) per buskWh
centralesPower plant catalogMW
lineas_transmisionTransmission line catalog—
limitaciones_transmisionFacility limitations and disturbancesMW
instrucciones_ssccAncillary-service operating instructionsMW
energia_no_suministradaUnserved energy per outageMWh

Step 2. Connect the MCP server

Use the MCP https://mcp.betterllama.com/mcp in your client or call it over HTTP with JSON-RPC, as in the examples. No account or sign-up is needed during the beta.

Step 3. Build your query

ParameterWhat it does
datasetWhat to query (table above). Default costo_marginal_online
startDate / endDateFrom and to (YYYY-MM-DD, Chile time, inclusive). Yesterday by default; up to 31 days per call. Not used by the plant and line catalogs
filterText that must appear in the name, case-insensitive: a bus («quillota 220», «crucero 220»), a plant or technology, or a facility or company in limitations
maxItemsMaximum results (1 to 500, default 50)

This is real generation on November 20, 2026 by technology, as the tool returns it with dataset generacion_diaria (query of November 22 at 08:22 Chile time; we computed the share over the total):

TechnologyCode (name)MWh in the dayShare
HydroTOTAL HIDRÁULICO97,25535.1%
SolarTOTAL SOLAR72,58426.2%
Batteries (BESS)BESS43,19015.6%
WindTOTAL EÓLICAS34,32912.4%
ThermalTOTAL TÉRMICAS29,17810.5%
GeothermalTOTAL GEOTÉRMICAS6470.2%
TotalTOTAL GENERACIÓN277,184100.0%

With the shared credential each call reads one API page and the filter is applied to that page, so a day of marginal cost (about 145,000 rows) comes from the first hours and with the notice «Page cap reached». Real example: with filter «quillota 220» the tool returned 6 records for November 21, 2026 between 00:45 and 01:15, at 0.11 USD/MWh at the BA S/E QUILLOTA 220KV BP1-1 bus. To read more pages per call (up to five), use your own credential in X-CEN-Key.

Step 4. Call the tool with curl

A JSON-RPC POST returns the result as JSON. This call asks for daily generation by technology on November 20, 2026:

curl
curl -s https://mcp.betterllama.com/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "get_chile_electricity_market", "arguments": {"dataset": "generacion_diaria", "startDate": "2026-11-20", "maxItems": 50}}}'

The same in Python

Each technology's share and the marginal cost at one bus:

python
import json
import requests

URL = "https://mcp.betterllama.com/mcp"
HEADERS = {"Accept": "application/json, text/event-stream"}

def cen(arguments):
    body = {"jsonrpc": "2.0", "id": 1, "method": "tools/call",
            "params": {"name": "get_chile_electricity_market", "arguments": arguments}}
    resp = requests.post(URL, json=body, headers=HEADERS, timeout=180)
    resp.raise_for_status()
    return json.loads(resp.json()["result"]["content"][0]["text"])

# Generation on 2026-11-20 by technology and its share
gen = cen({"dataset": "generacion_diaria", "startDate": "2026-11-20", "maxItems": 50})
total = next(r["value"] for r in gen["results"] if r["code"] == "TOTAL GENERACIÓN")
for r in gen["results"]:
    if r["code"] != "TOTAL GENERACIÓN":
        print(f'{r["name"]:<18} {r["value"]:>9,.0f} MWh {r["value"] / total:6.1%}')

# Preliminary marginal cost at the Quillota 220 kV bus
cmg = cen({"dataset": "costo_marginal_online", "filter": "quillota 220", "maxItems": 24})
for r in cmg["results"][:3]:
    print(r["localDateTime"], r["name"], r["value"], r["unit"])

Real output (November 22, 2026, Chile time):

output
BESS                  43,190 MWh  15.6%
TOTAL EÓLICAS         34,329 MWh  12.4%
TOTAL GEOTÉRMICAS        647 MWh   0.2%
TOTAL HIDRÁULICO      97,255 MWh  35.1%
TOTAL SOLAR           72,584 MWh  26.2%
TOTAL TÉRMICAS        29,178 MWh  10.5%
2026-11-21 00:45 BA S/E QUILLOTA 220KV BP1-1 0.11 USD/MWh
2026-11-21 00:45 BA S/E QUILLOTA 220KV BP1-2 0.11 USD/MWh
2026-11-21 01:00 BA S/E QUILLOTA 220KV BP1-2 0.11 USD/MWh

From JavaScript or any other language, a POST with the same JSON-RPC body is enough (for example, with fetch).

Use the Chile electricity market API from an AI agent (MCP)

Add the Better Llama MCP server to your client (Claude, Cursor, VS Code or any other with remote MCP). One MCP brings get_chile_electricity_market and the rest of the catalog, with no sign-up during the beta.

Cursor · mcp.json
{
  "mcpServers": {
    "better-llama": {
      "url": "https://mcp.betterllama.com/mcp"
    }
  }
}
Claude Code
claude mcp add --transport http better-llama https://mcp.betterllama.com/mcp

Setup for Claude, Codex, Gemini CLI, Windsurf, VS Code and other clients: connect your agent.

Ready-to-run Python and Node.js examples, with config files for each client: examples repository on GitHub.

Then ask, for example: «How much energy did Chile's national grid generate yesterday, and what share was solar and wind? Cite the source.»

Beta: free and with no sign-up while we test the service.

Which fields it returns

Each item in results has dataset, datasetTitle, date, localDateTime (Chile time), dateTimeUtc for hourly data, name (bus, plant or technology), code, value (numeric) and unit, plus fields specific to each dataset, such as costClpKwh and voltageKv in marginal cost. The answer includes count, warnings, stopReason, attribution, source and retrievedAt.

Real, complete response to the curl call above (November 22, 2026, 08:22 Chile time):

json
{
  "tool": "get_chile_electricity_market",
  "count": 7,
  "results": [
    {
      "dataset": "generacion_diaria",
      "datasetTitle": "Generación diaria total por tecnología",
      "date": "2026-11-20",
      "localDateTime": "2026-11-20",
      "name": "BESS",
      "code": "BESS",
      "value": 43190.42,
      "unit": "MWh",
      "redacted": false,
      "officialUrl": "https://www.coordinador.cl/",
      "dataSource": "Coordinador Eléctrico Nacional (CEN), Sistema de Información Pública (SIP) — https://www.coordinador.cl / https://sipub.api.coordinador.cl",
      "retrievedAt": "2026-11-22T11:22:32.452Z"
    },
    {
      "dataset": "generacion_diaria",
      "datasetTitle": "Generación diaria total por tecnología",
      "date": "2026-11-20",
      "localDateTime": "2026-11-20",
      "name": "TOTAL EÓLICAS",
      "code": "TOTAL EÓLICAS",
      "value": 34329.08,
      "unit": "MWh",
      "redacted": false,
      "officialUrl": "https://www.coordinador.cl/",
      "dataSource": "Coordinador Eléctrico Nacional (CEN), Sistema de Información Pública (SIP) — https://www.coordinador.cl / https://sipub.api.coordinador.cl",
      "retrievedAt": "2026-11-22T11:22:32.452Z"
    },
    {
      "dataset": "generacion_diaria",
      "datasetTitle": "Generación diaria total por tecnología",
      "date": "2026-11-20",
      "localDateTime": "2026-11-20",
      "name": "TOTAL GEOTÉRMICAS",
      "code": "TOTAL GEOTÉRMICAS",
      "value": 646.78,
      "unit": "MWh",
      "redacted": false,
      "officialUrl": "https://www.coordinador.cl/",
      "dataSource": "Coordinador Eléctrico Nacional (CEN), Sistema de Información Pública (SIP) — https://www.coordinador.cl / https://sipub.api.coordinador.cl",
      "retrievedAt": "2026-11-22T11:22:32.452Z"
    },
    {
      "dataset": "generacion_diaria",
      "datasetTitle": "Generación diaria total por tecnología",
      "date": "2026-11-20",
      "localDateTime": "2026-11-20",
      "name": "TOTAL HIDRÁULICO",
      "code": "TOTAL HIDRÁULICO",
      "value": 97254.69,
      "unit": "MWh",
      "redacted": false,
      "officialUrl": "https://www.coordinador.cl/",
      "dataSource": "Coordinador Eléctrico Nacional (CEN), Sistema de Información Pública (SIP) — https://www.coordinador.cl / https://sipub.api.coordinador.cl",
      "retrievedAt": "2026-11-22T11:22:32.452Z"
    },
    {
      "dataset": "generacion_diaria",
      "datasetTitle": "Generación diaria total por tecnología",
      "date": "2026-11-20",
      "localDateTime": "2026-11-20",
      "name": "TOTAL SOLAR",
      "code": "TOTAL SOLAR",
      "value": 72584.15,
      "unit": "MWh",
      "redacted": false,
      "officialUrl": "https://www.coordinador.cl/",
      "dataSource": "Coordinador Eléctrico Nacional (CEN), Sistema de Información Pública (SIP) — https://www.coordinador.cl / https://sipub.api.coordinador.cl",
      "retrievedAt": "2026-11-22T11:22:32.452Z"
    },
    {
      "dataset": "generacion_diaria",
      "datasetTitle": "Generación diaria total por tecnología",
      "date": "2026-11-20",
      "localDateTime": "2026-11-20",
      "name": "TOTAL TÉRMICAS",
      "code": "TOTAL TÉRMICAS",
      "value": 29178.42,
      "unit": "MWh",
      "redacted": false,
      "officialUrl": "https://www.coordinador.cl/",
      "dataSource": "Coordinador Eléctrico Nacional (CEN), Sistema de Información Pública (SIP) — https://www.coordinador.cl / https://sipub.api.coordinador.cl",
      "retrievedAt": "2026-11-22T11:22:32.452Z"
    },
    {
      "dataset": "generacion_diaria",
      "datasetTitle": "Generación diaria total por tecnología",
      "date": "2026-11-20",
      "localDateTime": "2026-11-20",
      "name": "TOTAL GENERACIÓN",
      "code": "TOTAL GENERACIÓN",
      "value": 277183.54,
      "unit": "MWh",
      "redacted": false,
      "officialUrl": "https://www.coordinador.cl/",
      "dataSource": "Coordinador Eléctrico Nacional (CEN), Sistema de Información Pública (SIP) — https://www.coordinador.cl / https://sipub.api.coordinador.cl",
      "retrievedAt": "2026-11-22T11:22:32.452Z"
    }
  ],
  "warnings": [],
  "stopReason": "completed",
  "attribution": "Fuente: Coordinador Eléctrico Nacional, Sistema de Información Pública — https://www.coordinador.cl",
  "source": "https://portal.api.coordinador.cl/",
  "retrievedAt": "2026-11-22T11:22:34.261Z"
}

If you reuse the data, cite «Fuente: Coordinador Eléctrico Nacional, Sistema de Información Pública» with the link https://www.coordinador.cl/.

Pricing

Free during the beta, with no sign-up and a limit of 60 requests per minute per IP; with the shared Coordinador credential, one new query per minute (repeated ones come from the cache). If paid plans come later, we will announce them on betterllama.com first.

Frequently asked questions

Does the Coordinador Eléctrico Nacional have an API?

Yes. The Coordinador's public information system (SIP) has an API with a free credential (user_key) from portal.api.coordinador.cl. Better Llama's get_chile_electricity_market tool queries that API and returns 11 datasets as clean JSON over MCP or JSON-RPC, without you requesting the credential.

What is marginal cost?

It is the cost of supplying one more MWh of energy at a grid bus at a given time, in USD/MWh. It is used to value energy transfers between companies. Online marginal cost is preliminary and comes every 15 minutes; real marginal cost is final and is published weeks later.

How do I get generation by technology for a day?

Call get_chile_electricity_market with dataset generacion_diaria and the day's startDate. On November 20, 2026 the total was 277,184 MWh, with 35.1% hydro and 26.2% solar.

Do I need a Coordinador user_key?

No. During the beta a Better Llama credential is used. Its quota is 60 queries per hour, so the server limits it to one call per minute and caches answers for an hour. If you need more, create your free credential at portal.api.coordinador.cl and send it in the X-CEN-Key header.

Which dates can I query?

startDate and endDate as YYYY-MM-DD, Chile time, up to 31 days per call; yesterday by default. Real marginal cost is published weeks later, so for recent days use costo_marginal_online. If a dataset has no data for those dates, the answer comes back empty with a notice in warnings.

Can I filter by bus or plant?

Yes, with filter: the text must appear in the bus, plant, technology or facility name, case-insensitive. Since the Coordinador API does not filter by bus, the filter is applied to the pages downloaded in each call.

Is Better Llama affiliated with the Coordinador Eléctrico Nacional?

No. Better Llama is an independent project, not affiliated with, sponsored or endorsed by the Coordinador Eléctrico Nacional. The data comes from the public information system API and every answer includes the source attribution.

Other guides

This guide is also available en español.