{
  "openapi": "3.1.0",
  "info": {
    "title": "Wild West",
    "version": "1.0.0",
    "summary": "Uncensored and abliterated LLMs behind one OpenAI and Anthropic compatible API.",
    "description": "Wild West serves the Outlaw line of uncensored models. Use any OpenAI client with the base URL https://wildwestapi.com/v1, or any Anthropic client (including Claude Code) with the base URL https://wildwestapi.com. Every key can carry a hard lifetime and monthly spend cap. Docs: https://wildwestapi.com/docs/",
    "contact": {
      "name": "Wild West",
      "url": "https://wildwestapi.com/support/",
      "email": "support@wildwestapi.com"
    }
  },
  "externalDocs": {
    "description": "Documentation",
    "url": "https://wildwestapi.com/docs/"
  },
  "servers": [
    {
      "url": "https://wildwestapi.com"
    }
  ],
  "security": [
    {
      "bearer": []
    },
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "OpenAI compatible"
    },
    {
      "name": "Anthropic compatible"
    },
    {
      "name": "Models"
    }
  ],
  "paths": {
    "/v1/models": {
      "get": {
        "tags": [
          "Models"
        ],
        "summary": "List the models you can call",
        "security": [],
        "responses": {
          "200": {
            "description": "The model list, OpenAI shape.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelList"
                }
              }
            }
          }
        }
      }
    },
    "/v1/chat/completions": {
      "post": {
        "tags": [
          "OpenAI compatible"
        ],
        "summary": "Create a chat completion",
        "description": "OpenAI Chat Completions format, streaming (server-sent events) or not. Tool calling and image input work on models that support them.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatCompletionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A chat completion, or an event stream when stream is true."
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/responses": {
      "post": {
        "tags": [
          "OpenAI compatible"
        ],
        "summary": "Create a response (OpenAI Responses API)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "input"
                ],
                "properties": {
                  "model": {
                    "$ref": "#/components/schemas/ModelId"
                  },
                  "input": {},
                  "stream": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A response, or an event stream when stream is true."
          },
          "401": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/messages": {
      "post": {
        "tags": [
          "Anthropic compatible"
        ],
        "summary": "Create a message (Anthropic Messages API)",
        "description": "Anthropic Messages format. Point Claude Code at it with ANTHROPIC_BASE_URL=https://wildwestapi.com and your key in ANTHROPIC_AUTH_TOKEN.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessagesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A message, or an event stream when stream is true."
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/messages/count_tokens": {
      "post": {
        "tags": [
          "Anthropic compatible"
        ],
        "summary": "Count the input tokens of a message request",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessagesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The input token count.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "input_tokens": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authorization: Bearer sk-ww-..."
      },
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Anthropic style: x-api-key: sk-ww-..."
      }
    },
    "responses": {
      "Error": {
        "description": "An error in OpenAI shape.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "ModelId": {
        "type": "string",
        "description": "A model id from GET /v1/models.",
        "examples": [
          "glm-5.3-outlaw",
          "glm-5.3-flash-outlaw",
          "mimo-v2.6-flash-outlaw",
          "qwen3.8-27b-outlaw"
        ]
      },
      "Model": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ModelId"
          },
          "object": {
            "const": "model"
          },
          "name": {
            "type": "string"
          },
          "context_length": {
            "type": "integer"
          },
          "supports_tools": {
            "type": "boolean"
          },
          "supports_vision": {
            "type": "boolean"
          },
          "pricing": {
            "type": "object",
            "description": "USD per token, as strings.",
            "properties": {
              "prompt": {
                "type": "string"
              },
              "completion": {
                "type": "string"
              }
            }
          }
        }
      },
      "ModelList": {
        "type": "object",
        "properties": {
          "object": {
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Model"
            }
          }
        }
      },
      "ChatMessage": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "role": {
            "enum": [
              "system",
              "user",
              "assistant",
              "tool"
            ]
          },
          "content": {
            "description": "A string, or an array of text and image parts."
          },
          "tool_calls": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "tool_call_id": {
            "type": "string"
          }
        }
      },
      "ChatCompletionRequest": {
        "type": "object",
        "required": [
          "model",
          "messages"
        ],
        "properties": {
          "model": {
            "$ref": "#/components/schemas/ModelId"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatMessage"
            }
          },
          "stream": {
            "type": "boolean"
          },
          "max_tokens": {
            "type": "integer",
            "description": "Clamped to what the key's spend cap can cover."
          },
          "temperature": {
            "type": "number"
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "tool_choice": {}
        }
      },
      "MessagesRequest": {
        "type": "object",
        "required": [
          "model",
          "messages",
          "max_tokens"
        ],
        "properties": {
          "model": {
            "$ref": "#/components/schemas/ModelId"
          },
          "system": {},
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "enum": [
                    "user",
                    "assistant"
                  ]
                },
                "content": {}
              }
            }
          },
          "max_tokens": {
            "type": "integer"
          },
          "stream": {
            "type": "boolean"
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    }
  }
}