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

# Text Compare

> Compare two texts to find similarities and differences between them. This endpoint analyzes both texts and returns detailed information about matching content, word counts, and similarity scores.



## OpenAPI

````yaml POST /v2/text-compare
openapi: 3.0.1
info:
  title: Winston AI API
  description: Winston AI API specification
  license:
    name: MIT
  version: 4.11.4
servers:
  - url: https://api.gowinston.ai/
security:
  - bearerAuth: []
paths:
  /v2/text-compare:
    post:
      description: >-
        Compare two texts to find similarities and differences between them.
        This endpoint analyzes both texts and returns detailed information about
        matching content, word counts, and similarity scores.
      requestBody:
        description: The text comparison request body
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextCompare'
        required: true
      responses:
        '200':
          description: Text comparison response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextCompare-response'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    default: BAD_REQUEST
                  description:
                    type: string
                    default: >-
                      The request was invalid and could not be processed. Make
                      sure you pass valid arguments.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    default: UNAUTHORIZED
                  description:
                    type: string
                    default: >-
                      Pass a valid API key in the Authorization header as a
                      Bearer token.
        '402':
          description: Payment Required (insufficient credits)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    default: PAYMENT_REQUIRED
                  description:
                    type: string
                    default: >-
                      Insufficient credits. Make sure you have enough credits to
                      make the request.
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    default: FORBIDDEN
                  description:
                    type: string
                    default: >-
                      The request was forbidden. Make sure you pass a valid URL
                      or document that we can access.
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    default: TOO_MANY_REQUESTS
                  description:
                    type: string
                    default: You have exceeded the rate limit. Please try again later.
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    default: INTERNAL_SERVER_ERROR
                  description:
                    type: string
                    default: An unexpected error occurred. Please try again later.
components:
  schemas:
    TextCompare:
      required:
        - first_text
        - second_text
      type: object
      properties:
        first_text:
          description: The first text to compare. Maximum 120,000 characters.
          type: string
          maxLength: 120000
        second_text:
          description: >-
            The second text to compare against the first text. Maximum 120,000
            characters.
          type: string
          maxLength: 120000
    TextCompare-response:
      type: object
      properties:
        status:
          type: integer
          description: >-
            HTTP status code representing the result of the text comparison
            request
        similarity_score:
          type: number
          description: |-
            Overall similarity score between the two texts (0-100). 

             0 means no similarity, 100 means identical.
        first_text:
          type: object
          properties:
            total_word_count:
              type: integer
              description: Total number of words in the first text
            matching_word_count:
              type: integer
              description: Number of words that match with the second text
            similarity_percentage:
              type: number
              description: Percentage of matching content in the first text
            items:
              type: array
              description: List of matching segments in the first text
              items:
                type: object
                properties:
                  type:
                    type: string
                    description: Type of match (identical, similar, etc.)
                  word_count:
                    type: integer
                    description: Number of words in this segment
                  index_start:
                    type: integer
                    description: Starting index of the segment in the text
                  length:
                    type: integer
                    description: Length of the segment in characters
        second_text:
          type: object
          properties:
            total_word_count:
              type: integer
              description: Total number of words in the second text
            matching_word_count:
              type: integer
              description: Number of words that match with the first text
            similarity_percentage:
              type: number
              description: Percentage of matching content in the second text
            items:
              type: array
              description: List of matching segments in the second text
              items:
                type: object
                properties:
                  type:
                    type: string
                    description: Type of match (identical, similar, etc.)
                  word_count:
                    type: integer
                    description: Number of words in this segment
                  index_start:
                    type: integer
                    description: Starting index of the segment in the text
                  length:
                    type: integer
                    description: Length of the segment in characters
        credits_used:
          description: >-
            The credits_used field represents the number of credits consumed for
            processing your request. Each text comparison request consumes the
            total number of words in both texts divided by 2.
          type: integer
        credits_remaining:
          description: >-
            The credits_remaining field shows how many credits you have left in
            your account after your request has been processed.
          type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````