> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kordless.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Run a price simulation

> Evaluates a request against the published Book without persisting it.
The response includes the decision, total, line items, derivation, and
any missing inputs or review reasons. Requires the `simulations:write`
scope.




## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/accounts/{id}/quote-simulations
openapi: 3.1.0
info:
  title: Kordless API
  version: 1.0.0
  description: |
    The Kordless API gives you programmatic access to the same verified Book,
    evaluator, and commitment mechanics that the workspace uses.

    ## Authentication

    All requests require a bearer token in the `Authorization` header:

    ```
    Authorization: Bearer sk_test_...
    ```

    Test keys use the `sk_test_` prefix; Live keys use `sk_live_`. The
    environment is encoded in the prefix — a Test key can never address Live
    data.

    ## Idempotency

    Write operations that create or mutate state require an `Idempotency-Key`
    header (up to 200 characters) so retries replay instead of duplicating.

    ## Rate limiting

    Requests are rate-limited per account and environment. The default limit is
    600 requests per minute. Responses include `ratelimit-limit`,
    `ratelimit-remaining`, and `ratelimit-reset` headers.

    ## Request IDs

    Every response includes an `x-request-id` header. Use this ID to find the
    request in the logs or when contacting support.
servers:
  - url: https://your-kordless-instance.com
    description: Replace with your Kordless instance base URL
security:
  - BearerAuth: []
tags:
  - name: Accounts
    description: List and retrieve account targets.
  - name: Quote spec
    description: Read the published Book specification.
  - name: Quote simulations
    description: Run non-persistent price simulations.
  - name: Quotes
    description: Produce formal, persisted quotes.
  - name: Commitments
    description: Create and confirm commitments on quotes.
  - name: Request logs
    description: Inspect API request history.
paths:
  /v1/accounts/{id}/quote-simulations:
    post:
      tags:
        - Quote simulations
      summary: Run a price simulation
      description: |
        Evaluates a request against the published Book without persisting it.
        The response includes the decision, total, line items, derivation, and
        any missing inputs or review reasons. Requires the `simulations:write`
        scope.
      operationId: createQuoteSimulation
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The account ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SimulationRequest'
      responses:
        '200':
          description: The simulation result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteSimulation'
        '400':
          $ref: '#/components/responses/InvalidRequest'
components:
  schemas:
    SimulationRequest:
      type: object
      required:
        - services
      properties:
        context:
          type: object
          description: >-
            Optional context key-value pairs (string, number, or boolean
            values).
          additionalProperties: true
        services:
          type: array
          minItems: 1
          maxItems: 10
          description: The services to price (1–10).
          items:
            type: object
            required:
              - service
            properties:
              service:
                type: string
                description: The service key from the quote spec.
              selections:
                type: object
                description: Key-value selections (string, number, or boolean values).
                additionalProperties: true
    QuoteSimulation:
      type: object
      properties:
        object:
          type: string
          enum:
            - quote_simulation
        decision:
          type: string
          enum:
            - priced
            - needs_input
            - unavailable
            - failed
          description: The evaluator's decision.
        quote_mode:
          type: string
          enum:
            - instant
            - quote
            - unavailable
        book:
          type: object
          properties:
            key:
              type: string
            version:
              type: integer
            currency:
              type: string
            artifact_hash:
              type: string
        total:
          type: object
          nullable: true
          properties:
            low_cents:
              type: integer
            high_cents:
              type: integer
            currency:
              type: string
        line_items:
          type: array
          items:
            type: object
            properties:
              source:
                type: string
              label:
                type: string
              kind:
                type: string
              quantity:
                type: number
              total:
                type: object
                properties:
                  low_cents:
                    type: integer
                  high_cents:
                    type: integer
        missing_inputs:
          type: array
          items:
            type: object
        review_reasons:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              message:
                type: string
        inspection:
          type: object
          nullable: true
          properties:
            kind:
              type: string
            code:
              type: string
            prompt:
              type: string
        derivation:
          type: array
          items:
            type: object
            properties:
              kind:
                type: string
              label:
                type: string
        warnings:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              message:
                type: string
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request
                - authentication_error
                - permission_error
                - not_found
                - idempotency_error
                - rate_limit_error
                - api_error
            code:
              type: string
              description: A stable, machine-readable error code.
            message:
              type: string
              description: A human-readable explanation.
            param:
              type: string
              description: The request parameter that caused the error, when applicable.
            request_id:
              type: string
              description: The unique request identifier.
  responses:
    InvalidRequest:
      description: The request was invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Pass your API key as a bearer token. Test keys start with `sk_test_`;
        Live keys start with `sk_live_`.

````