Live · Verified · Free

KAMMAREN Documentation

The correctness layer for Swedish company administration. Every number traced to a law paragraph. 304+ passing assertions. No AI touches a calculation.

API live 304+ assertions PASS Income year 2026

Quick start

Three ways to use KAMMAREN. Pick one.

1
Fetch constants
Zero dependencies. Every Swedish tax constant for 2026 in one JSON. Every value traced to a law paragraph.
2
Verify a calculation
Your system calculates. KAMMAREN verifies. Returns PASS or FAIL with exact diff.
3
Run a calculation
Send input only, omit expected. Returns full calculation with breakdown, legal sources, and disclaimer.

1 — Fetch constants

curl https://kammaren.nu/api/constants/2026

Returns every Swedish tax constant for income year 2026 — PBB, IBB, AG rates, corporate tax, 3:12 rules, VAT rates, income tax brackets. Every value traced to a specific law paragraph. 290 municipal tax rates included separately.

2 — Verify a calculation

curl -X POST https://kammaren.nu/api/verify \
  -H "Content-Type: application/json" \
  -d '{
    "skill": "ag-avgifter",
    "input": {
      "gross_salary": 500000,
      "birth_year": 1990,
      "first_employee": false,
      "num_employees": 0
    },
    "expected": { "total_ag_avgift": 157100 }
  }'

3 — Run a calculation

Same endpoint, omit expected:

curl -X POST https://kammaren.nu/api/verify \
  -H "Content-Type: application/json" \
  -d '{
    "skill": "ag-avgifter",
    "input": {
      "gross_salary": 500000,
      "birth_year": 1990,
      "first_employee": false,
      "num_employees": 0
    }
  }'

Source of Truth API

All Swedish tax constants for a given income year. One URL. One JSON. Every value with a legal reference.

Endpoints

URLReturns
GET /api/constants/2026All tax constants for income year 2026
GET /api/constants/kommunalskatt/2026Tax rates for all 290 municipalities

What's inside /api/constants/2026

55 constants total. 22 sections. Internal checksums verify that components sum correctly (e.g. 7 AG sub-rates = 31.42%).

basbelopp
  prisbasbelopp .............. 59 200 kr  (SFS 2025:XX, SCB)
  forhoijt_prisbasbelopp ..... 60 500 kr
  inkomstbasbelopp ........... 83 400 kr  (Pensionsmyndigheten)
  ibb_for_312 ............... 80 600 kr  (IL 57 kap 4 §, IBB 2025)

arbetsgivaravgifter
  total ...................... 31.42%     (SFL 2 kap 26 §)
  sjukforsakring ............. 3.55%
  foraldraforsakring ......... 2.00%
  alderspension .............. 10.21%
  efterlevandepension ........ 0.30%
  arbetsmarknad .............. 2.64%
  arbetsskada ................ 0.10%
  allman_loneavgift .......... 12.62%
  aldersreduktion ............ 10.21%    (67+ år, SFL 2 kap 27 §)
  vaxa_stodet ................ 10.21%    (max 35k/mån, SFL 2 kap 31 §)

moms
  standard ................... 25%       (ML 7:1)
  reducerad_1 ................ 12%
  reducerad_2 ................ 6%
  momsfri_grans .............. 120 000 kr (ML 9d kap)

bolagsskatt
  skattesats ................. 20.6%     (IL 65 kap 10 §)
  periodiseringsfond_max ..... 25%       (IL 30 kap 5 §)
  max_antal_fonder ........... 6         (IL 30 kap 7 §)

inkomstskatt
  skiktgrans ................. 643 000 kr (IL 65 kap 5 §)
  brytpunkt .................. 660 400 kr
  statlig_skatt .............. 20%

treslagregeln_312
  grundbelopp ................ 4 × IBB   (IL 57 kap 11 §, Prop. 2025/26:1)
  lonesparr .................. 8 × IBB   (IL 57 kap 16 §)
  lonebaserat_andel .......... 50%
  kapitalbaserat ............. SLR + 9%  (IL 57 kap 12 §)
  upprakningsranta ........... 0%        (SLOPAD, Prop. 2025/26:1)

statslanerantan .............. 2.55%     (Riksgälden, 30 nov 2025)

Plus: representation, traktamente, skattefria gåvor, reseavdrag, kostförmåner, SGI, SLP, pension.

What's inside /api/constants/kommunalskatt/2026

290 municipalities. Every entry has:

{
  "ale": {
    "kommunalskatt": 0.328,
    "begravningsavgift": 0.00292,
    "kyrkoavgift_snitt": 0.01
  }
}

kommunalskatt is the combined municipal + county rate. This is what Skatteverket publishes and what tax calculations use.

How it stays current

Tax constants change once per year. Skatteverket publishes new numbers in December. We create constants/2027.json, verify against the published tables, and push. The URL pattern (/api/constants/:year) serves the right year automatically. Year-guard refuses to let any skill calculate with outdated constants.

Verify API

Verification-as-a-service for Swedish tax calculations.

POST /api/verify — three modes

Mode 1 — VERIFY (send input + expected)

Your system calculated employer contributions on a 500 000 kr salary and got 157 100 kr. Is that right?

Request
{
  "skill": "ag-avgifter",
  "input": {
    "gross_salary": 500000,
    "birth_year": 1990,
    "first_employee": false,
    "num_employees": 0
  },
  "expected": {
    "total_ag_avgift": 157100
  }
}
Response (PASS)
{
  "status": "PASS",
  "skill": "ag-avgifter",
  "actual": {
    "total_ag_avgift": 157100
  },
  "expected": {
    "total_ag_avgift": 157100
  },
  "diff": {},
  "sources": [
    { "name": "SFL 2 kap 26 §", ... }
  ],
  "disclaimer": "...",
  "engine_version": "2026.1",
  "timestamp": "2026-04-13T..."
}

If your number is wrong:

{
  "status": "FAIL",
  "diff": {
    "total_ag_avgift": {
      "expected": 160000,
      "actual": 157100,
      "delta": -2900
    }
  }
}

Mode 2 — CALCULATE (omit expected)

Don't have a number to verify? Send just the input. Response includes the full calculation, breakdown by component, legal sources, and disclaimer.

{
  "skill": "ag-avgifter",
  "input": {
    "gross_salary": 500000,
    "birth_year": 1990,
    "first_employee": false,
    "num_employees": 0
  }
}

Mode 3 — LIST (GET request)

GET /api/verify

Returns all available skills with their input schemas, descriptions, and assertion counts.

Available skills

SkillDescriptionAssertions
ag-avgifter Employer contributions (31.42%, 7 components) 19/19 PASS
moms VAT (25/12/6/0%, reverse charge, BAS accounts) 34/34 PASS
bolagsskatt Corporate tax (20.6%, periodiseringsfond, underskott) 46/46 PASS
k10 K10 shareholder allowance (2026 additive model) 34/34 PASS

Skills reference

Every skill is a pure function. Same input always produces the same output. No AI touches a number.

ag-avgifter

Calculates Swedish employer contributions for income year 2026.

Input

FieldTypeRequiredDescription
gross_salarynumberYesAnnual gross salary in SEK
birth_yearnumberYesEmployee birth year (affects age reduction)
first_employeebooleanYesEligible for Växa-stöd?
num_employeesnumberYesNumber of employees (Växa max 2)

Output includes

total_ag_avgift — total employer contribution in SEK · ag_rate — effective rate (31.42% standard, 10.21% age-reduced or Växa) · total_lonekostnad — salary + AG combined · All 7 sub-components with individual amounts

Special cases

ConditionRule
Born 1958 or earlier (67+ at year start)Reduced rate 10.21% (only ålderspension)
Born 1937 or earlier (88+)Zero employer contributions
Växa-stöd10.21% on salaries up to 35 000 kr/month (max 2 employees)
Salary below 1 000 kr/yearNo contributions

Legal source: SFL 2 kap 26–31 §

moms

Calculates Swedish VAT for income year 2026.

Input

FieldTypeRequiredDescription
amountnumberYesAmount in SEK
vat_ratenumberYesVAT rate: 25, 12, 6, or 0
directionstringYesnetto_to_brutto or brutto_to_netto
reverse_chargebooleanNoReverse charge (omvänd skattskyldighet)

Output includes

netto — amount excluding VAT · brutto — amount including VAT · moms_belopp — VAT amount · bas_konto — correct BAS account number (2610/2620/2630/2640)

Legal source: ML 7:1, ML 3 kap, ML 9d kap

bolagsskatt

Calculates Swedish corporate tax for income year 2026.

Input

FieldTypeRequiredDescription
taxable_profitnumberYesProfit before tax in SEK
periodiseringsfond_avsattningnumberYesDesired fund allocation (max 25%)
befintliga_fonderarrayYesExisting funds [{year, amount}]
underskott_foregaende_arnumberYesPrior year deficit in SEK

Output includes

bolagsskatt — corporate tax in SEK · resultat_efter_skatt — profit after tax · periodiseringsfond_avdrag — actual fund deduction (capped at 25%) · schablonintakt — imputed income on existing funds (SLR × fund amounts) · aterford_fond — reversed fund (if any fund is 6+ years old)

Special cases

RuleDetail
Maximum 6 funds simultaneouslyIL 30 kap 7 §
Funds older than 6 yearsAutomatically reversed
Imputed incomeSLR (2.55%) × sum of all existing funds
Deficit carry-forwardIndefinitely, no time limit

Legal source: IL 65 kap 10 §, IL 30 kap 5–7 §

k10

Calculates K10 shareholder allowance (gränsbelopp) for income year 2026.

2026 model change

2026 uses the NEW additive model (Prop. 2025/26:1). The old rules (MAX of simplified/main rule) no longer apply.

Input

FieldTypeRequiredDescription
anskaffningsvardenumberYesShare acquisition cost in SEK
agarandel_procentnumberYesOwnership percentage (0–100)
total_lonesummanumberYesTotal company salaries in SEK
egen_lonnumberYesOwner's own salary in SEK
sparat_utrymmenumberYesSaved allowance from prior year
inkomstarnumberYesIncome year (must be 2026)

How the 2026 additive model works

gränsbelopp = grundbelopp
            + kapitalbaserat
            + lönebaserat
            + sparat utrymme

Where:
  grundbelopp    = 4 × 80 600 × ownership share = 322 400 kr (at 100%)
  kapitalbaserat = acquisition cost × (SLR + 9%) = cost × 11.55%
  lönebaserat    = 50% × (total salaries − 644 800 kr threshold)
  sparat         = prior year amount, carried forward at face value

Special cases

RuleDetail
4%-spärrenOwnership below 4%: no salary-based allowance
Salary cap50 × owner's own salary
Saved allowanceNo markup — uppräkningsränta abolished 2026 (Prop. 2025/26:1)

Legal source: IL 57 kap 11–16 §, Prop. 2025/26:1

Verification

Every number KAMMAREN returns is backed by verification.

Test suites

SuiteWhat it verifiesAssertions
Golden casesEach skill against hand-calculated values from Skatteverket tables153
ConstantsInternal checksums (AG sub-rates sum to 31.42%, grundbelopp = 4×IBB)46
IntegrationFull chain: VAT → AG → corporate tax → K10 → dividend13
Cross-validationTax optimizer vs K10 skill (independent implementations, same answer)6
Stress10 radically different companies through the entire chain100
Year-guardSystem refuses to calculate 2027 with 2026 constants3
Total304+

How golden cases work

We write expected values before writing the code. Each expected value is hand-calculated from Skatteverket's published tables (SKV 433, SFL, IL, ML). If the code produces a different number, the test fails.

Bugs caught before users saw them

The golden cases caught 4 bugs during development:

#Bug
1Wrong sub-rates in AG contributions (föräldraförsäkring 2.60% → 2.00%)
2Missing imputed income on periodiseringsfonder in 3 corporate tax test cases
3K10 using old MAX(simplified, main rule) logic instead of 2026 additive model (up to 297 400 kr wrong)
4Markup rate on saved K10 allowance: abolished 2026, we calculated 5.55%

Architecture

Any agent (Claude, GPT, local LLM, your own)
    │
    │ tool_call or HTTP POST
    ▼
┌───────────────────────────────────────┐
│  KAMMAREN                             │
│                                       │
│  skills/     → calculate()            │
│  constants/  → 2026.json (year-guard) │
│  verify/     → 304 assertions         │
│  vault/      → SHA-256 hash chain     │
└───────────┬───────────────────────────┘
            │
            ▼
  SkillOutput {
    result,      // exact numbers
    breakdown,   // component-by-component
    sources,     // law references with URLs
    disclaimer   // always present
  }

Principles

LLM classifies. Code calculates. Human decides. No neural network touches a number.
Year-guarded. System throws an error if constants year ≠ requested year.
Every value has a source. Law paragraph, SKV table reference, or explicit "verified": false marking.
Golden cases first. Expected values written before code. If code disagrees with Skatteverket, code is wrong.
One source of truth. All constants in 2026.json. No duplication. No drift.

Limits and caveats

TopicDetail
Constants update cadenceOnce per year (December). Between updates, they are static and correct.
AuthenticationNone. No rate limiting. If this becomes a problem, we'll add it.
Response time~50–200ms depending on skill complexity.
K10 yearUses the 2026 additive model. 2025 calculations (MAX rule) require a different constants file (not yet available).
Tax optimizerAvailable on kammaren.nu but not yet exposed via the verify API.
Municipal taxCombined KI (kommunal + landsting). No separate breakdown.
Unverified constants4 constants marked "verified": false — they exist in code but lack a confirmed legal reference.