{
    "openapi": "3.1.0",
    "info": {
        "title": "EvoLink Auto - Claude Format",
        "description": "Intelligent model routing using Anthropic Messages API format",
        "license": {
            "name": "MIT"
        },
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://direct.evolink.ai",
            "description": "Standard API"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "paths": {
        "/v1/messages": {
            "post": {
                "summary": "Intelligent Model Routing (Claude Format)",
                "description": "Intelligent routing using Anthropic Messages API format",
                "operationId": "createMessagesAuto",
                "tags": ["Intelligent Routing"],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ClaudeAutoRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ClaudeResponse"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "ClaudeAutoRequest": {
                "type": "object",
                "required": ["model", "messages", "max_tokens"],
                "properties": {
                    "model": {
                        "type": "string",
                        "description": "Use intelligent routing",
                        "enum": ["evolink/auto"],
                        "example": "evolink/auto"
                    },
                    "messages": {
                        "type": "array",
                        "description": "Conversation messages",
                        "items": {
                            "$ref": "#/components/schemas/MessageInput"
                        },
                        "minItems": 1,
                        "example": [
                            {
                                "role": "user",
                                "content": "Introduce the history of artificial intelligence"
                            }
                        ]
                    },
                    "max_tokens": {
                        "type": "integer",
                        "description": "Maximum tokens to generate",
                        "minimum": 1,
                        "example": 1024
                    },
                    "temperature": {
                        "type": "number",
                        "description": "Sampling temperature, `0` to `2`. When the request is routed to a Claude model, which accepts `0` to `1`, values above `1` are treated as `1` and values below `0` as `0`.",
                        "minimum": 0,
                        "maximum": 2,
                        "example": 0.7
                    },
                    "top_p": {
                        "type": "number",
                        "description": "Nucleus sampling parameter. When the request is routed to a Claude 4 or later model, which accepts only one of `temperature` and `top_p`, only one of them is used; see the Claude Messages API page for the rule.",
                        "minimum": 0,
                        "maximum": 1,
                        "example": 0.9
                    },
                    "top_k": {
                        "type": "integer",
                        "description": "Top-K sampling",
                        "minimum": 1,
                        "example": 40
                    },
                    "stream": {
                        "type": "boolean",
                        "description": "Enable streaming",
                        "default": false
                    }
                }
            },
            "MessageInput": {
                "type": "object",
                "required": ["role", "content"],
                "properties": {
                    "role": {
                        "type": "string",
                        "enum": ["user", "assistant"]
                    },
                    "content": {
                        "type": "string"
                    }
                }
            },
            "ClaudeResponse": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "Response unique identifier"
                    },
                    "model": {
                        "type": "string",
                        "description": "Actual model name used",
                        "example": "claude-opus-4-7"
                    },
                    "type": {
                        "type": "string",
                        "enum": ["message"]
                    },
                    "role": {
                        "type": "string",
                        "enum": ["assistant"]
                    },
                    "content": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "type": {
                                    "type": "string",
                                    "enum": ["text"]
                                },
                                "text": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "usage": {
                        "type": "object",
                        "properties": {
                            "input_tokens": {
                                "type": "integer"
                            },
                            "output_tokens": {
                                "type": "integer"
                            }
                        }
                    }
                },
                "example": {
                    "id": "msg_01XFDUDYJgAACyzWYzeHhsX7",
                    "model": "gpt-5.4",
                    "type": "message",
                    "role": "assistant",
                    "content": [
                        {
                            "type": "text",
                            "text": "인공지능의 발전 역사는 1950년대로 거슬러 올라갑니다..."
                        }
                    ],
                    "usage": {
                        "input_tokens": 15,
                        "output_tokens": 156
                    }
                }
            }
        },
        "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"
            }
        }
    }
}
