{
  "openapi": "3.1.0",
  "info": {
    "title": "RouterHub Inference API",
    "version": "1",
    "description": "Public compatibility reference for the Responses, Anthropic Messages, and Chat Completions endpoints. Authenticate with a RouterHub API key. Usage is charged to the account prepaid balance. See https://routerhub.si/quickstart.md."
  },
  "servers": [
    {
      "url": "https://routerhub.si/v1"
    }
  ],
  "tags": [
    {
      "name": "Inference"
    },
    {
      "name": "Discovery"
    }
  ],
  "paths": {
    "/responses": {
      "post": {
        "tags": [
          "Inference"
        ],
        "operationId": "createResponse",
        "summary": "Create a Responses API response",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "input"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "gpt-6.1-sol",
                      "gpt-6-astra",
                      "codex-auto-review",
                      "gpt-5.5",
                      "gpt-5.6-sol",
                      "gpt-5.6-terra",
                      "gpt-6-sol"
                    ]
                  },
                  "input": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      }
                    ]
                  },
                  "max_output_tokens": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "stream": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Model response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Provider-compatible response. Shape depends on the endpoint and model.",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key"
          },
          "402": {
            "description": "Insufficient credits"
          }
        }
      }
    },
    "/messages": {
      "post": {
        "tags": [
          "Inference"
        ],
        "operationId": "createMessage",
        "summary": "Create an Anthropic Messages API response",
        "security": [
          {
            "apiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "anthropic-version",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2023-06-01"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "claude-fable-5-1",
                      "claude-fable-5",
                      "claude-haiku-4-5-20251001",
                      "claude-opus-4-6",
                      "claude-opus-4-7",
                      "claude-opus-4-8",
                      "claude-opus-5",
                      "claude-opus-5-5",
                      "claude-sonnet-4-6",
                      "claude-sonnet-5",
                      "claude-sonnet-5-5"
                    ]
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "max_tokens": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "stream": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Model response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Provider-compatible response. Shape depends on the endpoint and model.",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key"
          },
          "402": {
            "description": "Insufficient credits"
          }
        }
      }
    },
    "/chat/completions": {
      "post": {
        "tags": [
          "Inference"
        ],
        "operationId": "createChatCompletion",
        "summary": "Create a Chat Completions response",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "deepseek-v4.1-flash",
                      "glm-5.3",
                      "glm-5.3-flash"
                    ]
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "max_tokens": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "stream": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Model response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Provider-compatible response. Shape depends on the endpoint and model.",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key"
          },
          "402": {
            "description": "Insufficient credits"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Create an API key in your RouterHub dashboard."
      },
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Create an API key in your RouterHub dashboard."
      }
    }
  }
}
