{
  "openapi": "3.1.0",
  "info": {
    "title": "rout.my API",
    "version": "1.0.0",
    "description": "OpenAI-compatible rout.my API surface."
  },
  "servers": [
    {
      "url": "https://api.rout.my/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/models": {
      "get": {
        "summary": "List models",
        "responses": {
          "200": {
            "description": "OpenAI-style model list"
          }
        }
      }
    },
    "/chat/completions": {
      "post": {
        "summary": "Create chat completion",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["model", "messages"],
                "properties": {
                  "model": { "type": "string", "example": "openai/gpt-5.4" },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "role": { "type": "string" },
                        "content": {}
                      }
                    }
                  },
                  "stream": { "type": "boolean" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Chat completion response" }
        }
      }
    },
    "/responses": {
      "post": {
        "summary": "Create response",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["model", "input"],
                "properties": {
                  "model": { "type": "string", "example": "openai/gpt-5.4" },
                  "input": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Responses-style object" }
        }
      }
    },
    "/embeddings": {
      "post": {
        "summary": "Create embeddings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["model", "input"],
                "properties": {
                  "model": { "type": "string", "example": "qwen/qwen3-embedding-8b" },
                  "input": {
                    "oneOf": [
                      { "type": "string" },
                      { "type": "array", "items": { "type": "string" } }
                    ]
                  },
                  "encoding_format": { "type": "string", "enum": ["float", "base64"] }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Embedding response" }
        }
      }
    },
    "/images/generations": {
      "post": {
        "summary": "Generate image",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["model", "prompt"],
                "properties": {
                  "model": { "type": "string", "example": "provider/image-model-id" },
                  "prompt": { "type": "string" },
                  "n": { "type": "integer", "minimum": 1 },
                  "size": { "type": "string" },
                  "quality": { "type": "string" },
                  "image_config": { "type": "object" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Image generation response" }
        }
      }
    },
    "/images/edits": {
      "post": {
        "summary": "Edit image",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["model", "prompt", "images"],
                "properties": {
                  "model": { "type": "string", "example": "provider/image-edit-model-id" },
                  "prompt": { "type": "string" },
                  "images": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        { "type": "string" },
                        {
                          "type": "object",
                          "properties": {
                            "image_url": {
                              "oneOf": [
                                { "type": "string" },
                                {
                                  "type": "object",
                                  "properties": {
                                    "url": { "type": "string" }
                                  }
                                }
                              ]
                            }
                          }
                        }
                      ]
                    }
                  },
                  "n": { "type": "integer", "minimum": 1 },
                  "size": { "type": "string" },
                  "quality": { "type": "string" },
                  "background": { "type": "string" },
                  "input_fidelity": { "type": "string" },
                  "moderation": { "type": "string" },
                  "output_compression": { "type": "integer", "minimum": 0, "maximum": 100 },
                  "output_format": { "type": "string" },
                  "partial_images": { "type": "integer", "minimum": 0 },
                  "stream": { "type": "boolean" }
                }
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["model", "prompt", "image"],
                "properties": {
                  "model": { "type": "string", "example": "provider/image-edit-model-id" },
                  "prompt": { "type": "string" },
                  "image": {
                    "oneOf": [
                      { "type": "string", "format": "binary" },
                      {
                        "type": "array",
                        "items": { "type": "string", "format": "binary" }
                      }
                    ]
                  },
                  "mask": { "type": "string", "format": "binary" },
                  "n": { "type": "integer", "minimum": 1 },
                  "size": { "type": "string" },
                  "quality": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Image edit response" }
        }
      }
    },
    "/video/generations": {
      "post": {
        "summary": "Generate video",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["model", "prompt"],
                "properties": {
                  "model": { "type": "string", "example": "provider/video-model-id" },
                  "prompt": {
                    "oneOf": [
                      { "type": "string" },
                      {
                        "type": "object",
                        "properties": {
                          "text": { "type": "string" },
                          "image": { "type": "string" }
                        }
                      }
                    ]
                  },
                  "duration": { "type": "number" },
                  "resolution": { "type": "string", "example": "720p" },
                  "aspect_ratio": { "type": "string", "example": "16:9" },
                  "input_image": { "type": "string" },
                  "image_url": { "type": "string" },
                  "input_video": { "type": "string" },
                  "video_url": { "type": "string" },
                  "input_audio": { "type": "string" },
                  "audio_url": { "type": "string" },
                  "n": { "type": "integer", "minimum": 1 },
                  "audio": { "type": "boolean" },
                  "sound": { "type": "string", "enum": ["on", "off"] },
                  "tier": { "type": "string", "enum": ["standard", "pro", "4k"] },
                  "quality": { "type": "string" },
                  "mode": { "type": "string" },
                  "voice_list": {
                    "type": "array",
                    "maxItems": 2,
                    "items": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "voice_id": { "type": "string" }
                      }
                    }
                  },
                  "provider_options": { "type": "object" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Video generation response" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
