> ## Documentation index
> Fetch the complete documentation index at: https://docs.simplycpf.com/llms.txt
> Ask it with GET https://docs.simplycpf.com/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.

# Batch calculate CPF contributions

> Calculate CPF contributions for multiple income scenarios (up to 100).

`POST /calculate/batch`

## OpenAPI

````yaml openapi.json post /calculate/batch
openapi: 3.1.0
info:
  title: SimplyCPF API
  version: 1.0.0
  description: "Public SimplyCPF calculation and reference API. No authentication
    required. Amounts are in SGD. Rate limit: 10 requests per 10 seconds per
    client IP. Results are estimates, not financial advice."
  contact:
    name: SimplyCPF
    url: https://simplycpf.com
servers:
  - url: https://simplycpf.com/api/cpf
    description: Production
  - url: http://localhost:3000/api/cpf
    description: Local development
security: []
tags:
  - name: Calculation
    description: Calculate CPF contributions and projections
  - name: Age Groups
    description: Age group information and lookups
  - name: Income Ceiling
    description: CPF income ceiling data
  - name: Interest Rates
    description: CPF interest rates and SGS yields
  - name: Investment
    description: Investment comparison tools
paths:
  /calculate/batch:
    post:
      operationId: calculateCpfBatch
      summary: Batch calculate CPF contributions
      description: Calculate CPF contributions for multiple income scenarios (up to 100).
      tags:
        - Calculation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BatchCalculateRequest"
            example:
              scenarios:
                - income: 4000
                - income: 6000
                - income: 8000
      responses:
        "200":
          description: Successful batch calculation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/ComputedResult"
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          $ref: "#/components/responses/RateLimited"
components:
  responses:
    RateLimited:
      description: Rate limit exceeded. Production CPF API endpoints allow 10 requests
        per 10 seconds per client IP.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            error: Rate limit exceeded
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
      required:
        - error
    CalculateRequest:
      type: object
      properties:
        income:
          type: number
          minimum: 0
          description: Monthly gross income (non-negative)
        date:
          type: string
          format: date
          description: Date in YYYY-MM-DD format (defaults to today)
        age:
          type: number
          minimum: 0
          description: Age for age-group lookup
      required:
        - income
    BatchCalculateRequest:
      type: object
      properties:
        scenarios:
          type: array
          minItems: 1
          maxItems: 100
          items:
            $ref: "#/components/schemas/CalculateRequest"
          description: Array of calculation scenarios (1-100)
      required:
        - scenarios
    ContributionResult:
      type: object
      properties:
        totalContribution:
          type: number
          description: Total CPF contribution (employee + employer)
        employer:
          type: number
          description: Employer's CPF contribution
        employee:
          type: number
          description: Employee's CPF contribution
      required:
        - totalContribution
        - employer
        - employee
    DistributionResult:
      type: object
      properties:
        OA:
          type: number
          description: Ordinary Account allocation
        SA:
          type: number
          description: Special Account allocation
        MA:
          type: number
          description: MediSave Account allocation
      required:
        - OA
        - SA
        - MA
    ComputedResult:
      type: object
      properties:
        contribution:
          $ref: "#/components/schemas/ContributionResult"
        distribution:
          $ref: "#/components/schemas/DistributionResult"
        afterCpfContribution:
          type: number
          description: Take-home pay after CPF deduction
      required:
        - contribution
        - distribution
        - afterCpfContribution
````
