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

# Suggest a source for every model parameter with AI

> Best-guess sources: pattern rules first, then AI for the gaps; all validated.



## OpenAPI

````yaml https://api.ionworks.com/openapi.json post /model_builders/suggest
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.ionworks.com
    description: Production
security: []
paths:
  /model_builders/suggest:
    post:
      tags:
        - Model builders
      summary: Suggest a source for every model parameter with AI
      description: >-
        Best-guess sources: pattern rules first, then AI for the gaps; all
        validated.
      operationId: suggest_sources_model_builders_suggest_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SuggestRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuggestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SuggestRequest:
      properties:
        model_id:
          type: string
          title: Model Id
        cell_spec_id:
          type: string
          title: Cell Spec Id
        use_ai:
          type: boolean
          title: Use Ai
          description: Ask the AI to fill what the pattern rules could not place.
          default: true
      type: object
      required:
        - model_id
        - cell_spec_id
      title: SuggestRequest
      description: 'What to suggest sources for: a model, against an example cell spec.'
    SuggestResponse:
      properties:
        sources:
          additionalProperties:
            additionalProperties: true
            type: object
          type: object
          title: Sources
          description: >-
            Parameter -> {kind: 'cell_spec', path} | {kind: 'value', value} |
            {kind: 'calculation', type, options}.
        reasons:
          additionalProperties:
            type: string
          type: object
          title: Reasons
        origins:
          additionalProperties:
            type: string
            enum:
              - rule
              - default
              - ai
          type: object
          title: Origins
          description: 'Who placed it: a rule, a conventional default to confirm, or the AI.'
        rejected:
          items:
            $ref: '#/components/schemas/RejectedSuggestion'
          type: array
          title: Rejected
        ai_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Ai Error
          description: Why the AI step did not run or failed; rules still apply.
      type: object
      required:
        - sources
      title: SuggestResponse
      description: Validated suggestions, in the editor's per-parameter source shape.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RejectedSuggestion:
      properties:
        parameter:
          type: string
          title: Parameter
        reason:
          type: string
          title: Reason
      type: object
      required:
        - parameter
        - reason
      title: RejectedSuggestion
      description: A suggestion the model made that failed validation, and why.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.