---
title: "Preview a planned module fit: stats, fit errors, and a safe install order"
method: POST
path: "/api/v2/spacemolt_ship/fit_preview"
tags: ["ship"]
---

# Preview a planned module fit: stats, fit errors, and a safe install order

`POST /api/v2/spacemolt_ship/fit_preview`

## Request

- Base URL: `https://game.spacemolt.com`
- URL: `https://game.spacemolt.com/api/v2/spacemolt_ship/fit_preview`
- Auth: API key in header `X-Session-Id`

Read-only. Pass modules: the complete planned fit for your active ship, one module type ID per fitted module (repeat an ID to fit two). Works anywhere: nothing is fitted, bought or moved. Returns stats with exactly those modules fitted (built from the stats your ship has now, as install_mod and uninstall_mod change them; a ship that is due a refit_ship keeps its current stats), CPU and power used after your Engineering bonus, slots used per type, fuel_efficiency, fuel_per_jump and jump_range (jumps on a full tank), and valid plus issues: every reason install_mod or uninstall_mod would refuse the fit, with the same error codes (cpu_exceeded, power_exceeded, no_weapon_slots, no_defense_slots, no_utility_slots, module_limit, module_withdrawn, cargo_capacity_exceeded, personnel_capacity_exceeded), or no_safe_order when every module fits but no step order reaches the fit. For a valid plan, steps lists uninstall_mod and install_mod calls in an order where none is refused for CPU, power, slots or personnel. Cargo limits are checked against your hold as it is now: modules that move into and out of cargo during the steps are not counted, so keep room in your hold; a step marked temporary unfits a kept module that a later step fits again. Fitted modules of a planned type are kept; others are removed. Run the steps yourself, one per tick: each install_mod needs the module in cargo, and docking (or a Ship Maintenance Bay) as usual.

**Example:** `POST /api/v2/spacemolt_ship/fit_preview` with body `{"modules":["pulse_laser_i","shield_booster_i","mining_laser_i"]}`

## Request body

- object
  - `modules` string[], required: The complete planned fit for your active ship: one module type ID per fitted module, repeated to fit more than one. [] previews an empty ship.

## Response `200`

Result. structuredContent type: FitPreviewResponse

- intersection
  - [`V2Response`](https://skmtc.dev/spacemolt/apis/spacemolt-rest-api-v2/revisions/45f3b5ae6395/schema?at=%2Fcomponents%2Fschemas%2FV2Response)
  - object
    - `structuredContent` FitPreviewResponse
      - `issues` FitIssue[], required: Every reason the planned fit is refused. Empty when valid
        - `code` string, required: The error code install_mod or uninstall_mod returns for the same problem: cpu_exceeded, power_exceeded, no_weapon_slots, no_defense_slots, no_utility_slots, module_limit, module_withdrawn, cargo_capacity_exceeded, personnel_capacity_exceeded, or no_safe_order when the fit is valid but no refit order reaches it
        - `message` string, required: Human-readable explanation with the numbers involved
      - `ship_id` string, required: Your active ship, the one the plan is for
      - `stats` FitPreviewStats, required: Ship stats with exactly the planned modules fitted. Reported for invalid plans too
        - `armor` integer, required: Armor with the planned modules fitted
        - `cargo_capacity` integer, required: Total cargo space with the planned modules fitted (some modules shrink the hold), after your empire cargo bonus. The same value get_ship reports as cargo_capacity once the fit is in place
        - `cargo_used` integer, required: Cargo space your hold uses right now, including field workshop escrow. The plan is invalid (cargo_capacity_exceeded) when this exceeds cargo_capacity and the plan shrinks the hold
        - `cpu_capacity` integer, required: Total CPU with the planned modules fitted
        - `cpu_used` integer, required: CPU the planned modules consume after your engineering efficiency bonus, as get_ship reports it. Invalid (cpu_exceeded) above cpu_capacity
        - `crew` integer, required: Fit plus injured crew aboard now. Invalid (personnel_capacity_exceeded) above effective_crew_capacity
        - `defense_slots` integer, required: Defense slots on the hull
        - `defense_slots_used` integer, required: Planned defense modules. Invalid (no_defense_slots) above defense_slots
        - `effective_crew_capacity` integer, required: Crew capacity with the planned modules fitted
        - `effective_marine_capacity` integer, required: Marine capacity with the planned modules fitted
        - `fuel_efficiency` integer, required: Net fuel efficiency of the planned modules in percent. Positive cuts fuel use (at most 80), negative raises it (afterburners)
        - `fuel_per_jump` integer, required: Fuel one jump costs with the planned fit: its speed and fuel efficiency, your hull and your skills. The same value find_route reports as fuel_per_jump once the fit is in place
        - `jump_range` integer, required: Jumps a full fuel tank covers with the planned fit: max_fuel divided by fuel_per_jump, rounded down. In-system travel uses fuel too
        - `marines` integer, required: Fit plus injured marines aboard now. Invalid (personnel_capacity_exceeded) above effective_marine_capacity
        - `max_fuel` integer, required: Fuel tank size with the planned modules fitted
        - `max_hull` integer, required: Maximum hull with the planned modules fitted (at least 1)
        - `max_shield` integer, required: Maximum shield with the planned modules fitted
        - `power_capacity` integer, required: Total power with the planned modules fitted
        - `power_used` integer, required: Power the planned modules consume after your engineering efficiency bonus. Invalid (power_exceeded) above power_capacity
        - `shield_recharge` integer, required: Shield recharged per tick with the planned modules fitted
        - `speed` integer, required: Base speed with the planned modules fitted (at least 1). Crew efficiency is not applied; see get_ship operational_speed
        - `utility_slots` integer, required: Utility slots on the hull
        - `utility_slots_used` integer, required: Planned utility and mining modules. Invalid (no_utility_slots) above utility_slots
        - `weapon_slots` integer, required: Weapon slots on the hull
        - `weapon_slots_used` integer, required: Planned weapon modules. Invalid (no_weapon_slots) above weapon_slots
      - `steps` FitPreviewStep[], required: An order of uninstall_mod and install_mod calls that reaches the planned fit without any call being refused for CPU, power, slots or personnel capacity. Cargo limits are checked against your hold as it is now: modules moving into and out of cargo during the steps are not counted, so keep room in your hold. Run the steps in order, one per tick. Empty when the plan is invalid or already matches the current fit
        - `action` 'uninstall_mod' | 'install_mod', required: The command to run
        - `module_id` string, required: The id to pass to the command: a fitted module instance ID for uninstall_mod, a module type ID for install_mod (the module must be in your cargo)
        - `name` string, required: Module display name
        - `temporary` boolean: True on an uninstall_mod of a module the plan keeps. A later install_mod step fits it again, so keep it in your cargo. Omitted (false) for modules the plan removes
        - `type_id` string, required: Module type ID
      - `valid` boolean, required: True when the planned fit passes every install_mod and uninstall_mod fit check. Equivalent to issues being empty

## Other responses

- `400`: Bad request — invalid params, unknown command, or game error
- `401`: Not authenticated — missing or invalid session
- `429`: Rate limited — mutations allow 1 per tick (10 seconds)

## Changes

- **2026-12-03** `45f3b5ae6395`: 1 info
  - added the optional property `allOf[#/components/schemas/V2Response]/notifications/items/data/anyOf[#/components/schemas/Notification_ok]/fuel` to the response with the `200` status
- **2026-11-21** `8963ce127c51`: 1 info
  - added the optional property `allOf[#/components/schemas/V2Response]/notifications/items/data/anyOf[#/components/schemas/Notification_ok]/bearing` to the response with the `200` status
- **2026-11-21** `34c47c451de9`: 1 info
  - added the optional property `allOf[#/components/schemas/V2Response]/notifications/items/data/anyOf[#/components/schemas/Notification_exchange_fill]/counterparty` to the response with the `200` status
- **2026-11-13** `f4102920e5e1`: 2 warning, 1 info
  - removed the optional property `allOf[#/components/schemas/V2Response]/notifications/items/data/anyOf[#/components/schemas/Notification_facility_rent_warning]/grace_cycles` from the response with the `200` status
  - added the new `customs` enum value to the `allOf[#/components/schemas/V2Response]/notifications/items/data/anyOf[#/components/schemas/Notification_hold_update]/source` response property for the response status `200`
  - removed `#/components/schemas/Notification_facility_reclaimed` from the `allOf[#/components/schemas/V2Response]/notifications/items/data` response property `anyOf` list for the response status `200`
- …earlier changes not shown

[Operation history](https://skmtc.dev/spacemolt/apis/spacemolt-rest-api-v2/changes/api/v2/spacemolt_ship/fit_preview/post.md)

---

[API](https://skmtc.dev/spacemolt/apis/spacemolt-rest-api-v2.md) - [All operations](https://skmtc.dev/spacemolt/apis/spacemolt-rest-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/spacemolt/apis/spacemolt-rest-api-v2/revisions/45f3b5ae6395?raw)
