{
    "openapi": "3.1.0",
    "info": {
        "title": "EvoLink Auto - Gemini Format",
        "description": "Intelligent model routing using Google Generative AI format",
        "license": {
            "name": "MIT"
        },
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://direct.evolink.ai",
            "description": "Standard API"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "paths": {
        "/v1beta/models/{model}:generateContent": {
            "post": {
                "summary": "Intelligent Model Routing (Gemini Format)",
                "description": "Intelligent routing using Google Generative AI format",
                "operationId": "generateContentAuto",
                "tags": ["Intelligent Routing"],
                "parameters": [
                    {
                        "name": "model",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": ["evolink/auto"],
                            "example": "evolink/auto"
                        },
                        "description": "Model name, use evolink/auto to enable intelligent routing"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/GeminiAutoRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GeminiResponse"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "GeminiAutoRequest": {
                "type": "object",
                "required": ["contents"],
                "properties": {
                    "contents": {
                        "type": "array",
                        "description": "Conversation content list",
                        "items": {
                            "type": "object",
                            "properties": {
                                "role": {
                                    "type": "string",
                                    "enum": ["user", "model"]
                                },
                                "parts": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "text": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                }
                            }
                        },
                        "example": [
                            {
                                "role": "user",
                                "parts": [
                                    {
                                        "text": "Introduce the history of artificial intelligence"
                                    }
                                ]
                            }
                        ]
                    },
                    "generationConfig": {
                        "type": "object",
                        "properties": {
                            "temperature": {
                                "type": "number",
                                "minimum": 0,
                                "maximum": 2,
                                "example": 0.7
                            },
                            "topP": {
                                "type": "number",
                                "minimum": 0,
                                "maximum": 1,
                                "example": 0.9
                            },
                            "topK": {
                                "type": "integer",
                                "minimum": 1,
                                "example": 40
                            },
                            "maxOutputTokens": {
                                "type": "integer",
                                "example": 1024
                            }
                        }
                    }
                }
            },
            "GeminiResponse": {
                "type": "object",
                "properties": {
                    "candidates": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "content": {
                                    "type": "object",
                                    "properties": {
                                        "parts": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "text": {
                                                        "type": "string"
                                                    }
                                                }
                                            }
                                        },
                                        "role": {
                                            "type": "string",
                                            "enum": ["model"]
                                        }
                                    }
                                },
                                "finishReason": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "usageMetadata": {
                        "type": "object",
                        "properties": {
                            "promptTokenCount": {
                                "type": "integer"
                            },
                            "candidatesTokenCount": {
                                "type": "integer"
                            },
                            "totalTokenCount": {
                                "type": "integer"
                            }
                        }
                    },
                    "modelVersion": {
                        "type": "string",
                        "description": "Actual model version used",
                        "example": "gemini-2.5-pro"
                    }
                },
                "example": {
                    "candidates": [
                        {
                            "content": {
                                "parts": [
                                    {
                                        "text": "인공지능의 발전 역사는 1950년대로 거슬러 올라갑니다..."
                                    }
                                ],
                                "role": "model"
                            },
                            "finishReason": "STOP"
                        }
                    ],
                    "usageMetadata": {
                        "promptTokenCount": 15,
                        "candidatesTokenCount": 156,
                        "totalTokenCount": 171
                    },
                    "modelVersion": "gpt-5.4"
                }
            }
        },
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "##All APIs require Bearer Token authentication##\n\n**Get API Key:**\n\nVisit [API Key Management](https://evolink.ai/dashboard/keys) to get your API Key\n\n**Add to request header:**\n```\nAuthorization: Bearer YOUR_API_KEY\n```",
                "bearerFormat": "sk-evo-xxxxxxxxxx"
            }
        }
    }
}
