{
  "openapi": "3.1.0",
  "info": {
    "title": "SeedRouter Kimi K3",
    "version": "1.0.0",
    "description": "Kimi's official Chat Completions, Responses and Anthropic Messages formats under the SeedRouter base URL: change the base URL and API key. Failed requests are not charged."
  },
  "servers": [
    {
      "url": "https://api.seedrouter.ai/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/chat/completions": {
      "post": {
        "summary": "Create a chat completion",
        "operationId": "createChatCompletion",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "messages"
                ],
                "additionalProperties": true,
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "kimi-k3"
                    ]
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "max_completion_tokens": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1048576,
                    "default": 131072,
                    "description": "Includes reasoning tokens. max_tokens is its deprecated name."
                  },
                  "reasoning_effort": {
                    "type": "string",
                    "enum": [
                      "low",
                      "high",
                      "max"
                    ],
                    "default": "max"
                  },
                  "stop": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "maxItems": 5
                      }
                    ]
                  },
                  "response_format": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "text",
                          "json_object",
                          "json_schema"
                        ]
                      }
                    }
                  },
                  "prompt_cache_options": {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "enum": [
                          "implicit"
                        ],
                        "default": "implicit"
                      },
                      "ttl": {
                        "type": "string",
                        "enum": [
                          "5m",
                          "1h"
                        ],
                        "default": "5m"
                      }
                    }
                  },
                  "temperature": {
                    "type": "number",
                    "enum": [
                      1
                    ],
                    "description": "Fixed; leave it out."
                  },
                  "top_p": {
                    "type": "number",
                    "enum": [
                      0.95
                    ],
                    "description": "Fixed; leave it out."
                  },
                  "n": {
                    "type": "integer",
                    "enum": [
                      1
                    ],
                    "description": "Fixed; leave it out."
                  },
                  "top_logprobs": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 20
                  },
                  "stream": {
                    "type": "boolean",
                    "default": false
                  },
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "tool_choice": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The official response object, or a server-sent event stream when stream is true."
          },
          "400": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/responses": {
      "post": {
        "summary": "Create a response",
        "operationId": "createResponse",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "input"
                ],
                "additionalProperties": true,
                "description": "Stateless: previous_response_id, conversation and built-in tools are ignored.",
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "kimi-k3"
                    ]
                  },
                  "input": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    ]
                  },
                  "instructions": {
                    "type": "string"
                  },
                  "max_output_tokens": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1048576,
                    "description": "Includes reasoning tokens."
                  },
                  "reasoning": {
                    "type": "object",
                    "properties": {
                      "effort": {
                        "type": "string",
                        "enum": [
                          "low",
                          "high",
                          "max"
                        ]
                      }
                    }
                  },
                  "text": {
                    "type": "object",
                    "properties": {
                      "format": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "tool_choice": {},
                  "stream": {
                    "type": "boolean",
                    "default": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The official response object, or a server-sent event stream when stream is true."
          },
          "400": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/messages": {
      "post": {
        "summary": "Create a message (Anthropic Messages format)",
        "operationId": "createMessage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "max_tokens",
                  "messages"
                ],
                "additionalProperties": true,
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "kimi-k3"
                    ]
                  },
                  "max_tokens": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1048576
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "system": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "additionalProperties": true
                        }
                      }
                    ]
                  },
                  "output_config": {
                    "type": "object",
                    "properties": {
                      "effort": {
                        "type": "string",
                        "enum": [
                          "low",
                          "high",
                          "max"
                        ]
                      }
                    }
                  },
                  "stream": {
                    "type": "boolean",
                    "default": false
                  },
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "tool_choice": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The official response object, or a server-sent event stream when stream is true."
          },
          "400": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Public error; no infrastructure details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              10001,
              10002,
              20001,
              20002,
              30001,
              30002,
              50001,
              50002,
              50003,
              60001,
              60002,
              60003,
              60004,
              90001
            ]
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
