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

# Text classification



## OpenAPI

````yaml /api-reference/openapi.json post /v1/classifications/text
openapi: 3.1.0
info:
  title: SynapsAI Inference API
  version: 1.0.0
servers:
  - url: https://api.synapsai.cloud
    description: Production server
security: []
paths:
  /v1/classifications/text:
    post:
      summary: Text classification
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextClassificationRequest'
      responses:
        '200':
          description: Text classification results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClassificationListLabelScore'
components:
  schemas:
    TextClassificationRequest:
      allOf:
        - type: object
          description: Request to classify text inputs.
          properties:
            inputs:
              oneOf:
                - type: string
                - type: array
                  items:
                    type: string
                - type: object
                - type: array
                  items:
                    type: object
              description: >-
                Single text, list of texts, dict pairs or list of dicts to
                classify. Required.
            top_k:
              type: integer
              default: 1
              description: Number of top labels to return for each input.
            function_to_apply:
              type: string
              enum:
                - sigmoid
                - softmax
                - none
              default: softmax
              description: Function to apply to logits to produce probabilities or scores.
          required:
            - inputs
    ClassificationListLabelScore:
      type: array
      description: 'Standard classification response: list of label/score pairs.'
      items:
        type: object
        properties:
          label:
            type: string
            description: Predicted label name.
          score:
            type: number
            description: Confidence score (probability-like) for the label.

````