openapi: 3.1.0
info:
  title: Gemma 3 1B IT API
  description: Instruction-tuned LLM for chat completion tasks
  version: '1.0.0'

servers:
  - url: https://api.simplismart.live
    description: Gemma 3 1B IT Proxy Server

tags:
  - name: Chat Completion
    description: Large Language Model chat completion services

paths:
  /chat/completions: 
    post:
      tags:
        - Chat Completion
      summary: Create chat completion with Gemma 3 1B IT
      description: Create a chat completion for given messages with streaming support
      operationId: createChatCompletionGemma34B
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                messages:
                  type: array
                  description: Array of messages in the conversation
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                        enum: [system, user, assistant]
                        description: The role of the message sender
                      content:
                        type: string
                        description: The content of the message
                    required:
                      - role
                      - content
                model:
                  type: string
                  description: Model identifier
                  enum: [google/gemma-3-1b-it]
                  default: "google/gemma-3-1b-it"
                stream:
                  type: boolean
                  description: Whether to stream the response
                  default: false
                temperature:
                  type: number
                  description: Sampling temperature
                  minimum: 0
                  maximum: 2
                  default: 0.7
                max_tokens:
                  type: integer
                  description: Maximum number of tokens to generate
                  minimum: 1
                  maximum: 4096
                  default: 1024
                top_p:
                  type: number
                  description: Nucleus sampling parameter
                  minimum: 0
                  maximum: 1
                  default: 0.95
                stop:
                  type: array
                  description: Sequences where the API will stop generating
                  items:
                    type: string
                  nullable: true
              required:
                - messages
                - model
            example:
              model: "google/gemma-3-1b-it"
              messages: [
                {
                  "role": "system",
                  "content": "Act as a helpful assistant to the user"
                },
                {
                  "role": "user",
                  "content": "Give me a travel itinerary for a 7-day trip to Japan"
                }
              ]
              stream: false
              temperature: 0.7
              max_tokens: 1024
              top_p: 0.9
              stop: null
      responses:
        '200':
          description: Successful chat completion
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the completion
                  choices:
                    type: array
                    items:
                      type: object
                      properties:
                        delta:
                          type: object
                          properties:
                            content:
                              type: string
                              description: Generated text content
                        index:
                          type: integer
                          description: Index of the choice
                        finish_reason:
                          type: string
                          enum: [stop, length, content_filter]
                          description: Reason for finishing the generation
        '400':
          description: Bad Request - Invalid request parameters. Check that all required fields are present and properly formatted.
        '401':
          description: Unauthorized - Invalid or missing authentication token. Ensure a valid Bearer token is provided in the Authorization header.
        '500':
          description: Internal Server Error - An unexpected error occurred on the server. Please retry the request or contact support if the issue persists.

components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token for authentication

security:
  - BearerAuth: []