ForHosting KIT · Finance & money

Autarky vs trade consumption calculator

Compare a country's consumption alone and with trade: in one example, 25 X and 12.5 Y become 25 X and 75 Y, a welfare gain of 144.948974278318%. Enter labor, hours per unit, world prices and spending share to see your case. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Labor
100
Labor per x
2
Labor per y
4
World price x
3
World price y
1
Alpha
0.5
You get
Max x
50
Max y
25
Autarky opp cost x
0.5
Autarky relative price
0.5

Opening a closed economy to trade changes what a country can consume, not only what it can produce. Under autarky a small country with a linear production-possibilities frontier consumes on that frontier at domestic relative prices set by unit labor requirements. After it specializes according to comparative advantage and trades at given world prices, its consumption point leaves the production frontier and sits on a world-price budget line through the specialized output bundle. This autarky versus trade consumption calculator takes a labor endowment, unit labor requirements for two goods, world prices, and a Cobb-Douglas expenditure share on good X. It returns autarky consumption of both goods, post-trade consumption, the specialization choice, the export and import vector, Cobb-Douglas utility in each regime, the utility ratio, and the percentage welfare gain from opening to trade.

What autarky and trade consumption measure on a linear PPF

A Ricardian small country has a fixed labor endowment and constant unit labor requirements for two goods, so its production-possibilities frontier is a straight line. The intercepts are maximum output of X if every hour goes to X, and maximum output of Y if every hour goes to Y. The slope is the opportunity cost of X in terms of Y, which is also the autarky relative price when labor markets are competitive.

With Cobb-Douglas preferences the country spends a constant share alpha of income on X and the rest on Y, so autarky consumption is simply that share of each intercept: alpha times max X of good X, and one minus alpha times max Y of good Y. When the country opens, it is too small to move world prices. If the world relative price of X exceeds the autarky opportunity cost, the country has comparative advantage in X and specializes completely in X; the opposite inequality sends all labor to Y.

Consumption then follows the same Cobb-Douglas shares applied to income valued at world prices. That post-trade basket typically contains more of the imported good and the same amount of the export good as under autarky, which is why utility rises. When world and autarky relative prices coincide there is no price wedge, production can stay at the autarky point, and the welfare gain is zero.

Where an autarky versus trade calculator earns its keep

Introductory international-trade courses assign Ricardian autarky-versus-trade problems because the move from the production-possibilities frontier to the consumption-possibilities line is the first quantitative picture of the gains from trade. Tutoring platforms and LMS auto-graders need a deterministic oracle that rejects a zero unit labor requirement instead of returning infinity, and that treats a world price equal to autarky cost as zero gain rather than a spurious specialization.

Instructors building practice banks want the same autarky basket, post-trade basket, and percentage welfare gain students derive on paper when they are given labor hours, a cloth-and-wine technology, and a terms-of-trade quote. Pair this capability with the separate opportunity-cost-ratio tool when you only need a PPF slope, and keep this surface focused on the consumption and welfare comparison that answers whether opening to trade raises living standards.

Homework Ricardian gains-from-trade checks

Students enter labor, unit labor requirements, world prices, and an expenditure share, then verify autarky and trade baskets plus the percentage welfare gain against a textbook drill.

LMS and tutoring auto-grading

Score autarky-versus-trade items with a deterministic oracle that rejects non-positive technologies or prices and an alpha outside (0, 1).

Lecture and policy notebooks

Show how a terms-of-trade improvement raises post-trade consumption and Cobb-Douglas utility relative to the closed-economy basket without building a multi-country CGE model.

How does this calculator compare autarky consumption with trade consumption?

It builds a linear PPF from labor and unit labor requirements, places Cobb-Douglas autarky demand on that frontier, then specializes at world prices and spends the same shares on the world budget line. The two baskets and the utility ratio are the comparison.

When does the country specialize in good X rather than good Y?

The opposite inequality specializes in Y. Equal relative prices leave production at the autarky point.

Why must alpha lie strictly between 0 and 1?

Alpha is the expenditure share on good X. At 0 or 1 the country would consume only one good, Cobb-Douglas utility would be zero, and the utility ratio would be undefined.

How large is the gain from trade in the worked example?

With 100 hours of labor, 2 hours per unit of X, 4 per unit of Y, world prices of 3 and 1 and half of spending on X, consumption of Y rises from 12.5 to 75 units and welfare grows by 144.948974278318%.

What if world prices match the country's own price ratio?

Then there is no price gap to exploit, production can stay where it was, and the welfare gain is zero. Trade only raises consumption when the world price ratio differs from the cost of X in terms of Y at home.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/econ/autarky-vs-trade

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/econ/autarky-vs-trade \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"labor":100,"labor_per_x":2,"labor_per_y":4,"world_price_x":3,"world_price_y":1,"alpha":0.5}'
{
  "labor": 100,
  "labor_per_x": 2,
  "labor_per_y": 4,
  "world_price_x": 3,
  "world_price_y": 1,
  "alpha": 0.5
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "econ.autarky_vs_trade",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

What autarky and trade consumption measure on a linear PPF

The calculator reports both baskets, the specialization flag, and the utility comparison so a homework row becomes a single reproducible payload instead of a chain of spreadsheet cells.

Inputs, outputs, validation, and how to read the welfare gain

Numbers are rounded to twelve decimal places for stable goldens. POST a JSON body with six required finite numbers: labor, the positive endowment L; labor_per_x and labor_per_y, the positive unit labor requirements a_x and a_y; world_price_x and world_price_y, the positive world prices the small country takes as given; and alpha, the Cobb-Douglas expenditure share on good X, which must lie strictly between zero and one. Fields may arrive under aliases such as a_x, px, or share_x, and numeric strings are accepted. Missing, empty, non-finite, non-positive production or price fields, and an alpha of zero or one, fail with invalid_input that names the problem. On success the response echoes the six inputs, returns the PPF intercepts max_x and max_y, returns autarky_opp_cost_x and autarky_relative_price as a_x over a_y, returns world_relative_price as P_x over P_y, and sets specializes_in to x, y, or none. It then reports produce_x and produce_y after the specialization decision, autarky_x and autarky_y, trade_x and trade_y, Cobb-Douglas autarky_utility and trade_utility, the signed trade vector export_x, export_y, import_x, and import_y, consumption deltas, utility_ratio, welfare_gain_pct as one hundred times the utility ratio minus one, and gains_from_trade_value as the world-price value of the extra consumption. Failed validation is not billed; successful parse calls use the published $0.002 base price per item.

Where an autarky versus trade calculator earns its keep

Pin welfare_gain_pct and the two consumption pairs in tests, keep alpha inside the open unit interval, and you get reproducible gains-from-trade numbers for homework, exam generators, and lightweight lecture notebooks without standing up a full computable general-equilibrium model.

What does welfare_gain_pct measure?

It is one hundred times (U_trade / U_autarky − 1), using Cobb-Douglas utility X^α Y^(1−α). Because preferences are homothetic, that percentage is also the real-income gain from opening to trade.

What does the autarky versus trade consumption calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →