openapi: 3.1.0
info:
  title: YJB AI Gateway
  version: 1.0.0
servers:
  - url: https://ai.yjb.su/v1
security:
  - bearerAuth: []
paths:
  /models:
    get:
      operationId: listModels
      responses:
        "200":
          description: Models available to the current API key
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ModelList"
  /chat/completions:
    post:
      operationId: createChatCompletion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChatRequest"
      responses:
        "200":
          description: Completion response or server-sent event stream
          content:
            application/json: {}
            text/event-stream: {}
  /responses:
    post:
      operationId: createResponse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [model, input]
              additionalProperties: true
              properties:
                model:
                  $ref: "#/components/schemas/ModelId"
                input: {}
                stream: { type: boolean, default: false }
      responses:
        "200": { description: Response or server-sent event stream }
  /embeddings:
    post:
      operationId: createEmbedding
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [model, input]
              additionalProperties: true
              properties:
                model:
                  $ref: "#/components/schemas/ModelId"
                input: {}
      responses:
        "200": { description: Embedding result }
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
  schemas:
    ModelId:
      type: string
      enum:
        - ai-synthetic-video-detector
        - arctic-embed-l
        - bge-m3
        - claude-fable-5
        - claude-haiku-4.5
        - claude-opus-4-5
        - claude-opus-4-6
        - claude-opus-4-7
        - claude-opus-4-8
        - claude-opus-5
        - claude-sonnet-4-5
        - claude-sonnet-4.6
        - claude-sonnet-5
        - codegemma-1-1-7b
        - codegemma-7b
        - codellama-70b
        - codestral
        - codestral-22b
        - command-a-plus
        - cosmos-reason2-8b
        - dbrx-instruct
        - deepseek-coder-6-7b-instruct
        - deepseek-r1
        - deepseek-v3.1
        - deepseek-v3.2
        - deepseek-v4-flash
        - deepseek-v4-pro
        - deplot
        - devstral-latest
        - diffusiongemma-26b-a4b-it
        - dracarys-llama-3-1-70b-instruct
        - embed-qa-4
        - fuyu-8b
        - gemini-2-5-flash
        - gemini-2.5-flash
        - gemini-2.5-flash-lite
        - gemini-2.5-pro
        - gemini-3-flash
        - gemini-3-pro
        - gemini-3.1-pro
        - gemini-3.5-flash
        - gemini-3.5-flash-lite
        - gemini-3.6-flash
        - gemini-fast
        - gemini-flash-lite-3.5
        - gemini-search
        - gemini-search-fast
        - gemini-search-large
        - gemma
        - gemma-2-2b-it
        - gemma-2b
        - gemma-3-12b-it
        - gemma-3-4b-it
        - gemma-3n-e2b-it
        - gemma-3n-e4b-it
        - gemma-4
        - gemma-4-26b
        - gemma-4-31b
        - gemma-4-31b-it
        - gliner-pii
        - glm-4.6
        - glm-4.7
        - glm-4.7-flash
        - glm-5
        - glm-5-turbo
        - glm-5.1
        - glm-5.2
        - glm-5v-turbo
        - gpt-4o
        - gpt-4o-mini
        - gpt-5-2-chat
        - gpt-5-mini
        - gpt-5-nano
        - gpt-5.2
        - gpt-5.4
        - gpt-5.4-mini
        - gpt-5.4-nano
        - gpt-5.5
        - gpt-5.6-luna
        - gpt-5.6-sol
        - gpt-5.6-terra
        - gpt-audio-1.5
        - gpt-audio-mini
        - gpt-oss
        - gpt-oss-120b
        - gpt-oss-20b
        - granite-3-0-3b-a800m-instruct
        - granite-3-0-8b-instruct
        - granite-34b-code-instruct
        - granite-8b-code-instruct
        - grok
        - grok-4-20-reasoning
        - grok-4.3
        - grok-4.5
        - grok-code-fast-1
        - hy3
        - inkling
        - ising-calibration-1-35b-a3b
        - jamba-1-5-large-instruct
        - kimi-k2-5
        - kimi-k2.6
        - kimi-k2.7-code
        - kimi-k3
        - kosmos-2
        - laguna
        - laguna-s-2.1
        - laguna-xs-2.1
        - ling-3.0-flash
        - llama-3-1-70b-instruct
        - llama-3-1-8b-instruct
        - llama-3-1-nemoguard-8b-content-safety
        - llama-3-1-nemoguard-8b-topic-control
        - llama-3-1-nemotron-51b-instruct
        - llama-3-1-nemotron-70b-instruct
        - llama-3-1-nemotron-nano-8b-v1
        - llama-3-1-nemotron-nano-vl-8b-v1
        - llama-3-1-nemotron-ultra-253b-v1
        - llama-3-2-11b-vision-instruct
        - llama-3-2-1b-instruct
        - llama-3-2-3b-instruct
        - llama-3-2-90b-vision-instruct
        - llama-3-2-nemoretriever-1b-vlm-embed-v1
        - llama-3-2-nemoretriever-300m-embed-v1
        - llama-3-2-nv-embedqa-1b-v1
        - llama-3-2-nv-embedqa-1b-v2
        - llama-3-3-70b-instruct
        - llama-3-3-nemotron-super-49b-v1
        - llama-3-3-nemotron-super-49b-v1-5
        - llama-3.3-70b
        - llama-4-maverick-17b-128e-instruct
        - llama-guard-4-12b
        - llama-maverick
        - llama-nemotron-embed-1b-v2
        - llama-nemotron-embed-vl-1b-v2
        - llama-scout
        - llama2-70b
        - llama3-chatqa-1-5-70b
        - longcat
        - mercury
        - midijourney
        - midijourney-large
        - mimo-v2.5
        - mimo-v2.5-pro
        - minimax-m2-her
        - minimax-m2.5
        - minimax-m2.7
        - minimax-m3
        - ministral-14b
        - ministral-14b-instruct-2512
        - ministral-3-8b
        - ministral-3b
        - ministral-8b
        - mistral-7b
        - mistral-large
        - mistral-large-2-instruct
        - mistral-large-3-675b-instruct-2512
        - mistral-medium-3-5
        - mistral-medium-3-5-128b
        - mistral-medium-latest
        - mistral-nemo-12b-instruct
        - mistral-nemo-minitron-8b-8k-instruct
        - mistral-nemotron
        - mistral-small-3.2
        - mistral-small-4
        - mixtral-8x22b
        - mixtral-8x22b-base
        - mixtral-8x7b
        - muse-spark-1.1
        - nemoretriever-parse
        - nemotron-3-content-safety
        - nemotron-3-embed-1b
        - nemotron-3-nano-30b-a3b
        - nemotron-3-nano-omni-30b-a3b-reasoning
        - nemotron-3-super
        - nemotron-3-ultra
        - nemotron-4-340b-instruct
        - nemotron-4-340b-reward
        - nemotron-content-safety-reasoning-4b
        - nemotron-mini-4b-instruct
        - nemotron-nano-12b-v2-vl
        - nemotron-nano-3-30b-a3b
        - nemotron-nano-9b-v2
        - nemotron-parse
        - neva-22b
        - nova-2-lite
        - nova-micro
        - nv-embed-v1
        - nv-embedcode-7b-v1
        - nv-embedqa-e5-v5
        - nv-embedqa-mistral-7b-v2
        - nvclip
        - nvidia-nemotron-nano-9b-v2
        - palmyra-creative-122b
        - palmyra-fin-70b-32k
        - palmyra-med-70b
        - palmyra-med-70b-32k
        - perplexity
        - perplexity-fast
        - perplexity-high
        - perplexity-reasoning
        - phi-3-5-moe-instruct
        - phi-3-vision-128k-instruct
        - phi-4-mini-instruct
        - phi-4-multimodal-instruct
        - qwen-2.5-coder-32b
        - qwen-coder
        - qwen-safety
        - qwen2-5
        - qwen3-5-122b-a10b
        - qwen3-5-397b-a17b
        - qwen3-coder-30-a3b
        - qwen3-coder-480b
        - qwen3-coder-480b-a35b-instruct
        - qwen3-coder-next
        - qwen3-next-80b-a3b-instruct
        - qwen3-next-80b-a3b-thinking
        - qwen3-vl
        - qwen3-vl-pro
        - qwen3.6-27b
        - qwen3.6-35b-a3b
        - qwen3.6-flash
        - qwen3.6-plus
        - qwen3.7-flash
        - qwen3.7-max
        - qwen3.7-plus
        - qwen3.8-max
        - recurrentgemma-2b
        - riva-translate-4b-instruct
        - riva-translate-4b-instruct-v1-1
        - sarvam-m
        - sea-lion-7b-instruct
        - seed-oss-36b-instruct
        - solar-10-7b-instruct
        - starcoder2-15b
        - step-3-5-flash
        - step-3.5-flash
        - step-3.7-flash
        - stockmark-2-100b-instruct
        - vila
        - yi-large
        - zamba2-7b-instruct
    ChatRequest:
      type: object
      required: [model, messages]
      additionalProperties: true
      properties:
        model:
          $ref: "#/components/schemas/ModelId"
        messages:
          type: array
          items:
            type: object
            required: [role, content]
            additionalProperties: true
            properties:
              role: { type: string, enum: [system, developer, user, assistant, tool] }
              content: {}
        stream: { type: boolean, default: false }
        tools: { type: array }
        tool_choice: {}
        response_format: { type: object }
    ModelList:
      type: object
      required: [object, data]
      properties:
        object: { type: string, const: list }
        data:
          type: array
          items:
            type: object
            required: [id, object, owned_by]
            properties:
              id: { type: string }
              object: { type: string, const: model }
              owned_by: { type: string, description: Model vendor organization (e.g. anthropic, openai, z-ai) }
