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

# Integrate with an AI model

> Integrates with an AI model (e.g., GPT-4) to generate responses and select tools in Sol.



## OpenAPI

````yaml sol-open-api-spec.yaml post /ai/integrate
openapi: 3.0.0
info:
  title: Sol API
  description: >-
    API for managing AI-powered tool integrations in third-party applications,
    enabling seamless automation and execution of tasks.
  version: 1.0.0
servers:
  - url: https://api.sol.com/v1
    description: Main (production) server
security: []
paths:
  /ai/integrate:
    post:
      summary: Integrate with an AI model
      description: >-
        Integrates with an AI model (e.g., GPT-4) to generate responses and
        select tools in Sol.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: AI model to use (e.g., gpt-4)
                  example: gpt-4
                messages:
                  type: array
                  description: List of messages for the AI model
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                        example: user
                      content:
                        type: string
                        example: Draft an email welcoming Tara to the platform.
                tools:
                  type: array
                  description: Available tools for the AI to select from
                  items:
                    type: string
                    example: create_email_draft
                tool_choice:
                  type: string
                  description: How the AI should choose tools (e.g., auto)
                  example: auto
      responses:
        '200':
          description: AI response with selected tool(s)
          content:
            application/json:
              schema:
                type: object
                properties:
                  responseId:
                    type: string
                    example: response-45678
                  tool_calls:
                    type: array
                    items:
                      type: object
                      properties:
                        toolId:
                          type: string
                          example: tool-6789
                        params:
                          type: object
                          example:
                            from_email: noreply@sol.com
                            to_email: tara@sol.com
                  status:
                    type: string
                    example: tools_selected

````