openapi: 3.1.0
info:
  title: AiGoCode API
  version: 1.0.0
  description: AiGoCode public API reference for compatible model access.
servers:
  - url: https://api.aigocode.com
paths:
  /v1/models:
    get:
      summary: List models
      description: List models available to the current API Key.
      responses:
        "200":
          description: Model list
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        object:
                          type: string
                          const: model
  /v1/chat/completions:
    post:
      summary: Create chat completion
      description: Create a chat completion with the OpenAI Compatible API.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - messages
              properties:
                model:
                  type: string
                  example: gpt-5.3-codex
                messages:
                  type: array
                  items:
                    type: object
                    required:
                      - role
                      - content
                    properties:
                      role:
                        type: string
                        enum: [system, user, assistant]
                      content:
                        type: string
      responses:
        "200":
          description: Chat completion response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  object:
                    type: string
                  choices:
                    type: array
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                        message:
                          type: object
                          properties:
                            role:
                              type: string
                            content:
                              type: string
  /v1/messages:
    post:
      summary: Create Anthropic-compatible message
      description: Create a Claude message with the Anthropic Compatible API.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - max_tokens
                - messages
              properties:
                model:
                  type: string
                  example: claude-sonnet-4-6
                max_tokens:
                  type: integer
                  example: 512
                messages:
                  type: array
                  items:
                    type: object
                    required:
                      - role
                      - content
                    properties:
                      role:
                        type: string
                        enum: [user, assistant]
                      content:
                        type: string
      responses:
        "200":
          description: Message response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  type:
                    type: string
                  role:
                    type: string
                  content:
                    type: array
  /v1beta/models/{model}:generateContent:
    post:
      summary: Generate Gemini content
      description: Generate content with the Gemini Compatible API.
      parameters:
        - name: model
          in: path
          required: true
          schema:
            type: string
            example: gemini-3.1-pro-preview
        - name: key
          in: query
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - contents
              properties:
                contents:
                  type: array
                  items:
                    type: object
                    properties:
                      parts:
                        type: array
                        items:
                          type: object
                          properties:
                            text:
                              type: string
      responses:
        "200":
          description: Gemini content response
          content:
            application/json:
              schema:
                type: object
                properties:
                  candidates:
                    type: array
